P

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=”hello@csspark.com”> ::-webkit-input-placeholder { color: pink; } ::-moz-placeholder { /* Firefox 19+ */ color: pink; } :-ms-input-placeholder { color: pink; } :-moz-placeholder { /* Firefox 18- */ color:

Continue reading →