0

div ギャラリーで 4 枚ごとの画像を選択しようとしています。選択できない理由がわかりません。

#gallery img:nth-of-type(4n){
   border: 5px solid #000;
}

私は他のいくつかのアイデアを試しましたが、成功しませんでした。div ギャラリーで 4 枚ごとの画像が選択されない理由を説明してくれる人はいますか? 前もって感謝します。

    <div id="gallery">

  <a href="/system/images/series_uploads/5/original/ankara_5602p_alabaster.jpg?1330114093" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/5/gallery/ankara_5602p_alabaster.jpg?1330114093" title="Ankara" />
    <div class="gallery-text">
      <h3>Ankara</h3>
      <p>Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/6/original/ankara_5624p_noce.jpg?1330114095" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/6/gallery/ankara_5624p_noce.jpg?1330114095" title="Ankara" />
    <div class="gallery-text">
      <h3>Ankara</h3>
      <p>Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/7/original/ashton_23931_smokey_beige_.jpg?1330114250" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/7/gallery/ashton_23931_smokey_beige_.jpg?1330114250" title="Ashton" />
    <div class="gallery-text">
      <h3>Ashton</h3>
      <p>Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/8/original/ashton_23942_camel_haze_entry.jpg?1330114251" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/8/gallery/ashton_23942_camel_haze_entry.jpg?1330114251" title="Ashton" />
    <div class="gallery-text">
      <h3>Ashton</h3>
      <p>Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/9/original/ashton_23942_camel_haze_lr.jpg?1330114252" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/9/gallery/ashton_23942_camel_haze_lr.jpg?1330114252" title="Ashton" />
    <div class="gallery-text">
      <h3>Ashton</h3>
      <p>Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/10/original/berkshire_25525_oak.jpg?1330115116" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/10/gallery/berkshire_25525_oak.jpg?1330115116" title="Berkshire" />
    <div class="gallery-text">
      <h3>Berkshire</h3>
      <p>HDP &ndash; High Definition Porcelain</p>
    </div>
  </a>

  <a href="/system/images/series_uploads/11/original/berkshire_25585_walnut_famousdaves01.jpg?1330115118" rel="lightbox['gallery']">
    <img alt="" src="/system/images/series_uploads/11/gallery/berkshire_25585_walnut_famousdaves01.jpg?1330115118" title="Berkshire" />
    <div class="gallery-text">
      <h3>Berkshire</h3>
      <p>HDP &ndash; High Definition Porcelain</p>
    </div>
  </a>
</div>
4

1 に答える 1

4

彼らは兄弟ではないので、使用する必要があります

#gallery a:nth-of-type(4n) img{
   border: 5px solid #000;
}
于 2013-04-22T17:28:06.010 に答える