ID attribute


Hello everybody, welcome to our website where you will find everything for free.

This is the twenty-second tutorial of CSS which will explain you about ID attribute.

Just like we made IDs in html, we can use that ID for changing the CSS property of specific elements.

For example, just see the below code:


<head>

<style type= “text/css” >
#yags {color: blue;}
</style>
</head>
<body>
<p id=“yags”> Yags3world</p>
</body>


Here, id attribute is applied to <p> element and CSS is given to that element.., hence the output will be:
Yags3world