:matches()

Posted by & filed under M.

The :matches pseudo-class is described as a functional pseudo-class by the official CSS Selectors Level 4 specifications. It doesn’t serve any purpose in itself except making some complex selectors lighter by allowing them to be grouped. In a way, we can think as:matches as syntactic sugar. Basically it keeps you away from repeating a compound selector when there is only one

Continue reading →

:link

Posted by & filed under L.

The :link selector is a pseudo-class that targets all unvisited anchor () elements on a page. a:link { color: aquamarine; } The example above will change the color of all unvisited links to aquamarine. When used in combination with the :hover pseudo-class, :link must appear first, or else not be defined at all, in order for the :hover styles to work.

Continue reading →

:last-of-type

Posted by & filed under L.

The :last-of-type selector allows you to target the last occurence of an element within its container. 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 content. Suppose we have an article with a title, several paragraphs and an image:

Continue reading →

:last-child

Posted by & filed under L.

The :last-child selector allows you to target the last element directly inside its containing element. 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 content. Suppose we have an article and want to make the last paragraph smaller, to

Continue reading →