0Pricing
CSS Academy · Lesson

::placeholder ::selection and ::marker

Style input placeholders, text selections, and list marker bullets with pseudo-elements.

::placeholder

::placeholder styles the placeholder text inside form input and textarea elements. Only a subset of CSS properties are supported.

input::placeholder {
  color: #aaa;
  font-style: italic;
  font-size: 0.9rem;
}

Supported ::placeholder Properties

Not all CSS properties work on ::placeholder. Supported properties include: color, font-size, font-weight, font-style, letter-spacing, opacity, and a few others. Layout properties are not supported.

All lessons in this course

  1. ::before and ::after Content
  2. ::placeholder ::selection and ::marker
  3. CSS Counters with ::before
  4. Decorative Patterns with Pseudo-elements
← Back to CSS Academy