CSS3 inserting content into a page

Source: Internet
Author: User

A . use selectors to insert content

h2:before{

Content: " prefix ";

}

h2:after{

Content: " suffix ";

}

B . Specifies that individual elements are not inserted

h2.sample:before{

Content:none;

}

2. inserting images

A . Insert an image file before the title

h2:before{

Content:url (anwy.jpg);

}

B . Displays the value of the ALT attribute as the caption of the image (not available)

img:after{

Content:attr (ALT);

Display:block;

Text-align:center;

margin-top:5px;

font-size:11px;

Font-weight:bold;

Color:black;

}

3. Insert Number

A . add consecutive numbering before multiple headings

div:before{

Content:counter (Divcounter);

}

div{

Counter-increment:divcounter;

}

B . Append text to bullets

div:before{

Content: " section" of "Counter (divcounter )";

}

C . Specify numbering style, kind

div:before{

Content:counter (Divcounter,upper-alpha) '. ';

Color:blue;

font-size:16px;

}

D . numbering nesting

div:before{

Content:counter (Divcounter,upper-alpha) '. ';

Color:blue;

font-size:16px;

}

div{

Counter-increment:divcounter;

Counter-reset:subdivcounter;

}

p:before{

Content:counter (Subdivcounter) '. ';

margin-left:15px;

font-size:12px;

}

p{

Counter-increment:subdivcounter;

}

E . Add text nesting symbols on both sides of the string

h3:before{

Content:open-quote;

}

h3:after{

Content:close-quote;

}

h3{

Quotes: "" """";

}

dot | Circle circle | Square square | Decimal digital | Decimal-leading-zero decimal number | Lower-roman lowercase roman text | Upper-roman uppercase Roman text | Lower-greek lowercase Greek alphabet | Lower-latin lowercase latin | Upper-latin uppercase Latin | Armenian Armenian numeral | Georgian Georgia digital | Lower-alpha lowercase English alphabet  | Upper-alpha uppercase English alphabet  | None no | Inherit inherit

CSS3 Insert content in page

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.