CONTENT: ”在CSS樣式中的作用

來源:互聯網
上載者:User
結合after或before偽類,在元素的開頭或結尾附加上一定的內容,content:""的引號中即是添加的內容,比如說我們這麼寫:<div>學而時習之不亦說乎</div>div:before{content:"子曰:"}那麼在顯示時就會顯示子曰:學而時習之不亦說乎這其中“子曰:”並不會出現在DOM文檔中
ps:其實這個主要是用來解決相容性問題
參考:http://www.w3school.com.cn/css/pr_gen_content.asp
相關文章

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.