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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

nth:child()問題,行內塊

nth:child()問題,行內塊

慕粉1470305008 2018-09-08 18:49:15
<div?class="one"> ????<a?href=""><div?class="pp"></div></a> ????<a?href=""><div?class="pp"></div></a> ????<a?href=""><div?class="pp"></div></a> ????<div?class="pp"></div> ????<div?class="pp"></div> </div>.one{width:300px;height:?100px;background:?#abcdef;margin:?50px?auto;} .pp{width:100px;height:?100px;background:?red;margin-top:?10px;display:?inline-block;} .pp:nth-child(1){background:?#ef507e} .pp:nth-child(2){background:?#ffffff} .pp:nth-child(3){background:?#5eef56}
查看完整描述

3 回答

?
奮斗好青年

TA貢獻69條經驗 獲得超30個贊

其實你想問啥

查看完整回答
1 反對 回復 2018-09-11
  • 慕粉1470305008
    慕粉1470305008
    前三個設置了不同的顏色,可是都表現為第一個屬性的顏色。
  • 奮斗好青年
    奮斗好青年
    改成這樣: .one a:nth-child(1) .pp{background: #ef507e} .one a:nth-child(2) .pp{background: #ffffff} .one a:nth-child(3) .pp{background: #5eef56} 因為你前三個都有a那樣肯定不行,你自己去了解仔細那個nth-child屬性真正用法吧
  • 慕粉1470305008
    慕粉1470305008
    這個我知道,在行內塊是不行,在塊級中可以,我就想知道為什么
點擊展開后面3
  • 3 回答
  • 0 關注
  • 1341 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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