Each feature in detail
MDN The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents.
Live preview Example from MDN
body {
box-sizing: border-box;
padding: 20px;
}
div {
margin-bottom: 20px;
display: flex;
}
input,
textarea {
field-sizing: content;
min-width: 50px;
max-width: 350px;
}
label {
width: 150px;
margin-right: 20px;
text-align: right;
}
<div>
<label for="name">Enter name:</label>
<input type="text" id="name" />
</div>
<div>
<label for="email">Enter email:</label>
<input type="email" id="email" placeholder="e.g. a@b.com" />
</div>
<div>
<label for="tel">Enter telephone:</label>
<input type="tel" id="tel" maxlength="15" />
</div>
<div>
<label for="comment">Enter comment:</label>
<textarea id="comment">This is a comment.</textarea>
</div>
Syntax
fixed | content
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
- Initial
- fixed
- Applies to
- elements with default preferred size
- Inherited
- no
- Percentages
- N/A
- Computed value
- as specified
- Canonical order
- per grammar
- Animation type
- discrete
Browser support
First browser version supporting field-sizing | Chrome | 123 |
| Edge | 123 |
| Firefox | 152 |
| Safari | 26.2 |
| Chrome Android | 123 |
| Safari iOS | 26.2 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
No prose in the spec's definition and no MDN page yet: the spec link below is the only description.
Syntax
auto | none
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
- Initial
- auto
- Applies to
- sensitive text inputs
- Inherited
- no
- Percentages
- N/A
- Computed value
- as specified
- Canonical order
- per grammar
- Animation type
- by computed value type
Specification ↗
No prose in the spec's definition and no MDN page yet: the spec link below is the only description.
Syntax
auto | left-to-right | right-to-left | top-to-bottom | bottom-to-top
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
- Initial
- auto
- Applies to
- all elements
- Inherited
- no
- Percentages
- n/a
- Computed value
- as specified
- Canonical order
- per grammar
- Animation type
- discrete
Specification ↗
Spec The ::checkmark pseudo-element represents an indicator of whether the item is checked, and is present on checkboxes, radios, and option elements.
MDN The ::checkmark CSS pseudo-element targets the checkmark placed inside the currently-selected <option> element of a customizable select element. It can be used to provide a visual indication of which option is selected.
Live preview Example from MDN
option::checkmark {
color: orange;
font-size: 1.5rem;
}
select,
::picker(select) {
appearance: base-select;
width: 200px;
}
select {
border: 2px solid #dddddd;
background: #eeeeee;
padding: 10px;
}
::picker(select) {
border: none;
}
option {
border: 2px solid #dddddd;
background: #eeeeee;
padding: 10px;
}
option:first-of-type {
border-radius: 8px 8px 0 0;
}
option:last-of-type {
border-radius: 0 0 8px 8px;
}
option:nth-of-type(odd) {
background: white;
}
option:not(option:last-of-type) {
border-bottom: none;
}
<label for="pet-select">
Select pet:
</label>
<br />
<select id="pet-select">
<option value="cat">Cat</option>
<option value="dog">Dog</option>
<option value="chicken">
Chicken
</option>
</select>
Syntax
::checkmark
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::checkmark | Chrome | 133 |
| Edge | 133 |
| Firefox | No |
| Safari | 27 |
| Chrome Android | 133 |
| Safari iOS | 27 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The ::clear-icon pseudo-element represents the portion of the input that allows the user to clear the input when clicked if provided by the user agent. With appearance: textfield, the user agent must not generate this part.
Syntax
::clear-icon
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::color-swatch pseudo-element represents the portion of the control that displays the chosen color value.
Syntax
::color-swatch
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::field-component pseudo-element represents the portions of the control that contain the date/time component values.
Syntax
::field-component
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::field-content pseudo-element represents the portion of the input that contains the editable text.
Syntax
::field-content
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::field-content | Chrome | No |
| Edge | No |
| Firefox | No |
| Safari | 27.2 |
| Chrome Android | No |
| Safari iOS | No |
First version with support, from MDN browser-compat-data.
Specification ↗
Spec The ::field-separator pseudo-element represents the portions of the control that separate the date/time component values if the user agent provides those portions.
Syntax
::field-separator
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::file-selector-button pseudo-element represents the button used to open a file picker, if the UA renders such a button.
MDN The ::file-selector-button CSS pseudo-element represents the button of an <input> of type="file".
Live preview Example from MDN
Syntax
::file-selector-button
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::file-selector-button | Chrome | 89 |
| Edge | 89 |
| Firefox | 82 |
| Safari | 14.1 |
| Chrome Android | 89 |
| Safari iOS | 14.5 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The ::picker-icon pseudo-element represents the part of the control that represents the icon denoting the presence of the picker. It is only generated when the originating element has basic appearance and if it opens a picker. It is a fully styleable pseudo-element and inherits from its originating element.
MDN The ::picker-icon CSS pseudo-element targets the picker icon inside form controls that have an icon associated with them. In the case of a customizable select element, it selects the arrow icon shown on the <select> element that points down when it is closed.
Syntax
::picker-icon
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::picker-icon | Chrome | 133 |
| Edge | 133 |
| Firefox | No |
| Safari | 27 |
| Chrome Android | 133 |
| Safari iOS | 27 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The ::picker() pseudo-element represents the part of the form control that pops out of the page.
MDN The ::picker() CSS pseudo-element targets the picker part of an element, for example the drop-down picker of a customizable select element.
Syntax
::picker( <form-control-identifier>+ )
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::picker() | Chrome | 135 |
| Edge | 135 |
| Firefox | No |
| Safari | 27 |
| Chrome Android | 135 |
| Safari iOS | 27 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The ::placeholder pseudo-element represents the portion of the input that contains the placeholder text.
MDN The ::placeholder CSS pseudo-element represents the placeholder text in an <input> or <textarea> element.
Live preview Example from MDN
input {
margin-top: 0.5rem;
}
input::placeholder {
font-weight: bold;
opacity: 0.5;
color: red;
}
<label for="first-name">Your phone number:</label><br />
<input
id="first-name"
type="tel"
name="phone"
minlength="9"
maxlength="9"
placeholder="It must be 9 digits" />
Syntax
::placeholder
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting ::placeholder | Chrome | 57 |
| Edge | 79 |
| Firefox | 51 |
| Safari | 10.1 |
| Chrome Android | 57 |
| Safari iOS | 10.3 |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The ::reveal-icon pseudo-element represents the portion of the input that allows the user to temporarily disable obscuring of sensitive text input when clicked if provided by the user agent. User agents providing ::reveal-icon may choose to remove it in some circumstances to help protect sensitive text input from being revealed unintentionally.
Syntax
::reveal-icon
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::slider-fill pseudo-element represents the portion containing the progressed portion of the control. When the progress of control is indeterminate (like with <progress>), the user agent must give this portion an inline-size of zero.
Syntax
::slider-fill
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::slider-thumb pseudo-element represents the portion that allows the user to adjust the progress of the control.
Syntax
::slider-thumb
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::slider-track pseudo-element represents the portion containing both the progressed and unprogressed portions of the control.
Syntax
::slider-track
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::step-control pseudo-element represents the portion of a number input that contains the up and down buttons.
Syntax
::step-control
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::step-down pseudo-element represents the button that decrements the value inside a number input when activated.
Syntax
::step-down
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The ::step-up pseudo-element represents the button that increments the value inside a number input when activated.
Syntax
::step-up
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The :high-value pseudo-class matches on a meter element when its value is over the value specified by the high HTML attribute.
Syntax
:high-value
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The :low-value pseudo-class matches on a meter element when its value is under the value specified by the low HTML attribute.
Syntax
:low-value
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The :optimal-value pseudo-class matches on a meter element when its value is in the range determined by the optimum / low / high HTML attributes.
Syntax
:optimal-value
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The control-value() function computes to the current value of the form control it is on. If it is used on an element that is not a form control, it returns an empty string.
Syntax
control-value( <type>? )
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
MDN The type() CSS function allows you to specify a particular data type, and is used by the following CSS features:
Live preview Example from MDN
@function --combine-strings(--strings type(<string>+)) {
result: var(--strings) " ❤️";
}
section {
font-family: system-ui;
background-color: lime;
padding: 20px;
}
section::after {
content: --combine-strings("hello" "goodbye");
}
<section>What you gonna say?</section>
Syntax
'<' [ number | string ] '>'
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting <type> | Chrome | 139 |
| Edge | 139 |
| Firefox | No |
| Safari | No |
| Chrome Android | 139 |
| Safari iOS | No |
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗