选择器
这里要说明的是类选择器的嵌套选择与多类选择器的差别,顺便捎上了一级子元素的选择
类选择器基本写法:
.your-class{/*...*/}
类选择器的嵌套选择写法:
.first-class .second-class{/*...*/}
多类选择器基本写法:
.first-class.second-class{/*...*/}
一级子元素的选择写法:
.first-class > .second-class{/*...*/}
从代码看它们之间的区别:
.first-style.second-style{ color: blueviolet} .first-style .third-style{ font-style: italic} .first-style > .fourth-style{ font-weight: bold}HELLO
查看更多关于《CSS权威指南》基础复习+查漏补缺_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did111846