Most people who have used word know that word has a sinking function inArticleSometimes it can add a lot of colors to the article.
Today, we use CSS to simulate the first word sinking function of word, so we don't need to modify it.CodeOnly use the pseudo element "first-letter" of CSS to sink the first character.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> CSS first word sinking </title>
<Style type = "text/CSS">
. Dyfirst {
Width: 300px;
Border: 1px solid # DDD;
Padding: 5px;
Font-size: 12px;
Margin: 5px 0;
}
. Dyfirst: first-line {
Color: #050;
}
. Dyfirst: First-letter {
Font-size: 300%;
Font-weight: bold;
Color: #000;
Float: left;
}
</Style>
</Head>
<Body>
<Div class = "dyfirst"> To the world you may be one person, but to one person you may be theworld. never frown, even when you are sad, because you never know who is fallingin love with your smile. </div>
<Div class = "dyfirst"> for the world, you are a person, but for a person, you are the whole world. Never frown even when you are sad, because you don't know who will fall in love with your smile. </Div>
</Body>
</Html>