Links States, Cursor Interaction

Links can be styled selecting on three pseudo-classes, giving more options and a dedicated syntax versus, targeting the tag names, via attributes, or worse alternatives.

:link Targets unvisited links
:visited Targets visited links
:any-link Targets both of the above

Links are frequently targeted by the user, via the cursor, and make good targets for the related pseudo-classes.

:hover Targets element while being hovered
:active Targets element while being clicked

Lists, Bullets, Counters

Specified in the CSS counter styles 3 module. Useful list of Predefined counter styles. The at-rule is not supported on Safari, iOS < 17.

Using @media print and @page.

Specified in the Paged Media 3 module.

Using @media screen

The core mechanism to use for reponsiveness with "breakpoint switching", i.e. not based on continuous proportions dependant on the viewport size.

Using @container

Setting the container shorthand does not always reflect the style changes (may depend on browser/version).

The work-around is to assign el.style.container = undefined and then setTimeout(_ => el.style.container = "MyCont/inline-size", 10)

A timeout of 10ms works, and 1ms does not.