Use CSS to sink the first word, similar to the first word sink of the word

Source: Internet
Author: User

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.