PIE breaks :first-child pseudo-class #54

lojjic opened this Issue Jul 31, 2010 · 2 comments


None yet
1 participant

lojjic commented Jul 31, 2010

Since PIE inserts its rendering element as a previous-sibling to the target element, then if that target element was the first-child of its parent it will no longer be. This breaks the :first-child pseudo-class if specified for the element.

Not sure if there's any way around this, besides the author using a class="first" on the element.


lojjic commented Jul 31, 2010

One possible workaround: make PIE check whether the element it's being applied to is a first-child, and if so add a .pie_first-child class to the element. That would allow the CSS author to target it with a second selector. Definitely not ideal, but would get the job done. There's precedent for this sort of thing with the .pie_hover class already.


lojjic commented Nov 1, 2010

The pie_first-child class is now added to the first-child elements with the behavior attached. However it doesn't properly remove itself if another element is inserted before it in the DOM after the fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment