:only-child

Posted by & filed under O.

The :only-child pseudo-class selector property in CSS represents an element that has a parent element and whose parent element has no other element children. This would be the same as :first-child:last-child or :nth-child(1):nth-last-child(1), but with a lower specificity. div p:only-child { color: red; } For example, if we nest paragraphs within a <div> like so… <div> <p>This paragraph is the only child of its parent</p>

Continue reading →

:nth-of-type

Posted by & filed under N.

The :nth-of-type selector allows you select one or more elements based on their source order, according to a formula. It is defined in the CSS Selectors Level 3 spec as a “structural pseudo-class”, meaning it is used to style content based on its relationship with parent and sibling elements. Suppose we have an unordered list and wish to “zebra-stripe”

Continue reading →

How to Use the Webshims Polyfill

Posted by & filed under VIllage.

Polyfill? In web development, we call scripts that emulate parts of the HTML5 or CSS3 specification “polyfills”. A polyfill can be nearly anything – a JavaScript library that adds support for CSS3 selectors to old versions Internet Explorer (i.e. Selectivizr) or a high end Flash based solution to enable the <audio> and <video> tag all the way back to IE

Continue reading →

:nth-last-of-type

Posted by & filed under N.

The :nth-last-of-type selector allows you select one or more elements based on their source order, according to a formula. It is defined in the CSS Selectors Level 3 spec as a “structural pseudo-class”, meaning it is used to style content based on its relationship with parent and sibling elements. It functions the same as :nth-of-type except it selects items starting at

Continue reading →