作为前端开发一年多的时间,今天有同学突然请教我css样式问题 忽然间发现自己不晓得怎么同时选中 同一元素的多个class
<h1 class="t1 t2">CSS 实例!</h1> .t1.t2{color:red;}//即选中了h1, 注意:.t1 .t2{color:red;}//t1和t2 之间有空格是选不中的
上面的书写方式,相当于
h1[class="t1 t2"]{color:red;}
<h1 class="t1">CSS 实例!<span class="t2">dddddd</span></h1> .t1 .t2{color:red;}//说明分开的clss 有层级关系相当于