Placeholder font-size bigger than 16px

The input and its placeholder must have matching font styles

input {
    display: block;
    width: 50vw;
    padding: 0 1.25rem;
}

input,
input::placeholder {
    font: 1.25rem/3 sans-serif;
}
<input type="text" placeholder="Example Input" />

A note about placeholder accessibility

The screenshot included in the question shows the placeholder values being used as labels. This technique may be problematic for users of assistive technology and is considered an accessibility anti-pattern.

From W3C › WAI › Placeholder Research › Avoid use of placeholder values:

A placeholder attribute should not be used as an alternative to a label. The placeholder is a short hint intended to aid the user with data entry so it should not be identical to the label element. The placeholder may not be available to assistive technology and thus may not be relied upon to convey an accessible name or description — it acts similar to fallback content.

See also:

Leave a Comment