몇 번째 nth-of-type과 nth-of-type을 여러 번 시도했으며 w3schools, css-tricks 및 mdn 그러나 이것을 이해할 수는 없습니다. 그것은 과거에는 저에게 효과적 이었지만 이제는 아무 일도 일어나지 않거나 모든 기간에 CSS 규칙이 적용됩니다.CSS : nth-of-type 및 nth-of-type이 내 마크 업 구조에서 작동하지 않습니다.
난 그냥 제 1, 제 2, 제이 다음과 같은 마크 업 (반복와 여덟째 8 배에 별도의 바닥 패딩을 추가하기 위해 노력하고있어모두는 부모 UL 안에 LIS :
<li class="campaign-links__list-item">
<a class="campaign-links__link " href="/feast-on-london-under-25" id="104014" data-analytics="Category|£25 and Under|offpage">
<img class="campaign-links__image opt-new--campaign-image" src="//img.static-bookatable.com/images/batweb/bat/sub-themes/feast-on-london/feast-on-london-under-25/hero.jpg?width=451&height=150&quality=80&mode=crop" alt="£25 and Under" width="94" height="94">
<span class="campaign-links__text opt-new--campaign-text" style="padding-bottom: 29px;">£25 and Under</span>
</a>
</li>
이
내가 '는 CSS입니다 해봤 :.opt-new--campaign-text:nth-of-child(1), .opt-new--campaign-text:nth-of-child(2), .opt-new--campaign-text:nth-of-child(8) {
padding-bottom: 29px;
}
.opt-new--campaign-text:nth-of-type(1), .opt-new--campaign-text:nth-of-type(2), .opt-new--campaign-text:nth-of-type(8) {
padding-bottom: 29px;
}
많은 감사를 사전에
'nth-child'가 아닌 'nth-of-child' – Swellar
"* [..] 첫 번째, 두 번째 및 여덟 번째에 패딩 * - 무엇을? 무엇의 첫 번째 또는 두 번째? '리 '? 왜 단지'리 : n 번째 - 아이 (n),'? – Abhitalks
귀하의 ''과''에는 귀하의 도움을 주신 덕분에 –