加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

多类选择器

发布时间:2020-12-16 09:28:48 所属栏目:asp.Net 来源:网络整理
导读:多类选择器 测试: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

多类选择器

测试: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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读