小白教程
所有教程
关于
Search
172.69.59.106
172.69.59.106
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Sel all”的源代码
本页内容
上一节:
Sel_id
下一节:
Sel_element
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:*}}[[Category:css selectors|3]] = CSS * 选择器 = [[css selectors|完整CSS选择器参考手册]] 选择所有元素,并设置其背景色: <sample title="" desc="" lang="html" hererun="1"> * { background-color:yellow; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> * { background-color:yellow; } </style> </head> <body> <h1>Welcome to My Homepage</h1> <div class="intro"> <p id="firstname">My name is Donald.</p> <p id="hometown">I live in Duckburg.</p> </div> <p>My best friend is Mickey.</p> </body> </html> </run> == 定义和用法 == * 选择器选择所有元素。 * 选择器也可以选择另一个元素内的所有元素: 选择<div>元素内的所有元素: <sample title="" desc="" lang="html" hererun="1"> div * { background-color:yellow; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> div * { background-color:yellow; } </style> </head> <body> <h1>Welcome to My Homepage</h1> <div class="intro"> <p id="firstname">My name is Donald.</p> <p id="hometown">I live in Duckburg.</p> </div> <p>My best friend is Mickey.</p> </body> </html> </run> == Browser Support == 所有主流浏览器都支持*选择器。 [[css selectors|完整CSS选择器参考手册]]
返回至“
Sel all
”。
上一节:
Sel_id
下一节:
Sel_element