The ::first-letter pseudo-element applies styling rules to the first letter of the text.
Now We create a Web page named first-letter-pe.htmlto understand how to use the ::first-letter pseudo-element.
<!doctype html>
<head>
<style type="text/css">
p:first-letter
{
color:#987651;
font-size:60px;
}
</style>
</head>
<body>
<P>This is the example of the first letter. This is the example of the first letter. This is the example of the first letter. This is the example of the first letter.</P>
</body>
</html>
The ::first-letter pseudo-element applies the #987651 color value and the 60px size to the first letter of the P element.
The Output of the Above Web page:
Now We create a Web page named first-letter-pe.htmlto understand how to use the ::first-letter pseudo-element.
<!doctype html>
<head>
<style type="text/css">
p:first-letter
{
color:#987651;
font-size:60px;
}
</style>
</head>
<body>
<P>This is the example of the first letter. This is the example of the first letter. This is the example of the first letter. This is the example of the first letter.</P>
</body>
</html>
The ::first-letter pseudo-element applies the #987651 color value and the 60px size to the first letter of the P element.
The Output of the Above Web page:
No comments:
Post a Comment