R

Last updated on

The :root selector allows you to target the highest-level “parent” element in the DOM, or document tree. 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. In the overwhelming majority of cases you’re likely to encounter, :root refers to the<html> element

Continue reading →

Last updated on

The :required pseudo class selector in CSS allows authors to select and style any matched element with the required attribute. Forms can easily indicate which fields must have valid data before the form can be submitted, but allows the user to avoid the wait incurred by having the server be the sole validator of the user’s input. Let’s say we have an

Continue reading →

Last updated on

:read-write and :read-only are two mutability pseudo-classes aiming at making form styling easier based on disabled, readonly and contenteditable HTML Attributes. While the browser support is not that bad, the various implementations are quite wonky. According to the official CSS Specifications, is considered :read-write an element which is: either an input which is neither readonly nor disabled or a textarea which is neither readonly nor disabled or any other editable element (thanks to contenteditable) Syntax &

Continue reading →