Keeping Your Elements’ Kids in Line with Offspring

A List Apart: Articles: Keeping Your Elements’ Kids in Line with Offspring

It occurred to me that classes resembling pseudo-classes could be added automagically through DOM Scripting. For instance, what if the first child of every element got the class first-child? And, to round things out, what about only-child and last-child as well?

This entry was posted in Cascading Style Sheets, Javascript. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>