pspanspan2
p
p
p
p
p
p
p
p
p
p
p
selector | example | example description |
---|---|---|
:nth-child(n) | p:nth-child(2) { background: #ff0000; } | Specify a background color for every <p> element that is the second child of its parent: |
:nth-of-type(n) | p:nth-of-type(2) { background: #ff0000; } | Specify a background color for every <p> element that is the second p element of its parent: |
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p