第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

為什么nth-of / nth-child不對嵌套元素起作用?

為什么nth-of / nth-child不對嵌套元素起作用?

慕運維8079593 2019-10-12 10:51:31
我正在嘗試更改div內(nèi)奇數(shù)div的樣式。由于某種原因,nth-of-type(odd)當它位于另一個div內(nèi)時,它會影響我的所有div。這是我的常規(guī)div和奇數(shù)div的代碼:.video-entry-summary {  width: 214px;  height: 210px;  margin-left: 10px;  float: left;  position: relative;  overflow: hidden;  border: 1px solid black;}.video-entry-summary:nth-of-type(odd) {  width: 214px;  height: 210px;  margin-left: 0px;  float: left;  position: relative;  overflow: hidden;  border: 1px solid black;  background: #ccc;}<div id="post-501" class="post-501 post type-post status-publish format-standard hentry category-moto-dz-films tag-news-sub-2">  <div class="video-entry-summary">    video 1  </div></div><div id="post-240" class="post-240 post type-post status-publish format-standard hentry category-videos">  <div class="video-entry-summary">    video 2  </div></div><div id="post-232" class="post-232 post type-post status-publish format-standard hentry category-videos">  <div class="video-entry-summary">    video 3  </div></div><div id="post-223" class="post-223 post type-post status-publish format-standard hentry category-videos">  <div class="video-entry-summary">    video 4  </div></div>出于某種原因,nth-of-type當將其包裹在我的div中時不起作用,但是當它們不包裹在任何div中時卻起作用。.video-entry-summary {  width: 214px;  height: 210px;  margin-left: 10px;  float: left;  position: relative;  overflow: hidden;  border: 1px solid black;}.video-entry-summary:nth-of-type(odd) {  width: 214px;  height: 210px;  margin-left: 0px;  float: left;  position: relative;  overflow: hidden;  border: 1px solid black;  background: #ccc;}<div class="video-entry-summary">  video 1</div><div class="video-entry-summary">  video 2</div><div class="video-entry-summary">  video 3</div><div class="video-entry-summary">  video 4</div>``如何使初始代碼與上述代碼相同?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 530 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號