CSS :nth-of-type() Selector
<!DOCTYPE html>
<html>
<head>
<style>
p:nth-of-type(3n+0) {
background: red;
}
</style>
</head>
<body>
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p>The fourth paragraph.</p>
<p>The fifth paragraph.</p>
<p>The sixth paragraph.</p>
<p>The seventh paragraph.</p>
<p>The eight paragraph.</p>
<p>The ninth paragraph.</p>
</body>
</html>
https://www.w3schools.com/cssref/sel_nth-of-type.asp
'기존카테고리 > CSS' 카테고리의 다른 글
체크박스2 (0) | 2018.03.15 |
---|---|
체크박스1 (0) | 2018.03.15 |
float 아래 콘텐츠 안밀려올라가기 (0) | 2018.03.10 |
Left 높이(100%) 만들기 + 부모 넓이 인식시키기 (0) | 2018.03.10 |
Div 간격이 있을 경우 font-size:0; 를 준다. (0) | 2018.02.01 |