企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# content **版本:CSS3** 继承性:无 ### 语法: **content** : normal | string | attr() | uri() | counter() ### 取值: normal:默认值。string:插入文本内容。attr():插入元素的属性值。uri():插入一个外部资源(图像,声频,视频或浏览器支持的其他任何资源)。counter(): 计数器,用于插入排序标识。 ### 说明: content用于插入生成内容; content属性与 :before 及 :after 伪元素配合使用,将生成内容放在一个元素内容的前面或后面。 ### 兼容性: <table><thead><tr><th class="type">类型</th> <th class="type_ie"><img src="https://box.kancloud.cn/2015-09-02_55e5d389e3b3d.png" alt="IE" />Internet Explorer</th> <th class="type_firefox"><img src="https://box.kancloud.cn/2015-09-02_55e5d389ed305.png" alt="Firefox" />Firefox</th> <th class="type_chrome"><img src="https://box.kancloud.cn/2015-09-02_55e5d38a017ac.png" alt="Chrome" />Chrome</th> <th class="type_opera"><img src="https://box.kancloud.cn/2015-09-02_55e5d38a0ac40.png" alt="Opera" />Opera</th> <th class="type_safari"><img src="https://box.kancloud.cn/2015-09-02_55e5d38a11b78.png" alt="Safari" />Safari</th> </tr></thead><tbody><tr><td rowspan="4" class="version">版本</td> <td class="support no"><span>(×)</span>IE6</td> <td class="support no"><span>(×)</span>Firefox 2.0</td> <td class="support no"><span>(×)</span>Chrome 1.0.x</td> <td class="support no"><span>(×)</span>Opera 9.63</td> <td class="support yes"><span>(√)</span>Safari 3.1</td> </tr><tr><td class="support no"><span>(×)</span>IE7</td> <td class="support yes"><span>(√)</span>Firefox 3.0</td> <td class="support no"><span>(×)</span>Chrome 2.0.x</td> <td></td> <td class="support yes"><span>(√)</span>Safari 4</td> </tr><tr><td class="support yes"><span>(√)</span>IE8</td> <td class="support yes"><span>(√)</span>Firefox 3.5</td> <td></td> <td></td> <td></td> </tr><tr><td></td> <td></td> <td></td> <td></td> <td></td> </tr></tbody></table> ### 示例: ![](https://box.kancloud.cn/2015-09-02_55e5d38a1cc54.png) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Language" content="utf-8" /><meta name="robots" content="all" /><meta name="author" content="Tencent-ISRD" /><meta name="Copyright" content="Tencent" /><title>content</title><style type="text/css">.example { width:400px; height:50px; line-height:50px; overflow:hidden; text-align:center; color:#FF0000; border:#993300 solid 1px; }#example_01:before { content:"您使用的浏览器支持content属性"; }</style></head><body><div id="example_01" class="example"></div></body></html> 复制代码 Copyright © 2009 [Tencent ISD webteam](http://webteam.tencent.com/). All Rights Reserved ### 快速跳转 - [语法](# "跳转到“语法”") - [取值](# "跳转到“取值”") - [说明](# "跳转到“说明”") - [兼容性](# "跳转到“兼容性”") - [示例](# "跳转到“示例”")