Sunday, 15 October 2017

Working With The ::first-line Pseudo-Element

The ::first-line pseudo-element applies styling rules to the first line of text. Now create a Web page named firstlinepe.html to understand how to use the ::first-line pseudo-element.

<!doctype html>
<head>
<style type="text/css">
p:first-line
{color:green;
font-variant:small-caps;
}
</style>
</head><body style="background-color:#45ffaa;">
<P>First line<br>
Second line<br>
Third line</P>
</body>
</html>

The ::first-line pseudo-element sets the green color to the first line in the P element.

The Output of the Above Web Page is:


No comments:

Post a Comment