css3中的content字元編碼

來源:互聯網
上載者:User
content有5中屬性

content:""; // 為空白

content:attr(title); // 可以擷取標籤屬性值 也可以擷取自訂屬性值 比如

css是 div:after{content:attr(gaga)}則可以擷取到了123


content:"我是誰"; // 填寫字串比如



// css是div:after{content:"我是"counter(title)",我怕"counter(gaga);}結果就是 "我是gaga2,我怕gaga1";

content:"\21e0"; //擷取如下的圖的字元集表徵圖 斜杠就是轉義 不過有一些表徵圖在瀏覽器直接是有一些差別

content:url(123.gif); //使用指定的絕對或相對位址插入一個外部資源(映像,聲頻,視頻或瀏覽器支援的其他任何資源)

  • 相關文章

    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.