html - Bootstrap/CSS: Clearfix affects even/odd index -


i'm using clearfix prevent bootstrap grid breaking when use columns of different heights.

however, once clearfix div added document, columns appear after in source behave if have different even/odd index do.

i have created relevant demo. can see, removing clearfix div, makes colors of divs change if index has changed.

do know may causing , can correct it?

if @ nth-of-type definition specifies

the :nth-last-of-type(an+b) pseudo-class notation represents element has an+b-1 siblings same expanded element name after in document tree, 0 or positive integer value of n, , has parent element. see :nth-child() pseudo-class syntax of argument.

the key thing here states:

the same expanded element name

so taking quite literally, css selector targets specific element , odd , matched on specific element name , not elements matched using specific selector.

this why replacing divwith span work never matched different element.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -