亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么.box1后面輸入的width:100px沒有生效?

<!DOCTYPE html>

<html>


<head>

? ? <meta charset="UTF-8">

? ? <title>flex布局</title>

? ? <style type="text/css">

? ? .box {

? ? ? ? background: blue;

? ? ? ? display: flex;

? ? }


? ? .box div {

? ? ? ? width: 200px;

? ? ? ? height: 200px;

? ? }


? ? .box1 {

? ? ? ? width:100px;

? ? ? ? background: red;

? ? }


? ? .box2 {

? ? ? ? background: orange;

? ? }


? ? .box3 {

? ? ? ? background: green;

? ? }

? ? </style>

</head>


<body>

? ? <div class="box">

? ? ? ? <div class="box1"></div>

? ? ? ? <div class="box2"></div>

? ? ? ? <div class="box3"></div>

? ? </div>

</body>


</html>


正在回答

1 回答

http://img1.sycdn.imooc.com//5f22e61a0001170d03830150.jpg看圖??!

1 回復 有任何疑惑可以回復我~
#1

慕的地2173049 提問者

不是,這個跟權值有關,class類選擇器是100,單個元素選擇器是1,.box div是100+1,而.box是100,所以沒生效。
2020-07-31 回復 有任何疑惑可以回復我~
#2

慕后端2961759

class權值不是10嗎
2021-08-30 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么.box1后面輸入的width:100px沒有生效?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號