css - :nth-child related only to specific class or element -


it's possible assign :nth-child specific element, without count other element in middle (ex http://jsfiddle.net/mgc4v/ <*br>).

<p>1</p> <br> <p>2</p> <p>3</p>  p:nth-child(3) {     background-color:red; } 

the red line second one, not third..thanks

p:nth-of-type(3) {     background-color:red; } 

will select third <p> element :) , question ?

see http://www.w3.org/wiki/css/selectors/pseudo-classes/:nth-of-type example : http://codepen.io/anon/pen/dxgos


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -