小白教程
所有教程
关于
Search
172.69.6.136
172.69.6.136
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Sel attr end”的源代码
本页内容
上一节:
Sel_attr_begin
下一节:
Sel_attr_contain
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:[attribute$=value]}}[[Category:css selectors|26]] = CSS3 [attribute$=value] 选择器 = [[css selectors|完整CSS选择器参考手册]] 设置class属性值以"test"结尾的所有div元素的背景颜色: <sample title="" desc="" lang="html" hererun="1"> div[class$="test"] { background:#ffff00; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> div[class$="test"] { background:#ffff00; } </style> </head> <body> <div class="first_test">The first div element.</div> <div class="second">The second div element.</div> <div class="test">The third div element.</div> <p class="test">This is some text in a paragraph.</p> </body> </html> </run> == 定义和用法 == [attribute$=value] 选择器匹配元素属性值带指定的值结尾的元素。 == 浏览器支持 == 所有主流浏览器都支持[attribute$=value] 选择器。 '''Note:''' [attribute$=value]在IE8中运行,必须声明[[tag doctype|<!DOCTYPE>]] 。 == Try it Yourself - Examples == 设置class属性值以"test"结尾的所有元素的背景颜色: <sample title="" desc="" lang="html" hererun="1"> [class$="test"] { background:#ffff00; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> [class$="test"] { background:#ffff00; } </style> </head> <body> <div class="first_test">The first div element.</div> <div class="second">The second div element.</div> <div class="test">The third div element.</div> <p class="test">This is some text in a paragraph.</p> </body> </html> </run> [[css selectors|完整CSS选择器参考手册]]
返回至“
Sel attr end
”。
上一节:
Sel_attr_begin
下一节:
Sel_attr_contain