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>
<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