How to select the first letter or text of an article with CSS
Maybe you have seen that the first letter of some articles is very big or uses different fonts, and some are presented in different colors. For these effects, you must find a way to select the first letter first, but if every article requires It’s too much trouble to select and modify the first letter . CSS has a first-letter property specifically to deal with this problem. After CSS has a way to select the first letter for us, we only need to change After the article is published, there will be special effects for the first letter automatically!
CSS example of editing after selecting the first letter of the article
<!--
p:first-letter{
color:gray; //Set the text to gray
font-size:23px;
font-weight:bold; //Set the text to bold Body
}
#DIV1{
font-size:13px;
}
#DIV1:first-letter{
color:blue; //Set the text to blue
font-size:23px;
font-weight:bold;
}
-->
</style >
<p>This is a test string.</p>
<div id="DIV1">This is a test text in a DIV block</div>
There are many functions that can modify the text.
- CSS font-family font
- CSS font-size text size
- CSS font-style property
- CSS font-weight sets the font weight
Post a Comment
0 Comments