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. 本站内容源于网络搜集,仅供学习和参考使用。