css3在頁面中插入內容

來源:互聯網
上載者:User

標籤:微軟   元素   樣式   open   strong   英文   content   繼承   isp   

A. 使用選取器來插入內容

h2:before{

  content:"首碼";

}

h2:after{

  content:"尾碼";

}

B. 指定個別的元素不進行插入

h2.sample:before{

  content:none;

}

2. 插入映像

A. 在標題前插入影像檔

h2:before{

  content:url(anwy.jpg);

}

B. 將alt屬性的值作為映像的標題來顯示(用不了)

img:after{

  content:attr(alt);

  display:block;

  text-align:center;

  margin-top:5px;

  font-size:11px;

  font-weight:bold;

  color:black;

}

3. 插入編號

A. 多個標題前加入連續編號

div:before{

  content:counter(divCounter);

}

div{

  counter-increment:divCounter;

}

B. 在項目符號中追加文字

div:before{

  content:"第"counter(divCounter)"段";

}

C. 指定編號樣式、種類

div:before{

  content:counter(divCounter,upper-alpha)‘.‘;

  color:blue;

  font-size:16px;

}

D. 編號嵌套

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. 字串兩邊添加文字嵌套符號

h3:before{

  content: open-quote;

}

h3:after{

  content: close-quote;

}

h3{

  quotes:"【""】";

}

 

disc 點| circle圓圈 | square正方形 | decimal數字 | decimal-leading-zero 十進位數| lower-roman 小寫羅馬文字| upper-roman 大寫羅馬文字| lower-greek小寫希臘字母 | lower-latin小寫拉丁文 | upper-latin 大寫拉丁文| armenian亞美尼亞數字 | georgian喬治亞數字 | lower-alpha小寫英文字母 | upper-alpha大寫英文字母 | none無 | inherit繼承

css3在頁面中插入內容

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.