小白教程
所有教程
关于
Search
172.69.6.143
172.69.6.143
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Sel after”的源代码
本页内容
上一节:
Sel_before
下一节:
Sel_lang
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE::after}}[[Category:css selectors|22]] = CSS :after 选择器 = [[css selectors|完整CSS选择器参考手册]] 每个<p>元素之后插入内容: <sample title="" desc="" lang="html" hererun="1"> p:after { content:"- Remember this"; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> p:after { content:"- 注意我"; } </style> </head> <body> <p>我的名字是 Donald</p> <p>我住在 Ducksburg</p> <p><b>注意:</b> :after在IE8中运行,必须声明 !DOCTYPE </p> </body> </html> </run> == 定义和说明 == :after 选择器向选定元素的最后子元素后面插入内容。 使用[[pr gen content|content]] 属性来指定要插入的内容。 == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 选择器 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | ::after | 4.0 | 9.0部分从 8.0 | 3.5 | 3.1 | 7.0部分从4.0 |} '''注意:''' after在IE8中运行,必须声明[[tag doctype|<!DOCTYPE>]] . == 相关文章 == CSS 教程: [[css pseudo elements|CSS Pseudo-elements]] CSS 选择器参考手册: [[sel before|CSS :before 选择器]] == 更多实例 == 在每个 <p>之后插入的内容和样式: <sample title="" desc="" lang="html" hererun="1"> p:after { content:"- Remember this"; background-color:yellow; color:red; font-weight:bold; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> p:after { content:"- Remember this"; background-color:yellow; color:red; font-weight:bold; } </style> </head> <body> <p>My name is Donald</p> <p>I live in Ducksburg</p> <p><b>注意:</b>:after作用于IE8 以及更早版本的浏览器,DOCTYPE 必须已经声明.</p> </body> </html> </run>
返回至“
Sel after
”。
上一节:
Sel_before
下一节:
Sel_lang