Home>Article>Web Front-end> How to insert content into the page in css3

How to insert content into the page in css3

PHP中文网
PHP中文网 Original
2017-06-22 11:38:13 1992browse

AUse selectors to insert content

h2:before{   content:"前缀"; } h2:after{   content:"后缀"; }

B.Specify individual elements not to be inserted

h2.sample:before{   content:none; }

2.Insert images

AInsert image file before the title

h2:before{   content:url(anwy.jpg); }

BDisplay the value of thealtattribute as the title of the image (cannot be used)

img:after{   content:attr(alt);   display:block;   text-align:center;   margin-top:5px;   font-size:11px;   font-weight:bold;   color:black; }

3.Insert number

AAdd consecutive numbers before multiple titles

p:before{   content:counter(pCounter); } p{   counter-increment:pCounter; }

BAppend text to bullets

p:before{   content:"第"counter(pCounter)"段"; }

CSpecify numbering style and type

p:before{   content:counter(pCounter,upper-alpha)'.';   color:blue;   font-size:16px; }

DNumber nesting

p:before{   content:counter(pCounter,upper-alpha)'.';   color:blue;   font-size:16px; } p{   counter-increment:pCounter;   counter-reset:subDivCounter; } p:before{   content:counter(subDivCounter)'.';   margin-left:15px;   font-size:12px; } p{   counter-increment:subDivCounter; }

EAdd text nesting symbols on both sides of the string

h3:before{   content: open-quote; } h3:after{   content: close-quote; } h3{   quotes:"【""】"; }

discPoint| circlecircle| squaresquare| decimalnumber| decimal-leading-zerodecimal number| lower-romanlowercase Roman text| upper-romanuppercase Roman script| lower-greeklower case Greek letter| lower-latinlowercase Latin| upper-latinuppercase Latin| armenianArmenia Number| georgianGeorgian number| lower-alphalowercaseEnglish letter| upper-alphauppercaseEnglish letter| none| inheritinherit

The above is the detailed content of How to insert content into the page in css3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn