I

Last updated on

The #id selector allows you to target an element by referencing the id HTML attribute. Similar to how class attributes are denoted in CSS with a “period” (.) before the class name, ID attributes are prefixed with an “octothorpe” (#), more commonly known as a “hash” or “pound sign”. <header id=”site-header”></header> #header { /* this

Continue reading →

Last updated on

The :invalid selector allows you to select <input> elements that do not contain valid content, as determined by its type attribute. :invalid is defined in the CSS Selectors Level 3 spec as a “validity pseudo-selector”, meaning it is used to style interactive elements based on an evaluation of user input. This selector has one particular use: providing a user with feedback while they are interacting

Continue reading →

Last updated on

The :in-range pseudo selector in CSS matches input elements when their value is within the range specified as being acceptable. <input type=”number” min=”5″ max=”10″> input:in-range { border: 5px solid green; } I believe it’s only relevant on input[type=number]. Range inputs don’t allow values outside their min/max and it doesn’t make much sense on any other

Continue reading →