Selectors

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 →

Last updated on

Just like pseudo-classes, pseudo-elements are added to selectors but instead of describing a special state, they allow you to style certain parts of a document. For example, the ::first-line pseudo-element targets only  the first line of an element specified by the selector. Syntax selector::pseudo-element { property: value; } Browser Support You can use only one pseudo-element in a

Continue reading →

Last updated on

A CSS pseudo-class is a keyword added to selectors that specifies a special state of the element to be selected. For example :hover will apply a style when the user hovers over the element specified by the selector. Pseudo-classes, together with pseudo-elements, let you apply a style to an element not only in relation to the content of the

Continue reading →

Last updated on

The ::placeholder pseudo element (or a pseudo class, in some cases) allows you to style the placeholder of a form element. As in, the text set with the placeholder attribute: <input type=”email” placeholder=”[email protected]”> ::-webkit-input-placeholder { color: pink; } ::-moz-placeholder { /* Firefox 19+ */ color: pink; } :-ms-input-placeholder { color: pink; } :-moz-placeholder { /* Firefox 18- */ color:

Continue reading →