Loading

多类选择器

多类选择器

测试:https://www.w3school.com.cn/tiy/t.asp?f=csse_selector_class_1

<html>
<head>
<style type="text/css">
.important {color:red;}
.im {color:red;}
.im2 {font-weight:bold;}
.im .im2 {font-size:18pt;}
.im.im2 {font-size:18pt;}
</style>
</head>

<body>
<div class="im">aaa</div>
<div class="im"><div class="im2">bbb</div></div>
<div class="im im2">ccc</div>


<h1 class="important">This heading is very important.</h1>

<p class="important">This paragraph is very important.</p>

<p>This is a paragraph.</p>

<p>This is a paragraph.</p>

<p>This is a paragraph.</p>

<p>...</p>
</body>
</html>

多类选择器;

(1).a.b中间没有空格,代表同时包含a 和 b样式。  

(2).a .b中间有空格,代表a包含b。 

参考:https://blog.csdn.net/weixin_42238430/article/details/80828541

 

posted @ 2019-08-20 10:36  stono  阅读(163)  评论(0编辑  收藏  举报