Thursday, December 27, 2018

CSS using the id attribute

HTML with CSS using the id attribute:- 


<html>
<head>
<style>
#p1 {
  color: green;
}
</style>
</head>
<body>

<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p id="p1">I am green.</p>

</body>
</html>

OUTPUT:- 


  • To define a specific style for one special element, add an id attribute to the element

No comments:

Post a Comment

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...