Answers for "style in element"

4

javascript style an element

// Getting the element first
var myElement = document.querySelector("#myElement");

// examples for updating styles
myElement.style.color = "blue";
myElement.style.backgroundColor = "red";
Posted by: Guest on September-02-2020
2

how to add style to p tag in html

<h1 style="color:blue;">This is a Blue Heading</h1>
<!DOCTYPE html>
<html>
<head>
<style>

 body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}

</style>
</head>
<body>

<h1>This is a 
 heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
Posted by: Guest on March-14-2020
0

html style element

<!-- EXAMPLE -->
<div class="your_class" style="display:none">

<!--[SYNTAX: style="<your-styling>"] -->
Posted by: Guest on February-25-2021

Browse Popular Code Answers by Language