实例
实例
PHP中文网-视频教程/*tag标签名、id名(名字前面加#)、class名(名字前面加.)、属性选择器 */
body{}/*标记选择器*/
#box{width:100px;height: 100px;background: pink; }/*id选择器*/
.main{width:100px;height: 100px;background: green; }/*class选择器 类*/
a{color: red;}
/*属性选择器*/
a[href="http://www.php.cn/"]{color:blue;}
a[href="demo2.html"]{color:pink; }
/*派生选择器 根据文档上下文关系来定义样式*/
div a{color: #000;}
#box a{}
百度
php中文网
demo2#
php