HTML attribute: alpha

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The Boolean alpha attribute, valid on <input type="color"/> elements, allows the user to choose the opacity of the color being selected.

Try it

<label for="no-alpha">Color input not using alpha:</label>

<input type="color" id="no-alpha" name="no-alpha" value="#ff0000" />

<label for="alpha">Color input using alpha:</label>

<input
  type="color"
  id="alpha"
  name="alpha"
  alpha
  value="oklab(50% 0.1 0.1 / 0.5)" />
label {
  display: block;
  margin-top: 1rem;
}

input {
  margin-bottom: 1rem;
}

Specifications

Specification
HTML
# attr-input-alpha

Browser compatibility

See also