CSS content 屬性
實例
以下示例將在每個鏈接後的括弧內加上網址:
a:after
{
content: " (" attr(href) ")";
}
屬性定義及使用說明
content 屬性與 :before 及 :after 偽元素配合使用,來插入生成內容。
默認值: | normal |
---|---|
繼承: | no |
版本: | CSS2 |
JavaScript 語法: | object.style.content="url(beep.wav)" |
流覽器支持
所有主流流覽器都支持Content屬性。
注意: IE8只有指定!DOCTYPE才支持Content屬性。
Content屬性值
值 | 說明 |
---|---|
none | 設置Content,如果指定成Nothing |
normal | 設置content,如果指定的話,正常,默認是"none"(該是nothing) |
counter | 設定計數器內容 |
attr(attribute) | 設置Content作為選擇器的屬性之一。 |
string | 設置Content到你指定的文本 |
open-quote | 設置Content是開口引號 |
close-quote | 設置Content是閉合引號 |
no-open-quote | 如果指定,移除內容的開始引號 |
no-close-quote | 如果指定,移除內容的閉合引號 |
url(url) | 設置某種媒體(圖像,聲音,視頻等內容) |
inherit | 指定的content屬性的值,應該從父元素繼承 |
更多實例
相關文章
CSS 參考手冊: :before 偽元素
CSS 參考手冊: :after 偽元素
上一篇 CSS3 columns 屬性
下一篇 CSS :before 選擇器
腳本語言
高級語言
Java技術
XML技術
大數據
Elasticsearch教學
Hadoop教學
HBase教學
Hive教學
Kafka教學
Pandas教學
Python數據科學
R語言教學
Solr教學
Spark教學
Sqoop教學
ZooKeeper教學
數據挖掘
數據結構和演算法教學
MyBatis教學
Spring AOP教學
Spring Batch教學
Spring Cloud教學
Spring MVC教學
Spring Boot教學
Spring Boot CLI教學
Spring JDBC教學
Spring Security教學
Struts2教學
Swing教學
Swing示例程式
Tableau教學
TensorFlow教學
開發工具
框架
軟體測試
前端技術
資料庫
Copyright © 許虎虎 All Rights Reserved. 本站內容源於網路搜集,僅供學習和參考使用。