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