# border-top-left-radius
The `border-top-left-radius` CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
## Try it
    
    border-top-left-radius: 80px 80px;
    
    
    border-top-left-radius: 250px 100px;
    
    
    border-top-left-radius: 50%;
    
    
    border-top-left-radius: 50%;
    border: black 10px double;
    background-clip: content-box;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a top left rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
The rounding can be a circle or an ellipse, or if one of the value is `0`, no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the `background-clip` property.
Note: If the value of this property is not set in a `border-radius` shorthand property that is applied to the element after the `border-top-left-radius` CSS property, the value of this property is then reset to its initial value by the shorthand property.
## Syntax
    
    /* the corner is a circle */
    /* border-top-left-radius: radius */
    border-top-left-radius: 3px;
    
    /* the corner is an ellipse */
    /* border-top-left-radius: horizontal vertical */
    border-top-left-radius: 0.5em 1em;
    
    border-top-left-radius: inherit;
    
    /* Global values */
    border-top-left-radius: inherit;
    border-top-left-radius: initial;
    border-top-left-radius: revert;
    border-top-left-radius: revert-layer;
    border-top-left-radius: unset;
    
With one value:
  * the value is a `<length>` or a `<percentage>` denoting the radius of the circle to use for the border in that corner.


With two values:
  * the first value is a `<length>` or a `<percentage>` denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
  * the second value is a `<length>` or a `<percentage>` denoting the vertical semi-major axis of the ellipse to use for the border in that corner.


### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Arc of a circle
A single `<length>` value produces an arc of a circle.
    
    div {
      border-top-left-radius: 40px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Arc of an ellipse
Two different `<length>` values produce an arc of an ellipse.
    
    div {
      border-top-left-radius: 40px 20px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Square element with percentage radius
A square element with a single `<percentage>` value produces an arc of a circle.
    
    div {
      border-top-left-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Non-square element with percentage radius
A non-square element with a single `<percentage>` value produces an arc of an ellipse.
    
    div {
      border-top-left-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 200px;
      height: 100px;
    }
    
# backdrop-filter
The `backdrop-filter` CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything behind the element, to see the effect the element or its background needs to be transparent or partially transparent.
## Try it
    
    backdrop-filter: blur(10px);
    
    
    backdrop-filter: invert(80%);
    
    
    backdrop-filter: sepia(90%);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div id="example-element">Example</div>
      </div>
    </section>
    
    
    .example-container {
      background-image: url("/shared-assets/images/examples/balloon.jpg");
      background-size: cover;
      width: 200px;
      height: 200px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: black;
    }
    
    #example-element {
      font-weight: bold;
      flex: 1;
      text-align: center;
      padding: 20px 10px;
      background-color: rgb(255 255 255 / 0.2);
    }
    
## Syntax
    
    /* Keyword value */
    backdrop-filter: none;
    
    /* URL to SVG filter */
    backdrop-filter: url("common-filters.svg#filter");
    
    /* <filter-function> values */
    backdrop-filter: blur(2px);
    backdrop-filter: brightness(60%);
    backdrop-filter: contrast(40%);
    backdrop-filter: drop-shadow(4px 4px 10px blue);
    backdrop-filter: grayscale(30%);
    backdrop-filter: hue-rotate(120deg);
    backdrop-filter: invert(70%);
    backdrop-filter: opacity(20%);
    backdrop-filter: sepia(90%);
    backdrop-filter: saturate(80%);
    
    /* Multiple filters */
    backdrop-filter: url("filters.svg#filter") blur(4px) saturate(150%);
    
    /* Global values */
    backdrop-filter: inherit;
    backdrop-filter: initial;
    backdrop-filter: revert;
    backdrop-filter: revert-layer;
    backdrop-filter: unset;
    
### Values
`none`
    
No filter is applied to the backdrop.
`<filter-value-list>`
    
A space-separated list of `<filter-function>`s or an SVG filter that will be applied to the backdrop. CSS `<filter-function>`s include `blur()`, `brightness()`, `contrast()`, `drop-shadow()`, `grayscale()`, `hue-rotate()`, `invert()`, `opacity()`, `saturate()`, and `sepia()`.
## Examples
>
### CSS
    
    .box {
      background-color: rgb(255 255 255 / 30%);
      backdrop-filter: blur(10px);
    }
    
    body {
      background-image: url("anemones.jpg");
    }
    
### HTML
    
    <div class="container">
      <div class="box">
        <p>backdrop-filter: blur(10px)</p>
      </div>
    </div>
    
### Result
# text-wrap
The `text-wrap` CSS shorthand property controls how text inside an element is wrapped. The different values provide:
  * Typographic improvements, for example more balanced line lengths across broken headings
  * A way to turn text wrapping off completely.


## Try it
    
    text-wrap: wrap;
    
    
    text-wrap: nowrap;
    
    
    text-wrap: balance;
    
    
    text-wrap: pretty;
    
    
    text-wrap: stable;
    
    
    <section class="default-example" id="default-example">
      <div class="whole-content-wrapper">
        <p>Edit the text in the box:</p>
        <div class="transition-all" id="example-element">
          <p contenteditable="">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut
            cum eum id quos est.
          </p>
        </div>
      </div>
    </section>
    
    
    .whole-content-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
    }
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 250px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `text-wrap-mode`
  * `text-wrap-style`


## Syntax
    
    /* Keyword values */
    text-wrap: wrap;
    text-wrap: nowrap;
    text-wrap: balance;
    text-wrap: pretty;
    text-wrap: stable;
    
    /* Global values */
    text-wrap: inherit;
    text-wrap: initial;
    text-wrap: revert;
    text-wrap: revert-layer;
    text-wrap: unset;
    
The `text-wrap` property is specified as a single keyword chosen from the list of values below.
### Values
`wrap`
    
Text is wrapped across lines at appropriate characters (for example spaces, in languages like English that use space separators) to minimize overflow. This is the default value.
`nowrap`
    
Text does not wrap across lines. It will overflow its containing element rather than breaking onto a new line.
`balance`
    
Text is wrapped in a way that best balances the number of characters on each line, enhancing layout quality and legibility. Because counting characters and balancing them across multiple lines is computationally expensive, this value is only supported for blocks of text spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).
`pretty`
    
Results in the same behavior as `wrap`, except that the user agent will use a slower algorithm that favors better layout over speed. This is intended for body copy where good typography is favored over performance (for example, when the number of orphans should be kept to a minimum).
`stable`
    
Results in the same behavior as `wrap`, except that when the user is editing the content, the lines that come before the lines they are editing remain static rather than the whole block of text re-wrapping.
## Description
There are 2 ways that text can flow across lines within a block of content, such as a paragraph (`<p>`) or headings (<h1>–<h6>). These are forced line breaks, that are controlled by the user, and soft line breaks, that are controlled by the browser. The `text-wrap` property can be used to prompt the browser how to control the soft line breaks.
The value you choose, for `text-wrap`, depends on how many lines of text you anticipate styling, whether the text is `contenteditable`, and whether you need to prioritize appearance or performance.
When the styled content will be limited to a short number of lines, such as headings, captions, and blockquotes, `text-wrap: balance` can be added to balance the number of characters on each line, enhancing layout quality and legibility. As browsers limit the number of lines impacted by this property, this value's impact on performance is negligible.
For longer sections of text, `text-wrap: pretty` can be used. Note that `pretty` has a negative effect on performance, so it should be only used for longer blocks of text when the layout is more important than speed.
The `stable` value improves user experience when used on content that is `contenteditable`. This value ensures that, as the user is editing text, the previous lines in the area being edited remain stable.
## Examples
>
### Basic text wrap value comparison
#### HTML
    
    <h2 class="wrap" contenteditable="true">
      The default behavior; the text in the heading wraps "normally"
    </h2>
    
    <h2 class="nowrap" contenteditable="true">
      In this case the text in the heading doesn't wrap, and overflows the container
    </h2>
    
    <h2 class="balance" contenteditable="true">
      In this case the text in the heading is nicely balanced across lines
    </h2>
    
### CSS
    
    .wrap {
      text-wrap: wrap;
    }
    
    .nowrap {
      text-wrap: nowrap;
    }
    
    .balance {
      text-wrap: balance;
    }
    
    h2 {
      font-size: 2rem;
      font-family: sans-serif;
    }
    
#### Result
The text in the example is editable. Change the text, adding long words, to view how the different line and word lengths impact wrapping.
# text-overflow
The `text-overflow` CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis (`…`), or display a custom string.
## Try it
    
    text-overflow: clip;
    
    
    text-overflow: ellipsis;
    
    
    text-overflow: "-";
    
    
    text-overflow: "";
    
    
    <section id="default-example">
      <div id="example-element-container">
        <p id="example-element">"Is there any tea on this spaceship?" he asked.</p>
      </div>
    </section>
    
    
    #example-element-container {
      width: 100%;
      max-width: 18em;
    }
    
    #example-element {
      line-height: 50px;
      border: 1px solid #c5c5c5;
      overflow: hidden;
      white-space: nowrap;
      font-family: sans-serif;
      padding: 0 0.5em;
      text-align: left;
    }
    
The `text-overflow` property doesn't force an overflow to occur. To make text overflow its container, you have to set other CSS properties: `overflow` and `white-space`. For example:
    
    overflow: hidden;
    white-space: nowrap;
    
The `text-overflow` property only affects content that is overflowing a block container element in its inline progression direction (not text overflowing at the bottom of a box, for example).
## Syntax
    
    text-overflow: clip;
    text-overflow: ellipsis ellipsis;
    text-overflow: ellipsis " [..]";
    
    /* Global values */
    text-overflow: inherit;
    text-overflow: initial;
    text-overflow: revert;
    text-overflow: revert-layer;
    text-overflow: unset;
    
The `text-overflow` property may be specified using one or two values. If one value is given, it specifies overflow behavior for the end of the line (the right end for left-to-right text, the left end for right-to-left text). If two values are given, the first specifies overflow behavior for the left end of the line, and the second specifies it for the right end of the line. The property accepts either a keyword value (`clip` or `ellipsis`) or a `<string>` value.
### Values
`clip`
    
The default for this property. This keyword value will truncate the text at the limit of the content area, therefore the truncation can happen in the middle of a character. To clip at the transition between characters you can specify `text-overflow` as an empty string, if that is supported in your target browsers: `text-overflow: '';`.
`ellipsis`
    
This keyword value will display an ellipsis (`'…'`, `U+2026 HORIZONTAL ELLIPSIS`) to represent clipped text. The ellipsis is displayed inside the content area, decreasing the amount of text displayed. If there is not enough space to display the ellipsis, it is clipped.
`<string>`
    
The `<string>` to be used to represent clipped text. The string is displayed inside the content area, shortening the size of the displayed text. If there is not enough space to display the string itself, it is clipped.
## Examples
>
### One-value syntax
This example shows different values for `text-overflow` applied to a paragraph, for left-to-right and right-to-left text.
#### HTML
    
    <div class="ltr">
      <h2>Left to right text</h2>
      <pre>clip</pre>
      <p class="overflow-clip">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
      <pre>ellipsis</pre>
      <p class="overflow-ellipsis">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
      <pre>" [..]"</pre>
      <p class="overflow-string">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
    </div>
    
    <div class="rtl">
      <h2>Right to left text</h2>
      <pre>clip</pre>
      <p class="overflow-clip">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
      <pre>ellipsis</pre>
      <p class="overflow-ellipsis">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
      <pre>" [..]"</pre>
      <p class="overflow-string">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit.
      </p>
    </div>
    
#### CSS
    
    p {
      width: 200px;
      border: 1px solid;
      padding: 2px 5px;
    
      /* Both of the following are required for text-overflow */
      white-space: nowrap;
      overflow: hidden;
    }
    
    .overflow-clip {
      text-overflow: clip;
    }
    
    .overflow-ellipsis {
      text-overflow: ellipsis;
    }
    
    .overflow-string {
      text-overflow: " [..]";
    }
    
    body {
      display: flex;
      justify-content: space-around;
    }
    
    .ltr > p {
      direction: ltr;
    }
    
    .rtl > p {
      direction: rtl;
    }
    
#### Result
### Two-value syntax
This example shows the two-value syntax for `text-overflow`, where you can define different overflow behavior for the start and end of the text. To show the effect we have to scroll the line so the start of the line is also hidden.
#### HTML
    
    <pre>clip clip</pre>
    <p class="overflow-clip-clip">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </p>
    <pre>clip ellipsis</pre>
    <p class="overflow-clip-ellipsis">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </p>
    <pre>ellipsis ellipsis</pre>
    <p class="overflow-ellipsis-ellipsis">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </p>
    <pre>ellipsis " [..]"</pre>
    <p class="overflow-ellipsis-string">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </p>
    
#### CSS
    
    p {
      width: 200px;
      border: 1px solid;
      padding: 2px 5px;
    
      /* Both of the following are required for text-overflow */
      white-space: nowrap;
      overflow: scroll;
    }
    
    .overflow-clip-clip {
      text-overflow: clip clip;
    }
    
    .overflow-clip-ellipsis {
      text-overflow: clip ellipsis;
    }
    
    .overflow-ellipsis-ellipsis {
      text-overflow: ellipsis ellipsis;
    }
    
    .overflow-ellipsis-string {
      text-overflow: ellipsis " [..]";
    }
    
#### JavaScript
    
    // Scroll each paragraph so the start is also hidden
    const paras = document.querySelectorAll("p");
    
    for (const para of paras) {
      para.scroll(100, 0);
    }
    
#### Result
A previous version of this interface reached the Candidate Recommendation status. As some not-listed-at-risk features needed to be removed, the spec was demoted to the Working Draft level, explaining why browsers implemented this property unprefixed, though not at the CR state.
# grid-column-start
The `grid-column-start` CSS property specifies a grid item's start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement. This start position defines the block-start edge of the grid area.
## Try it
    
    grid-column-start: auto;
    
    
    grid-column-start: 2;
    
    
    grid-column-start: -1;
    
    
    grid-column-start: span 2;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Syntax
    
    /* Keyword value */
    grid-column-start: auto;
    
    /* <custom-ident> value */
    grid-column-start: some-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-column-start: 2;
    grid-column-start: some-grid-area 4;
    
    /* span + <integer> + <custom-ident> values */
    grid-column-start: span 3;
    grid-column-start: span some-grid-area;
    grid-column-start: span some-grid-area 5;
    
    /* Global values */
    grid-column-start: inherit;
    grid-column-start: initial;
    grid-column-start: revert;
    grid-column-start: revert-layer;
    grid-column-start: unset;
    
This property is specified as a single `<grid-line>` value. A `<grid-line>` value can be specified as:
  * either the `auto` keyword
  * or a `<custom-ident>` value
  * or an `<integer>` value
  * or both `<custom-ident>` and `<integer>`, separated by a space
  * or the keyword `span` together with either a `<custom-ident>` or an `<integer>` or both.


### Values
`auto`
    
A keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name `<custom-ident>-start`, it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-column-start: foo;` will choose the start edge of that named grid area (unless another line named `foo-start` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement, such that the column start edge of the grid item's grid area is n lines from the end edge.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the <integer> is omitted, it defaults to `1`. Negative integers and `0` are invalid.
The `<custom-ident>` cannot take the `span` and `auto` values.
## Examples
>
### Setting column start for a grid item
#### HTML
    
    <div class="wrapper">
      <div class="box1">One</div>
      <div class="box2">Two</div>
      <div class="box3">Three</div>
      <div class="box4">Four</div>
      <div class="box5">Five</div>
    </div>
    
#### CSS
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-rows: 100px;
    }
    
    .box1 {
      grid-column-start: 1;
      grid-column-end: 4;
      grid-row-start: 1;
      grid-row-end: 3;
    }
    
    .box2 {
      grid-column-start: 1;
      grid-row-start: 3;
      grid-row-end: 5;
    }
    
#### Result
# all
The `all` shorthand CSS property resets all of an element's properties except `unicode-bidi`, `direction`, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin.
## Try it
    
    /* no all property */
    
    
    all: initial;
    
    
    all: inherit;
    
    
    all: unset;
    
    
    all: revert;
    
    
    <section id="default-example">
      <div class="example-container-bg">
        <div class="example-container">
          <p id="example-element">
            This paragraph has a font size of 1.5rem and a color of gold. It also
            has 1rem of vertical margin set by the user-agent. The parent of the
            paragraph is a &lt;div&gt; with a dashed blue border.
          </p>
        </div>
      </div>
    </section>
    
    
    #example-element {
      color: gold;
      padding: 10px;
      font-size: 1.5rem;
      text-align: left;
      width: 100%;
    }
    
    .example-container {
      border: 2px dashed #2d5ae1;
    }
    
    .example-container-bg {
      background-color: #77767b;
      padding: 20px;
    }
    
## Constituent properties
This property is a shorthand for all CSS properties except for `unicode-bidi`, `direction`, and custom properties.
## Syntax
    
    /* Global values */
    all: initial;
    all: inherit;
    all: unset;
    all: revert;
    all: revert-layer;
    
The `all` property is specified as one of the CSS global keyword values. Note that none of these values affect the `unicode-bidi` and `direction` properties.
### Values
`initial`
    
Specifies that all the element's properties should be changed to their initial values.
`inherit`
    
Specifies that all the element's properties should be changed to their inherited values.
`unset`
    
Specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not.
`revert`
    
Specifies behavior that depends on the stylesheet origin to which the declaration belongs:
  * If the rule belongs to the author origin, the `revert` value rolls back the cascade to the user level, so that the specified values are calculated as if no author-level rules were specified for the element. For purposes of `revert`, the author origin includes the Override and Animation origins.
  * If the rule belongs to the user origin, the `revert` value rolls back the cascade to the user-agent level, so that the specified values are calculated as if no author-level or user-level rules were specified for the element.
  * If the rule belongs to the user-agent origin, the `revert` value acts like `unset`.


`revert-layer`
    
Specifies that all the element's properties should roll back the cascade to a previous cascade layer, if one exists. If no other cascade layer exists, the element's properties will roll back to the matching rule, if one exists, in the current layer or to a previous style origin.
## Examples
In this example, the CSS file contains styling for the `<blockquote>` element in addition to some styling for the parent `<body>` element. Various outputs in the Results subsection demonstrate how the styling of the `<blockquote>` element is affected when different values are applied to the `all` property inside the `blockquote` rule.
### HTML
    
    <blockquote id="quote">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    </blockquote>
    Phasellus eget velit sagittis.
    
### CSS
    
    body {
      font-size: small;
      background-color: #f0f0f0;
      color: blue;
      margin: 0;
      padding: 0;
    }
    
    blockquote {
      background-color: skyblue;
      color: red;
    }
    
### Results
#### A. No `all` property
This is the scenario in which no `all` property is set inside the `blockquote` rule. The `<blockquote>` element uses the browser's default styling which gives it a margin, together with a specific background and text color as specified in the stylesheet. It also behaves as a block element: the text that follows it is beneath it.
#### B. `all: initial`
With the `all` property set to `initial` in the `blockquote` rule, the `<blockquote>` element doesn't use the browser default styling anymore: it is an inline element now (initial value), its `background-color` is `transparent` (initial value), its `font-size` is `medium`, and its `color` is `black` (initial value).
#### C. `all: inherit`
In this case, the `<blockquote>` element doesn't use the browser default styling. Instead, it inherits style values from its parent `<body>` element: it is a block element now (inherited value), its `background-color` is `#F0F0F0` (inherited value), its `font-size` is `small` (inherited value), and its `color` is `blue` (inherited value).
#### D. `all: unset`
When the `unset` value is applied to the `all` property in the `blockquote` rule, the `<blockquote>` element doesn't use the browser default styling. Because `background-color` is a non-inherited property and `font-size` and `color` are inherited properties, the `<blockquote>` element is an inline element now (initial value), its `background-color` is `transparent` (initial value), but its `font-size` is still `small` (inherited value), and its `color` is `blue` (inherited value).
#### E. `all: revert`
When the `all` property is set to `revert` in the `blockquote` rule, the `blockquote` rule is considered to be non-existent and the styling property values are inherited from the ones applied to the parent element `<body>`. So the `<blockquote>` element gets styled as a block element, with `background-color` `#F0F0F0`, `font-size` `small`, and `color` `blue` \- all values inherited from the `body` rule.
#### F. `all: revert-layer`
There are no cascade layers defined in the CSS file, so the `<blockquote>` element inherits its style from the matching `body` rule. The `<blockquote>` element here is styled as a block element, with `background-color` `#F0F0F0`, `font-size` `small`, and `color` `blue` \- all values inherited from the `body` rule. This scenario is an example of the case when `all` set to `revert-layer` behaves the same as when `all` is set to `revert`.
# @media
The `@media` CSS at-rule can be used to apply part of a style sheet based on the result of one or more media queries. With it, you specify a media query and a block of CSS to apply to the document if and only if the media query matches the device on which the content is being used.
Note: In JavaScript, the rules created using `@media` can be accessed with the `CSSMediaRule` CSS object model interface.
## Try it
    
    abbr {
      color: #860304;
      font-weight: bold;
      transition: color 0.5s ease;
    }
    
    @media (hover: hover) {
      abbr:hover {
        color: #001ca8;
        transition-duration: 0.5s;
      }
    }
    
    @media not all and (hover: hover) {
      abbr::after {
        content: " (" attr(title) ")";
      }
    }
    
    
    <p>
      <abbr title="National Aeronautics and Space Administration">NASA</abbr> is a
      U.S. government agency that is responsible for science and technology related
      to air and space.
    </p>
    
## Syntax
    
    /* At the top level of your code */
    @media screen and (width >= 900px) {
      article {
        padding: 1rem 3rem;
      }
    }
    
    /* Nested within another conditional at-rule */
    @supports (display: flex) {
      @media screen and (width >= 900px) {
        article {
          display: flex;
        }
      }
    }
    
The `@media` at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
For a discussion of media query syntax, please see Using media queries.
## Description
A media query's `<media-query-list>` includes `<media-type>`s, `<media-feature>s`, and logical operators.
### Media types
A `<media-type>` describes the general category of a device. Except when using the `only` logical operator, the media type is optional and the `all` type is implied.
`all`
    
Suitable for all devices.
`print`
    
Intended for paged material and documents viewed on a screen in print preview mode. (Please see paged media for information about formatting issues that are specific to these formats.)
`screen`
    
Intended primarily for screens.
Note: CSS2.1 and Media Queries 3 defined several additional media types (`tty`, `tv`, `projection`, `handheld`, `braille`, `embossed`, and `aural`, but they were deprecated in Media Queries 4 and shouldn't be used.
### Media features
A `<media feature>` describes specific characteristics of the user agent, output device, or environment. Media feature expressions test for their presence, value, or range of values, and are entirely optional. Each media feature expression must be surrounded by parentheses.
`any-hover`
    
Does any available input mechanism allow the user to hover over elements?
`any-pointer`
    
Is any available input mechanism a pointing device, and if so, how accurate is it?
`aspect-ratio`
    
Width-to-height aspect ratio of the viewport.
`color`
    
Number of bits per color component of the output device, or zero if the device isn't color.
`color-gamut`
    
Approximate range of colors that are supported by the user agent and output device.
`color-index`
    
Number of entries in the output device's color lookup table, or zero if the device does not use such a table.
`device-aspect-ratio`
    
Width-to-height aspect ratio of the output device. Deprecated in Media Queries Level 4.
`device-height`
    
Height of the rendering surface of the output device. Deprecated in Media Queries Level 4.
`device-posture`
    
Detects the device's current posture, that is, whether the viewport is in a flat or folded state. Defined in the Device Posture API.
`device-width`
    
Width of the rendering surface of the output device. Deprecated in Media Queries Level 4.
`display-mode`
    
The mode in which an application is being displayed: for example, fullscreen or picture-in-picture mode. Added in Media Queries Level 5.
`dynamic-range`
    
Combination of brightness, contrast ratio, and color depth that are supported by the user agent and the output device. Added in Media Queries Level 5.
`forced-colors`
    
Detect whether user agent restricts color palette. Added in Media Queries Level 5.
`grid`
    
Does the device use a grid or bitmap screen?
`height`
    
Height of the viewport.
`hover`
    
Does the primary input mechanism allow the user to hover over elements?
`inverted-colors`
    
Is the user agent or underlying OS inverting colors? Added in Media Queries Level 5.
`monochrome`
    
Bits per pixel in the output device's monochrome frame buffer, or zero if the device isn't monochrome.
`orientation`
    
Orientation of the viewport.
`overflow-block`
    
How does the output device handle content that overflows the viewport along the block axis?
`overflow-inline`
    
Can content that overflows the viewport along the inline axis be scrolled?
`pointer`
    
Is the primary input mechanism a pointing device, and if so, how accurate is it?
`prefers-color-scheme`
    
Detect if the user prefers a light or dark color scheme. Added in Media Queries Level 5.
`prefers-contrast`
    
Detects if the user has requested the system increase or decrease the amount of contrast between adjacent colors. Added in Media Queries Level 5.
`prefers-reduced-data`
    
Detects if the user has requested the web content that consumes less internet traffic.
`prefers-reduced-motion`
    
The user prefers less motion on the page. Added in Media Queries Level 5.
`prefers-reduced-transparency`
    
Detects if a user has enabled a setting on their device to reduce the transparent or translucent layer effects used on the device.
`resolution`
    
Pixel density of the output device.
`scan`
    
Whether display output is progressive or interlaced.
`scripting`
    
Detects whether scripting (i.e., JavaScript) is available. Added in Media Queries Level 5.
`shape`
    
Detects the shape of the device to distinguish rectangular and round displays.
`update`
    
How frequently the output device can modify the appearance of content.
`video-dynamic-range`
    
Combination of brightness, contrast ratio, and color depth that are supported by the video plane of user agent and the output device. Added in Media Queries Level 5.
`width`
    
Width of the viewport including width of scrollbar.
`-moz-device-pixel-ratio`
    
The number of device pixels per CSS pixel. Use the `resolution` feature with the `dppx` unit instead.
`-webkit-animation`
    
The browser supports `-webkit` prefixed CSS `animation`. Use the `@supports (animation)` feature query instead.
`-webkit-device-pixel-ratio`
    
The number of device pixels per CSS pixel. Use the `resolution` feature with the `dppx` unit instead.
`-webkit-transform-2d`
    
The browser supports `-webkit` prefixed 2D CSS `transform`. Use the `@supports (transform)` feature query instead.
`-webkit-transform-3d`
    
The browser supports `-webkit` prefixed 3D CSS `transform`. Use the `@supports (transform)` feature query instead.
`-webkit-transition`
    
The browser supports `-webkit` prefixed CSS `transition`. Use the `@supports (transition)` feature query instead.
### Logical operators
The logical operators `not`, `and`, `only`, and `or` can be used to compose a complex media query. You can also combine multiple media queries into a single rule by separating them with commas.
`and`
    
Used for combining multiple media features together into a single media query, requiring each chained feature to return `true` for the query to be `true`. It is also used for joining media features with media types.
`not`
    
Used to negate a media query, returning `true` if the query would otherwise return `false`. If present in a comma-separated list of queries, it will only negate the specific query to which it is applied.
Note: In Level 3, the `not` keyword can't be used to negate an individual media feature expression, only an entire media query.
`only`
    
Applies a style only if an entire query matches. It is useful for preventing older browsers from applying selected styles. When not using `only`, older browsers would interpret the query `screen and (width <= 500px)` as `screen`, ignoring the remainder of the query, and applying its styles on all screens. If you use the `only` operator, you must also specify a media type.
`,` (comma)
    
Commas are used to combine multiple media queries into a single rule. Each query in a comma-separated list is treated separately from the others Thus, if any of the queries in a list is `true`, the entire media statement returns `true`. In other words, lists behave like a logical `or` operator.
`or`
    
Equivalent to the `,` operator. Added in Media Queries Level 4.
### User agent client hints
Some media queries have corresponding user agent client hints. These are HTTP headers that request content that is pre-optimized for the particular media requirement. They include `Sec-CH-Prefers-Color-Scheme` and `Sec-CH-Prefers-Reduced-Motion`.
## Accessibility
To best accommodate people who adjust a site's text size, use `em`s when you need a `<length>` for your media queries.
Both `em` and `px` are valid units, but `em` works better if the user changes the browser text size.
Also consider media queries or HTTP user agent client hints to improve the user's experience. For example, the media query `prefers-reduced-motion` or the equivalent HTTP header `Sec-CH-Prefers-Reduced-Motion`) can be used to minimize the amount of animation or motion used based on user preferences.
## Security
Because media queries provide insights into the capabilities—and by extension, the features and design—of the device the user is working with, there is the potential that they could be abused to construct a "fingerprint" which identifies the device, or at least categorizes it to some degree of detail that may be undesirable to users.
Because of this potential, a browser may opt to fudge the returned values in some manner in order to prevent them from being used to precisely identify a computer. A browser might also offer additional measures in this area; for example, if Firefox's "Resist Fingerprinting" setting is enabled, many media queries report default values rather than values representing the actual device state.
## Examples
>
### Testing for print and screen media types
    
    @media print {
      body {
        font-size: 10pt;
      }
    }
    
    @media screen {
      body {
        font-size: 13px;
      }
    }
    
    @media screen, print {
      body {
        line-height: 1.2;
      }
    }
    
The range syntax allows for less verbose media queries when testing for any feature accepting a range, as shown in the below examples:
    
    @media (height > 600px) {
      body {
        line-height: 1.4;
      }
    }
    
    @media (400px <= width <= 700px) {
      body {
        line-height: 1.4;
      }
    }
    
For more examples, please see Using media queries.
# view-timeline-axis
The `view-timeline-axis` CSS property is used to specify the scrollbar direction that will be used to provide the timeline for a named view progress timeline animation, which is progressed through based on the change in visibility of an element (known as the subject) inside a scrollable element (scroller). `view-timeline-axis` is set on the subject. See CSS scroll-driven animations for more details.
Note: If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.
The `view-timeline-axis`, `view-timeline-inset` and `view-timeline-name` properties can also be set using the `view-timeline` shorthand property.
## Syntax
    
    /* Logical property values */
    view-timeline-axis: block;
    view-timeline-axis: inline;
    /* Non-logical property values */
    view-timeline-axis: y;
    view-timeline-axis: x;
    
### Values
Allowed values for `view-timeline-axis` are:
`block`
    
The scrollbar on the block axis of the scroller element, which is the axis in the direction perpendicular to the flow of text within a line. For horizontal writing modes, such as standard English, this is the same as `y`, while for vertical writing modes, it is the same as `x`. This is the default value.
`inline`
    
The scrollbar on the inline axis of the scroller element, which is the axis in the direction parallel to the flow of text in a line. For horizontal writing modes, this is the same as `x`, while for vertical writing modes, this is the same as `y`.
`y`
    
The scrollbar on the vertical axis of the scroller element.
`x`
    
The scrollbar on the horizontal axis of the scroller element.
## Examples
>
### Defining the axis of the view progress timeline
In this example, a view progress timeline named `--subject-reveal` is defined using the `view-timeline-name` property on a subject element with a class of "animation". This timeline is then applied to the animation on the same element, using `animation-timeline: --subject-reveal;`.
To demonstrate the effect of `view-timeline-axis`, a horizontal (non-default) scrollbar is used in this example to drive the animation.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua.
      </p>
    
      <p>
        Risus quis varius quam quisque id. Et ligula ullamcorper malesuada proin
        libero nunc consequat interdum varius. Elit ullamcorper dignissim cras
        tincidunt lobortis feugiat vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras.
      </p>
    
      <p>
        A erat nam at lectus urna duis convallis convallis. Nibh ipsum consequat
        nisl vel pretium lectus.
      </p>
    
      <p>
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris.
      </p>
    </div>
    
#### CSS
In the CSS, we set the `subject` element as the source of a view progress timeline named `--subject-reveal` using the `view-timeline-name` property. The scroll axis is set using `view-timeline-axis: x;` (Chromium) and `view-timeline-axis: horizontal;` (Firefox) — this causes the horizontal scrollbar position of the scrolling ancestor element to determine the animation timeline.
The `content` ancestor element is made to overflow horizontally by laying out its contents using `display: flex;` and `flex-flow: column wrap;`.
Also worth noting is that the subject element has an `animation-duration` applied to it so that the example will work in Firefox.
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 50%;
      height: 400px;
      margin-top: 30px;
      display: flex;
      flex-flow: column wrap;
      gap: 10px;
    }
    
    p {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    p {
      font-size: 1.3rem;
      line-height: 1.4;
    }
    
    .animation {
      view-timeline-name: --subject-reveal;
      /* Chromium supports the new x/y syntax */
      view-timeline-axis: x;
      /* Firefox still supports the old horizontal/vertical syntax */
      view-timeline-axis: horizontal;
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-timeline: --subject-reveal;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll the horizontal bar at the bottom to see the subject element animate as you scroll.
# block-size
The `block-size` CSS property defines the size of an element's block along the block axis. If the `writing-mode` is horizontal, it corresponds to the `height`; if the writing mode is vertical, it corresponds to the `width`. A related property is `inline-size`, which defines the other dimension of the element.
## Try it
    
    block-size: 150px;
    writing-mode: horizontal-tb;
    
    
    block-size: 150px;
    writing-mode: vertical-rl;
    
    
    block-size: auto;
    writing-mode: horizontal-tb;
    
    
    block-size: auto;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the block-size.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    block-size: 300px;
    block-size: 25em;
    block-size: anchor-size(height);
    block-size: calc(anchor-size(--my-anchor block) * 0.75);
    
    /* <percentage> values */
    block-size: 75%;
    
    /* Keyword values */
    block-size: max-content;
    block-size: min-content;
    block-size: fit-content;
    block-size: fit-content(20em);
    block-size: auto;
    
    /* Global values */
    block-size: inherit;
    block-size: initial;
    block-size: revert;
    block-size: revert-layer;
    block-size: unset;
    
### Values
The `block-size` property takes the same values as the `width` and `height` properties.
## Examples
>
### Block size with vertical text
#### HTML
    
    <p class="exampleText">Example text</p>
    
#### CSS
    
    .exampleText {
      writing-mode: vertical-rl;
      background-color: yellow;
      block-size: 200px;
    }
    
#### Result
# :first-child
The `:first-child` CSS pseudo-class represents the first element among a group of sibling elements.
## Try it
    
    p {
      font-weight: bold;
    }
    
    li:first-child {
      border: 2px solid orange;
    }
    
    
    <p>Track &amp; field champions:</p>
    <ul>
      <li>Adhemar da Silva</li>
      <li>Wang Junxia</li>
      <li>Wilma Rudolph</li>
      <li>Babe Didrikson-Zaharias</li>
      <li>Betty Cuthbert</li>
      <li>Fanny Blankers-Koen</li>
      <li>Florence Griffith-Joyner</li>
      <li>Irena Szewinska</li>
      <li>Jackie Joyner-Kersee</li>
      <li>Shirley Strickland</li>
      <li>Carl Lewis</li>
      <li>Emil Zatopek</li>
      <li>Haile Gebrselassie</li>
      <li>Jesse Owens</li>
      <li>Jim Thorpe</li>
      <li>Paavo Nurmi</li>
      <li>Sergei Bubka</li>
      <li>Usain Bolt</li>
    </ul>
    
## Syntax
    
    :first-child {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <div>
      <p>This text is selected!</p>
      <p>This text isn't selected.</p>
    </div>
    
    <div>
      <h2>This text isn't selected: it's not a `p`.</h2>
      <p>This text isn't selected.</p>
    </div>
    
#### CSS
    
    p:first-child {
      color: lime;
      background-color: black;
      padding: 5px;
    }
    
#### Result
### Styling a list
#### HTML
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>
        Item 3
        <ul>
          <li>Item 3.1</li>
          <li>Item 3.2</li>
          <li>Item 3.3</li>
        </ul>
      </li>
    </ul>
    
#### CSS
    
    ul li {
      color: blue;
    }
    
    ul li:first-child {
      color: red;
      font-weight: bold;
    }
    
#### Result
# ::scroll-marker
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `::scroll-marker` CSS pseudo-element can be generated inside any element and represents its scroll marker. All elements can have a `::scroll-marker` pseudo-element, which is placed into the `::scroll-marker-group` of the nearest scroll container ancestor. A scroll marker behaves like an anchor (`<a>` element) whose scroll target is the marker's originating element — and scrolls the scroll container to that element when activated.
## Syntax
    
    ::scroll-marker {
      /* ... */
    }
    
## Description
A `::scroll-marker` is generated on an element when the `::scroll-marker`'s `content` property is set to a non-`none` value, and its has an ancestor scroll container with a non-`none` `scroll-marker-group` property value (meaning that it will generate a `::scroll-marker-group` pseudo-element).
The scroll container's `::scroll-marker-group` pseudo-element automatically contains any `::scroll-marker` pseudo-elements generated on the scroll container or its descendants. This allows them to be positioned and laid out as a group and is typically used when creating a CSS carousel to create a scroll position indicator. The individual scroll markers can be used to navigate to their associated content items.
Accessibility-wise, the scroll marker group and contained scroll markers are rendered with `tablist`/`tab` semantics. When you `Tab` to the group, it behaves like a single item (that is, another press of the `Tab` key will move past the group to the next item), and you can move between the different scroll markers using the left and right (or up and down) cursor keys.
## Examples
See Creating CSS carousels for other examples that use the `::scroll-marker` pseudo-element.
### Creating carousel scroll markers
In this example, we demonstrate how to create scroll markers on a CSS carousel.
#### HTML
We have a basic HTML `<ul>` list with several `<li>` list items.
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>
      <li>Item 7</li>
      <li>Item 8</li>
    </ul>
    
#### CSS
We convert our `<ul>` into a scroll snapping overflow container by setting the `display` to `flex`, creating a single, non-wrapping row of `<li>` elements. The `overflow-x` property is set to `auto`, meaning if the items overflow their container on the x-axis, the content will scroll horizontally. We then convert the `<ul>` into a scroll-snap container, ensuring that items always snap into place when the container is scrolled with a `scroll-snap-type` value of `mandatory`.
We create a scroll marker group with the `scroll-marker-group` property, placing the group after all the content.
    
    ul {
      display: flex;
      gap: 4vw;
      padding-left: 0;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
      scroll-marker-group: after;
    }
    
Next, we style the `<li>` elements, using the `flex` property to make them `33%` of the width of the container. The `scroll-snap-align` value of `start` causes the left-hand side of the left-most visible item to snap to the left edge of the container when the content is scrolled.
    
    li {
      list-style-type: none;
      background-color: #eeeeee;
      flex: 0 0 33%;
      height: 100px;
      padding-top: 20px;
      scroll-snap-align: start;
      text-align: center;
    }
    
We then use the `::scroll-marker` pseudo-element to create a square marker for each list item with a red border:
    
    li::scroll-marker {
      content: "";
      border: 1px solid red;
      height: 1em;
      width: 1em;
    }
    
We also apply styles to the `::scroll-marker-group` pseudo-element to lay out the scroll markers in the center of the row with a `0.4em` gap between each one:
    
    ::scroll-marker-group {
      display: flex;
      gap: 0.4em;
      place-content: center;
    }
    
Finally, we style the marker of the currently-scrolled element differently from the others, targeting the marker with the `:target-current` pseudo-class.
    
    ::scroll-marker:target-current {
      background: red;
    }
    
#### Result
### Custom scroll marker numbering and style
This example is the same as the previous one, except that we have applied some different styling to the scroll markers, and used CSS counters to increment the number shown on each marker. The CSS differences are explained in the next section.
### CSS
In this example, we set a name of a counter we want to increment on each `<li>` — `markers` — using the `counter-increment` property:
    
    li {
      counter-increment: markers;
    }
    
We then set the `::scroll-marker` pseudo-element's `content` property to the `counter()` function, passing it the `markers` counter name as an argument. This has the effect of inserting a number into each marker, which increments automatically. The rest of the styling is rudimentary, but it illustrates how the markers can be fully-styled.
    
    li::scroll-marker {
      content: counter(markers);
      font-family: sans-serif;
      width: fit-content;
      height: 1em;
      padding: 5px;
      color: black;
      text-decoration: none;
      border: 2px solid rgb(0 0 0 / 0.15);
      border-radius: 0.5em;
      background-color: #eeeeee;
    }
    
For another interesting customization, we include two rules to select the marker of the first and last list items by inserting `:first-child` and `:last-child` into the selector chain, respectively. We give the first marker text content of "First", and the last marker text content of "Last".
    
    li:first-child::scroll-marker {
      content: "First";
    }
    
    li:last-child::scroll-marker {
      content: "Last";
    }
    
To improve user experience, we set a different color on the markers on `:hover` and use the `:target-current` pseudo-class to set a different `color` and `background-color` on the currently-scrolled element's marker so users know which item is currently in view:
    
    ::scroll-marker:hover {
      background-color: #ddcccc;
    }
    
    ::scroll-marker:target-current {
      background-color: purple;
      color: white;
    }
    
#### Result
# ::backdrop
The `::backdrop` CSS pseudo-element is a box the size of the viewport, which is rendered immediately beneath any element being presented in the top layer.
## Try it
    
    button {
      font-size: 1.2rem;
      padding: 5px 15px;
    }
    
    dialog::backdrop {
      background-color: salmon;
    }
    
    
    <button id="showDialogBtn">Show a dialog</button>
    
    <dialog id="favDialog">
      <form method="dialog">
        <p>The background shown outside of this dialog is a backdrop.</p>
        <button id="confirmBtn">Close the dialog</button>
      </form>
    </dialog>
    
    
    const showDialogBtn = document.getElementById("showDialogBtn");
    const favDialog = document.getElementById("favDialog");
    
    showDialogBtn.addEventListener("click", () => favDialog.showModal());
    
## Syntax
    
    ::backdrop {
      /* ... */
    }
    
## Description
Backdrops appear in the following instances:
  * Elements which have been placed in fullscreen mode using the Fullscreen API `Element.requestFullscreen()` method.
  * `<dialog>` elements that have been shown in the top layer via a `HTMLDialogElement.showModal()` call.
  * Popover elements that have been shown in the top layer via a `HTMLElement.showPopover()` call.


When multiple elements have been placed into the top layer, each one has its own `::backdrop` pseudo-element.
    
    /* Backdrop is only displayed when dialog is opened with dialog.showModal() */
    dialog::backdrop {
      background: rgb(255 0 0 / 25%);
    }
    
Elements are placed in a last-in/first out (LIFO) stack in the top layer. The `::backdrop` pseudo-element makes it possible to obscure, style, or completely hide everything located below a top layer element.
`::backdrop` neither inherits from nor is inherited by any other elements. No restrictions are made on what properties apply to this pseudo-element.
## Examples
>
### Styling a modal dialog's backdrop
In this example, we use the `::backdrop` pseudo-element to style the backdrop that is used when a modal `<dialog>` is open.
#### HTML
We include a `<button>` that, when clicked, will open the included `<dialog>`. When the `<dialog>` is opened, we give focus to the button that closes the dialog:
    
    <dialog>
      <button autofocus>Close</button>
      <p>This modal dialog has a beautiful backdrop!</p>
    </dialog>
    <button>Show the dialog</button>
    
#### CSS
We add a background to the backdrop, creating a colorful donut using CSS gradients:
    
    ::backdrop {
      background-image:
        radial-gradient(
          circle,
          white 0 5vw,
          transparent 5vw 20vw,
          white 20vw 22.5vw,
          #eeeeee 22.5vw
        ),
        conic-gradient(
          #272b66 0 50grad,
          #2d559f 50grad 100grad,
          #9ac147 100grad 150grad,
          #639b47 150grad 200grad,
          #e1e23b 200grad 250grad,
          #f7941e 250grad 300grad,
          #662a6c 300grad 350grad,
          #9a1d34 350grad 400grad,
          #43a1cd 100grad 150grad,
          #ba3e2e
        );
    }
    
#### JavaScript
The dialog is opened modally using the `.showModal()` method and closed using the `.close()` method.
    
    const dialog = document.querySelector("dialog");
    const showButton = document.querySelector("dialog + button");
    const closeButton = document.querySelector("dialog button");
    
    // "Show the dialog" button opens the dialog modally
    showButton.addEventListener("click", () => {
      dialog.showModal();
    });
    
    // "Close" button closes the dialog
    closeButton.addEventListener("click", () => {
      dialog.close();
    });
    
#### Results
# !important
A `!` delimiter followed by the `important` keyword marks the declaration as important. The `!important` flag alters the rules selecting declarations inside the cascade. A declaration that is not important is called normal.
To mark a declaration important, add the important flag (`!important`) after the value in the declaration. While white space is allowed between the delimiter and the keyword, the flag is generally written as `!important` without any white space.
    
    selector {
      property: value; /* normal declaration */
      property: value !important; /* important declaration (preferred) */
      property: value ! important; /* important declaration (not preferred) */
    }
    
The `!important` comes after the value of the property value pair declaration, preceded by zero or more spaces. The important flag must be the last token in the declaration. In other words, there can be white space and comments between the flag and the declaration's ending semicolon, but nothing else.
## Impact on the cascade
When it comes to important declarations, the cascade origin and layer orders are reversed. Without the important flag, declarations in the author's style sheets override declarations in a user's style sheet, which override declarations in the user-agent's default style sheet.
When a declaration is important, the order of precedence is reversed. Declarations marked as important in the user-agent style sheets override all important declarations in the user style sheets. Similarly, all important declarations in the user style sheets override all important declarations in the author's style sheets. Finally, all important declarations take precedence over all animations.
Note: All important declarations take precedence over all animations. `!important` is not valid within @keyframes animation declarations.
Reversing the precedence order for important declarations ensures users with special needs, such as personalized color schemes or large fonts, can override author styles when needed by marking some declarations in their user's style sheet as important. It also guarantees malicious extensions can't override important user-agent styles, which might break functionality or negatively impact security.
Does anything have precedence over important declarations? Yes, transitions. CSS transitions are a way to control the speed at which the property changes from one value to another. While transitioning from one value to another, a property will not match a specific important declaration.
    
    a {
      color: red !important;
      background-color: yellow;
      transition: all 2s linear;
    }
    a:hover {
      color: blue !important;
      background-color: orange !important;
    }
    
In this example, the `color` and `background-color` properties will transition to the hovered state over two seconds. Even though default states are normal declarations and hover states are `!important` declarations, the transition does happen.
### Cascade layers
Within each of the three origins for style sheets – author, user, and user-agent – normal declarations in unlayered styles override layered style declarations, with the last declared having precedence over the layers declared before it. Important declarations reverse the order of precedence: important declarations in the first layer take precedence over important declarations in the next layer, and so on. Also, all the important declarations have precedence over important declarations made outside any layer.
### Inline styles
Inline styles are styles defined using the `style` attributes. They can also be normal or important. Inline normal styles take precedence over all normal declarations, no matter the origin. Inline important styles take precedence over all other important author styles, no matter the layer, but important styles from user's or user-agent's style sheets and transitions override them.
### !important and specificity
While `!important` is not part of determining specificity, it is related. Important declarations override all other declarations from the same origin and cascade layer.
    
    #myElement#myElement#myElement .myClass.myClass p:hover {
      color: blue;
    }
    
    p {
      color: red !important;
    }
    
This example displays a case of over-specifying a selector. No matter how high the selector specificity matches a normal declaration, an important declaration from the same source and cascade layer will always have precedence. In this case, the paragraph will always be red.
When two important declarations from the same origin and layer apply to the same element, browsers select and use the declaration with the highest specificity.
    
    #myElement p {
      color: green !important;
    }
    
    p {
      color: purple !important;
    }
    
In this case, the selector specificity matters. Only if the selectors had the same specificity would source order matter.
## Impact on shorthand properties
Declaring a shorthand property with `!important` sets all of sub-properties as important. The two following selector style blocks are equivalent:
    
    p {
      background: blue !important;
    }
    
    p {
      background-image: none !important;
      background-position: 0 0 !important;
      background-size: auto auto !important;
      background-repeat: repeat !important;
      background-origin: padding-box !important;
      background-clip: border-box !important;
      background-attachment: scroll !important;
      background-color: blue !important;
    }
    
This example shows one of the several reasons avoiding the important flag is generally recommended.
## Impact on custom properties
When the `!important` flag is added to a custom property value declaration, it makes the value assignment important. The `!important` flag is then stripped from the custom property value. The `!important` flag is not passed as part of the custom property value to the `var()` function.
    
    :root {
      --my-color: red !important;
      --my-color: blue;
    }
    p {
      color: var(--my-color);
    }
    blockquote {
      color: var(--my-color);
      color: purple;
    }
    
In this example, the paragraph will be red, not blue, as the custom property value assignment is important. The blockquote will be purple, because the purple normal declaration comes after the normal red declaration.
## Best practices
Avoid using `!important` to override specificity. When intentionally creating important declarations for UI requirements, comment in your CSS code to explain to maintainers why they should not override that feature.
Even when working to override high-specificity styles not under your control, such as styles in a 3rd party plugin declared with an id selector, you don't need to use `!important`. Consider instead importing the 3rd party stylesheet script into a named or anonymous layer as your first cascade layer, instead of using `!important`. As long as the external styles do not include important declarations, your styles will take precedence over the widget styles, no matter the specificity.
If you need to override an external stylesheet containing important declarations, create a cascade layer containing the needed overrides, and declare that layer first.
### Accessibility concerns
Important styles from a user stylesheet take precedence over the author style sheet's important declarations, meaning adding an `!important` flag to a site's styles will not prevent individual users with special requirements, such as large fonts, from being able to override your styles by adding important styles in their own user's style sheet.
This feature is supported in all browsers.
# outline-offset
The `outline-offset` CSS property sets the amount of space between an outline and the edge or border of an element.
## Try it
    
    outline-offset: 4px;
    
    
    outline-offset: 0.6rem;
    
    
    outline-offset: 12px;
    outline: 5px dashed blue;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with an outline around it.
      </div>
    </section>
    
    
    #example-element {
      border: 2px solid crimson;
      outline: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <length> values */
    outline-offset: 3px;
    outline-offset: 0.2em;
    
    /* Global values */
    outline-offset: inherit;
    outline-offset: initial;
    outline-offset: revert;
    outline-offset: revert-layer;
    outline-offset: unset;
    
### Values
`<length>`
    
The width of the space between the element and its outline. A negative value places the outline inside the element. A value of `0` places the outline so that there is no space between it and the element.
## Description
An outline is a line that is drawn around an element, outside the border edge. The space between an element and its outline is transparent. In other words, it is the same as the parent element's background.
## Examples
>
### Setting outline offset in pixels
#### HTML
    
    <p>Gallia est omnis divisa in partes tres.</p>
    
#### CSS
    
    p {
      outline: 1px dashed red;
      outline-offset: 10px;
      background: yellow;
      border: 1px solid blue;
      margin: 15px;
    }
    
#### Result
# text-emphasis-position
The `text-emphasis-position` CSS property sets where emphasis marks are drawn. Similar to the text rendered by the `<ruby>` HTML element, if there isn't enough room for emphasis marks, the line height is increased.
## Try it
    
    text-emphasis-position: auto;
    
    
    text-emphasis-position: over right;
    
    
    text-emphasis-position: under right;
    
    
    text-emphasis-position: auto;
    writing-mode: vertical-rl;
    
    
    text-emphasis-position: over left;
    writing-mode: vertical-rl;
    
    
    text-emphasis-position: over right;
    writing-mode: vertical-rl;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
    #example-element {
      text-emphasis: filled double-circle #ffb703;
    }
    
## Syntax
    
    /* Initial value */
    text-emphasis-position: auto;
    
    /* Keyword values */
    text-emphasis-position: over;
    text-emphasis-position: under;
    
    text-emphasis-position: over right;
    text-emphasis-position: over left;
    text-emphasis-position: under right;
    text-emphasis-position: under left;
    
    text-emphasis-position: left over;
    text-emphasis-position: right over;
    text-emphasis-position: right under;
    text-emphasis-position: left under;
    
    /* Global values */
    text-emphasis-position: inherit;
    text-emphasis-position: initial;
    text-emphasis-position: revert;
    text-emphasis-position: revert-layer;
    text-emphasis-position: unset;
    
### Values
The property accepts one or two values:
  * If only one value is provided, it can be `auto`, `over`, or `under`. When only `over` or `under` is used, `right` is assumed as the default position.
  * If two values are provided, they must include one of `over` or `under` and one of `right` or `left`. Their order does not matter.


The values include:
`auto`
    
Draws marks over the text in horizontal writing mode and to the right of the text in vertical writing mode.
`over`
    
Draws marks over the text in horizontal writing mode.
`under`
    
Draws marks under the text in horizontal writing mode.
`right`
    
Draws marks to the right of the text in vertical writing mode.
`left`
    
Draws marks to the left of the text in vertical writing mode.
## Description
The preferred position of emphasis marks depends on the language. In Japanese for example, the preferred position is `over right`. In Chinese, on the other hand, the preferred position is `under right`. The informative table below summarizes the preferred emphasis mark positions for Chinese, Mongolian and Japanese:
Preferred emphasis mark and ruby position  Language Preferred position Illustration  
Horizontal Vertical  
Japanese over right  
Korean  
Mongolian  
Chinese under right  
Note: The `text-emphasis-position` cannot be set, and therefore are not reset either, using the `text-emphasis` shorthand property.
## Examples
>
### Adding emphasis mark positions
Use the drop down menu to change the position of the emphasis marks. This will change the class on the `<section>` element, which in turn, will update the position of the emphasis marks on the text.
#### HTML
    
    <section id="setting" class="auto">
      <p class="horizontal" lang="zh">你好世界</p>
      <!-- Hello World in Chinese -->
      <p class="vertical" lang="ja">世界、こんにちは。</p>
      <!-- Hello World in Japanese -->
    </section>
    
#### CSS
    
    section p {
      text-emphasis: filled circle tomato;
      text-emphasis-position: auto;
    }
    .over-right p,
    .preferred p [lang="ja"] {
      text-emphasis-position: over right;
    }
    .over-left p {
      text-emphasis-position: over left;
    }
    .under-right p,
    .preferred p [lang="zh"] {
      text-emphasis-position: under right;
    }
    .under-left p {
      text-emphasis-position: under left;
    }
    .preferred p [lang="ja"] {
    }
    
#### Result
Use the "Emphasis position" drop down to choose the location of the emphasis marks. The `preferred` option in the drop down uses the preferred positions, as explained in the Description section.
### Preferring ruby over emphasis marks
Some editors prefer to hide emphasis marks when they conflict with ruby. In HTML, this can be done with the following style rule:
    
    ruby {
      text-emphasis: none;
    }
    
### Preferring emphasis marks over ruby
Some other editors prefer to hide ruby when they conflict with emphasis marks. In HTML, this can be done with the following pattern:
    
    em {
      text-emphasis: dot; /* Set text-emphasis for <em> elements */
    }
    
    em rt {
      display: none; /* Hide ruby inside <em> elements */
    }
    
# :host-context()
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The `:host-context()` CSS pseudo-class allows you to style elements within a shadow DOM differently based on the selector of the shadow host (the element that has the shadow root) and its DOM ancestors.
Normally, elements within a shadow DOM are isolated from the DOM outside of it. The `:host-context()` allows you to "peek outside" of this Shadow DOM and check if any of the element's ancestor elements match a certain CSS selector. For example, applying a different text color to elements within a shadow root when a `.dark-theme` class is applied to `<body>`.
Think of it like this: Imagine you have a `<greenhouse>` custom element, that has a `<chameleon>` living inside. Here, the `<greenhouse>` is the Shadow DOM host and the `<chameleon>` element is within the Shadow DOM. The `:host-context()` lets the `<chameleon>` change its appearance based on the `<greenhouse>`'s environment. If the `<greenhouse>` is in a sunny location (has a "sunny-theme" class), the `<chameleon>` turns yellow. If the `<greenhouse>` is in a shady spot (a "shady-theme" class applied instead), the `<chameleon>` turns blue.
This selector pierces through all shadow boundaries. It will look for the sunny or shady theme applied directly to the `<greenhouse>` or on any of the host's ancestors and ancestor DOMs all the way up until it reaches the document root.
To limit the selector to only the `<greenhouse>` host directly or limit the selection to host's DOM, use the `:host` or `:host()` pseudo-class instead.
Note: This has no effect when used outside a shadow DOM.
The specificity of `:host-context()` is that of a pseudo-class, plus the specificity of the selector passed as the function's argument.
## Try it
    
    /* Following CSS is being applied inside the shadow DOM. */
    
    :host-context(.container) {
      border: 5px dashed green;
    }
    
    :host-context(h1) {
      color: red;
    }
    
    
    <!-- elements outside shadow dom -->
    <div class="container">
      <h1 id="shadow-dom-host"></h1>
    </div>
    
    
    const shadowDom = init();
    
    // add a <span> element in the shadow DOM
    const span = document.createElement("span");
    span.textContent = "Inside shadow DOM";
    shadowDom.appendChild(span);
    
    // attach shadow DOM to the #shadow-dom-host element
    function init() {
      const host = document.getElementById("shadow-dom-host");
      const shadowDom = host.attachShadow({ mode: "open" });
    
      const cssTab = document.querySelector("#css-output");
      const shadowStyle = document.createElement("style");
      shadowStyle.textContent = cssTab.textContent;
      shadowDom.appendChild(shadowStyle);
    
      cssTab.addEventListener("change", () => {
        shadowStyle.textContent = cssTab.textContent;
      });
      return shadowDom;
    }
    
    
    /* Selects a shadow root host, only if it is
       a descendant of the selector argument given */
    :host-context(h1) {
      font-weight: bold;
    }
    
    /* Changes paragraph text color from black to white when
       a .dark-theme class is applied to the document body */
    p {
      color: black;
    }
    
    :host-context(body.dark-theme) p {
      color: white;
    }
    
## Syntax
    
    :host-context(<compound-selector>) {
      /* ... */
    }
    
## Examples
>
### Selectively styling shadow hosts
The following snippets are taken from our host-selectors example (see it live also).
In this example we have a basic custom element — `<context-span>` — that you can wrap around text:
    
    <h1>
      Host selectors <a href="#"><context-span>example</context-span></a>
    </h1>
    
Inside the element's constructor, we create `style` and `span` elements, fill the `span` with the content of the custom element, and fill the `style` element with some CSS rules:
    
    const style = document.createElement("style");
    const span = document.createElement("span");
    span.textContent = this.textContent;
    
    const shadowRoot = this.attachShadow({ mode: "open" });
    shadowRoot.appendChild(style);
    shadowRoot.appendChild(span);
    
    style.textContent =
      "span:hover { text-decoration: underline; }" +
      ":host-context(h1) { font-style: italic; }" +
      ':host-context(h1)::after { content: " - no links in headers!" }' +
      ":host(.footer) { color : red; }" +
      ":host { background: rgb(0 0 0 / 10%); padding: 2px 5px; }";
    
The `:host-context(h1) { font-style: italic; }` and `:host-context(h1)::after { content: " - no links in headers!" }` rules style the instance of the `<context-span>` element (the shadow host in this instance) inside the `<h1>`. We've used it to make it clear that the custom element shouldn't appear inside the `<h1>` in our design.
# background-color
The `background-color` CSS property sets the background color of an element.
## Try it
    
    background-color: brown;
    
    
    background-color: #74992e;
    
    
    background-color: rgb(255 255 128);
    
    
    background-color: rgb(255 255 128 / 0.5);
    
    
    background-color: hsl(50 33% 25%);
    
    
    background-color: hsl(50 33% 25% / 0.75);
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      min-width: 100%;
      min-height: 100%;
      padding: 10%;
    }
    
## Syntax
    
    /* Keyword values */
    background-color: red;
    background-color: indigo;
    
    /* Hexadecimal value */
    background-color: #bbff00; /* Fully opaque */
    background-color: #bf0; /* Fully opaque shorthand */
    background-color: #11ffee00; /* Fully transparent */
    background-color: #1fe0; /* Fully transparent shorthand */
    background-color: #11ffeeff; /* Fully opaque */
    background-color: #1fef; /* Fully opaque shorthand */
    
    /* RGB value */
    background-color: rgb(255 255 128); /* Fully opaque */
    background-color: rgb(117 190 218 / 50%); /* 50% transparent */
    
    /* HSL value */
    background-color: hsl(50 33% 25%); /* Fully opaque */
    background-color: hsl(50 33% 25% / 75%); /* 75% opaque, i.e. 25% transparent */
    
    /* Special keyword values */
    background-color: currentColor;
    background-color: transparent;
    
    /* Global values */
    background-color: inherit;
    background-color: initial;
    background-color: revert;
    background-color: revert-layer;
    background-color: unset;
    
The `background-color` property is specified as a single `<color>` value.
### Values
`<color>`
    
The uniform color of the background. It is rendered behind any `background-image` that is specified, although the color will still be visible through any transparency in the image.
## Accessibility
It is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page.
Color contrast ratio is determined by comparing the luminance of the text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


## Examples
>
### Colorize boxes
This example demonstrates the applying `background-color` to HTML `<div>` elements using different CSS `<color>` values.
#### HTML
    
    <div class="example-one">Lorem ipsum dolor sit amet, consectetuer</div>
    
    <div class="example-two">Lorem ipsum dolor sit amet, consectetuer</div>
    
    <div class="example-three">Lorem ipsum dolor sit amet, consectetuer</div>
    
#### CSS
    
    .example-one {
      background-color: transparent;
    }
    
    .example-two {
      background-color: rgb(153 102 153);
      color: rgb(255 255 204);
    }
    
    .example-three {
      background-color: #777799;
      color: white;
    }
    
#### Result
### Colorize tables
This example demonstrates the use of `background-color` on HTML `<table>` elements, including `<tr>` rows and `<td>` cells.
#### HTML
    
    <table>
      <tr id="r1">
        <td id="c11">11</td>
        <td id="c12">12</td>
        <td id="c13">13</td>
      </tr>
      <tr id="r2">
        <td id="c21">21</td>
        <td id="c22">22</td>
        <td id="c23">23</td>
      </tr>
      <tr id="r3">
        <td id="c31">31</td>
        <td id="c32">32</td>
        <td id="c33">33</td>
      </tr>
    </table>
    
#### CSS
    
    table {
      border-collapse: collapse;
      border: solid black 1px;
      width: 250px;
      height: 150px;
    }
    td {
      border: solid 1px black;
    }
    #r1 {
      background-color: lightblue;
    }
    #c12 {
      background-color: cyan;
    }
    #r2 {
      background-color: grey;
    }
    #r3 {
      background-color: olive;
    }
    
#### Result
# text-box-trim
The `text-box-trim` CSS property specifies which of the over and under edges of text content to trim from a text element's block container.
Vertical spacing differs between fonts, making consistent typesetting historically challenging on the web. The `text-box-trim` property — along with its counterpart property `text-box-edge`, which specifies how much space to trim — makes consistent vertical spacing of text easier to achieve.
Note: The `text-box` shorthand property can be used to specify the `text-box-trim` and `text-box-edge` values in a single declaration.
## Syntax
    
    /* Keywords */
    text-box-trim: none;
    text-box-trim: trim-both;
    text-box-trim: trim-start;
    text-box-trim: trim-end;
    
    /* Global values */
    text-box-trim: inherit;
    text-box-trim: initial;
    text-box-trim: revert;
    text-box-trim: revert-layer;
    text-box-trim: unset;
    
### Value
The `text-box-trim` property value may be specified as one of the following keywords:
`none`
    
The default value. No space is trimmed from the text.
`trim-both`
    
The start (over) and end (under) edges are both trimmed.
`trim-start`
    
The start (over) edge is trimmed.
`trim-end`
    
The end (under) edge is trimmed.
## Description
The height of text-only content is relative to the height of the font. In digital font files, the height contains all characters, including capital letters, ascenders, descenders, etc. Different fonts have different base line-heights, meaning that lines of text with the same `font-size` will produce line boxes of differing heights, affecting the appearance of spacing between lines.
The `text-box-trim` property allows you to trim the over and under edge of the text's block container, making it easier to control text spacing in the block direction.
The actual amount of space trimmed is specified using the `text-box-edge` property. For example, you can choose to trim the over edge in line with a font's capital letters or lower-case letters, and the under edge flush with the font's baseline.
## Examples
>
### Basic `text-box-trim` usage
In the following example we set `text-box-edge: cap alphabetic` on two paragraphs, which trims the over edge of the text elements' block containers to the top of the capital letters and the under edge flush with the text baseline.
We then set `text-box-trim` values of `trim-end` on the first one, and `trim-both` on the second one. This results in the first paragraph only having its under edge trimmed, whereas the second one has both the over and under edge trimmed.
    
    p {
      text-box-edge: cap alphabetic;
      border-top: 5px solid magenta;
      border-bottom: 5px solid magenta;
    }
    
    .one {
      text-box-trim: trim-end;
    }
    
    .two {
      text-box-trim: trim-both;
    }
    
#### Result
The output is as follows. Note how we've included a top and bottom border on each paragraph, so that you can see how the space has been trimmed in each case.
### Interactive `text-box-trim` and `text-box-edge` value comparison
In this example we provide a user interface that allows you to choose the `text-box-trim` and `text-box-edge` values applied to a paragraph of text.
#### HTML
In our HTML, we include three main items:
  * Three `<select>` elements allowing you to set which edges of the paragraph should be trimmed (the `text-box-trim` value) and how much space to trim from the block-start and block-end edges of the paragraph (the `text-box-edge` value).
  * A `<p>` element containing text, which the `text-box-*` values are applied to. This paragraph has `contenteditable` set on it so you can edit the text.
  * An `<output>` element that displays the `text-box-*` declarations applied to the paragraph. This is updated when a selection is made.


We also import a font from the Google Fonts service to apply to our demo's text.
We have hidden the exact HTML code for brevity.
#### CSS
In our CSS, we apply the imported font to the `<html>` element and lay out the UI using flexbox. We have hidden most of the CSS code for brevity, but below we show the rules styling the paragraph the `text-box-*` effects are applied to and the `<output>` that shows the `text-box-*` rules being applied:
    
    p {
      margin: 0;
      font-size: 6rem;
      font-weight: bold;
      border-top: 5px solid magenta;
      border-bottom: 5px solid magenta;
    }
    
    output {
      border: 2px solid gray;
      border-radius: 10px;
      padding: 10px;
      margin: 0;
      width: fit-content;
    }
    
Again, note how we've included a top and bottom border on the `.display` paragraph, so that you can see how the space being trimmed changes when different `text-box-*` values are selected.
#### JavaScript
In the JavaScript, we start by grabbing references to the three `<select>` elements and two `<p>` elements:
    
    const boxTrimSelect = document.getElementById("box-trim");
    const trimOverSelect = document.getElementById("trim-over");
    const trimUnderSelect = document.getElementById("trim-under");
    
    const displayElem = document.querySelector("p");
    const codeElem = document.querySelector("output");
    
Next, we define a function called `setEdgeTrim()`. This applies a `text-box` value to the paragraph based on the values of the `<select>` elements, and also prints the applied declarations to the output (both the longhand and shorthand equivalents):
    
    function setEdgeTrim() {
      const textBoxTrimValue = boxTrimSelect.value;
      const textBoxEdgeValue = `${trimOverSelect.value} ${trimUnderSelect.value}`;
      displayElem.style.textBox = `${textBoxTrimValue} ${textBoxEdgeValue}`;
    
      codeElem.innerHTML = `
        <span><code>text-box-trim: ${textBoxTrimValue}</code></span>
        <br>
        <span><code>text-box-edge: ${textBoxEdgeValue}</code></span>
        <br><br>
        <span>Shorthand equivalent:</span>
        <br><br>
        <span><code>text-box: ${textBoxTrimValue} ${textBoxEdgeValue}</code></span>
      `;
    }
    
In the last part of the JavaScript we run the `setEdgeTrim()` function once to set an initial state for the UI. We then apply `change` event listeners to all of the `<select>` elements (via `addEventListener`) so that `setEdgeTrim()` is run whenever one of the `<select>` values changes to update the UI accordingly:
    
    setEdgeTrim();
    
    boxTrimSelect.addEventListener("change", setEdgeTrim);
    trimOverSelect.addEventListener("change", setEdgeTrim);
    trimUnderSelect.addEventListener("change", setEdgeTrim);
    
#### Result
The output is as follows:
`text-box-trim` is initially set to `trim-both`, meaning that the over and under edges of the paragraph are trimmed. `text-box-edge` is initially set to `cap alphabetic`, meaning that the text is trimmed flush with the top of capital letters at the start edge, and flush with the baseline at the end edge.
Try changing the `<select>` values to see the effect they have on the display text.
# transition
The `transition` CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, `transition-delay`, and `transition-behavior`.
## Try it
    
    transition: margin-right 2s;
    
    
    transition: margin-right 2s 0.5s;
    
    
    transition: margin-right 2s ease-in-out;
    
    
    transition: margin-right 2s ease-in-out 0.5s;
    
    
    transition:
      margin-right 2s,
      color 1s;
    
    
    transition: all 1s ease-out;
    
    
    <section id="default-example">
      <div id="example-element">Hover to see<br />the transition.</div>
    </section>
    
    
    #example-element {
      background-color: #e4f0f5;
      color: black;
      padding: 1rem;
      border-radius: 0.5rem;
      font: 1em monospace;
      width: 100%;
      transition: margin-right 2s;
    }
    
    #default-example:hover > #example-element {
      background-color: #990099;
      color: white;
      margin-right: 40%;
    }
    
Transitions enable you to define the transition between two states of an element. Different states may be defined using pseudo-classes like `:hover` or `:active` or dynamically set using JavaScript.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `transition-behavior`
  * `transition-delay`
  * `transition-duration`
  * `transition-property`
  * `transition-timing-function`


## Syntax
    
    /* Apply to 1 property */
    /* property name | duration */
    transition: margin-right 4s;
    
    /* property name | duration | delay */
    transition: margin-right 4s 1s;
    
    /* property name | duration | easing function */
    transition: margin-right 4s ease-in-out;
    
    /* property name | duration | easing function | delay */
    transition: margin-right 4s ease-in-out 1s;
    
    /* property name | duration | behavior */
    transition: display 4s allow-discrete;
    
    /* Apply to 2 properties */
    transition:
      margin-right 4s,
      color 1s;
    
    /* Apply to all changed properties */
    transition: all 0.5s ease-out allow-discrete;
    transition: 200ms linear 50ms;
    
    /* Global values */
    transition: inherit;
    transition: initial;
    transition: revert;
    transition: revert-layer;
    transition: unset;
    
The `transition` property value is specified as one of the following:
  * The special value `none`, which specifies that no transitions will occur on this element. This is the default value.
  * One or more single-property transitions, separated by commas.


Each single-property transition describes the transition that should be applied to a single property or all properties. It includes:
  * zero or one value representing the property or properties to which the transition should apply. This can be set as: 
    * A `<custom-ident>` representing a single property.
    * The special value `all`, which specifies that the transition will be applied to all properties that change as the element changes state.
    * No value, in which case a value of `all` will be inferred and the specified transition will still apply to all changing properties.
  * zero or one `<easing-function>` value representing the easing function to use
  * zero, one, or two `<time>` values. The first value that can be parsed as a time is assigned to the `transition-duration`, and the second value that can be parsed as a time is assigned to `transition-delay`.
  * zero or one value declaring whether to start transitions for properties whose animation behavior is discrete. The value, if present, is either the keyword `allow-discrete` or the keyword `normal`.


If you specify `all` as the transition property for one single-property transition, but then specify subsequent single-property transitions with `<custom-ident>` values, those subsequent transitions will override the first one. For example:
    
    transition:
      all 200ms,
      opacity 400ms;
    
In this case, all the properties that change as the element changes state will transition with a duration of 200ms except for `opacity`, which will take 400ms to transition.
See how things are handled when lists of property values aren't the same length. In short, extra transition descriptions beyond the number of properties actually being animated are ignored.
## Examples
>
### Basic example
In this example, when the user hovers over the element, there is a half-second (`500ms`) delay before a two-second `background-color` transition occurs.
#### HTML
    
    <a class="target">Hover over me</a>
    
#### CSS
We include two `<time>` values. In the `transition` shorthand, the first `<time>` value is the `transition-duration`. The second time value is the `transition-delay`. Both default to `0s` if omitted.
    
    .target {
      font-size: 2rem;
      background-color: palegoldenrod;
      transition: background-color 2s 500ms;
    }
    
    .target:hover {
      background-color: darkorange;
    }
    
# <hue-interpolation-method>
The `<hue-interpolation-method>` CSS data type represents the algorithm used for interpolation between `<hue>` values. The interpolation method specifies how to find a midpoint between two hue values based on a color wheel. It is used as a component of the `<color-interpolation-method>` data type.
When interpolating `<hue>` values, the hue interpolation algorithm defaults to `shorter`.
## Syntax
A `<hue-interpolation-method>` value consists of the name of a hue interpolation algorithm followed by a literal token `hue`:
    
    shorter hue
    longer hue
    increasing hue
    decreasing hue
    
### Values
Any pair of hue angles correspond to two radii on the color wheel, which cut the circumference into two possible arcs for interpolation. Both arcs start at the first radius and end at the second radius, but one goes clockwise and the other goes counterclockwise.
Note: The following descriptions and illustrations are based on color wheels in which hue angles increase in a clockwise direction. Be aware that there are color wheels where an increase in angles will be a counterclockwise operation.
For a pair of hue angles `θ1` and `θ2` normalized to the range `[0deg, 360deg)`, there are four algorithms to determine which arc is used when interpolating from `θ1` to `θ2`:
`shorter`
    
Use the shorter arc. When the two radii coincide, the arc degenerates to a single point. When both arcs have the same lengths:
  * If `θ1 < θ2`, use the clockwise arc;
  * If `θ1 > θ2`, use the counterclockwise arc.


`θ1 = 45deg`, `θ2 = 135deg` `θ1 = 135deg`, `θ2 = 45deg`  
`longer`
    
Use the longer arc. When the two radii coincide:
  * If `θ1 ≤ θ2`, the arc becomes the full circumference with a clockwise orientation.
  * If `θ1 > θ2`, the arc becomes the full circumference with a counterclockwise orientation.


When both arcs have the same lengths:
  * If `θ1 < θ2`, use the clockwise arc;
  * If `θ1 > θ2`, use the counterclockwise arc.


`θ1 = 45deg`, `θ2 = 135deg` `θ1 = 135deg`, `θ2 = 45deg`  
`increasing`
    
Use the clockwise arc. When the two radii coincide, the arc degenerates to a single point.
`θ1 = 45deg`, `θ2 = 135deg` `θ1 = 135deg`, `θ2 = 45deg`  
`decreasing`
    
Use the counterclockwise arc. When the two radii coincide, the arc degenerates to a single point.
`θ1 = 45deg`, `θ2 = 135deg` `θ1 = 135deg`, `θ2 = 45deg`  
As there are only two arcs to choose from, these algorithms are pairwise equivalent under certain circumstances. Specifically:
  * If `0deg < θ2 - θ1 < 180deg` or `θ2 - θ1 < -180deg`, `shorter` and `increasing` are equivalent, whereas `longer` and `decreasing` are equivalent.
  * If `-180deg < θ2 - θ1 < 0deg` or `θ2 - θ1 > 180deg`, `shorter` and `decreasing` are equivalent, whereas `longer` and `increasing` are equivalent.


A notable feature of `increasing` and `decreasing` is that when the hue angle difference passes through `180deg` during transition or animation, the arc will not flip to the other side like `shorter` and `longer` do.
## Examples
>
### Comparing hue interpolation algorithms
The following example shows the effect of using different hue interpolation algorithms in a `linear-gradient()`.
#### HTML
    
    <div class="hsl">
      <p>HSL</p>
    </div>
    <div class="hsl-increasing">
      <p>HSL increasing</p>
    </div>
    <div class="hsl-decreasing">
      <p>HSL decreasing</p>
    </div>
    <div class="hsl-shorter">
      <p>HSL shorter</p>
    </div>
    <div class="hsl-longer">
      <p>HSL longer</p>
    </div>
    <div class="hsl-named">
      <p>HSL named</p>
    </div>
    <div class="hsl-named-longer">
      <p>HSL named (longer)</p>
    </div>
    
#### CSS
    
    .hsl {
      background: linear-gradient(
        to right in hsl,
        hsl(39deg 100% 50%),
        hsl(60deg 100% 50%)
      );
    }
    .hsl-increasing {
      background: linear-gradient(
        to right in hsl increasing hue,
        hsl(190deg 100% 50%),
        hsl(180deg 100% 50%)
      );
    }
    .hsl-decreasing {
      background: linear-gradient(
        to right in hsl decreasing hue,
        hsl(39deg 100% 50%),
        hsl(60deg 100% 50%)
      );
    }
    .hsl-shorter {
      background: linear-gradient(
        to right in hsl shorter hue,
        hsl(39deg 100% 50%),
        hsl(60deg 100% 50%)
      );
    }
    .hsl-longer {
      background: linear-gradient(
        to right in hsl longer hue,
        hsl(39deg 100% 50%),
        hsl(60deg 100% 50%)
      );
    }
    .hsl-named {
      background: linear-gradient(to right in hsl, orange, yellow);
    }
    .hsl-named-longer {
      background: linear-gradient(to right in hsl longer hue, orange, yellow);
    }
    
#### Result
# unicode-bidi
The `unicode-bidi` CSS property, together with the `direction` property, determines how bidirectional text in a document is handled. For example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The `unicode-bidi` property overrides this algorithm and allows the developer to control the text embedding.
## Try it
    
    unicode-bidi: normal;
    
    
    unicode-bidi: bidi-override;
    
    
    unicode-bidi: plaintext;
    
    
    unicode-bidi: isolate-override;
    
    
    <section class="default-example" id="default-example">
      <p class="transition-all" id="example-element">
        בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ.
      </p>
    </section>
    
The `unicode-bidi` and `direction` properties are the only properties that are not affected by the `all` shorthand.
Warning: This property is intended for Document Type Definition (DTD) designers. Web designers and similar authors should not override it.
## Syntax
    
    /* Keyword values */
    unicode-bidi: normal;
    unicode-bidi: embed;
    unicode-bidi: isolate;
    unicode-bidi: bidi-override;
    unicode-bidi: isolate-override;
    unicode-bidi: plaintext;
    
    /* Global values */
    unicode-bidi: inherit;
    unicode-bidi: initial;
    unicode-bidi: revert;
    unicode-bidi: revert-layer;
    unicode-bidi: unset;
    
### Values
`normal`
    
The element does not offer an additional level of embedding with respect to the bidirectional algorithm. For inline elements, implicit reordering works across element boundaries.
`embed`
    
If the element is inline, this value opens an additional level of embedding with respect to the bidirectional algorithm. The direction of this embedding level is given by the `direction` property.
`bidi-override`
    
For inline elements this creates an override. For block container elements this creates an override for inline-level descendants not within another block container element. This means that inside the element, reordering is strictly in sequence according to the `direction` property; the implicit part of the bidirectional algorithm is ignored.
`isolate`
    
This keyword indicates that the element's container directionality should be calculated without considering the content of this element. The element is therefore isolated from its siblings. When applying its bidirectional-resolution algorithm, its container element treats it as one or several `U+FFFC Object Replacement Character`, i.e., like an image.
`isolate-override`
    
This keyword applies the isolation behavior of the `isolate` keyword to the surrounding content and the override behavior of the `bidi-override` keyword to the inner content.
`plaintext`
    
This keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the `direction` property. The directionality is calculated using the P2 and P3 rules of the Unicode Bidirectional Algorithm. This value allows the display of data that is already formatted using a tool following the Unicode Bidirectional Algorithm.
## Examples
>
### CSS
    
    .bible-quote {
      direction: rtl;
      unicode-bidi: embed;
    }
    
### HTML
    
    <div class="bible-quote">A line of text</div>
    <div>Another line of text</div>
    
### Result
# Type selectors
The CSS type selector matches elements by node name. In other words, it selects all elements of the given type within a document.
    
    /* All <a> elements. */
    a {
      color: red;
    }
    
Type selectors can be namespaced when using `@namespace`. This is useful when dealing with documents containing multiple namespaces such as HTML with inline SVG or MathML, or XML that mixes multiple vocabularies.
  * `ns|h1` \- matches `<h1>` elements in namespace ns 
  * `*|h1` \- matches all `<h1>` elements
  * `|h1` \- matches all `<h1>` elements without any declared namespace


## Syntax
    
    element { style properties }
    
## Examples
>
### CSS
    
    span {
      background-color: skyblue;
    }
    
### HTML
    
    <span>Here's a span with some text.</span>
    <p>Here's a p with some text.</p>
    <span>Here's a span with more text.</span>
    
### Result
### Namespaces
In this example the selector will only match `<h1>` elements in the example namespace.
    
    @namespace example url("http://www.example.com/");
    example|h1 {
      color: blue;
    }
    
# text-anchor
The `text-anchor` CSS property aligns a box containing a string of text where the wrapping area is determined from the `inline-size` property, and the text is then placed relative to the anchor point of the element, which is defined using the `x` and `y` (or `dx` and `dy`) attributes. If present, the value of the CSS property overrides any value of the element's `text-anchor` attribute.
Each individual text fragment within an element is aligned independently; thus, a multi-line `<text>` element will have each line of text aligned as per the value of `text-anchor`. `text-anchor` values only have an effect on the `<text>`, `<textPath>`, and `<tspan>` SVG elements. `text-anchor` does not apply to automatically wrapped text; for that, see `text-align`.
## Syntax
    
    text-anchor: start;
    text-anchor: middle;
    text-anchor: end;
    
    /* Global values */
    text-anchor: inherit;
    text-anchor: initial;
    text-anchor: revert;
    text-anchor: revert-layer;
    text-anchor: unset;
    
### Values
`start`
    
Aligns the text such that the inline start of the text string is aligned with the anchor point. This alignment is relative to the writing direction of the text; thus, for example, in right-to-left top-to-bottom writing, the text will be placed to the left of the anchor point. If the text's inline direction is vertical, as with many Asian languages, the top edge of the text is aligned with the anchor point.
`middle`
    
Aligns the text such that the center (middle) of the text string's inline box is aligned with the anchor point.
`end`
    
Aligns the text such that the inline end of the text string is aligned with the anchor point. This alignment is relative to the writing direction of the text; thus, for example, in right-to-left top-to-bottom writing, the text will be placed to the right of the anchor point. If the text's inline direction is vertical, as with many Asian languages, the bottom edge of the text is aligned with the anchor point.
## Example
Three `<text>` elements are given the same `x` position, but different values for `text-anchor`. A dashed red line is included to mark the x-axis position of all three anchor points.
    
    <svg
      viewBox="0 0 200 150"
      height="150"
      width="200"
      xmlns="http://www.w3.org/2000/svg">
      <line
        x1="100"
        y1="0"
        x2="100"
        y2="150"
        stroke="red"
        stroke-dasharray="10,5" />
      <text x="100" y="40">Anchored</text>
      <text x="100" y="80">Anchored</text>
      <text x="100" y="120">Anchored</text>
    </svg>
    
    
    text:nth-of-type(1) {
      text-anchor: start;
    }
    text:nth-of-type(2) {
      text-anchor: middle;
    }
    text:nth-of-type(3) {
      text-anchor: end;
    }
    
# CSS compositing and blending
The CSS compositing and blending module defines how an element's background layers can be blended together, how an element can be blended with its container, and whether the element must create a new stacking context.
The properties in this CSS module can be used to define the blending mode that should be used, if any, to blend an element's background images and colors into a single background image. This module provides 16 blending modes. You can also define how an element's borders, background, and content, including text, emojis, and images, should be blended with the background of its container.
## Compositing and blending in action
In this example, each box has a border, two striped background images, and a solid color background. The common background for all the boxes contains a pattern of circles. The three boxes in the second row are set to blend with the background of the container.
Notice how the background, border, and the content are all impacted as a result of the blending. Click "Play" in the example above to see or edit the code for the animation in the MDN Playground.
## Reference
>
### Properties
  * `background-blend-mode`
  * `isolation`
  * `mix-blend-mode`


## Related concepts
  * `<blend-mode>` data type
  * `backdrop-filter` CSS property
  * `filter` CSS property
  * `mask-composite` CSS property
  * `background-color` CSS property
  * `background-image` CSS property
  * stacking context glossary term
  * `<feBlend>` SVG filter primitive
  * `<feComposite>` SVG filter primitive


# scroll-padding-inline-start
The `scroll-padding-inline-start` property defines offsets for the start edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-inline-start: 0;
    
    
    scroll-padding-inline-start: 20px;
    
    
    scroll-padding-inline-start: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-inline-start: auto;
    
    /* <length> values */
    scroll-padding-inline-start: 10px;
    scroll-padding-inline-start: 1em;
    scroll-padding-inline-start: 10%;
    
    /* Global values */
    scroll-padding-inline-start: inherit;
    scroll-padding-inline-start: initial;
    scroll-padding-inline-start: revert;
    scroll-padding-inline-start: revert-layer;
    scroll-padding-inline-start: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the inline start edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# view-timeline-inset
The `view-timeline-inset` CSS property is used to specify one or two values representing an adjustment to the position of the scrollport (see Scroll container for more details) in which the subject element of a named view progress timeline animation is deemed to be visible. Put another way, this allows you to specify start and/or end inset (or outset) values that offset the position of the timeline.
This can be combined with or used instead of `animation-range` and its longhand properties, which can be used to set the attachment range of an animation along its timeline. See CSS scroll-driven animations for more details.
Note: If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.
The `view-timeline-inset`, `view-timeline-axis`, and `view-timeline-name` properties can also be set using the `view-timeline` shorthand property.
## Syntax
    
    /* Single value */
    view-timeline-inset: auto;
    view-timeline-inset: 200px;
    view-timeline-inset: 20%;
    
    /* Two values */
    view-timeline-inset: 20% auto;
    view-timeline-inset: auto 200px;
    view-timeline-inset: 20% 200px;
    
### Values
Allowed values for `view-timeline-inset` are:
`auto`
    
If set, the corresponding `scroll-padding` (or equivalent longhand value) for that edge of the scrollport is used. If this is not set (or set to `auto`), the value will usually be 0, although some user agents may use heuristics to determine a different default value if appropriate.
`<length-percentage>`
    
Any valid `<length-percentage>` value is accepted as an inset/outset value.
  * If the value is positive, the position of the animation's start/end will be moved inside the scrollport by the specified length or percentage.
  * If the value is negative, the position of the animation's start/end will be moved outside the scrollport by the specified length or percentage, i.e., it will start animating before it appears in the scrollport, or finish animating after it leaves the scrollport.


If two values are provided, the first value represents the start inset/outset in the relevant axis (where the animation begins) and the second value represents the end inset/outset (where the animation ends). If only one value is provided, the start and end inset/outset are both set to the same value.
## Examples
>
### Creating a named view progress timeline with inset
A view progress timeline named `--subject-reveal` is defined using the `view-timeline` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
A `view-timeline-inset` declaration is also set to make the animation begin later than expected, and finish earlier.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline` is set to define a named view progress timeline. We also give it a `view-timeline-inset` declaration to make the animation begin later than expected, and finish earlier. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline: --subject-reveal block;
      view-timeline-inset: 70% -100px;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# border-color
The `border-color` shorthand CSS property sets the color of an element's border.
## Try it
    
    border-color: red;
    
    
    border-color: red #32a1ce;
    
    
    border-color: red rgb(170 50 220 / 0.6) green;
    
    
    border-color: red yellow green hsl(60 90% 50% / 0.8);
    
    
    border-color: red yellow green transparent;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
Each side can be set individually using `border-top-color`, `border-right-color`, `border-bottom-color`, and `border-left-color`; or using the writing mode-aware `border-block-start-color`, `border-block-end-color`, `border-inline-start-color`, and `border-inline-end-color`.
You can find out more information about border colors in Applying colors to HTML elements.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-bottom-color`
  * `border-left-color`
  * `border-right-color`
  * `border-top-color`


## Syntax
    
    /* <color> values */
    border-color: red;
    
    /* top and bottom | left and right */
    border-color: red #f015ca;
    
    /* top | left and right | bottom */
    border-color: red rgb(240 30 50 / 70%) green;
    
    /* top | right | bottom | left */
    border-color: red yellow green blue;
    
    /* Global values */
    border-color: inherit;
    border-color: initial;
    border-color: revert;
    border-color: revert-layer;
    border-color: unset;
    
The `border-color` property may be specified using one, two, three, or four values.
  * When one value is specified, it applies the same color to all four sides.
  * When two values are specified, the first color applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first color applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the colors apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<color>`
    
Defines the color of the border.
## Examples
>
### Complete border-color usage
#### HTML
    
    <div id="justone">
      <p><code>border-color: red;</code> is equivalent to</p>
      <ul>
        <li><code>border-top-color: red;</code></li>
        <li><code>border-right-color: red;</code></li>
        <li><code>border-bottom-color: red;</code></li>
        <li><code>border-left-color: red;</code></li>
      </ul>
    </div>
    <div id="horzvert">
      <p><code>border-color: gold red;</code> is equivalent to</p>
      <ul>
        <li><code>border-top-color: gold;</code></li>
        <li><code>border-right-color: red;</code></li>
        <li><code>border-bottom-color: gold;</code></li>
        <li><code>border-left-color: red;</code></li>
      </ul>
    </div>
    <div id="topvertbott">
      <p><code>border-color: red cyan gold;</code> is equivalent to</p>
      <ul>
        <li><code>border-top-color: red;</code></li>
        <li><code>border-right-color: cyan;</code></li>
        <li><code>border-bottom-color: gold;</code></li>
        <li><code>border-left-color: cyan;</code></li>
      </ul>
    </div>
    <div id="trbl">
      <p><code>border-color: red cyan black gold;</code> is equivalent to</p>
      <ul>
        <li><code>border-top-color: red;</code></li>
        <li><code>border-right-color: cyan;</code></li>
        <li><code>border-bottom-color: black;</code></li>
        <li><code>border-left-color: gold;</code></li>
      </ul>
    </div>
    
#### CSS
    
    #justone {
      border-color: red;
    }
    
    #horzvert {
      border-color: gold red;
    }
    
    #topvertbott {
      border-color: red cyan gold;
    }
    
    #trbl {
      border-color: red cyan black gold;
    }
    
    /* Set width and style for all divs */
    div {
      border: solid 0.3em;
      width: auto;
      margin: 0.5em;
      padding: 0.5em;
    }
    
    ul {
      margin: 0;
      list-style: none;
    }
    
#### Result
# @container
The `@container` CSS at-rule is a conditional group rule that applies styles to a containment context. Style declarations are filtered by a condition and applied to the container if the condition is true. The condition is evaluated when the queried container size, `<style-feature>`, or scroll-state changes.
The `container-name` property specifies a list of query container names. These names can be used by `@container` rules to filter which query containers are targeted. The optional, case-sensitive `<container-name>` filters the query containers that are targeted by the query.
Once an eligible query container has been selected for an element, each container feature in the `<container-condition>` is evaluated against that query container.
## Syntax
    
    /* With a <size-query> */
    @container (width > 400px) {
      h2 {
        font-size: 1.5em;
      }
    }
    
    /* With an optional <container-name> */
    @container tall (height > 30rem) {
      p {
        line-height: 1.6;
      }
    }
    
    /* With a <scroll-state> */
    @container scroll-state(scrollable: top) {
      .back-to-top-link {
        visibility: visible;
      }
    }
    
    /* With a <container-name> and a <scroll-state> */
    @container sticky-heading scroll-state(stuck: top) {
      h2 {
        background: purple;
        color: white;
      }
    }
    
    /* Multiple queries in a single condition */
    @container (width > 400px) and style(--responsive: true) {
      h2 {
        font-size: 1.5em;
      }
    }
    
    /* Condition list */
    @container card (width > 400px), style(--responsive: true), scroll-state(stuck: top) {
      h2 {
        font-size: 1.5em;
      }
    }
    
### Parameters
`<container-condition>`
    
An optional `<container-name>` and a `<container-query>`. Styles defined in the `<stylesheet>` are applied if the condition is true.
`<container-name>`
    
Optional. The name of the container that the styles will be applied to when the query evaluates to true, specified as an `<ident>`.
`<container-query>`
    
A set of features that are evaluated against the query container when the size, `<style-feature>`, or scroll-state of the container changes.
### Logical keywords in container queries
Logical keywords can be used to define the container condition:
  * `and` combines two or more conditions.
  * `or` combines two or more conditions.
  * `not` negates the condition. Only one 'not' condition is allowed per container query and cannot be used with the `and` or `or` keywords.


    
    @container (width > 400px) and (height > 400px) {
      /* <stylesheet> */
    }
    
    @container (width > 400px) or (height > 400px) {
      /* <stylesheet> */
    }
    
    @container not (width < 400px) {
      /* <stylesheet> */
    }
    
### Named containment contexts
A containment context can be named using the `container-name` property.
    
    .post {
      container-name: sidebar;
      container-type: inline-size;
    }
    
The shorthand syntax for this is to use `container` in the form `container: <name> / <type>`, for example:
    
    .post {
      container: sidebar / inline-size;
    }
    
In container queries, the `container-name` property is used to filter the set of containers to those with a matching query container name:
    
    @container sidebar (width > 400px) {
      /* <stylesheet> */
    }
    
Details about usage and naming restrictions are described in the `container-name` page.
### Descriptors
The `<container-condition>` queries include size and scroll-state container descriptors.
#### Size container descriptors
The `<container-condition>` can include one or more boolean size queries, each within a set of parentheses. A size query includes a size descriptor, a value, and — depending on the descriptor — a comparison operator. The queries always measures the content box as the comparison. The syntax for including multiple conditions is the same as for `@media` size feature queries.
    
    @container (min-width: 400px) {
      /* … */
    }
    @container (orientation: landscape) and (width > 400px) {
      /* … */
    }
    @container (15em <= block-size <= 30em) {
      /* … */
    }
    
`aspect-ratio`
    
The `aspect-ratio` of the container calculated as the width to the height of the container expressed as a `<ratio>` value.
`block-size`
    
The `block-size` of the container expressed as a `<length>` value.
`height`
    
The height of the container expressed as a `<length>` value.
`inline-size`
    
The `inline-size` of the container expressed as a `<length>` value.
`orientation`
    
The orientation of the container, either `landscape` or `portrait`.
`width`
    
The width of the container expressed as a `<length>` value.
#### Scroll-state container descriptors
Scroll-state container descriptors are specified inside the `<container-condition>` within a set of parentheses following the `scroll-state` keyword, for example:
    
    @container scroll-state(scrollable: top) {
      /* … */
    }
    @container scroll-state(stuck: inline-end) {
      /* … */
    }
    @container scroll-state(snapped: both) {
      /* … */
    }
    
Supported keywords for scroll-state container descriptors include physical and flow relative values
`scrollable`
    
Queries whether the container can be scrolled in the given direction via user-initiated scrolling, such as by dragging the scrollbar or using a trackpad gesture. In other words, is there overflowing content in the given direction that can be scrolled to? Valid `scrollable` values include the following keywords:
`none`
    
The container is not a scroll container or otherwise cannot be scrolled in any direction.
`top`
    
The container can be scrolled towards its top edge.
`right`
    
The container can be scrolled towards its right-hand edge.
`bottom`
    
The container can be scrolled towards its bottom edge.
`left`
    
The container can be scrolled towards its left-hand edge.
`x`
    
The container can be scrolled horizontally towards either or both of its left-hand or right-hand edges.
`y`
    
The container can be scrolled vertically towards either or both of its top or bottom edges.
`block-start`
    
The container can be scrolled towards its block-start edge.
`block-end`
    
The container can be scrolled towards its block-end edge.
`inline-start`
    
The container can be scrolled towards its inline-start edge.
`inline-end`
    
The container can be scrolled towards its inline-end edge.
`block`
    
The container can be scrolled in its block direction towards either or both of its block-start or block-end edges.
`inline`
    
The container can be scrolled in its inline direction towards either or both of its inline-start and inline-end edges.
If the test passes, the rules inside the `@container` block are applied to descendants of the scroll container.
To evaluate whether a container is scrollable, without being concerned about the direction, use the `none` value with the `not` operator:
    
    @container not scroll-state(scrollable: none) {
      /* … */
    }
    
`snapped`
    
Queries whether the container is going to be snapped to a scroll snap container ancestor along the given axis. Valid `snapped` values include the following keywords:
`none`
    
The container is not a scroll snap target for its ancestor scroll container. When implementing a `snapped: none` query, containers that are snap targets for the scroll container will not have the `@container` styles applied, whereas non-snap targets will have the styles applied.
`x`
    
The container is a horizontal scroll snap target for its ancestor scroll container, that is, it is snapping horizontally to its ancestor.
`y`
    
The container is a vertical scroll snap target for its ancestor scroll container, that is, it is snapping vertically to its ancestor.
`block`
    
The container is a block-axis scroll snap target for its ancestor scroll container, that is, it is snapping to its ancestor in the block direction.
`inline`
    
The container is an inline-axis scroll snap target for its ancestor scroll container, that is, it is snapping to its ancestor in the inline direction.
`both`
    
The container is both a horizontal and vertical scroll snap target for its ancestor scroll container and is snapping to its ancestor in both directions. The container won't match if it is only snapping to its ancestor along the horizontal or vertical axis. It needs to be both.
To evaluate a container with a non-`none` `snapped` scroll-state query, it must be a container with a scroll container ancestor having a `scroll-snap-type` value other than `none`. A `snapped: none` query will match even when there is no scroll container ancestor.
Evaluations occur when `scrollsnapchanging` events fire on the scroll snap container. If the test passes, the rules inside the `@container` block are applied to descendants of the container.
To evaluate whether a container is a snap target, without being concerned about the direction, use the `none` value with the `not` operator:
    
    @container not scroll-state(snapped: none) {
      /* … */
    }
    
`stuck`
    
Queries whether a container with a `position` value of `sticky` is stuck to an edge of its scrolling container ancestor. Valid `stuck` values include the following keywords:
`none`
    
The container is not stuck to any edges of its container. Note that `none` queries will match even if the container does not have `position: sticky` set on it.
`top`
    
The container is stuck to the top edge of its container.
`right`
    
The container is stuck to the right-hand edge of its container.
`bottom`
    
The container is stuck to the bottom edge of its container.
`left`
    
The container is stuck to the left-hand edge of its container.
`block-start`
    
The container is stuck to the block-start edge of its container.
`block-end`
    
The container is stuck to the block-end edge of its container.
`inline-start`
    
The container is stuck to the inline-start edge of its container.
`inline-end`
    
The container is stuck to the inline-end edge of its container.
To evaluate a container with a non-`none` `stuck` scroll-state query, it must have `position: sticky` set on it, and be inside a scroll container. If the test passes, the rules inside the `@container` block are applied to descendants of the `position: sticky` container.
It is possible for two values from opposite axes to match at the same time:
    
    @container scroll-state((stuck: top) and (stuck: left)) {
      /* … */
    }
    
However, two values from opposite edges will never match at the same time:
    
    @container scroll-state((stuck: left) and (stuck: right)) {
      /* … */
    }
    
To evaluate whether a container is stuck, without being concerned about the direction, use the `none` value with the `not` operator:
    
    @container not scroll-state(stuck: none) {
      /* … */
    }
    
## Examples
>
### Setting styles based on a container's size
Consider the following example of a card component with a title and some text:
    
    <div class="post">
      <div class="card">
        <h2>Card title</h2>
        <p>Card content</p>
      </div>
    </div>
    
A container context can be created using the `container-type` property, in this case using the `inline-size` value on the `.post` class. You can then use the `@container` at-rule to apply styles to the element with the `.card` class in a container that's narrower than `650px`.
    
    /* A container context based on inline size */
    .post {
      container-type: inline-size;
    }
    
    /* Apply styles if the container is narrower than 650px */
    @container (width < 650px) {
      .card {
        width: 50%;
        background-color: lightgray;
        font-size: 1em;
      }
    }
    
### Creating named container contexts
Given the following HTML example which is a card component with a title and some text:
    
    <div class="post">
      <div class="card">
        <h2>Card title</h2>
        <p>Card content</p>
      </div>
    </div>
    
First, create a container context using the `container-type` and `container-name` properties. The shorthand syntax for this declaration is described in the `container` page.
    
    .post {
      container-type: inline-size;
      container-name: summary;
    }
    
Next, target that container by adding the name to the container query:
    
    @container summary (width >= 400px) {
      .card {
        font-size: 1.5em;
      }
    }
    
### Nested container queries
It's not possible to target multiple containers in a single container query. It is possible to nest container queries which has the same effect.
The following query evaluates to true and applies the declared style if the container named `summary` is wider than `400px` and has an ancestor container wider than `800px`:
    
    @container summary (width > 400px) {
      @container (width > 800px) {
        /* <stylesheet> */
      }
    }
    
### Container style queries
Container queries can also evaluate the computed style of the container element. A container style query is a `@container` query that uses one or more `style()` functional notations. The boolean syntax and logic combining style features into a style query is the same as for CSS feature queries.
    
    @container style(<style-feature>),
        not style(<style-feature>),
        style(<style-feature>) and style(<style-feature>),
        style(<style-feature>) or style(<style-feature>) {
      /* <stylesheet> */
    }
    
The parameter of each `style()` is a single `<style-feature>`. A `<style-feature>` is a valid CSS declaration, a CSS property, or a `<custom-property-name>`.
    
    @container style(--themeBackground),
        not style(background-color: red),
        style(color: green) and style(background-color: transparent),
        style(--themeColor: blue) or style(--themeColor: purple) {
      /* <stylesheet> */
    }
    
A style feature without a value evaluates to true if the computed value is different from the initial value for the given property.
If the `<style-feature>` passed as the `style()` function's argument is a declaration, the style query evaluates to true if the declaration's value is the same as the computed value of that property for the container being queried. Otherwise, it resolves to false.
The following container query checks if the computed value of the container element's `--accent-color` is `blue`:
    
    @container style(--accent-color: blue) {
      /* <stylesheet> */
    }
    
Note: If a custom property has a value of `blue`, the equivalent hexadecimal code `#0000ff` will not match unless the property has been defined as a color with `@property` so the browser can properly compare computed values.
Style features that query a shorthand property are true if the computed values match for each of its longhand properties, and false otherwise. For example, `@container style(border: 2px solid red)` will resolve to true if all 12 longhand properties (`border-bottom-style`, etc.) that make up that shorthand are true.
The global `revert` and `revert-layer` are invalid as values in a `<style-feature>` and cause the container style query to be false.
### Scroll-state queries
See Using container scroll-state queries for full walkthroughs of scroll-state query examples.
# box-align
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This is a property of the original CSS flexible box layout Module draft, and has been replaced by a newer standard.
The `box-align` CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box.
See flexbox for information about the current standard.
The direction of layout depends on the element's orientation: horizontal or vertical.
## Syntax
    
    /* Keyword values */
    box-align: start;
    box-align: center;
    box-align: end;
    box-align: baseline;
    box-align: stretch;
    
    /* Global values */
    box-lines: inherit;
    box-lines: initial;
    box-lines: unset;
    
The `box-align` property is specified as one of the keyword values listed below.
### Values
`start`
    
The box aligns contents at the start, leaving any extra space at the end.
`center`
    
The box aligns contents in the center, dividing any extra space equally between the start and the end.
`end`
    
The box aligns contents at the end, leaving any extra space at the start.
`baseline`
    
The box aligns the baselines of the contents (lining up the text). This only applies if the box's orientation is horizontal.
`stretch`
    
The box stretches the contents so that there is no extra space in the box.
## Notes
The edge of the box designated the start for alignment purposes depends on the box's orientation:
  * For horizontal elements, the start is the top edge.
  * For vertical elements, the start is the left edge.


The edge opposite to the start is designated the end.
If the alignment is set using the element's `align` attribute, then the style is ignored.
## Examples
>
### Setting box alignment
    
    <div class="example">
      <p>I will be second from the bottom of div.example, centered horizontally.</p>
      <p>I will be on the bottom of div.example, centered horizontally.</p>
    </div>
    
    
    div.example {
      display: box; /* As specified */
      display: -moz-box; /* Mozilla */
      display: -webkit-box; /* WebKit */
    
      /* Make this box taller than the children,
         so there is room for the box-pack */
      height: 400px;
    
      /* Make this box wider than the children
         so there is room for the box-align */
      width: 300px;
    
      /* Children should be oriented vertically */
      box-orient: vertical; /* As specified */
      -moz-box-orient: vertical; /* Mozilla */
      -webkit-box-orient: vertical; /* WebKit */
    
      /* Align children to the horizontal center of this box */
      box-align: center; /* As specified */
      -moz-box-align: center; /* Mozilla */
      -webkit-box-align: center; /* WebKit */
    
      /* Pack children to the bottom of this box */
      box-pack: end; /* As specified */
      -moz-box-pack: end; /* Mozilla */
      -webkit-box-pack: end; /* WebKit */
    }
    
    div.example > p {
      /* Make children narrower than their parent,
         so there is room for the box-align */
      width: 200px;
    }
    
Not part of any standard.
# contain
The `contain` CSS property indicates that an element and its contents are, as much as possible, independent from the rest of the document tree. Containment enables isolating a subsection of the DOM, providing performance benefits by limiting calculations of layout, style, paint, size, or any combination to a DOM subtree rather than the entire page. Containment can also be used to scope CSS counters and quotes.
## Try it
    
    contain: none;
    
    
    contain: size;
    
    
    contain: layout;
    
    
    contain: paint;
    
    
    contain: strict;
    
    
    <section class="default-example" id="default-example">
      <div class="card" id="example-element">
        <h2>Element with '<code>contain</code>'</h2>
        <p>
          The Goldfish is a species of domestic fish best known for its bright
          colors and patterns.
        </p>
        <div class="fixed"><p>Fixed right 4px</p></div>
      </div>
    </section>
    
    
    h2 {
      margin-top: 0;
    }
    
    #default-example {
      text-align: left;
      padding: 4px;
      font-size: 16px;
    }
    
    .card {
      text-align: left;
      border: 3px dotted;
      padding: 20px;
      margin: 10px;
      width: 85%;
      min-height: 150px;
    }
    
    .fixed {
      position: fixed;
      border: 3px dotted;
      right: 4px;
      padding: 4px;
      margin: 4px;
    }
    
There are four types of CSS containment: size, layout, style, and paint, which are set on the container. The property is a space-separated list of a subset of the five standard values or one of the two shorthand values. Changes to the contained properties within the container are not propagated outside of the contained element to the rest of the page. The main benefit of containment is that the browser does not have to re-render the DOM or page layout as often, leading to small performance benefits during the rendering of static pages and greater performance benefits in more dynamic applications.
Using the `contain` property is useful on pages with groups of elements that are supposed to be independent, as it can prevent element internals from having side effects outside of its bounding-box.
Note: Using `layout`, `paint`, `strict` or `content` values for this property creates:
  1. A new containing block (for the descendants whose `position` property is `absolute` or `fixed`).
  2. A new stacking context.
  3. A new block formatting context.


## Syntax
    
    /* Keyword values */
    contain: none;
    contain: strict;
    contain: content;
    contain: size;
    contain: inline-size;
    contain: layout;
    contain: style;
    contain: paint;
    
    /* Multiple keywords */
    contain: size paint;
    contain: size layout paint;
    contain: inline-size layout;
    
    /* Global values */
    contain: inherit;
    contain: initial;
    contain: revert;
    contain: revert-layer;
    contain: unset;
    
### Values
The `contain` property can have any of the following values:
  * The keyword `none` or 
  * One or more of the space-separated keywords `size` (or `inline-size`), `layout`, `style`, and `paint` in any order or 
  * One of the shorthand values `strict` or `content`


The keywords have the following meanings:
`none`
    
The element renders as normal, with no containment applied.
`strict`
    
All containment rules are applied to the element. This is equivalent to `contain: size layout paint style`.
`content`
    
All containment rules except `size` are applied to the element. This is equivalent to `contain: layout paint style`.
`size`
    
Size containment is applied to the element in both the inline and block directions. The size of the element can be computed in isolation, ignoring the child elements. This value cannot be combined with `inline-size`.
`inline-size`
    
Inline size containment is applied to the element. The inline size of the element can be computed in isolation, ignoring the child elements. This value cannot be combined with `size`.
`layout`
    
The internal layout of the element is isolated from the rest of the page. This means nothing outside the element affects its internal layout, and vice versa.
`style`
    
For properties that can affect more than just an element and its descendants, the effects don't escape the containing element. Counters and quotes are scoped to the element and its contents.
`paint`
    
Descendants of the element don't display outside its bounds. If the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. If a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing element's border-box.
## Examples
>
### Paint containment
The following example shows how to use `contain: paint` to prevent an element's descendants from painting outside of its bounds.
    
    div {
      width: 100px;
      height: 100px;
      background: red;
      margin: 10px;
      font-size: 20px;
    }
    
    .contain-paint {
      contain: paint;
    }
    
    
    <div class="contain-paint">
      <p>This text will be clipped to the bounds of the box.</p>
    </div>
    <div>
      <p>This text will not be clipped to the bounds of the box.</p>
    </div>
    
### Layout containment
Consider the example below which shows how elements behave with and without layout containment applied:
    
    <div class="card contain-layout">
      <h2>Card 1</h2>
      <div class="fixed"><p>Fixed box 1</p></div>
      <div class="float"><p>Float box 1</p></div>
    </div>
    <div class="card">
      <h2>Card 2</h2>
      <div class="fixed"><p>Fixed box 2</p></div>
      <div class="float"><p>Float box 2</p></div>
    </div>
    <div class="card">
      <h2>Card 3</h2>
      <!-- ... -->
    </div>
    
    
    .card {
      width: 70%;
      height: 90px;
    }
    
    .fixed {
      position: fixed;
      right: 10px;
      top: 10px;
      background: coral;
    }
    
    .float {
      float: left;
      margin: 10px;
      background: aquamarine;
    }
    
    .contain-layout {
      contain: layout;
    }
    
The first card has layout containment applied, and its layout is isolated from the rest of the page. We can reuse this card in other places on the page without worrying about layout recalculation of the other elements. If floats overlap the card bounds, elements on the rest of the page are not affected. When the browser recalculates the containing element's subtree, only that element is recalculated. Nothing outside of the contained element needs to be recalculated. Additionally, the fixed box uses the card as a layout container to position itself.
The second and third cards have no containment. The layout context for the fixed box in the second card is the root element so the fixed box is positioned in the top right corner of the page. A float overlaps the second card's bounds causing the third card to have unexpected layout shift that's visible in the positioning of the `<h2>` element. When recalculation occurs, it is not limited to a container. This impacts performance and interferes with the rest of the page layout.
### Style containment
Style containment scopes counters and quotes to the contained element. For CSS counters, the `counter-increment` and `counter-set` properties are scoped to the element as if the element is at the root of the document.
#### Containment and counters
The example below takes a look at how counters work when style containment is applied:
    
    <ul>
      <li>Item A</li>
      <li>Item B</li>
      <li class="container">Item C</li>
      <li>Item D</li>
      <li>Item E</li>
    </ul>
    
    
    body {
      counter-reset: list-items;
    }
    
    li::before {
      counter-increment: list-items;
      content: counter(list-items) ": ";
    }
    
    .container {
      contain: style;
    }
    
Without containment, the counter would increment from 1 to 5 for each list item. Style containment causes the `counter-increment` property to be scoped to the element's subtree and the counter begins again at 1:
#### Containment and quotes
CSS quotes are similarly affected in that the `content` values relating to quotes are scoped to the element:
    
    <!-- With style containment -->
    <span class="open-quote">
      outer
      <span class="contain-style">
        <span class="open-quote">inner</span>
      </span>
    </span>
    <span class="close-quote">close</span>
    <br />
    <!-- Without containment -->
    <span class="open-quote">
      outer
      <span>
        <span class="open-quote">inner</span>
      </span>
    </span>
    <span class="close-quote">close</span>
    
    
    body {
      quotes: "[" "]" "‹" "›";
    }
    .open-quote::before {
      content: open-quote;
    }
    
    .close-quote::after {
      content: close-quote;
    }
    
    .contain-style {
      contain: style;
    }
    
Because of containment, the first closing quote ignores the inner span and uses the outer span's closing quote instead:
# offset-position
The `offset-position` CSS property defines the initial position of an element along a path. This property is typically used in combination with the `offset-path` property to create a motion effect. The value of `offset-position` determines where the element gets placed initially for moving along an offset path if an `offset-path` function such as `path()` does not specify its own starting position.
The `offset-position` property is part of a motion system based on `offset` constituent properties, including `offset-anchor`, `offset-distance`, and `offset-path`. These properties work together to create various motion effects along a path.
## Syntax
    
    /* Keyword values */
    offset-position: normal;
    offset-position: auto;
    offset-position: top;
    offset-position: bottom;
    offset-position: left;
    offset-position: right;
    offset-position: center;
    
    /* <percentage> values */
    offset-position: 25% 75%;
    
    /* <length> values */
    offset-position: 0 0;
    offset-position: 1cm 2cm;
    offset-position: 10ch 8em;
    
    /* Edge offsets values */
    offset-position: bottom 10px right 20px;
    offset-position: right 3em bottom 10px;
    offset-position: bottom 10px right;
    offset-position: top right 10px;
    
    /* Global values */
    offset-position: inherit;
    offset-position: initial;
    offset-position: revert;
    offset-position: revert-layer;
    offset-position: unset;
    
### Values
`normal`
    
Indicates that the element does not have an offset starting position and places the element at `50% 50%` of the containing block. This is the default value.
`auto`
    
Indicates that the offset starting position is the top-left corner of the element's box.
`<position>`
    
Specifies the position as an x/y coordinate to place an element relative to its box edges. The position can be defined using one to four values. If two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. If only one value is specified, the second value is assumed to be `center`. If three or four values are used, the `<length-percentage>` values are offsets for the preceding keyword value(s). For more explanation of these value types, see `background-position`.
## Examples
>
### Setting initial offset-position for an offset-path
In this example, the `offset-path` property is used to define the path along which the `cyan` element should move. The value of the `path()` CSS function is an SVG data path that describes a curved path. The element moves along this curved path during the `move` animation.
#### HTML
    
    <div id="wrap">
      <div id="motion-demo"></div>
    </div>
    
#### CSS
    
    #motion-demo {
      offset-path: path("M20,20 C20,100 200,0 200,100");
      offset-position: left top;
      animation: move 3000ms infinite alternate ease-in-out;
      width: 40px;
      height: 40px;
      background: cyan;
    }
    
    @keyframes move {
      0%,
      20% {
        offset-distance: 0%;
      }
      80%,
      100% {
        offset-distance: 100%;
      }
    }
    
#### Result
### Comparing various offset starting positions
This example visually compares various initial offset starting position of an element when `ray()` is used to specify a value for the `offset-path` property. The number inside the element box indicates the element to which CSS is applied as well as the element's anchor point.
    
    .box {
      background-color: green;
      border-top: 6px dashed white;
      background-clip: border-box;
      position: absolute;
      top: 20px;
      left: 20px;
      opacity: 20%;
      color: white;
    }
    
    .box0 {
      offset-position: normal;
    }
    
    .box1 {
      offset-position: normal;
      offset-path: ray(0deg);
    }
    
    .box2 {
      offset-position: auto;
      offset-path: ray(0deg);
    }
    
    .box3 {
      offset-position: left top;
      offset-path: ray(0deg);
    }
    
    .box4 {
      offset-position: 30% 70%;
      offset-path: ray(120deg);
    }
    
#### Result
In `box0`, the absence of the `offset-path` property means that an `offset-position` of either `normal` or `auto` has no effect. When `offset-position` is `normal`, the ray starts at the center of the containing block (i.e., `50% 50%`). This is the default starting position of an offset path and is used when no `offset-position` is specified. Notice the difference between offset starting positions `auto` and `left top`. The value `auto` aligns the element's anchor point to its own top-left corner, whereas the value `left top` aligns the element's anchor point to the top-left corner of the containing block.
# flood-color
The `flood-color` CSS property defines the color of the current filter primitive subregion in `<feFlood>` and `<feDropShadow>` elements within a `<filter>`. If present, it overrides the element's `flood-color` attribute.
Note: The `flood-color` property only applies to `<feFlood>` and `<feDropShadow>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* <color> values */
    flood-color: red;
    flood-color: hsl(120deg 75% 25% / 60%);
    flood-color: currentColor;
    
    /* Global values */
    flood-color: inherit;
    flood-color: initial;
    flood-color: revert;
    flood-color: revert-layer;
    flood-color: unset;
    
### Values
`<color>`
    
The flood's color. This can be any valid CSS `<color>` value.
## Examples
>
### Defining the color of a filters flood
This example demonstrates the basic use case of `flood-color`, and how the CSS `flood-color` property takes precedence over the `flood-color` attribute.
#### HTML
We have an SVG with two `<filter>` elements, each with a `<feFlood>` child. Each `<feFlood>` element includes the SVG `flood-color` attribute defining the flood color as `seagreen`. We included two `<rect>` elements with a filter attribute; this is where the filters will be displayed.
    
    <svg viewBox="0 0 420 120" xmlns="http://www.w3.org/2000/svg">
      <filter id="flood1">
        <feFlood flood-color="seagreen" />
      </filter>
      <filter id="flood2">
        <feFlood flood-color="seagreen" />
      </filter>
    
      <rect id="r1" filter="url(#flood1)" />
      <rect id="r2" filter="url(#flood2)" />
    </svg>
    
#### CSS
We define the size and position of our `<rect>` using the CSS `height`, `width`, `x`, and `y` properties:
    
    rect {
      width: 100px;
      height: 100px;
      x: 10px;
      y: 10px;
    }
    #r2 {
      x: 150px;
    }
    
We then apply different flood color values to the `<feFlood>` elements using the CSS `flood-color` property. We use a named color and a 3-digit hexadecimal color, but we can use any valid CSS color syntax:
    
    #flood1 feFlood {
      flood-color: rebeccapurple;
    }
    #flood2 feFlood {
      flood-color: #ff3366;
    }
    
#### Results
The attributes defined the squares as seagreen, but these values were overridden by the CSS `flood-color` values.
# border-image-outset
The `border-image-outset` CSS property sets the distance by which an element's border image is set out from its border box.
The parts of the border image that are rendered outside the element's border box with `border-image-outset` do not trigger overflow scrollbars and don't capture mouse events.
## Try it
    
    border-image-outset: 0;
    
    
    border-image-outset: 15px;
    
    
    border-image-outset: 30px;
    
    
    border-image-outset: 40px;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
## Syntax
    
    /* <length> value */
    border-image-outset: 1rem;
    
    /* <number> value */
    border-image-outset: 1.5;
    
    /* top and bottom | left and right */
    border-image-outset: 1 1.2;
    
    /* top | left and right | bottom */
    border-image-outset: 30px 2 45px;
    
    /* top | right | bottom | left */
    border-image-outset: 7px 12px 14px 5px;
    
    /* Global values */
    border-image-outset: inherit;
    border-image-outset: initial;
    border-image-outset: revert;
    border-image-outset: revert-layer;
    border-image-outset: unset;
    
The `border-image-outset` property may be specified as one, two, three, or four values. Each value is a `<length>` or `<number>`. Negative values are invalid and will cause the `border-image-outset` declaration to be ignored.
  1. If one value is specified, it applies to all four sides.
  2. If two values are specified, the first applies to the top and bottom and the second to the left and right.
  3. If three values are specified, the first applies to the top, the second to the left and right, and the third to the bottom.
  4. If four values are specified, they apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length>`
    
The size of the `border-image` outset as a dimension — a number with a unit.
`<number>`
    
The size of the `border-image` outset as a multiple of the element's corresponding `border-width`s. For example, if an element has `border-width: 1em 2px 0 1.5rem`, and `border-image-outset: 2`, the final `border-image-outset` would be calculated as `2em 4px 0 3rem`.
## Examples
>
### Outsetting a border image
#### HTML
    
    <div id="outset">This element has an outset border image!</div>
    
#### CSS
    
    #outset {
      width: 10rem;
      background: #cceeff;
      border: 1.4rem solid;
      border-image: radial-gradient(#ffff22, #5555ff) 40;
      border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */
      margin: 2.1rem;
    }
    
#### Result
# border-width
The `border-width` shorthand CSS property sets the width of an element's border.
## Try it
    
    border-width: thick;
    
    
    border-width: 1em;
    
    
    border-width: 4px 1.25em;
    
    
    border-width: 2ex 1.25ex 0.5ex;
    
    
    border-width: 0 4px 8px 12px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-bottom-width`
  * `border-left-width`
  * `border-right-width`
  * `border-top-width`


## Syntax
    
    /* Keyword values */
    border-width: thin;
    border-width: medium;
    border-width: thick;
    
    /* <length> values */
    border-width: 4px;
    border-width: 1.2rem;
    
    /* top and bottom | left and right */
    border-width: 2px 1.5em;
    
    /* top | left and right | bottom */
    border-width: 1px 2em 1.5cm;
    
    /* top | right | bottom | left */
    border-width: 1px 2em 0 4rem;
    
    /* Global values */
    border-width: inherit;
    border-width: initial;
    border-width: revert;
    border-width: revert-layer;
    border-width: unset;
    
The `border-width` property may be specified using one, two, three, or four values.
  * When one value is specified, it applies the same width to all four sides.
  * When two values are specified, the first width applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<line-width>`
    
Defines the width of the border, either as an explicit nonnegative `<length>` or a keyword. If it's a keyword, it must be one of the following values:
  * `thin`
  * `medium`
  * `thick`


Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern `thin ≤ medium ≤ thick`, and the values are constant within a single document.
## Examples
>
### A mix of values and lengths
#### HTML
    
    <p id="one-value">one value: 6px wide border on all 4 sides</p>
    <p id="two-values">
      two different values: 2px wide top and bottom border, 10px wide right and left
      border
    </p>
    <p id="three-values">
      three different values: 0.3em top, 9px bottom, and zero width right and left
    </p>
    <p id="four-values">
      four different values: "thin" top, "medium" right, "thick" bottom, and 1em
      left
    </p>
    
#### CSS
    
    #one-value {
      border: ridge #cccccc;
      border-width: 6px;
    }
    #two-values {
      border: solid red;
      border-width: 2px 10px;
    }
    #three-values {
      border: dotted orange;
      border-width: 0.3em 0 9px;
    }
    #four-values {
      border: solid lightgreen;
      border-width: thin medium thick 1em;
    }
    p {
      width: auto;
      margin: 0.25em;
      padding: 0.25em;
    }
    
#### Result
# -webkit-border-before
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `-webkit-border-before` CSS property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `-webkit-border-before-color`
  * `-webkit-border-before-style`
  * `-webkit-border-before-width`


## Syntax
    
    /* Border values */
    -webkit-border-before: 1px;
    -webkit-border-before: 2px dotted;
    -webkit-border-before: medium dashed blue;
    
    /* Global values */
    -webkit-border-before: inherit;
    -webkit-border-before: initial;
    -webkit-border-before: revert;
    -webkit-border-before: revert-layer;
    -webkit-border-before: unset;
    
### Values
One or more of the following, in any order:
`<'border-width'>`
    
See `border-width`
`<'border-style'>`
    
See `border-style`
`<'color'>`
    
See `color`
## Description
The `-webkit-border-before` property maps to a physical border depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top`, `border-right`, `border-bottom`, or `border-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
It relates to `-webkit-border-after`, `-webkit-border-start`, and `-webkit-border-end`, which define the other borders of the element.
The standard-track equivalent of this property is `border-block-start`.
## Examples
>
### Applying a border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      -webkit-border-before: 5px dashed blue;
    }
    
#### Result
Not part of any standard, but it relates to the standards-track `border-block-start` property.
# padding-block-end
The `padding-block-end` CSS property defines the logical block end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-block-end: 20px;
    writing-mode: horizontal-tb;
    
    
    padding-block-end: 20px;
    writing-mode: vertical-rl;
    
    
    padding-block-end: 5em;
    writing-mode: horizontal-tb;
    
    
    padding-block-end: 5em;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    padding-block-end: 10px; /* An absolute length */
    padding-block-end: 1em; /* A length relative to the text size */
    
    /* <percentage> value */
    padding-block-end: 5%; /* A padding relative to the block container's width */
    
    /* Global values */
    padding-block-end: inherit;
    padding-block-end: initial;
    padding-block-end: revert;
    padding-block-end: revert-layer;
    padding-block-end: unset;
    
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Description
The `padding-block-end` property takes the same values as physical padding properties such as `padding-top`. However, it can be equivalent to `padding-bottom`, `padding-top`, `padding-left`, or `padding-right` depending on the values set for `writing-mode`, `direction`, and `text-orientation`.
It relates to `padding-block-start`, `padding-inline-start`, and `padding-inline-end`, which define the other padding values of the element.
## Examples
>
### Setting block end padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      padding-block-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# CSS display
The CSS display module defines how the CSS formatting box tree is generated from the document element tree and defines properties controlling it.
## Reference
>
### Properties
  * `display`
  * `order`
  * `visibility`
  * `reading-flow`
  * `reading-order`


### Data types
  * `<display-outside>`
  * `<display-inside>`
  * `<display-listitem>`
  * `<display-box>`
  * `<display-internal>`
  * `<display-legacy>`


### Glossary and terms
  * Block
  * Block formatting context (BFC)
  * Block-level content
  * Containing block
  * Flow layout
  * Reading order
  * Replaced elements
  * Ruby


## Guides
Using the multi-keyword syntax with CSS display
    
Describes the multi-keyword syntax and compares this syntax with legacy single-keyword values.
Block and inline layout in normal flow
    
The basics of how block and inline elements behave when they are part of the normal flow.
Flow layout and overflow
    
How overflow works when working with normal flow.
Flow layout and writing modes
    
How flow layout behaves when used with different document writing modes.
Introduction to formatting contexts
    
Formatting contexts, including block, inline, and flex, their behaviors, and use.
In flow and out of flow
    
What takes elements out of flow, and the effect of creating new Block Formatting Contexts.
## Related Concepts
>
### Properties
  * `overflow`
  * `transition-behavior`


### Glossary and terms
  * Flex
  * Grid
  * Inline formatting context
  * Inline-level content


### Guides
  * CSS flexible box layout module
    * Basic concepts of flexbox
    * Aligning items in a flex container
    * Controlling ratios of flex items along the main axis
    * Mastering wrapping of flex items
    * Ordering flex items
    * Relationship of flexbox to other layout methods
    * Typical use cases of flexbox
  * CSS grid layout module
    * Basic concepts of grid layout
    * Relationship of grid layout to other layout methods
    * Line-based placement
    * Grid template areas
    * Layout using named grid lines
    * Auto-placement in grid layout
    * Box alignment in grid layout
    * Grids, logical values and writing modes
    * CSS grid layout and accessibility
    * Realizing common layouts using grids


# :placeholder-shown
The `:placeholder-shown` CSS pseudo-class represents any `<input>` or `<textarea>` element that is currently displaying placeholder text.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:placeholder-shown {
      background-color: ivory;
      border: 2px solid darkorange;
      border-radius: 5px;
    }
    
    
    <form>
      <label for="name">Full Name:</label>
      <input id="name" name="name" type="text" />
    
      <label for="email">Email Address:</label>
      <input id="email" name="email" type="email" placeholder="name@example.com" />
    
      <label for="age">Your age:</label>
      <input
        id="age"
        name="age"
        type="number"
        value="18"
        placeholder="You must be 18+" />
    </form>
    
## Syntax
    
    :placeholder-shown {
      /* ... */
    }
    
## Examples
>
### Basic example
This example applies special font and border styles when the placeholder is shown.
#### HTML
    
    <input placeholder="Type something here!" />
    
#### CSS
    
    input {
      border: 1px solid black;
      padding: 3px;
    }
    
    input:placeholder-shown {
      border-color: teal;
      color: purple;
      font-style: italic;
    }
    
#### Result
### Overflowing text
When form fields are too small, placeholder text can get cropped in an undesirable way. You can use the `text-overflow` property to alter the way overflowing text is displayed.
#### HTML
    
    <input id="input1" placeholder="Name, Rank, and Serial Number" /> <br /><br />
    <input id="input2" placeholder="Name, Rank, and Serial Number" />
    
#### CSS
    
    #input2:placeholder-shown {
      text-overflow: ellipsis;
    }
    
#### Result
### Customized input field
The following example highlights the Student ID field with a custom style.
#### HTML
    
    <form id="test">
      <p>
        <label for="name">Enter Student Name:</label>
        <input id="name" placeholder="Student Name" />
      </p>
      <p>
        <label for="branch">Enter Student Branch:</label>
        <input id="branch" placeholder="Student Branch" />
      </p>
      <p>
        <label for="sid">Enter Student ID:</label>
        <input
          type="number"
          pattern="[0-9]{8}"
          title="8 digit ID"
          id="sid"
          class="student-id"
          placeholder="8 digit id" />
      </p>
      <input type="submit" />
    </form>
    
#### CSS
    
    input {
      background-color: #e8e8e8;
      color: black;
    }
    
    input.student-id:placeholder-shown {
      background-color: yellow;
      color: red;
      font-style: italic;
    }
    
#### Result
# border-block
The `border-block` CSS property is a shorthand property for setting the individual logical block border property values in a single place in the style sheet.
## Try it
    
    border-block: solid;
    writing-mode: horizontal-tb;
    
    
    border-block: dashed red;
    writing-mode: vertical-rl;
    
    
    border-block: 1rem solid;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
`border-block` can be used to set the values for one or more of `border-block-width`, `border-block-style`, and `border-block-color` setting both the start and end in the block dimension at once. The physical borders to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top` and `border-bottom` or `border-right`, and `border-left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
The borders in the other dimension can be set with `border-inline`, which sets `border-inline-start`, and `border-inline-end`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-block-color`
  * `border-block-style`
  * `border-block-width`


## Syntax
    
    border-block: 1px;
    border-block: 2px dotted;
    border-block: medium dashed blue;
    
    /* Global values */
    border-block: inherit;
    border-block: initial;
    border-block: revert;
    border-block: revert-layer;
    border-block: unset;
    
### Values
The `border-block` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### Border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-block: 5px dashed blue;
    }
    
#### Results
# :last-of-type
The `:last-of-type` CSS pseudo-class represents the last element of its type (tag name) among a group of sibling elements.
## Try it
    
    dt {
      font-weight: bold;
    }
    
    dd {
      margin: 3px;
    }
    
    dd:last-of-type {
      border: 2px solid orange;
    }
    
    
    <dl>
      <dt>Vegetables:</dt>
      <dd>1. Tomatoes</dd>
      <dd>2. Cucumbers</dd>
      <dd>3. Mushrooms</dd>
      <dt>Fruits:</dt>
      <dd>4. Apples</dd>
      <dd>5. Mangos</dd>
      <dd>6. Pears</dd>
      <dd>7. Oranges</dd>
    </dl>
    
## Syntax
    
    :last-of-type {
      /* ... */
    }
    
## Examples
>
### Styling the last paragraph
#### HTML
    
    <h2>Heading</h2>
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
    
#### CSS
    
    p:last-of-type {
      color: red;
      font-style: italic;
    }
    
#### Result
### Nested elements
This example shows how nested elements can also be targeted. Note that the universal selector (`*`) is implied when no simple selector is written.
#### HTML
    
    <article>
      <div>This `div` is first.</div>
      <div>This <span>nested `span` is last</span>!</div>
      <div>
        This <em>nested `em` is first</em>, but this <em>nested `em` is last</em>!
      </div>
      <p>This `p` qualifies!</p>
      <div>This is the final `div`!</div>
    </article>
    
#### CSS
    
    article :last-of-type {
      background-color: pink;
    }
    
#### Result
### Multiple selectors elements
This HTML example contains nested elements of different types. The CSS contains both type selectors and class selectors.
#### HTML
    
    <p>This `p` is not selected.</p>
    <p>This `p` is not selected either.</p>
    <p>
      This `p` is last `p` element of its parent e.g. `body` selected by `p` type
      selector.
    </p>
    <div class="container">
      <div class="item">This `div` is not selected.</div>
      <div class="item">This `div` is not selected either.</div>
      <div class="item">
        This `div` is last `div` element of its parent `div` selected by `.container
        .item` class selector.
      </div>
      <p class="item">
        This `p` is last `p` element of its parent `div` selected by `.container
        .item` class selector.
      </p>
    </div>
    
#### CSS
    
    p:last-of-type {
      background: skyblue;
    }
    
    .container .item:last-of-type {
      color: red;
      font-weight: bold;
    }
    
#### Result
The last `<div>` and the last `<p>` are both red and bold as the `.item:last-of-type` selects the last of every type if that last element also has the `item` class.
# fill
The `fill` CSS property defines how SVG text content and the interior canvas of SVG shapes are filled or painted. If present, it overrides the element's `fill` attribute.
The areas inside the outline of the SVG shape or text are painted. What is "inside" a shape may not always be clear. The paths defining a shape may overlap. The areas considered "inside" these complex shapes are clarified by the `fill-rule` property or attribute.
If subpaths are open, `fill` closes the path before painting, as if a "closepath" command were included connecting the last point of the subpath with the first point of the subpath. In other words, `fill` applies to open subpaths within `path` elements (i.e., subpaths without a closepath command) and `polyline` elements.
Note: The `fill` property only applies to `<circle>`, `<ellipse>`, `<path>`, `<polygon>`, `<polyline>`, `<rect>`, `<text>`, `<textPath>`, and `<tspan>` elements nested in an `<svg>`. It doesn't apply other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* keywords */
    fill: none;
    fill: context-fill;
    fill: context-stroke;
    
    /* <color> values */
    fill: red;
    fill: hsl(120deg 75% 25% / 60%);
    
    /* <url> values */
    fill: url("#gradientElementID");
    fill: url("star.png");
    
    /* <url> with fallback */
    fill: url("#gradientElementID") blue;
    fill: url("star.png") none;
    
    /* Global values */
    fill: inherit;
    fill: initial;
    fill: revert;
    fill: revert-layer;
    fill: unset;
    
### Values
`none`
    
No `fill` is painted; the areas inside the stroke, if any, are transparent.
`context-fill`
    
Uses the paint value of `fill` from a context element.
`context-stroke`
    
Uses the paint value of `stroke` from a context element.
`<color>`
    
The color of the fill as any valid CSS `<color>` value.
`<url>`
    
A URL reference to an SVG paint server element, such as a `<linearGradient>`, `<radialGradient>`, or `<pattern>`. The resource reference can optionally be followed by a `<color>` or `none`, which will be used as a fallback if the referenced paint server doesn't resolve.
## Examples
>
### Defining fill values for SVG elements
This example demonstrates how a `fill` is declared, the effect of the property, and how the CSS `fill` property takes precedence over the `fill` attribute.
#### HTML
We have an SVG with two complex shapes defined using the SVG `<polygon>` and `<path>` elements. Both have the `fill` attribute set to the default `black`. We add a dark grey stroke of `#666666` using the SVG `stroke` attribute but could have used the `stroke` property.
    
    <svg viewBox="0 0 220 120" xmlns="http://www.w3.org/2000/svg">
      <path
        d="M 10,5 l 90,0 -80,80 0,-60 80,80 -90,0 z"
        stroke="#666666"
        fill="black" />
      <polygon
        points="180,10 150,100 220,40 140,40 210,100"
        stroke="#666666"
        fill="black" />
    </svg>
    
#### CSS
We set `fill` values on the shapes in the SVG.
    
    path {
      fill: red;
    }
    polygon {
      fill: hsl(0deg 100% 50% / 60%);
    }
    
#### Results
The CSS `fill` property value overrides the SVG `fill` attribute value, resulting in both shapes being filled with a red color; the polygon's red is translucent.
### Using fill keyword values
This example demonstrates using keyword values for `fill`.
#### HTML
We include three `<path>` elements and a `<marker>` element that adds a `<circle>` to every path point. We set the circle marker to be black with a grey fill with the SVG `stroke` and `fill` attributes.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 90">
      <path d="M 10 44.64 L 30 10 L 70 10 L 90 44.64 L 70 79.28 L 30 79.28 Z" />
      <path d="M 100 44.64 L 80 10 L 120 10 L 140 44.64 L 120 79.28 L 80 79.28 Z" />
      <path
        d="M 150 44.64 L 130 10 L 170 10 L 190 44.64 L 170 79.28 L 130 79.28 Z" />
      <marker
        id="circle"
        markerWidth="12"
        markerHeight="12"
        refX="6"
        refY="6"
        markerUnits="userSpaceOnUse">
        <circle cx="6" cy="6" r="3" stroke-width="2" stroke="black" fill="grey" />
      </marker>
    </svg>
    
#### CSS
We set different `stroke` and `fill` colors on each path. The first path, the one with a red border, has its `fill` set to `none`. We set the circle marker's stroke and fill to the same color as the stroke of the element they're marking, using the `context-stroke` value.
    
    path {
      stroke-width: 2px;
      marker: url("#circle");
    }
    path:nth-of-type(1) {
      stroke: red;
      fill: none;
    }
    path:nth-of-type(2) {
      stroke: green;
      fill: lightgreen;
    }
    path:nth-of-type(3) {
      stroke: blue;
      fill: lightblue;
    }
    circle {
      stroke: context-stroke;
      fill: context-stroke;
    }
    
#### Results
Note how the first path has a transparent background because the `fill` is `none`, overriding the default `fill` of `black`. The circles are filled with the color of the stroke. If you change the value to `context-fill`, the circles will be transparent, `lightgreen` and `lightblue` instead of `red`, `green`, and `blue`.
### Fills and fallbacks
This example demonstrates how to include a `url()` value with a fallback as a `fill` value.
#### HTML
We have an SVG containing two `<polygon>` stars and a `<linearGradient>` that goes from green to gold to red.
    
    <svg viewBox="0 0 220 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <linearGradient id="myGradient">
          <stop offset="5%" stop-color="green" />
          <stop offset="50%" stop-color="gold" />
          <stop offset="95%" stop-color="red" />
        </linearGradient>
      </defs>
      <polygon points="80,10 50,100 120,40 40,40 110,100" />
      <polygon points="180,10 150,100 220,40 140,40 210,100" />
    </svg>
    
#### CSS
We set `fill` values on the polygons in the SVG, providing a `url()` value and a fallback.
    
    polygon:first-of-type {
      fill: url("#myGradient") magenta;
    }
    polygon:last-of-type {
      fill: url("#MISSINGIMAGE") magenta;
    }
    
#### Results
The first star has a gradient as a background. The second star uses the fallback value, as the element referenced in the `url()` does not exist.
# border-left-style
The `border-left-style` CSS property sets the line style of an element's left `border`.
## Try it
    
    border-left-style: none;
    
    
    border-left-style: dotted;
    
    
    border-left-style: dashed;
    
    
    border-left-style: solid;
    
    
    border-left-style: groove;
    
    
    border-left-style: inset;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
    body {
      background-color: white;
    }
    
Note: The specification doesn't define how borders of different styles connect in the corners.
## Syntax
    
    /* Keyword values */
    border-left-style: none;
    border-left-style: hidden;
    border-left-style: dotted;
    border-left-style: dashed;
    border-left-style: solid;
    border-left-style: double;
    border-left-style: groove;
    border-left-style: ridge;
    border-left-style: inset;
    border-left-style: outset;
    
    /* Global values */
    border-left-style: inherit;
    border-left-style: initial;
    border-left-style: revert;
    border-left-style: revert-layer;
    border-left-style: unset;
    
The `border-left-style` property is specified as a single `<line-style>` keyword value.
## Examples
>
### Setting border-left-style
#### HTML
    
    <table>
      <tr>
        <td class="b1">none</td>
        <td class="b2">hidden</td>
        <td class="b3">dotted</td>
        <td class="b4">dashed</td>
      </tr>
      <tr>
        <td class="b5">solid</td>
        <td class="b6">double</td>
        <td class="b7">groove</td>
        <td class="b8">ridge</td>
      </tr>
      <tr>
        <td class="b9">inset</td>
        <td class="b10">outset</td>
      </tr>
    </table>
    
#### CSS
    
    /* Define look of the table */
    table {
      border-width: 2px;
      background-color: #52e385;
    }
    tr,
    td {
      padding: 3px;
    }
    
    /* border-left-style example classes */
    .b1 {
      border-left-style: none;
    }
    .b2 {
      border-left-style: hidden;
    }
    .b3 {
      border-left-style: dotted;
    }
    .b4 {
      border-left-style: dashed;
    }
    .b5 {
      border-left-style: solid;
    }
    .b6 {
      border-left-style: double;
    }
    .b7 {
      border-left-style: groove;
    }
    .b8 {
      border-left-style: ridge;
    }
    .b9 {
      border-left-style: inset;
    }
    .b10 {
      border-left-style: outset;
    }
    
#### Result
# vertical-align
The `vertical-align` CSS property sets vertical alignment of an inline, inline-block or table-cell box.
## Try it
    
    vertical-align: baseline;
    
    
    vertical-align: top;
    
    
    vertical-align: middle;
    
    
    vertical-align: bottom;
    
    
    vertical-align: sub;
    
    
    vertical-align: text-top;
    
    
    <section class="default-example" id="default-example">
      <p>
        Align the star:
        <img id="example-element" src="/shared-assets/images/examples/star2.png" />
      </p>
    </section>
    
    
    #default-example > p {
      line-height: 3em;
      font-family: monospace;
      font-size: 1.2em;
      text-decoration: underline overline;
    }
    
The `vertical-align` property can be used in two contexts:
  * To vertically align an inline-level element's box inside its containing line box. For example, it could be used to vertically position an image in a line of text.
  * To vertically align the content of a cell in a table.


Note that `vertical-align` only applies to inline, inline-block and table-cell elements: you can't use it to vertically align block-level elements.
## Syntax
    
    /* Keyword values */
    vertical-align: baseline;
    vertical-align: sub;
    vertical-align: super;
    vertical-align: text-top;
    vertical-align: text-bottom;
    vertical-align: middle;
    vertical-align: top;
    vertical-align: bottom;
    
    /* <length> values */
    vertical-align: 10em;
    vertical-align: 4px;
    
    /* <percentage> values */
    vertical-align: 20%;
    
    /* Global values */
    vertical-align: inherit;
    vertical-align: initial;
    vertical-align: revert;
    vertical-align: revert-layer;
    vertical-align: unset;
    
The `vertical-align` property is specified as one of the values listed below.
### Values for inline elements
#### Parent-relative values
These values vertically align the element relative to its parent element:
`baseline`
    
Aligns the baseline of the element with the baseline of its parent. The baseline of some replaced elements, like `<textarea>`, is not specified by the HTML specification, meaning that their behavior with this keyword may vary between browsers.
`sub`
    
Aligns the baseline of the element with the subscript-baseline of its parent.
`super`
    
Aligns the baseline of the element with the superscript-baseline of its parent.
`text-top`
    
Aligns the top of the element with the top of the parent element's font.
`text-bottom`
    
Aligns the bottom of the element with the bottom of the parent element's font.
`middle`
    
Aligns the middle of the element with the baseline plus half the x-height of the parent.
`<length>`
    
Aligns the baseline of the element to the given length above the baseline of its parent. A negative value is allowed.
`<percentage>`
    
Aligns the baseline of the element to the given percentage above the baseline of its parent, with the value being a percentage of the `line-height` property. A negative value is allowed.
#### Line-relative values
The following values vertically align the element relative to the entire line:
`top`
    
Aligns the top of the element and its descendants with the top of the entire line.
`bottom`
    
Aligns the bottom of the element and its descendants with the bottom of the entire line.
For elements that do not have a baseline, the bottom margin edge is used instead.
### Values for table cells
`baseline` (and `sub`, `super`, `text-top`, `text-bottom`, `<length>`, and `<percentage>`)
    
Aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned.
`top`
    
Aligns the top padding edge of the cell with the top of the row.
`middle`
    
Centers the padding box of the cell within the row.
`bottom`
    
Aligns the bottom padding edge of the cell with the bottom of the row.
Negative values are allowed.
## Examples
>
### Basic example
#### HTML
    
    <div>
      An <img src="frame_image.svg" alt="link" width="32" height="32" /> image with
      a default alignment.
    </div>
    <div>
      An
      <img class="top" src="frame_image.svg" alt="link" width="32" height="32" />
      image with a text-top alignment.
    </div>
    <div>
      An
      <img class="bottom" src="frame_image.svg" alt="link" width="32" height="32" />
      image with a text-bottom alignment.
    </div>
    <div>
      An
      <img class="middle" src="frame_image.svg" alt="link" width="32" height="32" />
      image with a middle alignment.
    </div>
    
#### CSS
    
    img.top {
      vertical-align: text-top;
    }
    img.bottom {
      vertical-align: text-bottom;
    }
    img.middle {
      vertical-align: middle;
    }
    
#### Result
### Vertical alignment in a line box
#### HTML
    
    <p>
    top:         <img style="vertical-align: top" src="star.png" alt="star"/>
    middle:      <img style="vertical-align: middle" src="star.png" alt="star"/>
    bottom:      <img style="vertical-align: bottom" src="star.png" alt="star"/>
    super:       <img style="vertical-align: super" src="star.png" alt="star"/>
    sub:         <img style="vertical-align: sub" src="star.png" alt="star"/>
    </p>
    
    <p>
    text-top:    <img style="vertical-align: text-top" src="star.png" alt="star"/>
    text-bottom: <img style="vertical-align: text-bottom" src="star.png" alt="star"/>
    0.2em:       <img style="vertical-align: 0.2em" src="star.png" alt="star"/>
    -1em:        <img style="vertical-align: -1em" src="star.png" alt="star"/>
    20%:         <img style="vertical-align: 20%" src="star.png" alt="star"/>
    -100%:       <img style="vertical-align: -100%" src="star.png" alt="star"/>
    </p>
    
#### Result
### Vertical alignment in a table cell
In this example, we have a table with a single row containing six cells. The row sets `vertical-align` to `bottom` as the default value.
  * The first four cells each set their own `vertical-align` values, and these override the row's value.
  * The fifth cell does not set any `vertical-align` value, so inherits the row's value.


The sixth cell is only used to ensure that the cells are tall enough to see the effect.
#### HTML
    
    <table>
      <tr class="bottom">
        <td class="baseline">baseline</td>
        <td class="top">top</td>
        <td class="middle">middle</td>
        <td>bottom</td>
        <td>Row's style</td>
        <td>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
          pretium felis eu sem mattis vulputate.
        </td>
      </tr>
    </table>
    
#### CSS
    
    table {
      margin-left: auto;
      margin-right: auto;
      width: 80%;
    }
    
    table,
    th,
    td {
      border: 1px solid black;
    }
    
    td {
      padding: 0.5em;
      font-family: monospace;
    }
    
    .bottom {
      vertical-align: bottom;
    }
    
    .baseline {
      vertical-align: baseline;
    }
    
    .top {
      vertical-align: top;
    }
    
    .middle {
      vertical-align: middle;
    }
    
#### Result
# font-weight
The `font-weight` CSS property sets the weight (or boldness) of the font. The weights available depend on the `font-family` that is currently set.
## Try it
    
    font-weight: normal;
    
    
    font-weight: bold;
    
    
    font-weight: lighter;
    
    
    font-weight: bolder;
    
    
    font-weight: 100;
    
    
    font-weight: 900;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    section {
      font-size: 1.2em;
    }
    
## Syntax
    
    /* <font-weight-absolute> keyword values */
    font-weight: normal;
    font-weight: bold;
    
    /* <font-weight-absolute> numeric values [1,1000] */
    font-weight: 100;
    font-weight: 200;
    font-weight: 300;
    font-weight: 400; /* normal */
    font-weight: 500;
    font-weight: 600;
    font-weight: 700; /* bold */
    font-weight: 800;
    font-weight: 900;
    
    /* Keyword values relative to the parent */
    font-weight: lighter;
    font-weight: bolder;
    
    /* Global values */
    font-weight: inherit;
    font-weight: initial;
    font-weight: revert;
    font-weight: revert-layer;
    font-weight: unset;
    
The `font-weight` property is specified using either a `<font-weight-absolute>` value or a relative weight value, as listed below.
### Values
`normal`
    
Normal font weight. Same as `400`.
`bold`
    
Bold font weight. Same as `700`.
`<number>`
    
A `<number>` value between 1 and 1000, both values included. Higher numbers represent weights that are bolder than (or as bold as) lower numbers. This allows fine-grain control for variable fonts. For non-variable fonts, if the exact specified weight is unavailable, a fallback weight algorithm is used — numeric values that are divisible by 100 correspond to common weight names, as described in the Common weight name mapping section below.
`lighter`
    
One relative font weight lighter than the parent element. Note that only four font weights are considered for relative weight calculation; see the Meaning of relative weights section below.
`bolder`
    
One relative font weight heavier than the parent element. Note that only four font weights are considered for relative weight calculation; see the Meaning of relative weights section below.
### Fallback weights
If the exact weight given is unavailable, then the following rule is used to determine the weight actually rendered:
  * If the target weight given is between `400` and `500` inclusive:
    * Look for available weights between the target and `500`, in ascending order.
    * If no match is found, look for available weights less than the target, in descending order.
    * If no match is found, look for available weights greater than `500`, in ascending order.
  * If a weight less than `400` is given, look for available weights less than the target, in descending order. If no match is found, look for available weights greater than the target, in ascending order.
  * If a weight greater than `500` is given, look for available weights greater than the target, in ascending order. If no match is found, look for available weights less than the target, in descending order.


Note: The fallback weight algorithm is only used for rendering. The computed value of the property is still the specified value.
### Meaning of relative weights
When `lighter` or `bolder` is specified, the below chart shows how the absolute font weight of the element is determined.
Note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900). If a font family has more weights available, they are ignored for the purposes of relative weight calculation.
Inherited value `bolder` `lighter`  
100 400 100  
200 400 100  
300 400 100  
400 700 100  
500 700 100  
600 900 400  
700 900 400  
800 900 700  
900 900 700  
### Common weight name mapping
The numerical values `100` to `900` roughly correspond to the following common weight names (see the OpenType specification):
Value Common weight name  
100 Thin (Hairline)  
200 Extra Light (Ultra Light)  
300 Light  
400 Normal (Regular)  
500 Medium  
600 Semi Bold (Demi Bold)  
700 Bold  
800 Extra Bold (Ultra Bold)  
900 Black (Heavy)  
950 Extra Black (Ultra Black)  
### Variable fonts
While many fonts have a particular weight corresponding to one of the numbers in Common weight name mapping, most variable fonts support a range of weights providing much finer granularity, giving designers and developers more control over the chosen weight.
For TrueType or OpenType variable fonts, the "wght" variation is used to implement varying widths.
This demo loads with `font-weight: 500;` set. Change the value of the `font-weight` property in the `.sample` selector to see the weight of the text change (e.g., 200, 700). Click "Play" in the code blocks below to edit the example in the MDN Playground:
    
    <p class="sample">
      ...it would not be wonderful to meet a Megalosaurus, forty feet long or so,
      waddling like an elephantine lizard up Holborn Hill.
    </p>
    
    
    @font-face {
      src: url("https://mdn.github.io/shared-assets/fonts/variable-fonts/MutatorSans.ttf");
      font-family: "MutatorSans";
      font-style: normal;
      font-weight: 1 1000;
    }
    
    .sample {
      text-transform: uppercase;
      font-weight: 500;
      font-size: 1.5rem;
      font-family: "MutatorSans", sans-serif;
    }
    
## Accessibility
People experiencing low vision conditions may have difficulty reading text set with a `font-weight` value of `100` (Thin/Hairline) or `200` (Extra Light), especially if the font has a low contrast color ratio.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0


## Examples
>
### Setting font weights
#### HTML
    
    <p>
      Alice was beginning to get very tired of sitting by her sister on the bank,
      and of having nothing to do: once or twice she had peeped into the book her
      sister was reading, but it had no pictures or conversations in it, "and what
      is the use of a book," thought Alice "without pictures or conversations?"
    </p>
    
    <div>
      I'm heavy<br />
      <span>I'm lighter</span>
    </div>
    
#### CSS
    
    /* Set paragraph text to be bold. */
    p {
      font-weight: bold;
    }
    
    /* Set div text to two steps heavier than
       normal but less than a standard bold. */
    div {
      font-weight: 600;
    }
    
    /* Set span text to be one step lighter
       than its parent. */
    span {
      font-weight: lighter;
    }
    
#### Result
# shape-outside
The `shape-outside` CSS property defines a shape—which may be non-rectangular—around which adjacent inline content should wrap. By default, inline content wraps around its margin box; `shape-outside` provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than rectangular boxes.
## Try it
    
    shape-outside: circle(50%);
    
    
    shape-outside: ellipse(130px 140px at 20% 20%);
    
    
    shape-outside: url("/shared-assets/images/examples/round-balloon.png");
    
    
    shape-outside: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <img
          class="transition-all"
          id="example-element"
          src="/shared-assets/images/examples/round-balloon.png"
          width="150" />
        We had agreed, my companion and I, that I should call for him at his house,
        after dinner, not later than eleven o’clock. This athletic young Frenchman
        belongs to a small set of Parisian sportsmen, who have taken up “ballooning”
        as a pastime. After having exhausted all the sensations that are to be found
        in ordinary sports, even those of “automobiling” at a breakneck speed, the
        members of the “Aéro Club” now seek in the air, where they indulge in all
        kinds of daring feats, the nerve-racking excitement that they have ceased to
        find on earth.
      </div>
    </section>
    
    
    .example-container {
      text-align: left;
      padding: 20px;
    }
    
    #example-element {
      float: left;
      width: 150px;
      margin: 20px;
    }
    
## Syntax
    
    /* Keyword values */
    shape-outside: none;
    shape-outside: margin-box;
    shape-outside: content-box;
    shape-outside: border-box;
    shape-outside: padding-box;
    
    /* Function values */
    shape-outside: circle();
    shape-outside: ellipse();
    shape-outside: inset(10px 10px 10px 10px);
    shape-outside: polygon(10px 10px, 20px 20px, 30px 30px);
    
    /* Shape box with basic shape */
    shape-outside: circle() border-box;
    shape-outside: margin-box ellipse();
    
    /* <url> value */
    shape-outside: url("image.png");
    
    /* <gradient> value */
    shape-outside: linear-gradient(45deg, white 150px, red 150px);
    
    /* Global values */
    shape-outside: inherit;
    shape-outside: initial;
    shape-outside: revert;
    shape-outside: revert-layer;
    shape-outside: unset;
    
The `shape-outside` property is specified using the values from the list below, which define the float area for float elements. The float area determines the shape around which inline content (float elements) wrap.
### Values
`none`
    
The float area is unaffected. Inline content wraps around the element's margin box, like usual.
`<shape-box>`
    
The float area is computed according to the shape of a float element's edges (as defined by the CSS box model). This can be `margin-box`, `border-box`, `padding-box`, or `content-box`. The shape includes any curvature created by the `border-radius` property (behavior which is similar to `background-clip`).
`margin-box`
    
Defines the shape enclosed by the outside margin edge. The corner radii of this shape are determined by the corresponding `border-radius` and `margin` values. If the `border-radius / margin` ratio is `1` or more, then the margin box corner radius is `border-radius + margin`. If the ratio is less than `1`, then the margin box corner radius is `border-radius + (margin * (1 + (ratio - 1) ^ 3))`.
`border-box`
    
Defines the shape enclosed by the outside border edge. The shape follows the normal border radius shaping rules for the outside of the border.
`padding-box`
    
Defines the shape enclosed by the outside padding edge. The shape follows the normal border radius shaping rules for the inside of the border.
`content-box`
    
Defines the shape enclosed by the outside content edge. Each corner radius of this box is the larger of `0` or `border-radius - border-width - padding`.
`<basic-shape>`
    
The float area is computed based on the shape created by an `inset()`, `circle()`, `ellipse()`, or `polygon()` function; other `<basic-shape>` functions are invalid. If a `<shape-box>` is also supplied, it defines the reference box for the `<basic-shape>` function. Otherwise, the reference box defaults to `margin-box`.
`<image>`
    
The float area is extracted and computed based on the alpha channel of the specified `<image>` as defined by `shape-image-threshold`.
Note: If the image is invalid, the effect is as if the keyword `none` had been specified. Additionally, the image must be served with CORS headers allowing its use.
## Examples
>
### Funneling text
#### HTML
    
    <div class="main">
      <div class="left"></div>
      <div class="right"></div>
      <p>
        Sometimes a web page's text content appears to be funneling your attention
        towards a spot on the page to drive you to follow a particular link.
        Sometimes you don't notice.
      </p>
    </div>
    
#### CSS
    
    .main {
      width: 530px;
    }
    
    .left,
    .right {
      background-color: lightgray;
      height: 12ex;
      width: 40%;
    }
    
    .left {
      clip-path: polygon(0 0, 100% 100%, 0 100%);
      float: left;
      shape-outside: polygon(0 0, 100% 100%, 0 100%);
    }
    
    .right {
      clip-path: polygon(100% 0, 100% 100%, 0 100%);
      float: right;
      shape-outside: polygon(100% 0, 100% 100%, 0 100%);
    }
    
    p {
      text-align: center;
    }
    
#### Result
# :default
The `:default` CSS pseudo-class selects form elements that are the default in a group of related elements.
## Try it
    
    label,
    input[type="submit"] {
      display: block;
      margin-top: 1em;
    }
    
    input:default {
      border: none;
      outline: 2px solid deeppink;
    }
    
    
    <form>
      <p>How did you find out about us?</p>
      <label
        ><input name="origin" type="radio" value="google" checked /> Google</label
      >
      <label><input name="origin" type="radio" value="facebook" /> Facebook</label>
      <p>Please agree to our terms:</p>
    
      <label
        ><input name="newsletter" type="checkbox" checked /> I want to subscribe to
        a personalized newsletter.</label
      >
    
      <label
        ><input name="privacy" type="checkbox" /> I have read and I agree to the
        Privacy Policy.</label
      >
    
      <input type="submit" value="Submit form" />
    </form>
    
What this selector matches is defined in HTML Standard §4.16.3 Pseudo-classes — it may match the `<button>`, `<input type="checkbox">`, `<input type="radio">`, and `<option>` elements:
  * A default option element is the first one with the `selected` attribute, or the first enabled option in DOM order. `multiple` `<select>`s can have more than one `selected` option, so all will match `:default`.
  * `<input type="checkbox">` and `<input type="radio">` match if they have the `checked` attribute.
  * `<button>` matches if it is a `<form>`'s default submission button: the first `<button>` in DOM order that belongs to the form. This also applies to `<input>` types that submit forms, like `image` or `submit`.


## Syntax
    
    :default {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <fieldset>
      <legend>Favorite season</legend>
    
      <input type="radio" name="season" id="spring" value="spring" />
      <label for="spring">Spring</label>
    
      <input type="radio" name="season" id="summer" value="summer" checked />
      <label for="summer">Summer</label>
    
      <input type="radio" name="season" id="fall" value="fall" />
      <label for="fall">Fall</label>
    
      <input type="radio" name="season" id="winter" value="winter" />
      <label for="winter">Winter</label>
    </fieldset>
    
### CSS
    
    input:default {
      box-shadow: 0 0 2px 1px coral;
    }
    
    input:default + label {
      color: coral;
    }
    
### Result
# :local-link
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:local-link` CSS pseudo-class represents a link to the same document. Therefore an element that is the source anchor of a hyperlink whose target's absolute URL matches the element's own document URL.
    
    /* Selects any <a> that links to the current document */
    a:local-link {
      color: green;
    }
    
## Syntax
    
    :local-link {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <a href="#target">This is a link on the current page.</a><br />
    <a href="https://example.com">This is an external link</a><br />
    
### CSS
    
    a:local-link {
      color: green;
    }
    
### Result
Currently, no browsers support this feature.
# text-rendering
The `text-rendering` CSS property provides information to the rendering engine about what to optimize for when rendering text.
The browser makes trade-offs among speed, legibility, and geometric precision.
Note: The `text-rendering` property is an SVG property that is not defined in any CSS standard. However, Gecko and WebKit browsers let you apply this property to HTML and XML content on Windows, macOS, and Linux.
One very visible effect is `optimizeLegibility`, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example, Microsoft's Calibri, Candara, Constantia, and Corbel, or the DejaVu font family).
## Syntax
    
    /* Keyword values */
    text-rendering: auto;
    text-rendering: optimizeSpeed;
    text-rendering: optimizeLegibility;
    text-rendering: geometricPrecision;
    
    /* Global values */
    text-rendering: inherit;
    text-rendering: initial;
    text-rendering: revert;
    text-rendering: revert-layer;
    text-rendering: unset;
    
### Values
`auto`
    
The browser makes educated guesses about when to optimize for speed, legibility, and geometric precision while drawing text. For differences in how this value is interpreted by the browser, see the compatibility table.
The `auto` value is a good default for balancing quality and performance, especially for extended bodies of plain text.
`optimizeSpeed`
    
The browser emphasizes rendering speed over legibility and geometric precision when drawing text. It disables kerning and ligatures.
The `optimizeSpeed` value is preferable in resource-constrained rendering scenarios, such as slow processors or low battery.
`optimizeLegibility`
    
The browser emphasizes legibility over rendering speed and geometric precision. This enables kerning and optional ligatures.
The `optimizeLegibility` value is preferable for texts that are large in size but short in content, such as headers or banners, to enhance their readability. It could also be used for high-quality professional typography such as published articles. It's not recommended for typical articles due to potential performance impacts.
`geometricPrecision`
    
The browser emphasizes geometric precision over rendering speed and legibility. Certain aspects of fonts — such as kerning — don't scale linearly. So this value can make text using those fonts look good.
In SVG, when text is scaled up or down, browsers calculate the final size of the text (which is determined by the specified font size and the applied scale) and request a font of that computed size from the platform's font system. But if you request a font size of, say, 9 with a scale of 140%, the resulting font size of 12.6 doesn't explicitly exist in the font system, so the browser rounds the font size to 12 instead. This results in stair-step scaling of text.
But the `geometricPrecision` property — when fully supported by the rendering engine — lets you scale your text fluidly. For large scale factors, you might see less-than-beautiful text rendering, but the size is what you would expect—neither rounded up nor down to the nearest font size supported by Windows or Linux.
The `geometricPrecision` value optimizes neither readability nor performance. It usually makes sense in SVG, where you want your graphic to scale faithfully without distorting the text dimensions.
Note: WebKit precisely applies the specified value, but Gecko treats the value the same as `optimizeLegibility`.
## Examples
>
### Automatic application of optimizeLegibility
This demonstrates how `optimizeLegibility` is used by browsers automatically when the `font-size` is smaller than `20px`.
#### HTML
    
    <p class="small">LYoWAT - ff fi fl ffl</p>
    <p class="big">LYoWAT - ff fi fl ffl</p>
    
#### CSS
    
    .small {
      font:
        19.9px "Constantia",
        "Times New Roman",
        "Georgia",
        "Palatino",
        serif;
    }
    .big {
      font:
        20px "Constantia",
        "Times New Roman",
        "Georgia",
        "Palatino",
        serif;
    }
    
#### Result
### optimizeSpeed vs. optimizeLegibility
This example shows the difference between the appearance of `optimizeSpeed` and `optimizeLegibility` (in your browser; other browsers may vary).
#### HTML
    
    <p class="speed">LYoWAT - ff fi fl ffl</p>
    <p class="legibility">LYoWAT - ff fi fl ffl</p>
    
#### CSS
    
    p {
      font:
        1.5em "Constantia",
        "Times New Roman",
        "Georgia",
        "Palatino",
        serif;
    }
    
    .speed {
      text-rendering: optimizeSpeed;
    }
    .legibility {
      text-rendering: optimizeLegibility;
    }
    
#### Result
# grid-template-rows
The `grid-template-rows` CSS property defines the line names and track sizing functions of the grid rows.
## Try it
    
    grid-template-rows: auto;
    
    
    grid-template-rows: 40px 4em 40px;
    
    
    grid-template-rows: 1fr 2fr 1fr;
    
    
    grid-template-rows: 3ch auto minmax(10px, 60px);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-gap: 10px;
      width: 200px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Syntax
    
    /* Keyword value */
    grid-template-rows: none;
    
    /* <track-list> values */
    grid-template-rows: 100px 1fr;
    grid-template-rows: [line-name] 100px;
    grid-template-rows: [line-name1] 100px [line-name2 line-name3];
    grid-template-rows: minmax(100px, 1fr);
    grid-template-rows: fit-content(40%);
    grid-template-rows: repeat(3, 200px);
    grid-template-rows: subgrid;
    grid-template-rows: masonry;
    
    /* <auto-track-list> values */
    grid-template-rows: 200px repeat(auto-fill, 100px) 300px;
    grid-template-rows:
      minmax(100px, max-content)
      repeat(auto-fill, 200px) 20%;
    grid-template-rows:
      [line-name1] 100px [line-name2]
      repeat(auto-fit, [line-name3 line-name4] 300px)
      100px;
    grid-template-rows:
      [line-name1 line-name2] 100px
      repeat(auto-fit, [line-name1] 300px) [line-name3];
    
    /* Global values */
    grid-template-rows: inherit;
    grid-template-rows: initial;
    grid-template-rows: revert;
    grid-template-rows: revert-layer;
    grid-template-rows: unset;
    
This property may be specified as:
  * either the keyword value `none`
  * or a `<track-list>` value
  * or an `<auto-track-list>` value.


### Values
`none`
    
A keyword meaning that there is no explicit grid. Any rows will be implicitly generated and their size will be determined by the `grid-auto-rows` property.
`[line-name]`
    
A `<custom-ident>` specifying a name for the line in that location. The ident may be any valid string other than the reserved words `span` and `auto`. Lines may have multiple names separated by a space inside the square brackets, for example `[line-name-a line-name-b]`.
`<length>`
    
A non-negative length.
`<percentage>`
    
A non-negative `<percentage>` value, relative to the block size of the grid container. If the size of the grid container depends on the size of its tracks, the browser treats the percentage as `auto` for the purpose of calculating the intrinsic size of the grid container. The percentage is then resolved against the resulting grid container size for laying out the grid and its items. The browser may adjust the intrinsic size contributions of the track to the size of the grid container and may increase the final size of the track by the minimum amount that would result in honoring the percentage.
`<flex>`
    
A non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor. When appearing outside a `minmax()` notation, it implies an automatic minimum (i.e., `minmax(auto, <flex>)`).
`max-content`
    
A keyword representing the largest maximal content contribution of the grid items occupying the grid track.
`min-content`
    
A keyword representing the largest minimal content contribution of the grid items occupying the grid track.
`minmax(min, max)`
    
A functional notation that defines a size range, greater than or equal to min, and less than or equal to max. If max is smaller than min, then max is ignored and the function is treated as min. As a maximum, a `<flex>` value sets the track's flex factor. It is invalid as a minimum.
`auto`
    
As a maximum value, it represents the largest `max-content` size of the items in that track.
As a minimum value, it represents the largest minimum size of items in that track (specified by the `min-width`/`min-height` properties of the items). This often corresponds to the `min-content` size, but not always.
If used outside of `minmax()` notation, `auto` represents the range between the minimum and maximum values described above. In most cases, this behaves similarly to `minmax(min-content,max-content)`.
Note: `auto` track sizes (and only `auto` track sizes) can be stretched by the `align-content` and `justify-content` properties. Therefore, by default, an `auto`-sized track will take up any remaining space in the grid container.
`fit-content( [ <length> | <percentage> ] )`
    
Represents the formula `min(max-content, max(auto, argument))`, which is calculated similar to `auto` (i.e., `minmax(auto, max-content)`), except that the track size is clamped at argument if it is greater than the `auto` minimum.
`repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> )`
    
Represents a repeated fragment of the track list, allowing a large number of rows that exhibit a recurring pattern to be written in a more compact form.
`masonry`
    
Indicates that this axis should be laid out according to the masonry algorithm.
`subgrid`
    
Indicates that the grid will adopt the spanned portion of its parent grid in that axis. Rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid's definition.
## Examples
>
### Specifying grid row sizes
#### HTML
    
    <div id="grid">
      <div id="areaA">A</div>
      <div id="areaB">B</div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 100px;
      grid-template-rows: 30px 1fr;
    }
    
    #areaA {
      background-color: lime;
    }
    
    #areaB {
      background-color: yellow;
    }
    
#### Result
# :last-child
The `:last-child` CSS pseudo-class represents the last element among a group of sibling elements.
## Try it
    
    p {
      font-weight: bold;
    }
    
    li:last-child {
      border: 2px solid orange;
    }
    
    
    <p>Track &amp; field champions:</p>
    <ul>
      <li>Adhemar da Silva</li>
      <li>Wang Junxia</li>
      <li>Wilma Rudolph</li>
      <li>Babe Didrikson-Zaharias</li>
      <li>Betty Cuthbert</li>
      <li>Fanny Blankers-Koen</li>
      <li>Florence Griffith-Joyner</li>
      <li>Irena Szewinska</li>
      <li>Jackie Joyner-Kersee</li>
      <li>Shirley Strickland</li>
      <li>Carl Lewis</li>
      <li>Emil Zatopek</li>
      <li>Haile Gebrselassie</li>
      <li>Jesse Owens</li>
      <li>Jim Thorpe</li>
      <li>Paavo Nurmi</li>
      <li>Sergei Bubka</li>
      <li>Usain Bolt</li>
    </ul>
    
## Syntax
    
    :last-child {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <div>
      <p>This text isn't selected.</p>
      <p>This text is selected!</p>
    </div>
    
    <div>
      <p>This text isn't selected.</p>
      <h2>This text isn't selected: it's not a `p`.</h2>
    </div>
    
#### CSS
    
    p:last-child {
      color: lime;
      background-color: black;
      padding: 5px;
    }
    
#### Result
### Styling a list
#### HTML
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>
        Item 3
        <ul>
          <li>Item 3.1</li>
          <li>Item 3.2</li>
          <li>Item 3.3</li>
        </ul>
      </li>
    </ul>
    
#### CSS
    
    ul li {
      color: blue;
    }
    
    ul li:last-child {
      border: 1px solid red;
      color: red;
    }
    
#### Result
# scroll-marker-group
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `scroll-marker-group` CSS property controls whether a scroll container has a `::scroll-marker-group` pseudo-element generated and, if so, whether it should be placed immediately `before` or `after` the container's contents in the default visual and tabbing order.
## Syntax
    
    /* Single values */
    scroll-marker-group: before;
    scroll-marker-group: after;
    scroll-marker-group: none;
    
    /* Global values */
    scroll-marker-group: inherit;
    scroll-marker-group: initial;
    scroll-marker-group: revert;
    scroll-marker-group: revert-layer;
    scroll-marker-group: unset;
    
### Values
`after`
    
A `::scroll-marker-group` pseudo-element is generated as a sibling of the scroll container's child DOM elements, immediately preceding them, and any generated `::scroll-button()` pseudo-elements. It appears at the end of the container's tab order and layout box order (but not DOM structure).
`before`
    
A `::scroll-marker-group` pseudo-element is generated as a sibling of the scroll container's child DOM elements, immediately preceding them, and any generated `::scroll-button()` pseudo-elements. The scroll marker group appears at the start of the container's tab order and layout box order.
`none`
    
No `::scroll-marker-group` pseudo-element will be generated on the element. This is the default value.
Note: It is a best practice to match the visual rendering position of the scroll marker group with the tab order. When positioning the marker group at the start of the content with styles applied to `::scroll-marker-group`, put it at the beginning of the tab order using `before`. When positioning the group at the end of the content, put it at the end of the tab order using `after`.
## Examples
See Creating CSS carousels for full examples that use the `scroll-marker-group` property.
### Placement of the scroll markers
In this example, we demonstrate the three values of the `scroll-marker-group` property.
#### HTML
We have a basic HTML `<ul>` list with several `<li>` list items.
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>
      <li>Item 7</li>
      <li>Item 8</li>
    </ul>
    
#### CSS
We convert our `<ul>` into a carousel by setting the `display` to `flex`, creating a single, non-wrapping row of `<li>` elements. The `overflow-x` property is set to `auto`, meaning if the items overflow their container on the x-axis, the content will scroll horizontally. We then convert the `<ul>` into a scroll-snap container, ensuring that items always snap into place when the container is scrolled with a `scroll-snap-type` value of `mandatory`.
We create a scroll marker group with the `scroll-marker-group` property, placing the group after all the content.
    
    ul {
      display: flex;
      gap: 4vw;
      padding-left: 0;
      margin: 32px 0;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
    
      scroll-marker-group: after;
    }
    
Next, we style the `<li>` elements, using the `flex` property to make them `33%` of the width of the container. The `scroll-snap-align` value of `start` makes the left-hand side of the left-most visible item snap to the left edge of the container when the content is scrolled.
    
    li {
      list-style-type: none;
      background-color: #eeeeee;
      flex: 0 0 33%;
      scroll-snap-align: start;
      text-align: center;
      line-height: 5;
    }
    
We then use the `::scroll-marker` pseudo-element to create a square marker for each list item with a red border, and apply styles to the `::scroll-marker-group` pseudo-element to lay out the scroll markers in a row with a `0.2em` gap between each one.
    
    li::scroll-marker {
      content: " ";
      border: 1px solid red;
      height: 1em;
      width: 1em;
    }
    
    ::scroll-marker-group {
      display: flex;
      gap: 0.2em;
    }
    
Finally, to ensure good user experience, we style the marker of the currently-scrolled element differently from the others, targeting the marker with the `:target-current` pseudoclass.
    
    ::scroll-marker:target-current {
      background: red;
    }
    
#### Result
Note the placement of the scroll marker group. Check out how the keyboard tabbing order is different for `before` versus `after`, and note how the group disappears when the value is set to `none`.
# atan()
The `atan()` CSS function is a trigonometric function that returns the inverse tangent of a number between `-∞` and `+∞`. The function contains a single calculation that returns the number of radians representing an `<angle>` between `-90deg` and `90deg`.
## Syntax
    
    /* Single <number> values */
    transform: rotate(atan(1));
    transform: rotate(atan(4 * 50));
    
    /* Other values */
    transform: rotate(atan(pi / 2));
    transform: rotate(atan(e * 3));
    
### Parameters
The `atan(number)` function accepts only one value as its parameter.
`number`
    
A calculation which resolves to a `<number>` between `-∞` and `+∞`.
### Return value
The inverse tangent of an `number` will always return an `<angle>` between `-90deg` and `90deg`.
  * If `number` is `0⁻`, the result is `0⁻`.
  * If `number` is `+∞` the result is `90deg`.
  * If `number` is `-∞` the result is `-90deg`.


That is:
  * `atan(-infinity)` representing `-90deg`.
  * `atan(-1)` representing `-45deg`
  * `atan(0)` representing `0deg`
  * `atan(1)` representing `45deg`
  * `atan(infinity)` representing `90deg`.


## Examples
>
### Rotate elements
The `atan()` function can be used to `rotate` elements as it return an `<angle>`.
#### HTML
    
    <div class="box box-1"></div>
    <div class="box box-2"></div>
    <div class="box box-3"></div>
    <div class="box box-4"></div>
    <div class="box box-5"></div>
    
#### CSS
    
    div.box {
      width: 100px;
      height: 100px;
      background: linear-gradient(orange, red);
    }
    div.box-1 {
      transform: rotate(atan(-99999));
    }
    div.box-2 {
      transform: rotate(atan(-1));
    }
    div.box-3 {
      transform: rotate(atan(0));
    }
    div.box-4 {
      transform: rotate(atan(1));
    }
    div.box-5 {
      transform: rotate(atan(99999));
    }
    
#### Result
# container-type
An element can be established as a query container using the `container-type` CSS property. `container-type` is used to define the type of container context used in a container query. The available container contexts are:
  * Size: Enable selectively applying CSS rules to a container's children based on a general size or inline size condition such as a maximum or minimum dimension, aspect ratio, or orientation.
  * Scroll-state: Enable selectively applying CSS rules to a container's children based on a scroll-state condition such as whether the container is a scroll container that is partially scrolled or whether the container is a snap target that is going to be snapped to its scroll snap container.


Note: When using the `container-type` and `container-name` properties, the `style` and `layout` values of the `contain` property are automatically applied.
## Syntax
    
    /* Keyword values */
    container-type: normal;
    container-type: size;
    container-type: inline-size;
    container-type: scroll-state;
    
    /* Two values */
    container-type: size scroll-state;
    
    /* Global Values */
    container-type: inherit;
    container-type: initial;
    container-type: revert;
    container-type: revert-layer;
    container-type: unset;
    
### Values
The `container-type` property can take a single value from the list below, or two values — one must be `scroll-state` and the other can be `inline-size` or `size`. In other words, an element can be established as a size query container, a scroll-state query container, both, or neither.
`inline-size`
    
Establishes a query container for dimensional queries on the inline axis of the container. Applies layout, style, and inline-size containment to the element.
Inline size containment is applied to the element. The inline size of the element can be computed in isolation, ignoring the child elements (see Using CSS containment).
`normal`
    
Default value. The element is not a query container for any container size queries, but remains a query container for container style queries.
`scroll-state`
    
Establishes a query container for scroll-state queries on the container. In this case, the size of the element is not computed in isolation; no containment is applied.
`size`
    
Establishes a query container for container size queries in both the inline and block dimensions. Applies layout containment, style containment, and size containment to the container.
Size containment is applied to the element in both the inline and block directions. The size of the element can be computed in isolation, ignoring the child elements.
## Description
Container queries allow you to selectively apply styles inside a container based on conditional queries performed on the container. The `@container` at-rule is used to specify the tests performed on a container, and the rules that will apply to the container's contents if the query returns `true`.
The container query tests are only performed on elements with a `container-type` property, which defines the elements as a size or scroll-state container, or both.
### Container size queries
Container size queries allow you to selectively apply CSS rules to a container's descendants based on a size condition such as a maximum or minimum dimension, aspect ratio, or orientation.
Size containers additionally have size containment applied to them — this turns off the ability of an element to get size information from its contents, which is important for container queries to avoid infinite loops. If this were not the case, a CSS rule inside a container query could change the content size, which in turn could make the query evaluate to false and change the parent element's size, which in turn could change the content size and flip the query back to true, and so on. This sequence would then repeat itself in an endless loop.
The container size has to be set by context, such as block-level elements that stretch to the full width of their parent, or explicitly defined. If a contextual or explicit size is not available, elements with size containment will collapse.
### Container scroll-state queries
Container scroll-state queries allow you to selectively apply CSS rules to a container's children based on a scroll-state condition such as:
  * Whether the container's contents are partially scrolled.
  * Whether the container is a snap target that is going to be snapped to a scroll snap container.
  * Whether the container is positioned via `position: sticky` and stuck to a boundary of a scrolling container.


In the first case, the queried container is the scroll container itself. In the other two cases the queried container is an element that is affected by the scroll position of an ancestor scroll container.
## Examples
>
### Establishing inline size containment
Given the following HTML example which is a card component with an image, a title, and some text:
    
    <div class="container">
      <div class="card">
        <h3>Normal card</h3>
        <div class="content">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </div>
      </div>
    </div>
    
    <div class="container wide">
      <div class="card">
        <h3>Wider card</h3>
        <div class="content">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </div>
      </div>
    </div>
    
To create a container context, add the `container-type` property to an element. The following uses the `inline-size` value to create a containment context for the inline axis of the container:
    
    .container {
      container-type: inline-size;
      width: 300px;
      height: 120px;
    }
    
    .wide {
      width: 500px;
    }
    
Writing a container query via the `@container` at-rule will apply styles to the elements of the container when it is wider than 400px:
    
    @container (width > 400px) {
      .card {
        display: grid;
        grid-template-columns: 1fr 2fr;
      }
    }
    
# list-style-position
The `list-style-position` CSS property sets the position of the `::marker` relative to a list item.
## Try it
    
    list-style-position: inside;
    
    
    list-style-position: outside;
    
    
    <section class="default-example" id="default-example">
      <div>
        <p>NASA Notable Missions</p>
        <ul class="transition-all" id="example-element">
          <li>Apollo 11: First Human Landing</li>
          <li>City in Space: The International Space Station</li>
          <li>Great Observatory: The Hubble Space Telescope</li>
          <li>Everlasting Mars Rovers</li>
        </ul>
      </div>
    </section>
    
    
    .default-example {
      font-size: 1.2rem;
    }
    
    #example-element {
      width: 100%;
      background: #be094b;
      color: white;
    }
    
    section {
      text-align: left;
      flex-direction: column;
    }
    
    hr {
      width: 50%;
      color: lightgray;
      margin: 0.5em;
    }
    
    .note {
      font-size: 0.8rem;
    }
    
    .note a {
      color: #009e5f;
    }
    
    @counter-style space-counter {
      symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
      suffix: " ";
    }
    
## Syntax
    
    /* Keyword values */
    list-style-position: inside;
    list-style-position: outside;
    
    /* Global values */
    list-style-position: inherit;
    list-style-position: initial;
    list-style-position: revert;
    list-style-position: revert-layer;
    list-style-position: unset;
    
The `list-style-position` property is specified as one of the keyword values listed below.
### Values
`inside`
    
The `::marker` is the first element among the list item's contents.
`outside`
    
The `::marker` is outside the principal block box. This is the default value for `list-style`.
## Description
This property is applied to list items, i.e., elements with ``display`: list-item;`. By default this includes `<li>` elements. Because this property is inherited, it can be set on the parent element (normally `<ol>` or `<ul>`) to let it apply to all list items.
If a block element is the first child of a list element declared as `list-style-position: inside`, then the block element is placed on the line after the marker-box.
It is often more convenient to use the shorthand `list-style`.
## Examples
>
### Setting list item position
#### HTML
    
    <p>List 1</p>
    <ul class="inside">
      <li>List Item 1-1</li>
      <li>List Item 1-2</li>
      <li>List Item 1-3</li>
      <li>List Item 1-4</li>
    </ul>
    <p>List 2</p>
    <ul class="outside">
      <li>List Item 2-1</li>
      <li>List Item 2-2</li>
      <li>List Item 2-3</li>
      <li>List Item 2-4</li>
    </ul>
    <p>List 3</p>
    <ul class="inside-img">
      <li>List Item 3-1</li>
      <li>List Item 3-2</li>
      <li>List Item 3-3</li>
      <li>List Item 3-4</li>
    </ul>
    
#### CSS
    
    .inside {
      list-style-position: inside;
      list-style-type: square;
    }
    
    .outside {
      list-style-position: outside;
      list-style-type: circle;
    }
    
    .inside-img {
      list-style-position: inside;
      list-style-image: url("star-solid.gif");
    }
    
#### Result
# :enabled
The `:enabled` CSS pseudo-class represents any enabled element. An element is enabled if it can be activated (selected, clicked on, typed into, etc.) or accept focus. The element also has a disabled state, in which it can't be activated or accept focus.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    *:enabled {
      background-color: gold;
    }
    
    
    <form>
      <label for="name">Name:</label>
      <input id="name" name="name" type="text" />
    
      <label for="emp">Employed:</label>
      <select id="emp" name="emp" disabled>
        <option>No</option>
        <option>Yes</option>
      </select>
    
      <label for="empDate">Employment Date:</label>
      <input id="empDate" name="empDate" type="date" disabled />
    
      <label for="resume">Resume:</label>
      <input id="resume" name="resume" type="file" />
    </form>
    
## Syntax
    
    :enabled {
      /* ... */
    }
    
## Examples
The following example makes the color of text and button `<input>`s green when enabled, and gray when disabled. This helps the user understand which elements can be interacted with.
### HTML
    
    <form action="url_of_form">
      <label for="FirstField">First field (enabled):</label>
      <input type="text" id="FirstField" value="Lorem" /><br />
    
      <label for="SecondField">Second field (disabled):</label>
      <input type="text" id="SecondField" value="Ipsum" disabled /><br />
    
      <input type="button" value="Submit" />
    </form>
    
### CSS
    
    input:enabled {
      color: #22bb22;
    }
    
    input:disabled {
      color: #aaaaaa;
    }
    
### Result
# @charset
The `@charset` CSS rule specifies the character encoding used in the style sheet. This syntax is useful when using non-ASCII characters in some CSS properties, like `content`. Although the first character in `@charset` is the `@` symbol, it is not an at-rule. It is a specific byte sequence that can only be placed at the very beginning of a stylesheet. No other characters, except the Unicode byte-order mark, are allowed before it. It also does not follow normal CSS syntax rules such as use of quotes or whitespace.
If a `@charset` is not recognized as the charset declaration, it is parsed as a normal at-rule. The CSS syntax module deprecates this fallback behavior, defining it as an unrecognized legacy rule to be dropped when a stylesheet is grammar-checked.
As there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result):
  1. The value of the Unicode byte-order character placed at the beginning of the file.
  2. The value given by the `charset` attribute of the `Content-Type:` HTTP header or the equivalent in the protocol used to serve the style sheet.
  3. The `@charset` CSS declaration.
  4. Use the character encoding defined by the referring document: the `charset` attribute of the `<link>` element. This method is obsolete and should not be used.
  5. Assume that the document is UTF-8.


## Syntax
    
    @charset "UTF-8";
    @charset "iso-8859-15";
    
### Parameters
charset
    
A `<string>` denoting the character encoding to be used. It must be the name of a web-safe character encoding defined in the IANA-registry, and must be double-quoted, following exactly one space character (U+0020), and immediately terminated with a semicolon. If several names are associated with an encoding, only the one marked with preferred must be used.
## Examples
>
### Valid and invalid charset declarations
    
    @charset "UTF-8"; /* Set the encoding of the style sheet to Unicode UTF-8 */
    
    
    @charset 'iso-8859-15'; /* Invalid, wrong quotes used */
    @charset  "UTF-8"; /* Invalid, more than one space */
     @charset "UTF-8"; /* Invalid, there is a character (a space) before the declarations */
    @charset UTF-8; /* Invalid, the charset is a CSS <string> and requires double-quotes */
    
# mask-border-repeat
The `mask-border-repeat` CSS property specifies how the images for the sides and the middle part of the mask border image are scaled and tiled.
## Syntax
    
    /* Keyword value */
    mask-border-repeat: stretch;
    mask-border-repeat: repeat;
    mask-border-repeat: round;
    mask-border-repeat: space;
    
    /* top and bottom | left and right */
    mask-border-repeat: round stretch;
    
    /* Global values */
    mask-border-repeat: inherit;
    mask-border-repeat: initial;
    mask-border-repeat: revert;
    mask-border-repeat: revert-layer;
    mask-border-repeat: unset;
    
The `mask-border-repeat` property may be specified using one or two values chosen from the list of values below.
  * When one value is specified, it applies the same behavior on all four sides.
  * When two values are specified, the first applies to the top and bottom, the second to the left and right.


### Values
`stretch`
    
The source image's edge regions are stretched to fill the gap between each border.
`repeat`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be clipped to achieve the proper fit.
`round`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be stretched to achieve the proper fit.
`space`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Extra space will be distributed in between tiles to achieve the proper fit.
## Examples
>
### Basic usage
This property doesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to define how the border mask slice will repeat around the border — i.e., will it just repeat, or be scaled slightly so a whole number of slices fits, or be stretched so one slice fits?
    
    mask-border-repeat: round;
    
Chromium-based browsers support an outdated version of this property — `mask-box-image-repeat` — with a prefix:
    
    -webkit-mask-box-image-repeat: round;
    
Note: The `mask-border` page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect.
# corner-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-shape` shorthand CSS property specifies the shape of a box's corners, within the area specified by its `border-radius` property value.
## Constituent properties
The `corner-shape` property is a shorthand for the following physical properties:
  * `corner-top-left-shape`
  * `corner-top-right-shape`
  * `corner-bottom-left-shape`
  * `corner-bottom-right-shape`


## Syntax
    
    /* Single value set for all four corners */
    corner-shape: bevel;
    
    /* top-left and bottom-right, top-right and bottom-left */
    corner-shape: notch superellipse(0.6);
    
    /* top-left, top-right and bottom-left, bottom-right */
    corner-shape: superellipse(-1.2) square squircle;
    
    /* top-left, top-right, bottom-right, bottom-left */
    corner-shape: scoop superellipse(-1.6) superellipse(-2.2) round;
    
    /* Global values */
    corner-shape: inherit;
    corner-shape: initial;
    corner-shape: revert;
    corner-shape: revert-layer;
    corner-shape: unset;
    
The `corner-shape` property may be specified using one, two, three, or four `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of all four corners.
  * If two values are used, the first shape applies to the top-left and bottom-right corners, and the second to the top-right and bottom-left corners.
  * If three values are used, the first shape specifies the shape of the top-left corner, the second to the top-right and bottom-left corners, and the third to the bottom-right corner.
  * If four values are used, they specify the shape of the top-left, top-right, bottom-right, and bottom-left corners, in that order (clockwise).


### Values
`<corner-shape-value>`
    
A `superellipse()` or keyword equivalent describing the shape of the corner.
## Description
The `corner-shape` property is used to modify the shape of rounded corners created by the `border-radius` property and its associated longhands. Already-rounded corners can be further customized in terms of the degree of rounding applied to them, allowing the creation of, for example, bevelled, notched, and squircle corners. Borders, outlines, shadows, and background effects applied to the container will follow the defined corner shape.
If a `border-radius` is not applied to a container, or the `border-radius` resolves to `0`, `corner-shape` will have no effect.
The `corner-shape` shorthand property and its associated `corner-*-shape` shorthands and longhands accept one to four `<corner-shape-value>` values. Each is specified directly as a `superellipse()` function or a keyword describing a common shape. Each keyword is equivalent to a specific `superellipse()` value.
The default (initial) value of `corner-shape` is `round`, which gives the same effect as using `border-radius` on its own, without `corner-shape`. There is also a keyword value `square`, which gives the same effect as default square corners, effectively removing any `border-radius` applied. The `bevel` value has the effect of drawing a straight line between the two ends of a `border-radius`.
Different `corner-shape` values can be smoothly animated between, as the `superellipse()` equivalents of the keyword values are used as interpolation values.
The `corner-shape` shorthand is especially useful when you want all four borders to be the same, or you want to set different values using a single declaration. To set only one or two corner shapes at a time, use the `corner-*-shape` shorthands and longhands.
###  `corner-*-shape` shorthands and longhands
The `corner-shape` shorthand defines the shapes of all four corners in one declaration.
To set only one corner shape at a time, use the corner shape longhands:
  * Physical longhand corner shape properties: 
    * `corner-bottom-left-shape`
    * `corner-bottom-right-shape`
    * `corner-top-left-shape`
    * `corner-top-right-shape`
  * Logical longhand corner shape properties: 
    * `corner-start-start-shape`
    * `corner-start-end-shape`
    * `corner-end-start-shape`
    * `corner-end-end-shape`


To set two corner shapes at a time, use the side shorthands:
  * Physical side shorthand properties: 
    * `corner-top-shape`
    * `corner-right-shape`
    * `corner-bottom-shape`
    * `corner-left-shape`
  * Logical side shorthand properties: 
    * `corner-block-start-shape`
    * `corner-block-end-shape`
    * `corner-inline-start-shape`
    * `corner-inline-end-shape`


### Constraining opposite corner shape radii
When opposite corners have `border-radius` and `corner-shape` values set that would cause the shapes to overlap, the browser constrains the values to prevent the overlap.
For example, the following values would cause the top-left and bottom-right corners to overlap, therefore the browser adjusts the first `border-radius` component to a value that avoids this.
    
    div {
      width: 480px;
      height: 200px;
      background-color: goldenrod;
      border-radius: 80% 20px;
      corner-shape: scoop;
    }
    
### Properties that follow the corner shape
The following properties all follow the shape of the corner when set on the container:
  * `background-color`
  * `background-image`
  * `border`
  * `outline`
  * `box-shadow`
  * `overflow`
  * `backdrop-filter`


See Demonstration of properties that follow the `corner-shape` for some examples.
## Examples
>
### Basic `corner-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div>Nice scooped corners</div>
    
#### CSS
We give the box a fixed `height`, a `box-shadow`, a `border-radius` of 30 pixels, and a `corner-shape` of `scoop`, along with some additional styles that we've hidden for brevity.
    
    div {
      height: 180px;
      box-shadow: 1px 1px 3px gray;
      border-radius: 30px;
      corner-shape: scoop;
    }
    
#### Result
The rendered result looks like this:
Note how the `corner-shape` value of `scoop` gives the container concave corners — the curve is an inversion of the default `border-radius` curve. Note also how the background, border, and box shadow follow the shape of the curve.
### Demonstration of properties that follow the `corner-shape`
#### HTML
The markup for this example contains a single `<div>` element with some text content inside it.
    
    <div>
      Some styles follow the corner shape, such as border, outline, box-shadow,
      overflow, and backdrop-filter. This is useful for helping various aspects of
      your design to not clash. As shown, it can result in some interesting visual
      effects, so you should test your design carefully.
    </div>
    
#### CSS
To demonstrate how some styles follow the shape of a container's corners, we apply a `background-image` to the document `<body>`, then apply a `border-radius` of `40px` and a `corner-shape` of `scoop notch` to the `<div>`.
We then apply the following to the `<div>`:
  * A semi-transparent `background-color`.
  * A different color and style of `border` on each edge.
  * A `backdrop-filter` that inverts the `background-image` set on the `<body>`.
  * A `:hover` style so you can see that the clickable content area falls outside the corner shape.


Additional set up styles have been hidden for brevity.
    
    body {
      background: url("https://mdn.github.io/shared-assets/images/examples/leopard.jpg")
        no-repeat;
      background-size: cover;
    }
    
    div {
      border-radius: 40px;
      corner-shape: scoop notch;
      background-color: rgb(255 255 255 / 0.2);
      border-top: 3px solid blue;
      border-left: 6px dashed red;
      border-bottom: 9px solid yellow;
      border-right: 12px double green;
      backdrop-filter: invert(100%);
    }
    
    div:hover {
      background-color: white;
    }
    
#### Result
The rendered result looks like this:
Note how most of the set styles follow the shape of the `<div>` resulting from its `corner-shape` styles, but not all. The content is displayed relative to the original box, and the hover effect is still applied if you hover over the text sticking out past the top- and bottom-left corners.
### Comparing `corner-shape` values
In this demonstration, you can select different `corner-shape` values and set different `border-radius` values on a container and compare the effects.
#### HTML
The markup for this example contains a `<select>` picker from which different `corner-shape` values can be selected, an `<input type="range">` slider to select different `border-radius` values, and a `<section>` element to create a container to apply those values to. The select `<option>` elements provide multiple keyword and `superellipse()` value choices, broken into two groups using `<optgroup>` elements. In the case of the keyword values, we've also included the `superellipse()` value equivalent for each one, separated by a pipe character.
    
    <form>
      <div>
        <label for="corner-shape-choice">Choose a corner-shape value:</label>
        <select id="corner-shape-choice">
          <optgroup label="Keywords">
            <option value="square">square | superellipse(infinity)</option>
            <option selected value="squircle">squircle | superellipse(2)</option>
            <option value="round">round | superellipse(1)</option>
            <option value="bevel">bevel | superellipse(0)</option>
            <option value="scoop">scoop | superellipse(-1)</option>
            <option value="notch">notch | superellipse(-infinity)</option>
          </optgroup>
          <optgroup label="Functions">
            <option>superellipse(3)</option>
            <option>superellipse(1.5)</option>
            <option>superellipse(0.5)</option>
            <option>superellipse(-0.5)</option>
            <option>superellipse(-1.5)</option>
            <option>superellipse(-3)</option>
          </optgroup>
        </select>
      </div>
      <div>
        <label for="radius-slider">Choose a border-radius value:</label>
        <input
          type="range"
          id="radius-slider"
          min="0"
          value="45"
          max="90"
          step="1" />
      </div>
    </form>
    <section></section>
    
#### CSS
We apply a `box-shadow` to the `<section>`. We also give the `<section>` and form elements some basic styles, which we've hidden for brevity.
    
    section {
      box-shadow: 1px 1px 3px gray;
    }
    
The JavaScript that applies the user-selected values to the `<section>` has been hidden for brevity.
#### Result
The rendered result looks like this:
Try selecting different values to see how this affects the shape of the corners.
###  `superellipse()` value comparison
In this example, we provide two `<input type="range">` sliders allowing you to cycle through many different `corner-shape` `superellipse()` values and `border-radius` values to compare the effects of each on a container.
#### HTML
The markup for this example contains two `<input type="range">` elements from which different `corner-shape` `superellipse()` and `border-radius` values can be selected, and a `<section>` element to apply those values to.
    
    <form>
      <div>
        <label for="superellipse-slider">Choose a superellipse() value:</label>
        <input
          type="range"
          id="superellipse-slider"
          min="-5"
          value="0"
          max="5"
          step="0.1" />
      </div>
      <div>
        <label for="radius-slider">Choose a border-radius value:</label>
        <input
          type="range"
          id="radius-slider"
          min="0"
          value="45"
          max="90"
          step="1" />
      </div>
    </form>
    <section></section>
    
#### CSS
We apply a `box-shadow` to the `<section>` element. Additional basic styles have been hidden for brevity.
    
    section {
      box-shadow: 1px 1px 3px gray;
    }
    
The JavaScript that applies the user-selected values to the `<section>` has been hidden for brevity.
#### Result
The rendered result looks like this:
Try selecting different values to see how this affects the shape of the corners.
### Animating `corner-shape`
In this example, we demonstrate how the `corner-shape` property can be animated.
#### HTML
The markup for this example contains a single `<div>`, with `tabindex="0"` applied so it can be focused.
    
    <div tabindex="0"></div>
    
#### CSS
We create a set of `@keyframes` that animate smoothly between the `corner-shape` values of `square` and `notch`. We then apply an `animation` based on those `@keyframes` to the `<div>` when its containing `<html>` element is hovered over or focused. Additional basic `<div>` styles have been hidden for brevity.
    
    @keyframes corner-pulse {
      from {
        corner-shape: square;
      }
    
      to {
        corner-shape: notch;
      }
    }
    
    html:hover div,
    div:focus {
      animation: corner-pulse infinite alternate 2s linear;
    }
    
#### Result
The rendered result looks like this:
Hover or focus the shape to see the animation.
# asin()
The `asin()` CSS function is a trigonometric function that returns the inverse sine of a number between `-1` and `1`. The function contains a single calculation that returns the number of radians representing an `<angle>` between `-90deg` and `90deg`.
## Syntax
    
    /* Single <number> values */
    transform: rotate(asin(-0.2));
    transform: rotate(asin(2 * 0.125));
    
    /* Other values */
    transform: rotate(asin(pi / 5));
    transform: rotate(asin(e / 3));
    
### Parameters
The `asin(number)` function accepts only one value as its parameter.
`number`
    
A calculation which resolves to a `<number>` between `-1` and `1`.
### Return value
The inverse sine of an `number` will always return an `<angle>` between `-90deg` and `90deg`.
  * If `number` is less than `-1` or greater than `1`, the result is `NaN`.
  * If `number` is `0⁻`, the result is `0⁻`.


## Examples
>
### Rotate elements
The `asin()` function can be used to `rotate` elements as it return an `<angle>`.
#### HTML
    
    <div class="box box-1"></div>
    <div class="box box-2"></div>
    <div class="box box-3"></div>
    <div class="box box-4"></div>
    <div class="box box-5"></div>
    
#### CSS
    
    div.box {
      width: 100px;
      height: 100px;
      background: linear-gradient(orange, red);
    }
    div.box-1 {
      transform: rotate(asin(1));
    }
    div.box-2 {
      transform: rotate(asin(0.5));
    }
    div.box-3 {
      transform: rotate(asin(0));
    }
    div.box-4 {
      transform: rotate(asin(-0.5));
    }
    div.box-5 {
      transform: rotate(asin(-1));
    }
    
#### Result
# CSS selectors
The CSS selectors module defines the patterns to select elements to which a set of CSS rules are then applied along with their specificity. The CSS selectors module provides us with more than 60 selectors and five combinators. Other modules provide additional pseudo-class selectors and pseudo-elements.
In CSS, selectors are patterns used to match, or select, the elements you want to style. Selectors are also used in JavaScript to enable selecting the DOM nodes to return as a `NodeList`.
Selectors, whether used in CSS or JavaScript, enable targeting HTML elements based on their type, attributes, current states, and even position in the DOM. Combinators allow you to be more precise when selecting elements by enabling selecting elements based on their relationship to other elements.
## Reference
>
### Combinators and separators
  * `+` (Next-sibling combinator)
  * `>` (Child combinator)
  * `~` (Subsequent sibling combinator)
  * " " (Descendant combinator)
  * `|` (Namespace separator)
  * `,` (Selector list)


The CSS selectors module also introduces the column combinator (`||`). Currently, no browsers support this feature.
### Selectors
  * `:active`
  * `:any-link`
  * `:autofill`
  * `:buffering`
  * `:checked`
  * `:default`
  * `:defined`
  * `:dir()`
  * `:disabled`
  * `:empty`
  * `:enabled`
  * `:first-child`
  * `:first-of-type`
  * `:focus`
  * `:focus-visible`
  * `:focus-within`
  * `:fullscreen`
  * `:future`
  * `:has()`
  * `:hover`
  * `:in-range`
  * `:indeterminate`
  * `:invalid`
  * `:is()`
  * `:lang()`
  * `:last-child`
  * `:last-of-type`
  * `:link`
  * `:matches()` (obsolete legacy selector alias for `:is()`)
  * `:modal`
  * `:muted`
  * `:not()`
  * `:nth-child()`
  * `:nth-of-type()`
  * `:nth-last-child()`
  * `:nth-last-of-type()`
  * `:only-child`
  * `:only-of-type`
  * `:open`
  * `:optional`
  * `:out-of-range`
  * `:past`
  * `:paused`
  * `:picture-in-picture`
  * `:placeholder-shown`
  * `:playing`
  * `:popover-open`
  * `:read-only`
  * `:read-write`
  * `:required`
  * `:root`
  * `:scope`
  * `:seeking`
  * `:stalled`
  * `:target`
  * `:user-invalid`
  * `:user-valid`
  * `:valid`
  * `:visited`
  * `:volume-locked`
  * `:where()`
  * `:-webkit-` pseudo-classes
  * Attribute selectors
  * Class selector
  * ID selectors
  * Type selectors
  * Universal selectors


The CSS selectors module also introduces the `:blank`, `:current`, and `:local-link` pseudo-classes. Currently, no browsers support these features.
## Terms
  * Pseudo-class glossary term
  * Functional pseudo-classes
  * Combinators
  * Simple selector
  * Compound selector
  * Complex selector
  * Relative selector
  * Specificity


## Guides
CSS selectors and combinators
    
Overview of the different types of simple selectors and various combinators defined in the CSS selectors and the CSS pseudo modules.
CSS selector structure
    
Explanation of the structure of CSS selectors and the terminologies introduced in the CSS selectors module, ranging from "simple selector" to "forgiving relative selector list".
Pseudo classes
    
Lists the pseudo-classes, selectors that allow the selection of elements based on state information that is not contained in the document tree, defined in the various CSS modules and HTML.
Using the `:target` pseudo-class in selectors
    
Learn how to use the `:target` pseudo-class to style the target element a URL's fragment identifier.
Privacy and the `:visited` selector
    
Explores the style limitations set on the `:visited` class for user privacy.
CSS building blocks: CSS selectors
    
Introduction to basic CSS selectors, including tutorials on Type, class, and ID selectors, Attribute selectors, Pseudo-classes and pseudo-elements, and Combinators.
Learn: UI pseudo-classes
    
Learn the different UI pseudo-classes available for styling forms in different states.
Locating DOM elements using selectors
    
The selectors API enables using selectors in JavaScript to retrieve element nodes from the DOM.
## Related concepts
  * `state()` pseudo-class
  * CSS nesting module
    * `&` nesting selector
  * CSS scoping module
    * `:host` pseudo-class
    * `:host()` pseudo-class
    * `:host-context()` pseudo-class
    * `:has-slotted` pseudo-class
    * `::slotted` pseudo-element
  * CSS overflow module
    * `::scroll-button()`
    * `::scroll-marker`
    * `::scroll-marker-group`
    * `:target-current`
  * CSS multi-column layout module
    * `::column`
  * CSS paged media module
    * `:left` pseudo-class
    * `:right` pseudo-class
    * `:first` pseudo-class
    * `:blank` pseudo-class
  * CSS pseudo-element module (representing entities not included in HTML)
    * `::after`
    * `::before`
    * `::file-selector-button`
    * `::first-letter`
    * `::first-line`
    * `::grammar-error`
    * `::marker`
    * `::placeholder`
    * `::selection`
    * `::spelling-error`
    * `::target-text`
  * CSS shadow parts module
    * `::part` pseudo-element
  * CSS positioned layout module
    * `::backdrop`
  * Other pseudo-elements
    * `::cue`
  * `@namespace` at-rule
  * `!important`
  * Specificity
  * Cascade
  * `Document.querySelector` method
  * `Document.querySelectorAll` method
  * `NodeList.forEach()` method


# position-area
The `position-area` CSS property enables an anchor-positioned element to be positioned relative to the edges of its associated anchor element by placing the positioned element on one or more tiles of an implicit 3x3 grid, where the anchoring element is the center cell.
`position-area` provides a convenient alternative to tethering and positioning an element relative to its anchor via inset properties and the `anchor()` function. The grid-based concept solves the common use-case of positioning the edges of the positioned element's containing block relative to the edges of its default anchor element.
If an element does not have a default anchor element, or is not an absolutely-positioned element, this property has no effect.
Note: This property was originally named and supported in Chromium browsers as `inset-area`, with the same property values. Both property names will be supported for a short while, for backwards compatibility purposes.
## Syntax
    
    /* Default value */
    position-area: none;
    
    /* Two <position-area> keywords defining a single specific tile */
    position-area: top left;
    position-area: start end;
    position-area: block-start center;
    position-area: inline-start block-end;
    position-area: x-start y-end;
    position-area: center y-self-end;
    
    /* Two <position-area> keywords spanning two tiles */
    position-area: top span-left;
    position-area: center span-start;
    position-area: inline-start span-block-end;
    position-area: y-start span-x-end;
    
    /* Two <position-area> keywords spanning three tiles */
    position-area: top span-all;
    position-area: block-end span-all;
    position-area: x-self-start span-all;
    
    /* One <position-area> keyword with an implicit second <position-area> keyword  */
    position-area: top; /* equiv: top span-all */
    position-area: inline-start; /* equiv: inline-start span-all */
    position-area: center; /* equiv: center center */
    position-area: span-all; /* equiv: center center */
    position-area: end; /* equiv: end end */
    
    /* Global values */
    position-area: inherit;
    position-area: initial;
    position-area: revert;
    position-area: revert-layer;
    position-area: unset;
    
### Values
The property value is two `<position-area>` keyterms, or the keyword `none`. If only one `<position-area>` keyterm is provided, the second keyterm is implied.
`<position-area>`
    
Specifies the area of the position area grid on which to place selected positioned elements.
`none`
    
No position area is set.
## Description
The `position-area` property provides an alternative to the `anchor()` function for positioning elements relative to anchors. `position-area` works on the concept of a 3x3 grid of tiles, called the position-area grid, with the anchor element being the center tile:
The grid tiles are broken up into rows and columns:
  * The three rows are represented by the physical values `top`, `center`, and `bottom`. They also have logical equivalents such as `block-start`, `center`, and `block-end`, and coordinate equivalents — `y-start`, `center`, and `y-end`.
  * The three columns are represented by the physical values `left`, `center`, and `right`. They also have logical equivalents such as `inline-start`, `center`, and `inline-end`, and coordinate equivalents — `x-start`, `center`, and `x-end`.


The dimensions of the center tile are defined by the containing block of the anchor element, while the dimensions of the grid's outer edge are defined by the positioned element's containing block.
The `<position-area>` value is composed of one or two keywords, which define the region of the grid the positioned element should be placed inside. To be exact, the containing block of the positioned element is set to the grid area.
For example:
  * You can specify a row value and a column value to place the positioned element in a single, specific grid square — for example, `top left` (logical equivalent `start start`) or `bottom center` (logical equivalent `end center`) will place the positioned element in the top-right or bottom-center square.
  * You can specify a row or column value plus a `span-*` value to span two or three cells. The first value specifies the row or column to place the positioned element in, placing it initially in the center, and the other one specifies the other tiles of that row or column to span. For example: 
    * `top span-left` causes the positioned element to be placed in the center of the top row, and span across the center and left tiles of that row.
    * `block-end span-inline-end` causes the positioned element to be placed in the center of the block end row, and span across the center and inline end tiles of that row.
    * `bottom span-all` and `y-end span-all` cause the positioned element to be placed in the center of the bottom row, and span across three cells, in this case the left, center, and right tiles of the bottom row.


For detailed information on anchor features, usage, and the `position-area` property, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide, specifically the section on setting a `position-area`.
### Adjusted default behavior
When a `<position-area>` value is set on a positioned element, some of its properties will have their default behavior adjusted to provide a good default alignment.
#### Self-alignment property `normal` value
The `normal` value of the self-alignment properties, including `align-items`, `align-self`, `justify-items`, and `justify-self`, behaves as either `start`, `end`, or `anchor-center`. Which value a self-alignment property defaults to depends on the positioning of the element:
  * If the `position-area` value specifies the center region in an axis, the default alignment in that axis is `anchor-center`.
  * Otherwise, the behavior is the opposite of the region specified by the `position-area` property. For example, if the `position-area` value specifies the start region of its axis, the default alignment in that axis is `end`.


For example, if the `writing-mode` is set to `horizontal-tb`, `position-area: top span-x-start` causes the positioned element to be placed in the center of the top row, and span across the center and start tiles of that row. In this case, the self-alignment properties will default to `align-self: end` and `justify-self: anchor-center`.
#### inset properties and values
When an anchor-positioned element is positioned using the `position-area` property, any inset properties set, such as `top` or `inset-inline-end`, specify offsets from the position-area. Some other property values, like `max-block-size: 100%`, will also be relative to the position-area. Any inset properties set or defaulting to `auto` will behave as if their value was set to `0`.
### An aside on positioned element width
If the positioned element does not have a specific size set on it, its size will default to its intrinsic size, but it will also be affected by the size of the position-area grid.
If the positioned element is placed in a single top-center, bottom-center, or center-center cell, its block size will be the same as the anchor's containing block size, growing up, down, or in both directions respectively. The positioned element will align with the specified grid square but adopt the same width as the anchor element. However, it won't allow its content to overflow — its minimum `width` will be its `min-content` (as defined by the width of its longest word).
If the positioned element is placed in any other single grid square (say with `position-area: top left`) or is set to span two or more grid squares (for example using `position-area: bottom span-all`), it will align with the specified grid area but behave as if it has a `width` of `max-content` set on it. It is being sized according to its containing block size, which is the size imposed on it when it was set to `position: fixed`. It will stretch as wide as the text content, although it may also be constrained by the edge of the `<body>`.
### Using `position-area` to position popovers
When using `position-area` to position popovers, be aware that the default styles for popovers may conflict with the position you're trying to achieve. The usual culprits are the default styles for `margin` and `inset`, so it's advisable to reset those:
    
    .my-popover {
      margin: 0;
      inset: auto;
    }
    
The CSS working group is looking at ways to avoid requiring this workaround.
## Examples
>
### Basic example
In this example, a positioned element is tethered and positioned relative to its associated anchor using the `position-area` property.
#### HTML
The HTML includes a `<div>` and a `<p>`. The `<p>` will be positioned relative to the `<div>` with CSS. We also include a style block that will be made visible. All elements are set to be directly editable via the `contenteditable` attribute.
    
    <div class="anchor" contenteditable="true">⚓︎</div>
    
    <p class="positionedElement" contenteditable="true">This can be edited.</p>
    
    <style contenteditable="true">.positionedElement {
        position-area: top center;
      }
    </style>
    
#### CSS
We convert the `<div>` to an anchor element with the `anchor-name` property. We then associate the absolutely-positioned `<p>` with it by setting its `position-anchor` value to the same anchor name.
We set the initial `position-area` value to `top center`. This value is set on a `p` selector, so the value has less specificity than any value added to the `<style>` block's `.positionedElement` class selector. As a result, you can override the initial `position-area` value by setting an `position-area` value inside the style block.
    
    .anchor {
      anchor-name: --infobox;
      background: palegoldenrod;
      font-size: 3em;
      width: fit-content;
      border: 1px solid goldenrod;
      margin: 100px auto;
    }
    
    p {
      position: absolute;
      position-anchor: --infobox;
      position-area: top center;
      margin: 0;
      background-color: darkkhaki;
      border: 1px solid darkolivegreen;
    }
    
    style {
      display: block;
      white-space: pre;
      font-family: monospace;
      background-color: #ededed;
      -webkit-user-modify: read-write-plaintext-only;
      line-height: 1.5;
      padding: 10px;
    }
    
#### Results
Try changing the amount of text in the anchor-positioned element to see how it grows. Also, try changing the value of the `position-area` property to something else, like `center`.
###  `position-area` value comparison
This demo creates an anchor and tethers a positioned element to it. It also provides a drop-down menu allowing you to choose various `position-area` values to apply to the positioned element, to see their effect. One of the options causes a text field to appear that enables you to enter a custom value. Finally, a checkbox is provided to turn `writing-mode: vertical-lr` on and off, allowing you to observe how `position-area` value effects differ across different writing modes.
#### HTML
In the HTML, we specify two `<div>` elements, one with a class of `anchor` and one with a class of `infobox`. These are intended to be the anchor element and the positioned element we will associate with it, respectively. We've included the `contenteditable` attribute on both, making them directly editable.
We've also included two forms that contain the `<select>` and `<input type="text">` elements for setting different `position-area` values, and the `<input type="checkbox">` element for toggling the vertical `writing-mode` on and off. The code for these, along with the JavaScript, has been hidden for the sake of brevity.
    
    <div class="anchor" contenteditable>⚓︎</div>
    
    <div class="infobox">
      <p contenteditable>You can edit this text.</p>
    </div>
    
#### CSS
In the CSS, we first declare the `anchor` `<div>` as an anchor element by setting an anchor name on it via the `anchor-name` property.
The positioned element is associated with the anchor element by setting its anchor name as the value of the positioned element's `position-anchor` property. We also give it an initial position with `position-area: top left`; this will be overridden when new values are selected from the `<select>` menu. Finally, we set its `opacity` to `0.8`, so that when the positioned element is given a `position-area` value that places it over the top of the anchor, you can still see the elements' position relative to one another.
    
    .anchor {
      anchor-name: --my-anchor;
    }
    
    .infobox {
      position-anchor: --my-anchor;
      position: fixed;
      opacity: 0.8;
      position-area: top left;
    }
    
#### Result
The result is as follows:
Try selecting new `position-area` values from the `<select>` menu to see the effect they have on the position of the infobox. Select the "Custom" value and try entering some custom `position-area` values into the text input to see their effect. Add text to the anchor and the anchor positioned elements to see how the anchor positioned element grows based on the `position-area` value. Finally, check the checkbox and then experiment with different `position-area` values to see which ones give the same result across different writing modes, and which ones give different results.
# counter-reset
The `counter-reset` CSS property creates named CSS counters and initializes them to a specific value. It supports creating counters that count up from one to the number of elements, as well as those that count down from the number of elements to one.
## Try it
    
    counter-reset: none;
    
    
    counter-reset: chapter-count 0;
    
    
    counter-reset: chapter-count;
    
    
    counter-reset: chapter-count 5;
    
    
    counter-reset: chapter-count -5;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="chapters">
        <h1>Alice's Adventures in Wonderland</h1>
        <h2>Down the Rabbit-Hole</h2>
        <h2 id="example-element">The Pool of Tears</h2>
        <h2>A Caucus-Race and a Long Tale</h2>
        <h2>The Rabbit Sends in a Little Bill</h2>
      </div>
    </section>
    
    
    #default-example {
      text-align: left;
      counter-reset: chapter-count;
    }
    
    #example-element {
      background-color: lightblue;
      color: black;
    }
    
    h2 {
      counter-increment: chapter-count;
      font-size: 1em;
    }
    
    h2::before {
      content: "Chapter " counters(chapter-count, ".") ": ";
    }
    
## Syntax
    
    /* Create a counter with initial default value 0 */
    counter-reset: my-counter;
    
    /* Create a counter and initialize as "-3" */
    counter-reset: my-counter -3;
    
    /* Create a reversed counter with initial default value */
    counter-reset: reversed(my-counter);
    
    /* Create a reversed counter and initialize as "-1" */
    counter-reset: reversed(my-counter) -1;
    
    /* Create reversed and regular counters at the same time */
    counter-reset: reversed(pages) 10 items 1 reversed(sections) 4;
    
    /* Remove all counter-reset declarations in less specific rules */
    counter-reset: none;
    
    /* Global values */
    counter-reset: inherit;
    counter-reset: initial;
    counter-reset: revert;
    counter-reset: revert-layer;
    counter-reset: unset;
    
### Values
The `counter-reset` property accepts a list of one or more space-separated counter names or the keyword `none`. For counter names, regular counters use the format `<counter-name>`, and reversed counters use `reversed(<counter-name>)`, where `<counter-name>` is a `<custom-ident>` or `list-item` for the built-in `<ol>` counter. Optionally, each counter name can be followed by an `<integer>` to set its initial value.
`<custom-ident>`
    
Specifies the counter name to create and initialize using the `<custom-ident>` format. The `reversed()` functional notation can be used to mark the counter reversed.
`<integer>`
    
The initial value to set on the newly created counter. Defaults to `0` if not specified.
`none`
    
Specifies that no counter initialization should occur. This value is useful for overriding `counter-reset` values in less specific rules.
## Description
The `counter-reset` property can create both regular and, in browsers that support it, reversed counters. You can create multiple regular and reversed counters, each separated by a space. Counters can be a standalone name or a space-separated name-value pair.
Warning: There is a difference between `counter-reset` and `counter-set` properties. After creating a counter using `counter-reset`, you can adjust its value by using the `counter-set` property. This is counterintuitive because, despite its name, the `counter-reset` property is used for creating and initializing counters, while the `counter-set` property is used for resetting the value of an existing counter.
Setting `counter-increment: none` on a selector with greater specificity overrides the creation of the named counter set on selectors with lower specificity.
### Default initial values
The default initial values of both regular and reversed counters make it easy to implement the two most common numbering patterns: counting up from one to the number of elements and counting down from the number of elements to one, respectively. By including a counter value for a named counter, your counter can count up or down, starting at an integer value.
Regular counters default to `0` if no reset value is provided. By default, regular counters increment by one, which can be adjusted with the `counter-increment` property.
    
    h1 {
      /* Create the counters "chapter" and "page" and set to initial default value.
         Create the counter "section" and set to "4". */
      counter-reset: chapter section 4 page;
    }
    
### Reversed counters
When creating reversed counters without a value, the counter will start with the value equal to the number of elements in the set, counting down so the last element in the set is `1`. By default, reverse counters decrement by one; this can also be changed with the `counter-increment` property.
    
    h1 {
      /* Create reversed counters "chapter" and "section".
          Set "chapter" as the number of elements and "section" as "10".
          Create the counter "pages" with the initial default value. */
      counter-reset: reversed(chapter) reversed(section) 10 pages;
    }
    
### Built-in `list-item` counter
Ordered lists (`<ol>`) come with built-in `list-item` counters that control their numbering. These counters automatically increase or decrease by one with each list item. The `counter-reset` property can be used to reset the `list-item` counters. Like with other counters, you can override the default increment value for `list-item` counters by using the `counter-increment` property.
## Examples
>
### Overriding the `list-item` counter
In this example, the `counter-reset` property is used to set a starting value for an implicit `list-item` counter.
#### HTML
    
    <ol>
      <li>First</li>
      <li>Second</li>
      <li>Third</li>
      <li>Fourth</li>
      <li>Fifth</li>
    </ol>
    
#### CSS
Using `counter-reset`, we set the implicit `list-item` counter to start at a value other than the default `1`:
    
    ol {
      counter-reset: list-item 3;
    }
    
#### Result
Using `counter-reset`, we set the implicit `list-item` counter to start counting at `3` for every `ol`. Then, the first item would be numbered 4, second would be numbered 5, etc., similar to the effect of writing `<ol start="4">` in HTML.
### Using a reverse counter
In the following example, we've declared a reversed counter named 'priority'. The counter is being used to number five tasks.
    
    <ul class="stack">
      <li>Task A</li>
      <li>Task B</li>
      <li>Task C</li>
      <li>Task D</li>
      <li>Task E</li>
    </ul>
    
    
    li::before {
      content: counter(priority) ". ";
      counter-increment: priority -1;
    }
    
    .stack {
      counter-reset: reversed(priority);
      list-style: none;
    }
    
In the output, the items are numbered in reversed order from 5 to 1. Notice in the code we haven't specified the counter's initial value. The browser automatically calculates the initial value at layout-time using the counter increment value.
# CSS scroll-driven animations
The CSS scroll-driven animations module provides functionality that builds on top of the CSS animations module and Web Animations API. It allows you to animate property values based on a progression along a scroll-based timeline instead of the default time-based document timeline. This means that you can animate an element by scrolling a scrollable element, rather than just by the passing of time.
There are two types of scroll-based timelines:
  * scroll progress timeline: You progress this timeline by scrolling a scrollable element (scroller) from top to bottom (or left to right) and back again. The position in the scroll range is converted into a percentage of progress — 0% at the start and 100% at the end.
  * view progress timeline: You progress this timeline based on the change in visibility of an element (known as the subject) inside a scroller. The visibility of the subject inside the scroller is tracked as a percentage of progress — by default, the timeline is at 0% when the subject is first visible at one edge of the scroller, and 100% when it reaches the opposite edge.


When one of these two timelines is applied to an animated element, the animation progresses along that timeline instead of following the default time-based timeline.
It is possible to adjust the effective placement of the animation along the scroll progress and view progress timelines, i.e., you can define the position at which the animation starts and ends. This can be done in a couple of different ways:
  * Start and end animation range values can be applied to the animation to adjust the position of the animation's starting and ending position along the timeline.
  * View progress timelines can have a start and/or end inset (or outset) applied to them to adjust the position of the scrollport (see Scroll container for more details) in which the subject element is deemed to be visible. Put another way, this allows you to specify start and/or end inset (or outset) values that offset the position of the timeline itself.


## Scroll-driven animations in action
You can find several tools and demos showing scroll-driven animations in action at Scroll-driven Animations tools and demos.
## Reference
>
### Properties
Set the timeline that will control the progress of an animation, and set its attachment range along that timeline:
  * `animation-timeline`
  * `animation-range`
  * `animation-range-start`
  * `animation-range-end`


Define named scroll progress timelines:
  * `scroll-timeline`
  * `scroll-timeline-axis`
  * `scroll-timeline-name`


Define named view progress timelines:
  * `view-timeline`
  * `view-timeline-axis`
  * `view-timeline-inset`
  * `view-timeline-name`


Modify timeline scope:
  * `timeline-scope`


### At-rules
CSS scroll-driven animations adds the ability to include `<timeline-range-name>`s in `@keyframes` blocks, to place keyframes at specific positions inside named timeline ranges.
### Functions
Possible values of the `animation-timeline` property for defining anonymous scroll progress timelines and anonymous view progress timelines (i.e., implicitly defined by the browser rather than being explicitly named and defined using the `scroll-timeline-*` and `view-timeline-*` properties):
  * `scroll()`
  * `view()`


### Interfaces
  * `Element.animate()`
  * `AnimationTimeline`
  * `ScrollTimeline`
  * `ViewTimeline`


# CSS box alignment
The CSS box alignment module specifies CSS features relating to the alignment of boxes within their containers. It defines the alignment of the various CSS box layout models including block layout, table layout, flexible box layout (flexbox), and grid layout, creating a consistent alignment method across all of CSS.
The module details alignment terminology, enabling alignment properties to be used in multiple layout modules, rather than limited to a particular layout method.
Alignment is linked to writing modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom, and left. Instead, we describe alignment in terms of the start and end of the particular dimension we are working with. This ensures that alignment works in the same way whichever writing mode the document has.
The alignment of text and inline-level content is defined in CSS text module and CSS inline module, respectively.
## Reference
>
### CSS Properties
  * `align-content`
  * `align-items`
  * `align-self`
  * `column-gap`
  * `gap`
  * `justify-content`
  * `justify-items`
  * `justify-self`
  * `place-content`
  * `place-items`
  * `place-self`
  * `row-gap`


### Data types
  * `<baseline-position>`
  * `<content-distribution>`
  * `<content-position>`
  * `<overflow-position>`
  * `<self-position>`


### Terms and definitions
  * Alignment container
  * Alignment subject
  * Baseline alignment
  * Distributed alignment
  * Fallback alignment
  * Positional alignment


## Guides
Box alignment overview
    
Overview of the general concepts found in the CSS box alignment module.
Box alignment in flexbox
    
How box alignment works in the context of flexbox.
Box alignment in CSS grid layout
    
How box alignment works in the context of grid layout.
Box alignment in multiple-column layout
    
How box alignment works in the context of multi-column layout.
Box alignment for block, absolutely positioned and table layout
    
How box alignment works in the context of block layout, including floated, positioned, and table elements.
## Related concepts
  * `alignment-baseline`
  * `dominant-baseline`
  * `scroll-snap-align`
  * SVG `dominant-baseline` attribute
  * Cross axis
  * Main axis


# page
The `page` CSS property is used to specify the named page, a specific type of page defined by the `@page` at-rule.
If there are multiple selectors that are using a named page consecutively then a forced page break using `break-after` may be needed.
## Syntax
    
    /* set a named page */
    page: exampleName;
    page: chapterIntro;
    
    /* Use ancestors named page */
    page: auto; /* default value */
    
    /* Global values */
    page: inherit;
    page: initial;
    page: revert;
    page: revert-layer;
    page: unset;
    
### Values
`auto`
    
Default value. Use the value of the nearest ancestor with a non-`auto` value. If no ancestor has a named page value set, the used value for auto is the empty string.
`<custom-ident>`
    
Case-sensitive name defined in a `@page` at-rule.
## Examples
>
### Named page example
In this example, there are two parts to this HTML; print controls and the content to be printed. The print controls allow the user to select how the `section`s in the `article` will be printed.
    
    <!-- print options in a fieldset -->
    <fieldset id="printStyle">
      <legend>How would you like to print</legend>
      <label for="single">
        <input type="radio" id="single" name="type" value="single" checked />
        No Pages
      </label>
      <label for="grouped">
        <input type="radio" id="grouped" name="type" value="grouped" />Pages with
        Grouped Chapters
      </label>
      <label for="paged">
        <input type="radio" id="paged" name="type" value="paged" />
        Chapters Paged
      </label>
      <button id="print">Print</button>
    </fieldset>
    
    <!-- Content to be printed -->
    <article id="print-area" data-print="single">
      <section id="toc">
        <h2>Table of contents</h2>
        <ul>
          <li>Foreword</li>
          <li>Introduction</li>
          <li>Chapter One - named pages</li>
          <li>Chapter Two - page orientation</li>
          <li>Chapter Three - page margins</li>
          <li>Conclusion</li>
        </ul>
      </section>
      <section id="foreword">
        <h2>Foreword</h2>
        <p>
          This book is all about how the CSS <code>@page</code> at-rule can help
          with printing HTML books.
        </p>
      </section>
      <section id="introduction">
        <h2>Introduction</h2>
        <p>
          This book is a concept to show how an <em>HTML</em> document can easily be
          printed out in pages.
        </p>
      </section>
      <section id="chapter1" class="chapter">
        <h2>Named pages</h2>
        <p>Lorem ipsum</p>
      </section>
      <section id="chapter2" class="chapter">
        <h2>Page Orientation</h2>
        <p>Lorem ipsum</p>
      </section>
      <section id="chapter3" class="chapter">
        <h2>Page Margins</h2>
        <p>There are 16 page margins that can be set:</p>
        <ul>
          <li>@top-left-corner</li>
          <li>@top-left</li>
          <li>@top-center</li>
          <li>@top-right</li>
          <li>@top-right-corner</li>
          <li>@left-top</li>
          <li>@left-middle</li>
          <li>@left-bottom</li>
          <li>@right-top</li>
          <li>@right-middle</li>
          <li>@right-bottom</li>
          <li>@bottom-left-corner</li>
          <li>@bottom-left</li>
          <li>@bottom-center</li>
          <li>@bottom-right</li>
          <li>@bottom-right-corner</li>
        </ul>
        <p>They can be used to show what appears in these parts of the margin</p>
      </section>
      <section id="conclusion">
        <h2>Conclusion</h2>
        <p>Now go ahead and write books.</p>
      </section>
    </article>
    
The first part of the CSS sets up the named pages, these include the size and orientation and also some content to go in the `@top-center` margin of the printed pages.
    
    @page toc {
      size: a4 portrait;
      @top-center {
        content: "Table of contents";
      }
    }
    
    @page foreword {
      size: a4 portrait;
      @top-center {
        content: "Foreword";
      }
    }
    
    @page introduction {
      size: a4 portrait;
      @top-center {
        content: "Introduction";
      }
    }
    
    @page conclusion {
      size: a4 portrait;
      @top-center {
        content: "Conclusion";
      }
    }
    
    @page chapter {
      size: a4 landscape;
      @top-center {
        content: "Chapter";
      }
    }
    
The next part of the CSS uses attribute selectors to apply the print dimensions, orientation, and margins defined in the named `@page` rules defined in the previous CSS section to elements using the `page` property. The sections with `class="chapter"` are concurrent and appear as one page. The `break-after: page;` is used to split them up, which splits each chapter into a separately printed page.
    
    @media print {
      fieldset {
        display: none;
      }
      section {
        font-size: 2rem;
        font-family: Roboto, sans-serif;
      }
      .chapter {
        border: tomato 2px solid;
      }
      [data-print="grouped"] > #toc,
      [data-print="paged"] > #toc {
        page: toc;
        font-family: Courier;
      }
      [data-print="grouped"] > #foreword,
      [data-print="paged"] > #foreword {
        page: foreword;
        font-family: Courier;
      }
      [data-print="grouped"] > #introduction,
      [data-print="paged"] > #introduction {
        page: introduction;
        font-family: Courier;
      }
      [data-print="grouped"] > #conclusion,
      [data-print="paged"] > #conclusion {
        page: conclusion;
        font-family: Courier;
      }
      [data-print="grouped"] > .chapter,
      [data-print="paged"] > .chapter {
        page: chapter;
      }
      [data-print="paged"] > .chapter {
        border: none;
        break-after: page;
      }
      .chapter > ul {
        columns: 2;
      }
    }
    
The JavaScript updates the value of the `data-print` attribute, which is the attribute on which the named page is applied, when you select a different printing option:
    
    const printArea = document.querySelector("#print-area");
    const printButton = document.querySelector("#print");
    const printOption = document.querySelector("#printStyle");
    
    printOption.addEventListener("change", (event) => {
      if (event.target.value === "single") {
        printArea.dataset.print = "single";
      } else if (event.target.value === "grouped") {
        printArea.dataset.print = "grouped";
      } else {
        printArea.dataset.print = "paged";
      }
    });
    
    printButton.addEventListener("click", () => {
      window.print();
    });
    
What is printed, and what is shown in the print preview dialog, will change depending on which print style radio button is selected:
# font-synthesis-weight
The `font-synthesis-weight` CSS property lets you specify whether or not the browser may synthesize the bold typeface when it is missing in a font family.
It is often convenient to use the shorthand property `font-synthesis` to control all typeface synthesis values.
## Syntax
    
    /* Keyword values */
    font-synthesis-weight: auto;
    font-synthesis-weight: none;
    
    /* Global values */
    font-synthesis-weight: inherit;
    font-synthesis-weight: initial;
    font-synthesis-weight: revert;
    font-synthesis-weight: revert-layer;
    font-synthesis-weight: unset;
    
### Values
`auto`
    
Indicates that the missing bold typeface may be synthesized by the browser if needed.
`none`
    
Indicates that the synthesis of the missing bold typeface by the browser is not allowed.
## Examples
>
### Disabling synthesis of bold typeface
This example shows turning off synthesis of the bold typeface by the browser in the `Montserrat` font.
#### HTML
    
    <p class="english">
      This is the default <strong>bold typeface</strong> and
      <em>oblique typeface</em>.
    </p>
    
    <p class="english no-syn">
      The <strong>bold typeface</strong> is turned off here but not the
      <em>oblique typeface</em>.
    </p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
    
    .english {
      font-family: "Montserrat", sans-serif;
    }
    .no-syn {
      font-synthesis-weight: none;
    }
    
#### Result
# ruby-align
The `ruby-align` CSS property defines the distribution of the different ruby elements over the base.
## Syntax
    
    /* Keyword values */
    ruby-align: start;
    ruby-align: center;
    ruby-align: space-between;
    ruby-align: space-around;
    
    /* Global values */
    ruby-align: inherit;
    ruby-align: initial;
    ruby-align: revert;
    ruby-align: revert-layer;
    ruby-align: unset;
    
### Values
`start`
    
Is a keyword indicating that the ruby will be aligned with the start of the base text.
`center`
    
Is a keyword indicating that the ruby will be aligned at the middle of the base text.
`space-between`
    
Is a keyword indicating that the extra space will be distributed between the elements of the ruby.
`space-around`
    
Is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it.
## Examples
>
### Ruby aligned at the start of the base text
#### HTML
    
    <ruby>
      <rb>This is a long text to check</rb>
      <rp>（</rp><rt>short ruby</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-align: start;
    }
    
#### Result
### Ruby aligned at the center of the base text
#### HTML
    
    <ruby>
      <rb>This is a long text to check</rb>
      <rp>（</rp><rt>short ruby</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-align: center;
    }
    
#### Result
### Extra space distributed between ruby elements
#### HTML
    
    <ruby>
      <rb>This is a long text to check</rb>
      <rp>（</rp><rt>short ruby</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-align: space-between;
    }
    
#### Result
### Extra space distributed between and around ruby elements
#### HTML
    
    <ruby>
      <rb>This is a long text to check</rb>
      <rp>（</rp><rt>short ruby</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-align: space-around;
    }
    
#### Result
# ::scroll-marker-group
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `::scroll-marker-group` CSS pseudo-element is generated inside a scroll container and contains any `::scroll-marker` pseudo-elements generated on descendants of the scroll container.
## Syntax
    
    ::scroll-marker-group {
      /* ... */
    }
    
## Description
A scroll container's `::scroll-marker-group` pseudo-element represents a scroll marker group. This is a container that automatically contains any `::scroll-marker` pseudo-elements generated on itself or its descendants. This allows them to be positioned and laid out as a group, and is typically used when creating a CSS carousel to provide a scroll position indicator. The individual scroll markers can be used to navigate to their associated content items.
The scroll container must have its `scroll-marker-group` property set to a non-`none` value for the `::scroll-marker-group` pseudo-element to be generated. The `scroll-marker-group` value determines where the scroll marker group appears in the carousel's tab order and layout box order (but not DOM structure) — `before` puts it at the start, while `after` puts it at the end.
It is a best practice to match the visual rendering position of the scroll marker group with the tab order. When positioning the group at the start of the content, put it at the beginning of the tab order using `before`. When positioning the group at the end of the content, put it at the end of the tab order using `after`.
Accessibility-wise, the scroll marker group and contained scroll markers are rendered with `tablist`/`tab` semantics. When you `Tab` to the group, it behaves like a single item (that is, another press of the `Tab` key will move past the group to the next item), and you can move between the different scroll markers using the left and right (or up and down) cursor keys.
## Examples
See Creating CSS carousels for other examples that use the `::scroll-marker` pseudo-element.
### Creating carousel scroll markers
This demo is a carousel of single pages, with each item taking up the full page. We have included scroll markers to enable the user to navigate to any page with the click of a marker.
#### HTML
The HTML consists of an unordered list, with each list item containing some sample content:
    
    <ul>
      <li>
        <h2>Page 1</h2>
      </li>
      <li>
        <h2>Page 2</h2>
      </li>
      <li>
        <h2>Page 3</h2>
      </li>
      <li>
        <h2>Page 4</h2>
      </li>
    </ul>
    
#### CSS
We first convert our `<ul>` into a carousel by setting the `display` to `flex`, creating a single, non-wrapping row of `<li>` elements. The `overflow-x` property is set to `auto`, meaning if the items overflow their container on the x-axis, the content will scroll horizontally. We then convert the `<ul>` into a scroll-snap container, ensuring that items always snap into place when the container is scrolled with a `scroll-snap-type` value of `mandatory`.
    
    ul {
      display: flex;
      gap: 4vw;
      padding-left: 0;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
    }
    
Next, we style the `<li>` elements, using the `flex` property to make them `100%` of the width of the container. The `scroll-snap-align` value of `start` causes the left-hand side of the left-most visible item to snap to the left edge of the container when the content is scrolled.
    
    li {
      list-style-type: none;
      background-color: #eeeeee;
      flex: 0 0 100%;
      height: 200px;
      padding-top: 20px;
      scroll-snap-align: start;
      text-align: center;
    }
    
Next, the list's `scroll-marker-group` property is set to `after`, so the `::scroll-marker-group` pseudo-element is placed after the list's DOM content in the tabbing order and layout box order; this means it comes after the scroll buttons:
    
    ul {
      scroll-marker-group: after;
    }
    
Next, the list's `::scroll-marker-group` pseudo-element is laid out using flexbox, with a `justify-content` value of `center` and a `gap` of `20px` so that its children (the `::scroll-marker` pseudo-elements) are centered inside the `::scroll-marker-group` with a gap between each one.
    
    ul::scroll-marker-group {
      display: flex;
      justify-content: center;
      gap: 20px;
    }
    
Next, the scroll markers themselves are styled. The look of each one is handled by setting `width`, `height`, `background-color`, `border`, and `border-radius`, but we also need to set a non-`none` value for the `content`, property so they are actually generated.
    
    li::scroll-marker {
      width: 16px;
      height: 16px;
      background-color: transparent;
      border: 2px solid black;
      border-radius: 50%;
      content: "";
    }
    
Note: Generated content is inline by default; we can apply `width` and `height` to our scroll markers because they are being laid out as flex items.
Finally, the `:target-current` pseudo-class is used to select whichever scroll marker corresponds to the currently visible "page", highlighting how far the user has scrolled through the content. In this case, we set the `background-color` to `black` so it is styled as a filled-in circle.
    
    li::scroll-marker:target-current {
      background-color: black;
    }
    
#### Result
### Positioning the scroll marker group with anchor-positioning
This example extends the previous one, demonstrating the use of CSS anchor positioning to position the scroll marker group relative to the carousel.
#### CSS
The list's `::scroll-marker-group` pseudo-element is positioned relative to the carousel using CSS anchor positioning by giving the group a value for `position-anchor` that matches the `anchor-name` of the `<ul>`. We then position the group relative to the scroll container in the block direction by setting a `top` value that includes an `anchor()` function. We also add a `justify-self` value of `anchor-center`, which aligns the group to the center of the scroll container in the inline direction.
    
    ul {
      anchor-name: --my-carousel;
    }
    
    ul::scroll-marker-group {
      /* From the previous example */
      display: flex;
      gap: 20px;
    
      position: absolute;
      position-anchor: --my-carousel;
      top: calc(anchor(bottom) - 70px);
      justify-self: anchor-center;
    }
    
#### Result
# Subsequent-sibling combinator
The subsequent-sibling combinator (`~`, a tilde) separates two selectors and matches all instances of the second element that follow the first element (not necessarily immediately) and share the same parent element.
In the following example, the subsequent-sibling combinator (`~`) helps to select and style paragraphs that are both siblings of an image and appear after any image.
    
    img ~ p {
      color: red;
    }
    
## Syntax
    
    /* The white space around the ~ combinator is optional but recommended. */
    former_element ~ target_element { style properties }
    
## Examples
>
### Using the combinator with simple selectors
This example shows the use of the `~` combinator when both the selectors are simple selectors (`p` and `span`).
    
    <article>
      <span>This is not red because it appears before any paragraph.</span>
      <p>Here is a paragraph.</p>
      <code>Here is some code.</code>
      <span>
        This span is red because it appears after the paragraph, even though there
        are other nodes in between.
      </span>
      <p>Whatever it may be, keep smiling.</p>
      <h1>Dream big</h1>
      <span>
        Doesn't matter how many or what kind of nodes are in between, all spans from
        the same parent after a paragraph are red.
      </span>
    </article>
    <span>
      This span is not red because it doesn't share a parent with a paragraph.
    </span>
    
    
    p ~ span {
      color: red;
    }
    
### Using the combinator with complex selectors
This example contains two complex selectors, both using the subsequent-sibling combinator: `.foo p ~ span` and `.foo p ~ .foo span`.
  * The first complex selector, `.foo p ~ span`, matches all spans that come after a paragraph if the span and paragraph share the same parent and that parent or an ancestor of that parent has the class `.foo`.
  * The second complex selector, `.foo p ~ .foo span`, matches all spans that are a descendant of the element with class `.foo` if that element is a sibling of the previously mentioned paragraph.


The example below shows that the target element in the complex selector must share the same parent as the initial element in the complex selector.
    
    <h1>Dream big</h1>
    <span>And yet again this is a red span!</span>
    <div class="foo">
      <p>Here is another paragraph.</p>
      <span>A blue span</span>
      <div class="foo">
        <span>A green span</span>
      </div>
    </div>
    
    
    .foo p ~ span {
      color: blue;
    }
    
    .foo p ~ .foo span {
      color: green;
    }
    
In the above HTML, the two siblings of `.foo p` are `span` and `.foo`. The green `span` is a descendant of the `.foo` class, which is a sibling of `p`.
  * When the target selector is `span`, the `span` element that is a sibling of `p` is selected. The `p` element is a descendant of `.foo`, so are its `span` siblings.
  * In `.foo p ~ .foo span`, the target selector is `span` that is a descendant of `.foo`. In this case, the `span` element that's a descendant of `.foo` is selected if that `.foo` is a sibling of `p`; essentially, both are nested in an ancestor of `.foo`.


# :valid
The `:valid` CSS pseudo-class represents any `<input>` or other `<form>` element whose contents validate successfully. This allows to easily make valid fields adopt an appearance that helps the user confirm that their data is formatted properly.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:valid {
      background-color: ivory;
      border: none;
      outline: 2px solid deepskyblue;
      border-radius: 5px;
      accent-color: gold;
    }
    
    
    <form>
      <label for="email">Email Address:</label>
      <input id="email" name="email" type="email" value="na@me@example.com" />
    
      <label for="secret">Secret Code: (lower case letters)</label>
      <input id="secret" name="secret" type="text" value="test" pattern="[a-z]+" />
    
      <label for="age">Your age: (18+)</label>
      <input id="age" name="age" type="number" value="5" min="18" />
    
      <label
        ><input name="tos" type="checkbox" required checked /> - Do you agree to
        ToS?</label
      >
    </form>
    
This pseudo-class is useful for highlighting correct fields for the user.
## Syntax
    
    :valid {
      /* ... */
    }
    
## Accessibility
The color green is commonly used to indicate valid input. People who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning. Typically, descriptive text and/or an icon are used.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.1 | W3C Understanding WCAG 2.0


## Examples
>
### Indicating valid and invalid form fields
In this example, we use structures like this, which include extra `<span>`s to generate content on; we'll use these to provide indicators of valid/invalid data:
    
    <div>
      <label for="fname">First name *: </label>
      <input id="fname" name="fname" type="text" required />
      <span></span>
    </div>
    
To provide these indicators, we use the following CSS:
    
    input + span {
      position: relative;
    }
    
    input + span::before {
      position: absolute;
      right: -20px;
      top: 5px;
    }
    
    input:invalid {
      border: 2px solid red;
    }
    
    input:invalid + span::before {
      content: "✖";
      color: red;
    }
    
    input:valid + span::before {
      content: "✓";
      color: green;
    }
    
We set the `<span>`s to `position: relative` so that we can position the generated content relative to them. We then absolutely position different generated content depending on whether the form's data is valid or invalid — a green check or a red cross, respectively. To add a bit of extra urgency to the invalid data, we've also given the inputs a thick red border when invalid.
Note: We've used `::before` to add these labels, as we were already using `::after` for the "required" labels.
You can try it below:
Notice how the required text inputs are invalid when empty, but valid when they have something filled in. The email input on the other hand is valid when empty, as it is not required, but invalid when it contains something that is not a proper email address.
# ::file-selector-button
The `::file-selector-button` CSS pseudo-element represents the button of an `<input>` of `type="file"`.
## Try it
    
    input {
      margin-top: 1rem;
    }
    
    input::file-selector-button {
      font-weight: bold;
      color: dodgerblue;
      padding: 0.5em;
      border: thin solid grey;
      border-radius: 3px;
    }
    
    
    <label for="avatar">Choose a profile picture:</label><br />
    
    <input id="avatar" type="file" name="avatar" accept="image/png, image/jpeg" />
    
## Syntax
    
    ::file-selector-button {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <form>
      <label for="fileUpload">Upload file</label>
      <input type="file" id="fileUpload" />
    </form>
    
#### CSS
    
    input[type="file"]::file-selector-button {
      border: 2px solid #6c5ce7;
      padding: 0.2em 0.4em;
      border-radius: 0.2em;
      background-color: #a29bfe;
      transition: 1s;
    }
    
    input[type="file"]::file-selector-button:hover {
      background-color: #81ecec;
      border: 2px solid #00cec9;
    }
    
#### Result
Note that `::file-selector-button` is a whole element, and as such matches the rules from the UA stylesheet. In particular, fonts and colors won't necessarily inherit from the `input` element.
### Fallback example
#### HTML
    
    <form>
      <label for="fileUpload">Upload file</label>
      <input type="file" id="fileUpload" />
    </form>
    
#### CSS
    
    input[type="file"]::file-selector-button {
      border: 2px solid #6c5ce7;
      padding: 0.2em 0.4em;
      border-radius: 0.2em;
      background-color: #a29bfe;
      transition: 1s;
    }
    
    input[type="file"]::-ms-browse:hover {
      background-color: #81ecec;
      border: 2px solid #00cec9;
    }
    
    input[type="file"]::-webkit-file-upload-button:hover {
      background-color: #81ecec;
      border: 2px solid #00cec9;
    }
    
    input[type="file"]::file-selector-button:hover {
      background-color: #81ecec;
      border: 2px solid #00cec9;
    }
    
#### Result
# order
The `order` CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. Items not given an explicit `order` value are assigned the default value of `0`.
## Try it
    
    order: 0;
    
    
    order: 3;
    
    
    order: -1;
    
    
    order: 2;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Box 1:</div>
      <div style="order: 1">Box 2: <code>order: 1;</code></div>
      <div style="order: 2">Box 3: <code>order: 2;</code></div>
      <div style="order: 2">Box 4: <code>order: 2;</code></div>
      <div style="order: 3">Box 5: <code>order: 3;</code></div>
    </section>
    
    
    .default-example {
      max-height: 300px;
      display: flex;
      flex-flow: column;
    }
    
    .default-example > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 0.5rem;
      padding: 0.5rem;
      flex: 1;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
    #example-element::after {
      content: attr(style);
      outline: 2px dashed;
      font-family: monospace;
    }
    
In the above demo, select the options on the left-hand side to change the value of the pink box's `order` property. The light blue boxes have been given fixed `order` values.
Bear in mind the effect of source order. For example, when `order: 2;` is selected, the pink box is placed before the two blue boxes with `order: 2;`. This is because the pink box appears before the blue boxes in the source code.
## Syntax
    
    /* <integer> values */
    order: 5;
    order: -5;
    
    /* Global values */
    order: inherit;
    order: initial;
    order: revert;
    order: revert-layer;
    order: unset;
    
Since `order` is only meant to affect the visual order of elements and not their logical or tab order, it must not be used on non-visual media such as speech.
Defined in the CSS display module, this property impacts only grid and flex items. When `order` is set on an element whose parent's `display` property is not creating a flex or grid container, it has no effect.
### Values
`<integer>`
    
Represents the ordinal group to be used by the item.
## Accessibility
Using the `order` property will create a disconnect between the visual presentation of content and DOM order. This will adversely affect low vision users navigating with the aid of assistive technology such as a screen reader. If the visual order differs from the DOM order, your users will have different experiences depending on how they access your content.
  * Flexbox & the keyboard navigation disconnect via Tink (2016)
  * Source Order Matters via Adrian Roselli (2015)
  * Understanding WCAG, Guideline 1.3 explanations
  * Understanding Success Criterion 1.3.2 | W3C Understanding WCAG 2.0


## Examples
>
### Ordering items in a flex container
In this example, we create a classic two-sidebar layout.
#### HTML
We include a header, a footer, and a main content area. The main content includes an article and two side bars. Note their order! We'll use the CSS `order` property to change their visual order.
    
    <header>Header</header>
    <main>
      <article>Article</article>
      <nav>Nav</nav>
      <aside>Aside</aside>
    </main>
    <footer>Footer</footer>
    
#### CSS
We style the main area using flexible box layout module features; by setting `display` to `flex`, the `<main>` element becomes a flex container. By default, this creates flex items of equal vertical size. The sidebars are both given an absolute `width`, while the `<article>` will consume all the positive free space with a `flex-grow` factor set via the `flex` shorthand.
We then set different `order` property values on each of the flex container's three children; this means the CSS is defining that component's visual order rather than it appearing in the order declared in the HTML.
    
    main {
      display: flex;
      text-align: center;
    }
    main > article {
      flex: 1;
      order: 2;
    }
    main > nav {
      width: 200px;
      order: 1;
    }
    main > aside {
      width: 200px;
      order: 3;
    }
    
#### Result
The `<article>` appears first in the source order but visually rendered in the center.
# view-timeline
The `view-timeline` CSS shorthand property is used to define a named view progress timeline, which is progressed through based on the change in visibility of an element (known as the subject) inside a scrollable element (scroller). `view-timeline` is set on the subject.
The visibility of the subject inside the scroller is tracked — by default, the timeline is at 0% when the subject is first visible at one edge of the scroller and 100% when it reaches the opposite edge.
`view-timeline` can contain two constituent values — a name for the named view progress timeline and an optional scroll axis value. The name is then referenced in an `animation-timeline` declaration to indicate the element that will be animated as the timeline progresses. This can be the subject element, but it doesn't have to be — you can animate a different element as the subject moves through the scrolling area.
Note: If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `view-timeline-axis`
  * `view-timeline-inset`
  * `view-timeline-name`


## Syntax
    
    /* three values: one each for view-timeline-name, view-timeline-inset and view-timeline-axis */
    view-timeline: --custom_name_for_timeline block auto;
    view-timeline: --custom_name_for_timeline block 20% 200px;
    
    /* two values: one each for view-timeline-name and view-timeline-axis */
    view-timeline: --custom_name_for_timeline block;
    view-timeline: --custom_name_for_timeline inline;
    view-timeline: --custom_name_for_timeline y;
    view-timeline: --custom_name_for_timeline x;
    view-timeline: none block;
    view-timeline: none inline;
    view-timeline: none y;
    view-timeline: none x;
    
    /* one value: view-timeline-name */
    view-timeline: none;
    view-timeline: --custom_name_for_timeline;
    
The `view-timeline` shorthand property can be applied to a container element as a combination of the `<view-timeline-name>`, `<view-timeline-inset>` and `<view-timeline-axis>` values. At least one of the values must be specified. If both the values are specified, the order followed must be the `<view-timeline-name>` value followed by the `<view-timeline-axis>` value and/or the `<view-timeline-inset>` value.
Note: `<view-timeline-name>`s must be `<dashed-ident>` values, which means they must start with `--`. This helps avoid name clashes with standard CSS keywords.
### Values
`<view-timeline-name>`
    
See `view-timeline-name`. The default value is `none`.
`<view-timeline-inset>`
    
See `view-timeline-inset`. The default value is `auto`.
`<view-timeline-axis>`
    
See `view-timeline-axis`. The default value is `block`.
## Examples
>
### Creating a named view progress timeline
A view progress timeline named `--subject-reveal` is defined using the `view-timeline` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline: --subject-reveal block;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# <overflow-position>
The `<overflow-position>` enumerated value type defines how an alignment subject that is larger than its alignment container will overflow that container. For example, if centered items are wider than their container, the overflow may be displayed beyond the viewport's start edge, which can't be scrolled to. The `<overflow-position>` value defines whether the alignment mode should be overridden to ensure the content is visible (`safe`) or if the alignment mode must be adhered to (`unsafe`).
This data type is valid for the `align-content`, `align-items`, `align-self`, `justify-items` and `justify-self` properties as well as the `place-content`, `place-items`, and `place-self` shorthand properties. If omitted, the default overflow alignment is a blend of `safe` and `unsafe`.
## Syntax
    
    <overflow-position> = unsafe | safe
    
## Values
The following keyword values are represented by the `<overflow-position>` grammar term:
`safe`
    
If the size of the alignment subject overflows the alignment container, the alignment subject is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Regardless of the relative sizes of the alignment subject and alignment container, the given alignment value is honored.
# <content-distribution>
The `<content-distribution>` enumerated value type is used by `justify-content` and `align-content` properties, and the `place-content` shorthand, to distribute a container's extra space among its alignment subjects.
## Syntax
    
    <content-distribution> = space-between | space-around | space-evenly | stretch
    
## Values
The following keyword values are represented by the `<content-distribution>` grammar term:
`space-between`
    
Evenly distributes the alignment subject within the alignment container. The first item is placed flush with the start edge of the alignment container, the last item subject is placed flush with the end edge of the alignment container, and the remaining items are evenly distributed so that the spacing between any two adjacent items is the same. The default fallback alignment for `space-between` is `safe flex-start` for flex layout, and `start` otherwise. If there is only one item, the item will be flush with the start edge.
`space-around`
    
The items are evenly distributed in the container, with a half-size space on either end. The spacing between any two adjacent items is the same, and the spacing before the first and after the last items is half the size of the other spacing. The default fallback alignment for `space-around` is `safe center`. If the container has only one child, the item will be centered.
`space-evenly`
    
The items are evenly distributed in the container, with a full-size space on either end. The spacing between any two adjacent items, before the first item, and after the last item, are all the same. The default fallback alignment for `space-evenly` is `safe center`. If the container has only one child, the item will be centered.
`stretch`
    
If the combined size of the items is less than the size of the container, any items that can grow will have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`, `max-width`, or equivalent functionality, so that the combined size of the items exactly fills the container. The default fallback alignment for `stretch` is `flex-start` in flexbox, and `start` in other layout modes. If there is only one item, and that item can grow, it will grow to fill the container.
# @document
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `@document` CSS at-rule restricts the style rules contained within it based on the URL of the document. It is designed primarily for user-defined style sheets (see userchrome.org for more information), though it can be used on author-defined style sheets, too.
## Syntax
    
    @document url("https://www.example.com/")
    {
      h1 {
        color: green;
      }
    }
    
An `@document` rule can specify one or more matching functions. If any of the functions apply to a given URL, the rule will take effect on that URL. The functions available are:
`url()`
    
Matches an exact URL.
`url-prefix()`
    
Matches if the document URL starts with the value provided.
`domain()`
    
Matches if the document URL is on the domain provided (or a subdomain of it).
`media-document()`
    
Matches the media according to the string in parameter, one of `video`, `image`, `plugin` or `all`.
`regexp()`
    
Matches if the document URL is matched by the regular expression provided. The expression must match the entire URL.
The values provided to the `url()`, `url-prefix()`, `domain()`, and `media-document()` functions can be optionally enclosed by single or double quotes. The values provided to the `regexp()` function must be enclosed in quotes.
Escaped values provided to the `regexp()` function must additionally be escaped from the CSS. For example, a `.` (period) matches any character in regular expressions. To match a literal period, you would first need to escape it using regular expression rules (to `\.`), then escape that string using CSS rules (to `\\.`).
`@document` is currently only supported in Firefox; if you wanted to replicate using such functionality in your own non-Firefox browser, you could try using this polyfill by @An-Error94, which uses a combination of a user script, data-* attributes, and attribute selectors.
Note: There is a -moz-prefixed version of this property — `@-moz-document`. This has been limited to use only in user and UA sheets in Firefox 59 in Nightly and Beta — an experiment designed to mitigate potential CSS injection attacks (See Firefox bug 1035091).
## Examples
>
### Specifying document for CSS rule
    
    @document url("http://www.w3.org/"),
              url-prefix("http://www.w3.org/Style/"),
              domain("mozilla.org"),
              media-document("video"),
              regexp("https:.*") {
      /* CSS rules here apply to:
         - The page "http://www.w3.org/"
         - Any page whose URL begins with "http://www.w3.org/Style/"
         - Any page whose URL's host is "mozilla.org"
           or ends with ".mozilla.org"
         - Any standalone video
         - Any page whose URL starts with "https:" */
    
      /* Make the above-mentioned pages really ugly */
      body {
        color: purple;
        background: yellow;
      }
    }
    
Initially in Level 3, `@document` was postponed to Level 4, but then subsequently removed.
# Class selectors
The CSS class selector matches elements based on the contents of their `class` attribute.
    
    /* All elements with class="spacious" */
    .spacious {
      margin: 2em;
    }
    
    /* All <li> elements with class="spacious" */
    li.spacious {
      margin: 2em;
    }
    
    /* All <li> elements with a class list that includes both "spacious" and "elegant" */
    /* For example, class="elegant retro spacious" */
    li.spacious.elegant {
      margin: 2em;
    }
    
## Syntax
    
    .class_name {
      /* … */
    }
    
Note that this is equivalent to the following attribute selector:
    
    [class~="class_name"] {
      /* … */
    }
    
The `class_name` value must be a valid CSS identifier. HTML `class` attributes which are not valid CSS identifiers must be escaped before they can be used in class selectors.
## Examples
>
### Valid class selectors
#### HTML
    
    <p class="red">This paragraph has red text.</p>
    <p class="red yellow-bg">
      This paragraph has red text and a yellow background.
    </p>
    <p class="red fancy">This paragraph has red text and "fancy" styling.</p>
    <p>This is just a regular paragraph.</p>
    
    
    <!-- The next two paragraphs have class attributes
    that contain characters which must be escaped in CSS -->
    
    <p class="item?one">This paragraph has a pink background.</p>
    <p class="123item">This paragraph has a yellow background.</p>
    
#### CSS
    
    .red {
      color: #ff3333;
    }
    
    .yellow-bg {
      background: #ffffaa;
    }
    
    .fancy {
      font-weight: bold;
      text-shadow: 4px 4px 3px #7777ff;
    }
    
    
    /* In the next two rules, the class attributes must be escaped */
    
    .item\?one {
      background-color: pink;
    }
    
    .\00003123item {
      background-color: yellow;
    }
    
#### Result
### Invalid class selectors
The class selectors in the following rules are not valid CSS identifiers, and will be ignored.
    
    .item?one {
      background-color: green;
    }
    
    .123item {
      background-color: green;
    }
    
# box-sizing
The `box-sizing` CSS property sets how the total width and height of an element is calculated.
## Try it
    
    box-sizing: content-box;
    width: 100%;
    
    
    box-sizing: content-box;
    width: 100%;
    border: solid #5b6dcd 10px;
    padding: 5px;
    
    
    box-sizing: border-box;
    width: 100%;
    border: solid #5b6dcd 10px;
    padding: 5px;
    
    
    <section id="default-example">
      <div id="example-element-parent">
        <p>Parent container</p>
        <div class="transition-all" id="example-element">
          <p>Child container</p>
        </div>
      </div>
    </section>
    
    
    #example-element-parent {
      width: 220px;
      height: 200px;
      border: solid 10px #ffc129;
      margin: 0.8em;
    }
    
    #example-element {
      height: 60px;
      margin: 2em auto;
      background-color: rgb(81 81 81 / 0.6);
    }
    
    #example-element > p {
      margin: 0;
    }
    
By default in the CSS box model, the `width` and `height` you assign to an element is applied only to the element's content box. If the element has any border or padding, this is then added to the `width` and `height` to arrive at the size of the box that's rendered on the screen. This means that when you set `width` and `height`, you have to adjust the value you give to allow for any border or padding that may be added. For example, if you have four boxes with `width: 25%;`, if any has left or right padding or a left or right border, they will not by default fit on one line within the constraints of the parent container.
The `box-sizing` property can be used to adjust this behavior:
  * `content-box` gives you the default CSS box-sizing behavior. If you set an element's width to 100 pixels, then the element's content box will be 100 pixels wide, and the width of any border or padding will be added to the final rendered width, making the element wider than 100px.
  * `border-box` tells the browser to account for any border and padding in the values you specify for an element's width and height. If you set an element's width to 100 pixels, that 100 pixels will include any border or padding you added, and the content box will shrink to absorb that extra width. This typically makes it much easier to size elements.
`box-sizing: border-box` is the default styling that browsers use for the `<table>`, `<select>`, and `<button>` elements, and for `<input>` elements whose type is `radio`, `checkbox`, `reset`, `button`, `submit`, `color`, or `search`.


Note: It is often useful to set `box-sizing` to `border-box` to lay out elements. This makes dealing with the sizes of elements much easier, and generally eliminates a number of pitfalls you can stumble on while laying out your content. On the other hand, when using `position: relative` or `position: absolute`, use of `box-sizing: content-box` allows the positioning values to be relative to the content, and independent of changes to border and padding sizes, which is sometimes desirable.
## Syntax
    
    box-sizing: border-box;
    box-sizing: content-box;
    
    /* Global values */
    box-sizing: inherit;
    box-sizing: initial;
    box-sizing: revert;
    box-sizing: revert-layer;
    box-sizing: unset;
    
The `box-sizing` property is specified as a single keyword chosen from the list of values below.
### Values
`content-box`
    
This is the initial and default value as specified by the CSS standard. The `width` and `height` properties include the content, but does not include the padding, border, or margin. For example, `.box {width: 350px; border: 10px solid black;}` renders a box that is 370px wide.
Here, the dimensions of the element are calculated as: width = width of the content, and height = height of the content. (Borders and padding are not included in the calculation.)
`border-box`
    
The `width` and `height` properties include the content, padding, and border, but do not include the margin. Note that padding and border will be inside of the box. For example, `.box {width: 350px; border: 10px solid black;}` renders a box that is 350px wide, with the area for content being 330px wide. The content box can't be negative and is floored to 0, making it impossible to use `border-box` to make the element disappear.
Here the dimensions of the element are calculated as: width = border + padding + width of the content, and height = border + padding + height of the content.
## Examples
>
### Box sizes with content-box and border-box
This example shows how different `box-sizing` values alter the rendered size of two otherwise identical elements.
#### HTML
    
    <div class="content-box">Content box</div>
    <br />
    <div class="border-box">Border box</div>
    
#### CSS
    
    div {
      width: 160px;
      height: 80px;
      padding: 20px;
      border: 8px solid red;
      background: yellow;
    }
    
    .content-box {
      box-sizing: content-box;
      /* Total width: 160px + (2 * 20px) + (2 * 8px) = 216px
         Total height: 80px + (2 * 20px) + (2 * 8px) = 136px
         Content box width: 160px
         Content box height: 80px */
    }
    
    .border-box {
      box-sizing: border-box;
      /* Total width: 160px
         Total height: 80px
         Content box width: 160px - (2 * 20px) - (2 * 8px) = 104px
         Content box height: 80px - (2 * 20px) - (2 * 8px) = 24px */
    }
    
#### Result
# lighting-color
The `lighting-color` CSS property defines the color of the light source for the `<feDiffuseLighting>` and `<feSpecularLighting>` SVG lighting filter primitives within an SVG `<filter>`. If present, it overrides the element's `lighting-color` attribute.
Note: The `lighting-color` property only applies to `<feDiffuseLighting>` and `<feSpecularLighting>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* <color> values */
    lighting-color: red;
    lighting-color: hsl(120deg 75% 25% / 60%);
    lighting-color: currentColor;
    
    /* Global values */
    lighting-color: inherit;
    lighting-color: initial;
    lighting-color: revert;
    lighting-color: revert-layer;
    lighting-color: unset;
    
### Values
`<color>`
    
The lighting's color. This can be any valid CSS `<color>` value.
## Examples
>
### Defining the color of filter lighting
This example demonstrates the basic use case of `lighting-color`, and how the CSS `lighting-color` property takes precedence over the `lighting-color` attribute.
#### HTML
We have an SVG with two `<filter>` elements, one with a `<feDiffuseLighting>` and one with a `<feSpecularLighting>` child. Each includes the SVG `lighting-color` attribute defining the lighting color as `red`. Both of these children have a `<fePointLight>`, the required child that sets the light source. We included two `<rect>` elements with a filter attribute; this is where the filters will be displayed.
    
    <svg viewBox="0 0 420 120" xmlns="http://www.w3.org/2000/svg">
      <filter id="flood1">
        <feDiffuseLighting lighting-color="red">
          <fePointLight x="75" y="30" z="10" />
        </feDiffuseLighting>
      </filter>
      <filter id="flood2">
        <feSpecularLighting specularExponent="5" lighting-color="red">
          <fePointLight x="225" y="75" z="5" />
        </feSpecularLighting>
      </filter>
    
      <rect id="r1" filter="url(#flood1)" />
      <rect id="r2" filter="url(#flood2)" />
    </svg>
    
#### CSS
We define the size and position of our `<rect>` using the CSS `height`, `width`, `x`, and `y` properties. We also add a background image to the SVG to make any color alpha transparency more apparent:
    
    svg {
      background-image: repeating-linear-gradient(
        45deg,
        transparent 0 9px,
        #cccccc 0px 10px
      );
    }
    
    rect {
      width: 100px;
      height: 100px;
      x: 10px;
      y: 10px;
    }
    
    #r2 {
      x: 150px;
    }
    
We then apply different lighting color values to the filter's child elements using the CSS `lighting-color` property. We use a named color and a 3-digit hexadecimal color, but we can use any valid CSS color syntax:
    
    feDiffuseLighting {
      lighting-color: blue;
    }
    
    feSpecularLighting {
      lighting-color: #ff0099;
    }
    
#### Results
The attributes defined the color of both light filters as `red`, but these values were overridden by the CSS `lighting-color` values.
# :heading
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:heading` CSS pseudo-class matches all heading elements in a document. This allows you to style all headings at once, rather than matching and styling them individually.
This pseudo-class matches only elements that by default are semantically recognized as headings (`<h1>` through `<h6>`). Elements with `role="heading"` are not matched; you can select those by using the `[role="heading"]` attribute selector.
Note: The `:heading` pseudo-class has the same specificity as a class selector, that is, `0-1-0`. So `:heading` would have a specificity of `0-1-0`, and `section:heading` would have a specificity of `0-1-1`.
## Syntax
    
    :heading {
      /* ... */
    }
    
## Examples
>
### Styling all headings
The document in this example contains headings at three different levels.
    
    <h1>Mastering CSS</h1>
    <h2>Chapter 1: Selectors</h2>
    <h3>1.1 Pseudo-classes</h3>
    
    
    :heading {
      color: tomato;
    }
    
The `:heading` pseudo-class applies the `color` to all the headings in the document:
The `:heading` pseudo-class applies the `color` to all the headings in the document.
# unset
The `unset` CSS keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. In other words, it behaves like the `inherit` keyword in the first case, when the property is an inherited property, and like the `initial` keyword in the second case, when the property is a non-inherited property.
`unset` can be applied to any CSS property, including the CSS shorthand property `all`.
## Examples
>
### Color
`color` is an inherited property.
#### HTML
    
    <p>This text is red.</p>
    <div class="foo">
      <p>This text is also red.</p>
    </div>
    <div class="bar">
      <p>This text is green (default inherited value).</p>
    </div>
    
#### CSS
    
    .foo {
      color: blue;
    }
    
    .bar {
      color: green;
    }
    
    p {
      color: red;
    }
    
    .bar p {
      color: unset;
    }
    
#### Result
### Border
`border` is a non-inherited property.
#### HTML
    
    <p>This text has a red border.</p>
    <div>
      <p>This text has a red border.</p>
    </div>
    <div class="bar">
      <p>This text has a black border (initial default, not inherited).</p>
    </div>
    
#### CSS
    
    div {
      border: 1px solid green;
    }
    
    p {
      border: 1px solid red;
    }
    
    .bar p {
      border-color: unset;
    }
    
#### Result
# appearance
The `appearance` CSS property specifies the rendered appearance of replaced UI widget elements such as form controls. Most commonly, such elements are given native, platform-specific styling based on the operating system's theme, or a primitive appearance with styles that can be overridden using CSS.
## Try it
    
    appearance: auto;
    
    
    appearance: none;
    
    
    appearance: textfield;
    
    
    <section id="default-example">
      <div class="background" id="example-element">
        <input type="search" value="search" aria-label="unlabeled search" />
        <input type="checkbox" aria-label="unlabeled checkbox" />
        <input type="radio" aria-label="unlabeled radio button" />
        <button>Button</button>
      </div>
    </section>
    
    
    input,
    button {
      appearance: inherit;
    }
    
## Syntax
    
    /* CSS Basic User Interface Module Level 4 values */
    appearance: none;
    appearance: auto;
    appearance: menulist-button;
    appearance: textfield;
    appearance: base-select;
    
    /* Global values */
    appearance: inherit;
    appearance: initial;
    appearance: revert;
    appearance: revert-layer;
    appearance: unset;
    
    /* <compat-auto> values have the same effect as 'auto' */
    appearance: button;
    appearance: checkbox;
    
### Values
The `appearance` property can be applied to all elements and pseudo-elements, but the effect of the specified value, if any, depends on the element to which it is applied.
`none`
    
Gives the widget a primitive appearance, making it stylable via CSS, while maintaining the widget's native functionality. This value does not affect non-widgets.
`auto`
    
Sets interactive widgets to render with their OS-native appearance. Behaves as `none` on elements with no OS-native styling.
`base-select`
    
Only relevant to the `<select>` element and `::picker(select)` pseudo-element, allowing them to be styled.
`<compat-special>`
    
Has an effect similar to `auto` on certain elements.
`textfield`
    
Causes the appearance of certain `<input>` types to match the appearance of the `text` type.
`menulist-button`
    
When set on the `<select>` element, the drop-down picker's style matches that of its default state.
`<compat-auto>`
    
Included for backwards compatibility; possible values include `button`, `checkbox`, `listbox`, `menulist`, `meter`, `progress-bar`, `push-button`, `radio`, `searchfield`, `slider-horizontal`, `square-button`, and `textarea`. The values all behave as `auto`: use `auto` instead.
Note: The specification also defines a `base` value. This is not yet supported by any browser.
#### Non-standard values
Some non-standard values are also supported in some browsers:
`slider-vertical`
    
Makes the slider vertical when applied to `<input type="range">` elements. To create a vertical slider you should instead set the `writing-mode` to `vertical-lr` and the `direction` to `rtl`.
`-apple-pay-button`
    
Displays the Apple Pay logo when set on a `<button>`, `<a>`, or `<input>` element of type `button` or `reset`.
## Description
The `appearance` property enables displaying elements in their OS-native style based on the operating system's theme, as well as the removal of any platform-native styling with the `none` value. Setting `appearance: none`, or otherwise changing the appearance of UI widgets, does not change the element's functionality.
While most elements in a document can be fully styled by CSS, UI controls (widgets) are typically rendered by the browser using the operating system's native UI styles. This native appearance differs between operating systems and browsers. In this default state, widgets have limited, if any, features that can be styled with CSS. Which elements have this native UI appearance is defined in HTML.
The `appearance` property provides some control over the appearance of HTML widgets that, by default, look like native operating system controls. Most notably, the `none` value suppresses some of a widget's native appearance. This results in a primitive look that can be styled via CSS while still maintaining functionality and supporting native user interactions.
Some widgets disappear completely when set to `appearance: none`. The hidden controls are still interactive, however. For example, clicking on a `<label>` associated with an `appearance: none` checkbox will toggle the checkbox's checked state.
Because `none` can cause a widget to be hidden, the `base` value is being added to provide widgets with a base appearance. When supported, the `base` value will ensure widgets maintain their native appearance while enabling CSS to be used to change a widget's styles that are not changeable by default. Unlike `none`, which can make radio buttons and checkboxes disappear, `base` gives the widget a primitive appearance with default native styles that are usable and interoperable, as well as enabling a good degree of customization via CSS. While this `base` value is not yet supported, the many `<compat-auto>` values provide similar functionality but are type-specific and not global.
The `base-select` value, which is relevant only to the `<select>` element and `::picker(select)` pseudo-element, enables styling `<select>` elements and the select picker (which contains the `<option>` elements). The picker is rendered in the top layer, similar to a popover. When `base-select` is set, the picker can be positioned relative to the select (or other elements) using CSS anchor positioning features. In addition, the `base-select` value causes the `<select>` not to render outside the browser pane or to trigger built-in mobile operating system components. It is also no longer sized based on the width of the widest `<option>`.
### Prefixed non-standard values
Before standardization, the prefixed `-moz-appearance` and `-webkit-appearance` properties allowed elements to be shown as widgets such as buttons or checkboxes. The following non-standard values may be encountered in legacy style sheets, most commonly as values of shadow DOM component prefixed pseudo-elements.
Non-standard values
  * `attachment`
  * `borderless-attachment`
  * `button-bevel`
  * `caps-lock-indicator`
  * `caret`
  * `checkbox-container`
  * `checkbox-label`
  * `checkmenuitem`
  * `color-well`
  * `continuous-capacity-level-indicator`
  * `default-button`
  * `discrete-capacity-level-indicator`
  * `inner-spin-button`
  * `image-controls-button`
  * `list-button`
  * `listitem`
  * `media-enter-fullscreen-button`
  * `media-exit-fullscreen-button`
  * `media-fullscreen-volume-slider`
  * `media-fullscreen-volume-slider-thumb`
  * `media-mute-button`
  * `media-play-button`
  * `media-overlay-play-button`
  * `media-return-to-realtime-button`
  * `media-rewind-button`
  * `media-seek-back-button`
  * `media-seek-forward-button`
  * `media-toggle-closed-captions-button`
  * `media-slider`
  * `media-sliderthumb`
  * `media-volume-slider-container`
  * `media-volume-slider-mute-button`
  * `media-volume-slider`
  * `media-volume-sliderthumb`
  * `media-controls-background`
  * `media-controls-dark-bar-background`
  * `media-controls-fullscreen-background`
  * `media-controls-light-bar-background`
  * `media-current-time-display`
  * `media-time-remaining-display`
  * `menulist-text`
  * `menulist-textfield`
  * `meterbar`
  * `number-input`
  * `progress-bar-value`
  * `progressbar`
  * `progressbar-vertical`
  * `range`
  * `range-thumb`
  * `rating-level-indicator`
  * `relevancy-level-indicator`
  * `scale-horizontal`
  * `scalethumbend`
  * `scalethumb-horizontal`
  * `scalethumbstart`
  * `scalethumbtick`
  * `scalethumb-vertical`
  * `scale-vertical`
  * `scrollbarthumb-horizontal`
  * `scrollbarthumb-vertical`
  * `scrollbartrack-horizontal`
  * `scrollbartrack-vertical`
  * `searchfield-decoration`
  * `searchfield-results-decoration`
  * `searchfield-results-button`
  * `searchfield-cancel-button`
  * `snapshotted-plugin-overlay`
  * `sheet`
  * `sliderthumb-horizontal`
  * `sliderthumb-vertical`
  * `textfield-multiline`


Authors are encouraged to use only standard keywords.
## Examples
>
### Basic example
This example demonstrates basic usage of the `appearance` property, altering the appearance of an `<input>` element in some browsers.
#### HTML
We include two `number` form controls along with their labels.
    
    <p>
      <label>Enter a number: <input type="number" min="0" max="10" /></label>
    </p>
    <p>
      <label
        >Enter a number: <input type="number" min="0" max="10" class="text"
      /></label>
    </p>
    
#### CSS
We set the element with the class of `text` to look like a text field.
    
    .text {
      appearance: textfield;
    }
    
#### Results
Depending on the browser, the spinner may be visually removed when the control is set to look like a text field. The `appearance` property has no effect on the functionality: for example, while there may no longer be a spinner to click on,the up and down cursor keys will still increment and decrement the value.
### Appearance set to `none`
The following example shows how to remove the default styling from a checkbox, a radio button, and a `<select>` element, and apply custom styling.
#### HTML
We include pairs of checkboxes, radio buttons, and `<select>` elements, along with their associated labels:
    
    <label><input type="checkbox" /> Default unchecked </label>
    <label><input type="checkbox" checked /> Default checked </label>
    
    <hr />
    
    <label><input type="radio" name="radio" /> Default unchecked </label>
    <label><input type="radio" name="radio" checked /> Default checked </label>
    
    <hr />
    
    <label
      >Unstyled select
      <select>
        <option>Option 1</option>
        <option>Option 2</option>
      </select>
    </label>
    
    <label
      >Styled select
      <select class="none">
        <option>Option 1</option>
        <option>Option 2</option>
      </select>
    </label>
    
#### CSS
We apply styles to both `<input>` elements of type `checkbox`; these styles create a red square if the element is stylable. We set `appearance: none` on the `:checked` UI state for all inputs (`checkbox` and `radio`), as well as to elements with the `.none` class. This removes all the style of the radio button and checkbox, other than the margins, and allows any set styles to be applied. There are no alternative styles provided for the radio buttons or `<select>` elements for when `none` is set.
    
    [type="checkbox"] {
      width: 1em;
      height: 1em;
      display: inline-block;
      background: red;
    }
    input:checked,
    .none {
      appearance: none;
    }
    
#### Result
Setting `appearance: none` enables UI elements to be styled, but it also runs the risk of hiding the widget. The unchecked checkbox, with its `appearance` defaulting to `auto`, looks like a checkbox. Setting `appearance: none` in the `:checked` state enables it to be styled.
Like the unchecked checkbox, the unchecked radio button looks like the native UI widget, because it is. When in the checked state, with `appearance: none` applied, the radio button disappears; its functionality is retained, and only its margins affect page rendering.
### Setting the appearance of a select
We can use the `appearance` property to opt-in to custom select functionality, enabling styling the `<select>` element and its picker, which represents the part of the form control that pops out of the page.
#### HTML
We include three `<select>` elements, with the same multiple `<option>` children. As with every `<select>`, we also include associated `<label>` elements. The third option has more text to demonstrate the effect of `base-select` on the width of the `<select>`:
    
    <label for="ice-cream1"
      >Default flavor:
      <select id="ice-cream1">
        <option>Asparagus</option>
        <option>Dulce de leche</option>
        <option>Pistachio, rum raisin, and coffee</option>
      </select>
    </label>
    <label for="ice-cream2"
      >Base select flavor:
      <select id="ice-cream2" class="baseSelect">
        <option>Asparagus</option>
        <option>Dulce de leche</option>
        <option>Pistachio, rum raisin, and coffee</option>
      </select>
    </label>
    <label for="ice-cream3"
      >Menulist button flavor:
      <select id="ice-cream3" class="menulistButton">
        <option>Asparagus</option>
        <option>Dulce de leche</option>
        <option>Pistachio, rum raisin, and coffee</option>
      </select>
    </label>
    
#### CSS
We select the pickers of all the `<select>` elements using the `::picker()` pseudo-element with the `select` parameter. We set the `appearance` value of all the pickers and one `<select>` element to `base-select`. We set the last `<select>` to `menulist-button`. The first `<select>` defaults to the `auto` state:
    
    .baseSelect,
    ::picker(select) {
      appearance: base-select;
    }
    .menulistButton {
      appearance: menulist-button;
    }
    
    
    label {
      display: block;
    }
    
We set values for the `<select>` and pickers' `background-color` and `border` properties to demonstrate the effects of the `appearance` values:
    
    select {
      border: 1px solid red;
      background-color: orange;
    }
    
    ::picker(select) {
      background-color: yellow;
      border: none;
    }
    
#### Results
While the `background-color` and `border` styles are defined on all the `<select>` elements and their pickers, the `::picker(select)` styles only effect the picker where both the select and the picker have the `appearance` property set to `base-select`. The first and third selects look the same because `menulist-button` is a compatibility keyword.
Notice that, by default, the inline-size of the `<select>` is generally the inline-size of the `<option>` with the most text, and that the drop-down picker appears over the top of the rendered page when opened, making it not constrained by the surrounding page and therefore fully visible. These statements are no longer true when `base-select` is set.
# scroll-margin-block-end
The `scroll-margin-block-end` property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-block-end: 0;
    
    
    scroll-margin-block-end: 20px;
    
    
    scroll-margin-block-end: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-block-end: 10px;
    scroll-margin-block-end: 1em;
    
    /* Global values */
    scroll-margin-block-end: inherit;
    scroll-margin-block-end: initial;
    scroll-margin-block-end: revert;
    scroll-margin-block-end: revert-layer;
    scroll-margin-block-end: unset;
    
### Values
`<length>`
    
An outset from the block end edge of the scroll container.
# <image>
The `<image>` CSS data type represents a two-dimensional image.
## Syntax
The `<image>` data type can be represented with any of the following:
  * An image denoted by the `<url>` data type
  * A `<gradient>` data type
  * A part of the webpage, defined by the `element()` function
  * An image, image fragment or solid patch of color, defined by the `image()` function
  * A blending of two or more images defined by the `cross-fade()` function.
  * A selection of images chosen based on resolution defined by the `image-set()` function.
  * Generated by a paint worklet with the `paint()` function.


## Description
CSS can handle the following kinds of images:
  * Images with intrinsic dimensions (a natural size), like a JPEG, PNG, or other raster format.
  * Images with multiple intrinsic dimensions, existing in multiple versions inside a single file, like some .ico formats. (In this case, the intrinsic dimensions will be those of the image largest in area and the aspect ratio most similar to the containing box.)
  * Images with no intrinsic dimensions but with an intrinsic aspect ratio between its width and height, like an SVG or other vector format.
  * Images with neither intrinsic dimensions, nor an intrinsic aspect ratio, like a CSS gradient.


CSS determines an object's concrete size using (1) its intrinsic dimensions; (2) its specified size, defined by CSS properties like `width`, `height`, or `background-size`; and (3) its default size, determined by the kind of property the image is used with:
Kind of Object (CSS Property) Default object size  
`background-image` The size of the element's background positioning area  
`list-style-image` The size of a `1em` character  
`border-image-source` The size of the element's border image area  
`cursor` The browser-defined size matching the usual cursor size on the client's system  
`mask-image` ?  
`shape-outside` ?  
`mask-border-source` ?  
`symbols()` for @counter-style At risk feature. If supported, the browser-defined size matching the usual cursor size on the client's system  
`content` for a pseudo-element (`::after`/`::before`) A 300px × 150px rectangle  
The concrete object size is calculated using the following algorithm:
  * If the specified size defines both the width and the height, these values are used as the concrete object size.
  * If the specified size defines only the width or only the height, the missing value is determined using the intrinsic ratio, if there is any, the intrinsic dimensions if the specified value matches, or the default object size for that missing value.
  * If the specified size defines neither the width nor the height, the concrete object size is calculated so that it matches the intrinsic aspect ratio of the image but without exceeding the default object size in any dimension. If the image has no intrinsic aspect ratio, the intrinsic aspect ratio of the object it applies to is used; if this object has none, the missing width or height are taken from the default object size.


Note: Not all browsers support every type of image on every property. See the browser compatibility section for details.
## Accessibility
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
  * MDN Understanding WCAG, Guideline 1.1 explanations
  * Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0


## Examples
>
### Valid images
    
    url("test.jpg")               /* A <url>, as long as test.jpg is an actual image */
    linear-gradient(blue, red)  /* A <gradient> */
    element(#real-id)            /* A part of the webpage, referenced with the element() function,
                                   if "real-id" is an existing ID on the page */
    image(ltr "arrow.png#xywh=0,0,16,16", red)
                                /* A section 16x16 section of <url>, starting from the top, left of the original
                                   image as long as arrow.png is a supported image, otherwise a solid
                                   red swatch. If language is rtl, the image will be horizontally flipped. */
    cross-fade(20% url("twenty.png"), url("eighty.png"))
                                /* cross faded images, with twenty being 20% opaque
                                   and eighty being 80% opaque. */
    image-set("test.jpg' 1x, 'test-2x.jpg" 2x)
                                /* a selection of images with varying resolutions */
    
### Invalid images
    
    "no-url.jpg"           /* An image file must be defined using the url() function. */
    url("report.pdf")      /* A file pointed to by the url() function must be an image. */
    element(#fakeid)     /* An element ID must be an existing ID on the page. */
    image(z.jpg#xy=0,0)  /* The spatial fragment must be written in the format of xywh=#,#,#,# */
    image-set("cat.jpg" 1x, "dog.jpg" 1x) /* every image in an image set must have a different resolution */
    
# offset-path
The `offset-path` CSS property specifies a path for an element to follow and determines the element's positioning within the path's parent container or the SVG coordinate system. The path is a line, a curve, or a geometrical shape along which the element gets positioned or moves.
The `offset-path` property is used in combination with the `offset-distance`, `offset-rotate`, and `offset-anchor` properties to control the position and orientation of the element along a path.
## Try it
    
    offset-path: path("M-70,-40 C-70,70 70,70 70,-40");
    
    
    offset-path: path("M0,0 L60,70 L-60,30z");
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element"></div>
      <button id="playback" type="button">Play</button>
    </section>
    
    
    #example-element {
      width: 24px;
      height: 24px;
      background: #2bc4a2;
      animation: distance 8000ms infinite linear;
      animation-play-state: paused;
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    #playback {
      position: absolute;
      top: 0;
      left: 0;
      font-size: 1em;
    }
    
    @keyframes distance {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
    #default-example {
      position: relative;
    }
    
    
    const example = document.getElementById("example-element");
    const button = document.getElementById("playback");
    
    button.addEventListener("click", () => {
      if (example.classList.contains("running")) {
        example.classList.remove("running");
        button.textContent = "Play";
      } else {
        example.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
## Syntax
    
    /* Default */
    offset-path: none;
    
    /* Line segment */
    offset-path: ray(45deg closest-side contain);
    offset-path: ray(contain 150deg at center center);
    offset-path: ray(45deg);
    
    /* URL */
    offset-path: url("#my-circle");
    
    /* Basic shape */
    offset-path: circle(50% at 25% 25%);
    offset-path: ellipse(50% 50% at 25% 25%);
    offset-path: inset(50% 50% 50% 50%);
    offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%);
    offset-path: path("M 0,200 Q 200,200 260,80 Q 290,20 400,0 Q 300,100 400,200");
    offset-path: rect(5px 5px 160px 145px round 20%);
    offset-path: xywh(0 5px 100% 75% round 15% 0);
    
    /* Coordinate box */
    offset-path: content-box;
    offset-path: padding-box;
    offset-path: border-box;
    offset-path: fill-box;
    offset-path: stroke-box;
    offset-path: view-box;
    
    /* Global values */
    offset-path: inherit;
    offset-path: initial;
    offset-path: revert;
    offset-path: revert-layer;
    offset-path: unset;
    
### Values
The `offset-path` property takes as its value an `<offset-path>` value, a `<coord-box>` value, or both, or the `none` keyword. The `<offset-path>` value is a `ray()` function, a `<url>` value, or a `<basic-shape>` value.
`none`
    
Specifies that the element does not follow any offset path. The `none` value is equivalent to the element not having any offset transform. The element's movement in this case is determined by its default position properties, such as `top` and `left`, instead of an offset path. This is the default value.
`<offset-path>`
    
A `ray()` function, a `<url>` value, or a `<basic-shape>` value that specifies the geometrical offset path. If omitted, the path shape for the `<coord-box>` value is `inset(0 round X)`, where `X` is the value of `border-radius` of the element that establishes the containing block.
`ray()`
    
Defines a line starting at a set position, of a set length, and extending at the specified angle. The `ray()` function accepts up to four parameters – an `<angle>`, an optional size value, the optional keyword `contain`, and an optional `at <position>`.
`<url>`
    
Specifies the ID of an SVG shape element. The path is the shape of the SVG `<circle>`, `<ellipse>`, `<line>`, `<path>`, `<polygon>`, `<polyline>`, or `<rect>` element referenced by its `id` in the `url()` function. If the URL does not reference a shape element or is otherwise invalid, the resolved value for the offset path is `path("M0,0")` (which is a valid `<basic-shape>` value).
`<basic-shape>`
    
Specifies the offset path as the equivalent path of a CSS basic shape function, such as `circle()`, `ellipse()`, `inset()`, `path()`, `polygon()`, `rect()`, or `xywh()`. For example, if the `<basic_shape>` is an `ellipse()` function, then the path is the outline of the ellipse, starting at the rightmost point of the ellipse, proceeding clockwise through a full rotation. For `ellipse()` and `circle()`, which accept the `at <position>` parameter, if the `<position>` is omitted, the position defaults to `center` unless the element has an `offset-position` specified. In this case, the `offset-position` value is used for the `at <position>` parameter. More complex shapes can be defined using the `shape()` function.
`<coord-box>`
    
Specifies the size information of the reference box containing the path. The reference box is derived from the element that establishes the containing block for this element. This parameter is optional. If not specified, the default value is `border-box` in CSS contexts. In SVG contexts, the value is treated as `view-box`. If `ray()` or `<basic-shape>` is used to define the offset path, the `<coord-box>` value provides the reference box for the ray or the `<basic-shape>`, respectively. If `<url>` is used to define the offset path, the `<coord-box>` value provides the viewport and user coordinate system for the shape element, with the origin (`0 0`) at the top left corner and size being `1px`.
## Description
The `offset-path` property defines a path an animated element can follow. An offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. The element's exact position on the offset path is determined by the `offset-distance` property. Each shape or path must define an initial position for the computed value of `0` for `offset-distance` and an initial direction which specifies the rotation of the object to the initial position.
Early versions of the spec called this property `motion-path`. It was changed to `offset-path` because the property describes static positions, not motion.
## Examples
>
### Creating an offset-path using box-edge positioning
This example demonstrates using various `<coord-box>` values in the `offset-path` property.
    
    .box {
      width: 40px;
      height: 20px;
      animation: move 8000ms infinite ease-in-out;
    }
    
    .blueBox {
      background-color: blue;
      offset-path: border-box;
      offset-distance: 5%;
    }
    
    .greenBox {
      background-color: green;
      offset-path: padding-box;
      offset-distance: 8%;
    }
    
    .redBox {
      background-color: red;
      offset-path: content-box;
      offset-distance: 12%;
    }
    
    @keyframes move {
      0%,
      20% {
        offset-distance: 0%;
      }
      80%,
      100% {
        offset-distance: 100%;
      }
    }
    
In this example, the margin, border, and padding have been purposely given large values to demonstrate the placement of the blue, green, and red rectangles on their respective `<coord-box>` edges: border-box, padding-box, and content-box.
#### Result
### Creating an offset-path using path()
In this example, the `<svg>` element creates a house with a chimney and also defines two halves of a scissor. The house and chimney are composed of rectangles and polygons, and the scissor halves are represented by two distinct path elements. In the CSS code, the `offset-path` property is used to specify a path to follow for the two scissor halves. This CSS-defined path is identical to the one represented by the `<path>` element in the SVG, which is the outline of the house including the chimney.
    
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="700"
      height="450"
      viewBox="350 0 1400 900">
      <title>House and Scissors</title>
      <rect x="595" y="423" width="610" height="377" fill="blue" />
      <polygon points="506,423 900,190 1294,423" fill="yellow" />
      <polygon points="993,245 993,190 1086,190 1086,300" fill="red" />
      <path
        id="house"
        d="M900,190 L993,245 V201 A11,11 0 0,1 1004,190 H1075 A11,11 0 0,1 1086,201 V300 L1294,423 H1216 A11,11 0 0,0 1205,434 V789 A11,11 0 0,1 1194,800 H606 A11,11 0 0,1 595,789 V434 A11,11 0 0,0 584,423 H506 L900,190"
        fill="none"
        stroke="black"
        stroke-width="13"
        stroke-linejoin="round"
        stroke-linecap="round" />
      <path
        id="first-scissor-half"
        class="scissor-half"
        d="M30,0 H-10 A10,10 0 0,0 -20,10 A20,20 0 1,1 -40,-10 H20 A10,10 0 0,1 30,0 M-40,20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,20 M0,0" />
      <path
        id="second-scissor-half"
        class="scissor-half"
        d="M30,0 H-10 A10,10 0 0,1 -20,-10 A20,20 0 1,0 -40,10 H20 A10,10 0 0,0 30,0 M-40,-20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,-20 M0,0" />
    </svg>
    
    
    .scissor-half {
      offset-path: path(
        "M900,190 L993,245 V201 A11,11 0 0,1 1004,190 H1075 A11,11 0 0,1 1086,201 V300 L1294,423 H1216 A11,11 0 0,0 1205,434 V789 A11,11 0 0,1 1194,800 H606 A11,11 0 0,1 595,789 V434 A11,11 0 0,0 584,423 H506 L900,190"
      );
      transform: translate(0px, 0px);
      fill: green;
      stroke: black;
      stroke-width: 5px;
      stroke-linejoin: round;
      stroke-linecap: round;
      fill-rule: evenodd;
      offset-anchor: 0 0;
    }
    
    #first-scissor-half {
      animation:
        move 12s linear infinite,
        rotate-left 1s infinite;
    }
    #second-scissor-half {
      animation:
        move 12s linear infinite,
        rotate-right 1s infinite;
    }
    
    @keyframes move {
      from {
        offset-distance: 0%;
      }
      to {
        offset-distance: 100%;
      }
    }
    
    @keyframes rotate-left {
      0% {
        offset-rotate: auto 0deg;
      }
      50% {
        offset-rotate: auto -45deg;
      }
      100% {
        offset-rotate: auto 0deg;
      }
    }
    
    @keyframes rotate-right {
      0% {
        offset-rotate: auto 0deg;
      }
      50% {
        offset-rotate: auto 45deg;
      }
      100% {
        offset-rotate: auto 0deg;
      }
    }
    
#### Result
Without the `offset-path` property, the two halves of the scissors would default to the top-left corner of the canvas. However, by using `offset-path`, the two scissor halves are aligned with the starting point of the SVG path, allowing them to move along it.
### Creating an offset-path using url()
This example illustrates how to refer to an SVG shape to define the shape of the path that an element can follow. The green circle (defined by `.target`) follows the path of a rectangle, which is defined by passing the SVG shape's ID (`svgRect`) to the `offset-path` property by using `url()`.
The SVG rectangle that defines the path shape is shown here only to visually demonstrate that the green circle is indeed following the path defined by this rectangle.
    
    <div class="outer">
      <div class="target"></div>
    </div>
    <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg">
      <rect id="svgRect" x="50" y="50" width="200" height="100" />
    </svg>
    
    
    .target {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background-color: green;
      offset-path: url("#svgRect");
      offset-anchor: auto;
      animation: move 5s linear infinite;
    }
    
    #svgRect {
      fill: antiquewhite;
      stroke: black;
      stroke-width: 2;
    }
    
    @keyframes move {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
### Different shapes
This example involves different `<basic-shape>` values: `circle()`, `ellipse()`, `inset()`, `polygon()`.
    
    <div class="container">
      <div class="mover mover-path">path()</div>
      <div class="mover mover-circle">circle()</div>
      <div class="mover mover-ellipse">ellipse()</div>
      <div class="mover mover-inset">inset()</div>
      <div class="mover mover-polygon">polygon()</div>
    </div>
    
    
    .container {
      border: 1px solid black;
      width: 80vw;
      height: 80vh;
      position: relative;
      left: 10vw;
      top: 10vh;
    }
    
    .mover {
      width: 100px;
      height: 80px;
      border-radius: 50%;
      line-height: 80px;
      text-indent: 10px;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='e644da42-a34e-4ceb-a89a-89a4eb6dcc51' data-name='Layer 1' viewBox='0 0 71.08 54.62'%3E%3Ctitle%3Epointer-hand%3C/title%3E%3Cpath d='M43.56,49.35a5.24,5.24,0,0,0-1.27-3.43,5.26,5.26,0,0,0,1.86-9,5.26,5.26,0,0,0-.5-9.53L66.12,27c2.28-.07,5-1.57,5-4.58a5.06,5.06,0,0,0-4.58-4.83L34.08,17c3.48-2.89,6.26-6.55,6.73-11.08C41.45-.14,36.07-1.15,35,1.09,32,7.11,23,12.75,17.42,15.52,8.64,19.08,0,19.77,0,34.56,0,42.7,2.7,47.94,9.42,51c5.51,2.52,13.71,3.59,25.36,3.59H38.3A5.27,5.27,0,0,0,43.56,49.35Z'/%3E%3C/svg%3E")
        no-repeat;
      background-size: cover;
      color: white;
      animation: move 10s linear infinite;
      font-family: monospace;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      transform-origin: center center;
    }
    .mover-path {
      top: 50px;
      motion-path: path(
        "M18.45,58.46s52.87-70.07,101.25-.75,101.75-6.23,101.75-6.23S246.38,5.59,165.33,9.08s-15,71.57-94.51,74.56S18.45,58.46,18.45,58.46Z"
      );
      offset-path: path(
        "M18.45,58.46s52.87-70.07,101.25-.75,101.75-6.23,101.75-6.23S246.38,5.59,165.33,9.08s-15,71.57-94.51,74.56S18.45,58.46,18.45,58.46Z"
      );
    }
    .mover-circle {
      top: 150px;
      offset-path: circle(100px at 50px 50px);
      motion-path: circle(100px at 50px 50px);
    }
    .mover-ellipse {
      top: 250px;
      offset-path: ellipse(25% 40% at 50% 50%);
      motion-path: ellipse(25% 40% at 50% 50%);
    }
    .mover-inset {
      top: 350px;
      offset-path: inset(5% 20% 15% 10%);
      motion-path: inset(5% 20% 15% 10%);
    }
    .mover-polygon {
      top: 450px;
      offset-path: polygon(
        30% 0%,
        70% 0%,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0% 70%,
        0% 30%
      );
      motion-path: polygon(
        30% 0%,
        70% 0%,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0% 70%,
        0% 30%
      );
    }
    
    @keyframes move {
      100% {
        motion-offset: 100%;
        offset-distance: 100%;
      }
    }
    
# :paused
The `:paused` CSS pseudo-class selector represents an element that is playable, such as `<audio>` or `<video>`, when that element is "paused" (i.e., not "playing").
A resource is paused if the user explicitly paused it, or if it is in a non-activated or other non-playing state, like "loaded, hasn't been activated yet". This is different from `:buffering` or `:stalled`, which are states that occur while the resource is considered "playing".
## Syntax
    
    :paused {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :paused {
      border: 5px solid orange;
    }
    
# padding-left
The `padding-left` CSS property sets the width of the padding area to the left of an element.
## Try it
    
    padding-left: 1.5em;
    
    
    padding-left: 10%;
    
    
    padding-left: 20px;
    
    
    padding-left: 1ch;
    
    
    padding-left: 0;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
    }
    
An element's padding area is the space between its content and its border.
Note: The `padding` property can be used to set paddings on all four sides of an element with a single declaration.
## Syntax
    
    /* <length> values */
    padding-left: 0.5em;
    padding-left: 0;
    padding-left: 2cm;
    
    /* <percentage> value */
    padding-left: 10%;
    
    /* Global values */
    padding-left: inherit;
    padding-left: initial;
    padding-left: revert;
    padding-left: revert-layer;
    padding-left: unset;
    
The `padding-left` property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Examples
>
### Setting left padding using pixels and percentages
    
    .content {
      padding-left: 5%;
    }
    .side-box {
      padding-left: 10px;
    }
    
# :fullscreen
The `:fullscreen` CSS pseudo-class matches every element that is currently in fullscreen mode. If multiple elements have been put into fullscreen mode, this selects them all.
## Syntax
    
    :fullscreen {
      /* ... */
    }
    
## Usage notes
The `:fullscreen` pseudo-class lets you configure your stylesheets to automatically adjust the size, style, or layout of content when elements switch back and forth between fullscreen and traditional presentations.
## Examples
>
### Styling a fullscreen element
This example applies a different background color to a `<div>` element, depending on whether or not it is in fullscreen mode. It includes a `<button>` to toggle fullscreen on and off.
    
    <div class="element">
      <h1><code>:fullscreen</code> pseudo-class demo</h1>
    
      <p>
        This demo uses the <code>:fullscreen</code> pseudo-class to automatically
        change the background color of the <code>.element</code> div.
      </p>
    
      <p>
        Normally, the background is light yellow. In fullscreen mode, the background
        is light pink.
      </p>
    
      <button class="toggle">Toggle Fullscreen</button>
    </div>
    
The `:fullscreen` pseudo-class is used to override the `background-color` of the `<div>` when it is in fullscreen mode.
    
    .element {
      background-color: lightyellow;
    }
    
    .element:fullscreen {
      background-color: lightpink;
    }
    
The following JavaScript provides an event handler function that toggles fullscreen when the `<button>` is clicked.
    
    document.querySelector(".toggle").addEventListener("click", (event) => {
      if (document.fullscreenElement) {
        // If there is a fullscreen element, exit full screen.
        document.exitFullscreen();
        return;
      }
      // Make the .element div fullscreen.
      document.querySelector(".element").requestFullscreen();
    });
    
# @view-transition
The `@view-transition` CSS at-rule is used to opt in the current and destination documents to undergo a view transition, in the case of a cross-document navigation.
For a cross-document view transition to work, the current and destination documents of the navigation also need to be on the same origin.
## Syntax
    
    @view-transition {
      navigation: auto;
    }
    
### Descriptors
`navigation`
    
Specifies the effect this at-rule will have on the document's view transition behavior. Possible values are:
  * `auto`: The document will undergo a view transition when taking part in a navigation, provided the navigation is same-origin, without cross-origin redirects, and its `navigationType` is `traverse`, `push`, or `replace`. In the case of `push` or `replace`, the navigation must be initiated by a user interacting with the page content, not by a browser UI feature.
  * `none`: The document will not undergo a view transition.


## Examples
>
### Transitioning page view
The following code snippets show key concepts used in a page transition demo. The demo uses cross-document view-transitions; a half second transition that occurs when navigating between two pages of a site. For the full demo, see the View transitions multi-page app demo.
The `@view-transition` at-rule is specified in the CSS for both your current and destination documents of a navigation to opt them both in to the view transition:
    
    @view-transition {
      navigation: auto;
    }
    
In addition to the `@view-transition` at-rule, we use the `@keyframes` at-rule to define two keyframe animations and use the `animation` shorthand property to apply those keyframe animations to the elements in the outbound (`::view-transition-old()`) and inbound (`::view-transition-new()`) pages that we want to animate.
    
    /* Create a custom animation */
    @keyframes move-out {
      from {
        transform: translateY(0%);
      }
    
      to {
        transform: translateY(-100%);
      }
    }
    
    @keyframes move-in {
      from {
        transform: translateY(100%);
      }
    
      to {
        transform: translateY(0%);
      }
    }
    
    /* Apply the custom animation to the old and new page states */
    ::view-transition-old(root) {
      animation: 0.4s ease-in both move-out;
    }
    
    ::view-transition-new(root) {
      animation: 0.4s ease-in both move-in;
    }
    
See this transitions multi-page app demo live.
# mask-border
The `mask-border` CSS shorthand property lets you create a mask along the edge of an element's border.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `mask-border-mode`
  * `mask-border-outset`
  * `mask-border-repeat`
  * `mask-border-slice`
  * `mask-border-source`
  * `mask-border-width`


## Syntax
    
    /* source | slice */
    mask-border: url("border-mask.png") 25;
    
    /* source | slice | repeat */
    mask-border: url("border-mask.png") 25 space;
    
    /* source | slice | width */
    mask-border: url("border-mask.png") 25 / 35px;
    
    /* source | slice | width | outset | repeat | mode */
    mask-border: url("border-mask.png") 25 / 35px / 12px space alpha;
    
    /* Global values */
    mask-border: inherit;
    mask-border: initial;
    mask-border: revert;
    mask-border: revert-layer;
    mask-border: unset;
    
### Values
`<'mask-border-source'>`
    
The source image. See `mask-border-source`.
`<'mask-border-slice'>`
    
The dimensions for slicing the source image into regions. Up to four values may be specified. See `mask-border-slice`.
`<'mask-border-width'>`
    
The width of the border mask. Up to four values may be specified. See `mask-border-width`.
`<'mask-border-outset'>`
    
The distance of the border mask from the element's outside edge. Up to four values may be specified. See `mask-border-outset`.
`<'mask-border-repeat'>`
    
Defines how the edge regions of the source image are adjusted to fit the dimensions of the border mask. Up to two values may be specified. See `mask-border-repeat`.
`<'mask-border-mode'>`
    
Defines whether the source image is treated as a luminance mask or alpha mask. See `mask-border-mode`.
## Examples
>
### Setting a bitmap-based mask border
In this example, we will mask an element's border with a diamond pattern. The source for the mask is a ".png" file of 90 by 90 pixels, with three diamonds going vertically and horizontally:
To match the size of a single diamond, we will use a value of 90 divided by 3, or `30`, for slicing the image into corner and edge regions. A repeat value of `round` will make the mask slices fit evenly, i.e., without clipping or gaps.
    
    <div class="masked">
      This element is surrounded by a bitmap-based mask border! Pretty neat, isn't
      it?
    </div>
    
    
    .masked {
      width: 200px;
      background-color: lavender;
      border: 18px solid salmon;
      padding: 10px;
    
      -webkit-mask-box-image: url("https://mdn.github.io/shared-assets/images/examples/mask-border-diamonds.png")
        30 fill /          /* slice */
        20px /             /* width */
        1px                /* outset */
        round;             /* repeat */
    
      mask-border:
        url("https://mdn.github.io/shared-assets/images/examples/mask-border-diamonds.png")
        30 fill /        /* slice */
        20px /           /* width */
        1px              /* outset */
        round;           /* repeat */
    }
    
# :lang()
The `:lang()` CSS pseudo-class matches elements based on the language they are determined to be in.
## Try it
    
    *:lang(en-US) {
      outline: 2px solid deeppink;
    }
    
    
    <p lang="en-US">
      Music during road trips and long commutes aren’t a problem, but using
      headphones isn’t the best thing to do while driving in your car.
    </p>
    
    <p lang="pl-PL">
      Gdy widzimy znak z narysowaną czaszką i napisem
      <strong lang="en-US">DANGER</strong> to lepiej nie wchodzić do środka.
    </p>
    
Note: In HTML, the language is determined by a combination of the `lang` attribute, the `<meta>` element, and possibly by information from the protocol (such as HTTP headers). For other document types there may be other document methods for determining the language.
## Syntax
    
    :lang(<language-code> [,<language-code> ]*) {
      /* ... */
    }
    
### Parameters
`<language-code>`
    
A comma separated list of one or more `<string>`s that target an element with a language value according to BCP 47 language codes. Matching by language range is case-insensitive.
## Description
When selecting languages, there is implicit wildcard matching, so `:lang(de-DE)` will match `de-DE`, `de-DE-1996`, `de-Latn-DE`, `de-Latf-DE`, and `de-Latn-DE-1996`. Explicitly using wildcards must include a full match of a language subtag, so `:lang("*-F*")` is invalid but `:lang("*-Fr")` is valid.
## Examples
>
### Matching children of a given language
In this example, the `:lang()` pseudo-class is used to match the parents of quote elements (`<q>`) using child combinators. Note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document. Also note that Unicode values are used to specify some of the special quote characters.
#### HTML
    
    <div lang="en">
      <q>This English quote has a <q>nested</q> quote inside.</q>
    </div>
    <div lang="fr">
      <q>This French quote has a <q>nested</q> quote inside.</q>
    </div>
    <div lang="de">
      <q>This German quote has a <q>nested</q> quote inside.</q>
    </div>
    
#### CSS
    
    :lang(en) > q {
      quotes: "\201C" "\201D" "\2018" "\2019";
    }
    :lang(fr) > q {
      quotes: "« " " »";
    }
    :lang(de) > q {
      quotes: "»" "«" "\2039" "\203A";
    }
    
#### Result
### Matching multiple languages
The following example shows how to match multiple languages by providing a comma-separated list of language codes. It's also possible to use a wildcard to match languages in a given language range.
#### CSS
    
    /* Matches nl and de */
    :lang("nl", "de") {
      color: green;
    }
    
    /* Omitting quotes & case-insensitive matching */
    :lang(EN, FR) {
      color: blue;
    }
    
    /* Wildcard matching a language range */
    :lang("*-Latn") {
      color: red;
    }
    
#### HTML
    
    <p lang="nl">Dit is een Nederlandse paragraaf.</p>
    <p lang="de">Dies ist ein deutscher Satz.</p>
    <p lang="en">This is an English sentence.</p>
    <p lang="en-GB">Matching the language range of English.</p>
    <p lang="fr">Ceci est un paragraphe français.</p>
    <p lang="fr-Latn-FR">Ceci est un paragraphe français en latin.</p>
    
#### Result
# <integer>
The `<integer>` CSS data type is a special type of `<number>` that represents a positive or negative whole number. Integers can be used in numerous CSS properties and descriptors, such as the `column-count`, `counter-increment`, `grid-column`, `grid-row`, and `z-index` properties and the `range` descriptor.
## Syntax
The `<integer>` data type consists of one or several decimal digits, 0 through 9 inclusive, optionally preceded by a single `+` or `-` sign. There is no unit associated with integers.
Note: There is no official range of valid `<integer>` values, and the specifications do not specify a range.
## Interpolation
When animated, values of the `<integer>` data type are interpolated using discrete, whole steps. The calculation is done as if they were real, floating-point numbers; the discrete value is obtained using the floor function. The speed of the interpolation is determined by the easing function associated with the animation.
## Examples
>
### Valid integers
    
    12          Positive integer (without a leading + sign)
    +123        Positive integer (with a leading + sign)
    -456        Negative integer
    0           Zero
    +0          Zero, with a leading +
    -0          Zero, with a leading -
    
### Invalid integers
    
    12.0        This is a <number>, not an <integer>, though it represents an integer.
    12.         Decimal points are not allowed.
    +---12      Only one leading +/- is allowed.
    ten         Letters are not allowed.
    _5          Special characters are not allowed.
    \35         Escaped Unicode characters are not allowed, even if they are an integer (here: 5).
    \4E94       Non-arabic numerals are not allowed, even when escaped (here: the Japanese 5, 五).
    3e4         Scientific notation is not allowed.
    
# scroll-behavior
The `scroll-behavior` CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs.
## Try it
    
    scroll-behavior: auto;
    
    
    scroll-behavior: smooth;
    
    
    <section id="default-example">
      <div class="container">
        <p class="nav">
          Scroll to:
          <a href="#pageA">A</a>
          <a href="#pageB">B</a>
          <a href="#pageC">C</a>
        </p>
        <scroll-container id="example-element">
          <scroll-page id="pageA">A</scroll-page>
          <scroll-page id="pageB">B</scroll-page>
          <scroll-page id="pageC">C</scroll-page>
        </scroll-container>
      </div>
    </section>
    
    
    .container {
      flex-direction: column;
    }
    
    .nav a {
      color: #009e5f;
    }
    
    scroll-container {
      border: 1px solid black;
      display: block;
      height: 200px;
      overflow-y: scroll;
      width: 200px;
    }
    
    scroll-page {
      align-items: center;
      display: flex;
      font-size: 5em;
      height: 100%;
      justify-content: center;
    }
    
Note that any other scrolls, such as those performed by the user, are not affected by this property. When this property is specified on the root element, it applies to the viewport instead. This property specified on the `body` element will not propagate to the viewport.
User agents are allowed to ignore this property.
## Syntax
    
    /* Keyword values */
    scroll-behavior: auto;
    scroll-behavior: smooth;
    
    /* Global values */
    scroll-behavior: inherit;
    scroll-behavior: initial;
    scroll-behavior: revert;
    scroll-behavior: revert-layer;
    scroll-behavior: unset;
    
The `scroll-behavior` property is specified as one of the keyword values listed below.
### Values
`auto`
    
The scrolling box scrolls instantly.
`smooth`
    
The scrolling box scrolls in a smooth fashion using a user-agent-defined easing function over a user-agent-defined period of time. User agents should follow platform conventions, if any.
## Examples
>
### Setting smooth scroll behavior
#### HTML
    
    <nav>
      <a href="#page-1">1</a>
      <a href="#page-2">2</a>
      <a href="#page-3">3</a>
    </nav>
    <div class="scroll-container">
      <div class="scroll-page" id="page-1">1</div>
      <div class="scroll-page" id="page-2">2</div>
      <div class="scroll-page" id="page-3">3</div>
    </div>
    
#### CSS
    
    a {
      display: inline-block;
      width: 50px;
      text-decoration: none;
    }
    nav,
    .scroll-container {
      display: block;
      margin: 0 auto;
      text-align: center;
    }
    nav {
      width: 339px;
      padding: 5px;
      border: 1px solid black;
    }
    .scroll-container {
      width: 350px;
      height: 200px;
      overflow-y: scroll;
      scroll-behavior: smooth;
    }
    .scroll-page {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      font-size: 5em;
    }
    
#### Result
# hyphenate-character
The `hyphenate-character` CSS property sets the character (or string) used at the end of a line before a hyphenation break.
Both automatic and soft hyphens are displayed according to the specified hyphenate-character value.
## Try it
    
    hyphenate-character: auto;
    
    
    hyphenate-character: "=";
    
    
    hyphenate-character: "—";
    
    
    <section id="default-example">
      <p id="example-element">An extra­ordinarily long English word!</p>
    </section>
    
    
    #example-element {
      border: 2px dashed #999999;
      font-size: 1.5rem;
      text-align: left;
      width: 7rem;
      hyphens: auto;
    }
    
## Syntax
    
    hyphenate-character: <string>;
    hyphenate-character: auto;
    
The value either sets the string to use instead of a hyphen, or indicates that the user agent should select an appropriate string based on the current typographic conventions (default).
### Values
`<string>`
    
The `<string>` to use at the end of the line before a hyphenation break. The user agent may truncate this value if too many characters are used.
`auto`
    
The user-agent selects an appropriate string based on the content language's typographic conventions. This is the default property value, and only needs to be explicitly set in order to override a different inherited value.
## Examples
This example shows two identical blocks of text that have `hyphens` set to ensure that they break wherever needed, and on soft hyphen breaks (created using `&shy;`). The first block has the value of the hyphen changed to the equals symbol (`=`). The second block has no hyphenate-character set, which is equivalent to `hyphenate-character: auto` for user agents that support this property.
### HTML
    
    <dl>
      <dt><code>hyphenate-character: "="</code></dt>
      <dd id="string" lang="en">Superc&shy;alifragilisticexpialidocious</dd>
      <dt><code>hyphenate-character is not set</code></dt>
      <dd lang="en">Superc&shy;alifragilisticexpialidocious</dd>
    </dl>
    
### CSS
    
    dd {
      width: 90px;
      border: 1px solid black;
      hyphens: auto;
    }
    
    dd#string {
      -webkit-hyphenate-character: "=";
      hyphenate-character: "=";
    }
    
### Result
# <self-position>
The `<self-position>` enumerated value data type is used by the `justify-self` and `align-self` properties, and the `place-self` shorthand, to align the box within its alignment container. It is also used by the `justify-items` and `align-items` properties, and the `place-items` shorthand, to specify default values for `justify-self` and `align-self`.
## Syntax
    
    <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
    
## Values
The following keyword values are represented by the `<self-position>` grammar term:
`center`
    
Centers the alignment subject within its alignment container.
`start`
    
Aligns the alignment subject flush with the alignment container's start edge.
`end`
    
Aligns the alignment subject flush with the alignment container's end edge.
`self-start`
    
Aligns the alignment subject flush with the edge of the alignment container corresponding to the alignment subject's start side.
`self-end`
    
Aligns the alignment subject flush with the edge of the alignment container corresponding to the alignment subject's end side.
`flex-start`
    
In flex layout, aligns the alignment subject flush with the edge of the alignment container corresponding to the flex container's main-start or cross-start side, as appropriate. It is identical to `start` for layout modes other than flex layout.
`flex-end`
    
In flex layout, aligns the alignment subject flush with the edge of the alignment container corresponding to the flex container's main-end or cross-end side, as appropriate. Identical to `end` for layout modes other than flex layout.
Note: The `left` and `right` keywords are excluded from `<self-position>`, despite being valid positional alignment values for the `justify-*` properties (`justify-content`, `justify-self`, and `justify-items`), because they are not allowed in the `align-*` properties (`align-content`, `align-self`, and `align-items`). They are instead explicitly included in the `justify-*` properties' grammars.
# CSS filter effects
The properties in the CSS filter effects module let you define a way of processing an element's rendering before the element is displayed in the document. Examples of such effects include blurring and changing the intensity of the color of an element.
## Filter effects in action
Play with the various sliders to apply filter effects to the image below.
### Properties
  * `backdrop-filter`
  * `filter`


### Functions
  * `blur()`
  * `brightness()`
  * `contrast()`
  * `drop-shadow()`
  * `grayscale()`
  * `hue-rotate()`
  * `invert()`
  * `opacity()`
  * `saturate()`
  * `sepia()`


## Guides
Using CSS filter effects
    
Overview of the concepts surrounding CSS filter effects, including properties, filter functions, and SVG filters, with an explanation of filter values, source order, and value interactions.
## Related concepts
  * `<image>` data type
  * `<filter-function>` data type
  * `background-image` CSS property
  * `background-blend-mode` CSS property
  * `mix-blend-mode` CSS property
  * interpolation glossary term
  * `color-interpolation-filters` SVG property


# scroll-margin-bottom
The `scroll-margin-bottom` property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-bottom: 0;
    
    
    scroll-margin-bottom: 20px;
    
    
    scroll-margin-bottom: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-bottom: 10px;
    scroll-margin-bottom: 1em;
    
    /* Global values */
    scroll-margin-bottom: inherit;
    scroll-margin-bottom: initial;
    scroll-margin-bottom: revert;
    scroll-margin-bottom: revert-layer;
    scroll-margin-bottom: unset;
    
### Values
`<length>`
    
An outset from the bottom edge of the scroll container.
# animation-fill-mode
The `animation-fill-mode` CSS property sets how a CSS animation applies styles to its target before and after its execution.
## Try it
    
    animation-fill-mode: none;
    animation-delay: 1s;
    
    
    animation-fill-mode: forwards;
    animation-delay: 1s;
    
    
    animation-fill-mode: backwards;
    animation-delay: 1s;
    
    
    animation-fill-mode: both;
    animation-delay: 1s;
    
    
    <section class="flex-column" id="default-example">
      <div>Animation <span id="play-status"></span></div>
      <div id="example-element">Select a mode to start!</div>
    </section>
    
    
    #example-element {
      background-color: #1766aa;
      color: white;
      margin: auto;
      margin-left: 0;
      border: 5px solid #333333;
      width: 150px;
      height: 150px;
      border-radius: 50%;
    
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
    }
    
    #play-status {
      font-weight: bold;
    }
    
    .animating {
      animation: slide 1s ease-in 1;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const status = document.getElementById("play-status");
    
    function update() {
      status.textContent = "delaying";
      el.className = "";
      window.requestAnimationFrame(() => {
        window.requestAnimationFrame(() => {
          el.className = "animating";
        });
      });
    }
    
    el.addEventListener("animationstart", () => {
      status.textContent = "playing";
    });
    
    el.addEventListener("animationend", () => {
      status.textContent = "finished";
    });
    
    const observer = new MutationObserver(() => {
      update();
    });
    
    observer.observe(el, {
      attributes: true,
      attributeFilter: ["style"],
    });
    
    update();
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Single animation */
    animation-fill-mode: none;
    animation-fill-mode: forwards;
    animation-fill-mode: backwards;
    animation-fill-mode: both;
    
    /* Multiple animations */
    animation-fill-mode: none, backwards;
    animation-fill-mode: both, forwards, none;
    
    /* Global values */
    animation-fill-mode: inherit;
    animation-fill-mode: initial;
    animation-fill-mode: revert;
    animation-fill-mode: revert-layer;
    animation-fill-mode: unset;
    
### Values
`none`
    
The animation will not apply any styles to the target when it's not executing. The element will instead be displayed using any other CSS rules applied to it. This is the default value.
`forwards`
    
The target will retain the computed values set by the last keyframe encountered during execution. The last keyframe depends on the value of `animation-direction` and `animation-iteration-count`:
`animation-direction` `animation-iteration-count` last keyframe encountered  
`normal` even or odd `100%` or `to`  
`reverse` even or odd `0%` or `from`  
`alternate` even `0%` or `from`  
`alternate` odd `100%` or `to`  
`alternate-reverse` even `100%` or `to`  
`alternate-reverse` odd `0%` or `from`  
Animated properties behave as if included in a set `will-change` property value. If a new stacking context was created during the animation, the target element retains the stacking context after the animation has finished.
`backwards`
    
The animation will apply the values defined in the first relevant keyframe as soon as it is applied to the target, and retain this during the `animation-delay` period. The first relevant keyframe depends on the value of `animation-direction`:
`animation-direction` first relevant keyframe  
`normal` or `alternate` `0%` or `from`  
`reverse` or `alternate-reverse` `100%` or `to`  
`both`
    
The animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: `animation-fill-mode` has the same effect when creating CSS scroll-driven animations as it does for regular time-based animations.
## Examples
>
### Setting fill mode
You can see the effect of `animation-fill-mode` in the following example. It demonstrates how you can make the animation remain in its final state rather than reverting to the original state (which is the default).
#### HTML
    
    <p>Move your mouse over the gray box!</p>
    <div class="demo">
      <div class="grows-and-stays">This grows and stays big.</div>
      <div class="grows">This just grows.</div>
    </div>
    
#### CSS
    
    .demo {
      border-top: 100px solid #cccccc;
      height: 300px;
    }
    
    @keyframes grow {
      0% {
        font-size: 0;
      }
      100% {
        font-size: 40px;
      }
    }
    
    .demo:hover .grows {
      animation-name: grow;
      animation-duration: 3s;
    }
    
    .demo:hover .grows-and-stays {
      animation-name: grow;
      animation-duration: 3s;
      animation-fill-mode: forwards;
    }
    
#### Result
See CSS animations for more examples.
# max-width
The `max-width` CSS property sets the maximum width of an element. It prevents the used value of the `width` property from becoming larger than the value specified by `max-width`.
## Try it
    
    max-width: 150px;
    
    
    max-width: 20em;
    
    
    max-width: 75%;
    
    
    max-width: 20ch;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        Change the maximum width.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
`max-width` overrides `width`, but `min-width` overrides `max-width`.
## Syntax
    
    /* <length> value */
    max-width: 3.5em;
    max-width: anchor-size(--my-anchor inline, 245px);
    max-width: calc(anchor-size(width) + 4em);
    
    /* <percentage> value */
    max-width: 75%;
    
    /* Keyword values */
    max-width: none;
    max-width: max-content;
    max-width: min-content;
    max-width: fit-content;
    max-width: fit-content(20em);
    max-width: stretch;
    
    /* Global values */
    max-width: inherit;
    max-width: initial;
    max-width: revert;
    max-width: revert-layer;
    max-width: unset;
    
### Values
`<length>`
    
Defines the `max-width` as an absolute value.
`<percentage>`
    
Defines the `max-width` as a percentage of the containing block's width.
`none`
    
No limit on the size of the box.
`max-content`
    
The intrinsic preferred `max-width`.
`min-content`
    
The intrinsic minimum `max-width`.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the `fit-content` formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, argument))`.
`stretch`
    
Limits the maximum width of the element's margin box to the width of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
Note: To check aliases used by browsers for the `stretch` value and its implementation status, see the Browser compatibility section.
## Accessibility
Ensure that elements set with a `max-width` are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Setting max width in pixels
In this example, the "child" will be either 150 pixels wide or the width of the "parent," whichever is smaller.
#### HTML
    
    <div id="parent">
      <div id="child">
        Fusce pulvinar vestibulum eros, sed luctus ex lobortis quis.
      </div>
    </div>
    
#### CSS
    
    #parent {
      background: lightblue;
      width: 300px;
    }
    
    #child {
      background: gold;
      width: 100%;
      max-width: 150px;
    }
    
#### Result
# border
The `border` shorthand CSS property sets an element's border. It sets the values of `border-width`, `border-style`, and `border-color`.
## Try it
    
    border: solid;
    
    
    border: dashed red;
    
    
    border: 1rem solid;
    
    
    border: thick double #32a1ce;
    
    
    border: 4mm ridge rgb(211 220 50 / 0.6);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-width`
  * `border-style`
  * `border-color`


## Syntax
    
    /* style */
    border: solid;
    
    /* width | style */
    border: 2px dotted;
    
    /* style | color */
    border: outset #ff3333;
    
    /* width | style | color */
    border: medium dashed green;
    
    /* Global values */
    border: inherit;
    border: initial;
    border: revert;
    border: revert-layer;
    border: unset;
    
The `border` property may be specified using one, two, or three of the values listed below. The order of the values does not matter.
Note: The border will be invisible if its style is not defined. This is because the style defaults to `none`.
### Values
`<line-width>`
    
Sets the thickness of the border. Defaults to `medium` if absent. See `border-width`.
`<line-style>`
    
Sets the style of the border. Defaults to `none` if absent. See `border-style`.
`<color>`
    
Sets the color of the border. Defaults to `currentColor` if absent. See `border-color`.
## Description
As with all shorthand properties, any omitted sub-values will be set to their initial value. Importantly, `border` cannot be used to specify a custom value for `border-image`, but instead sets it to its initial value, i.e., `none`.
The `border` shorthand is especially useful when you want all four borders to be the same. To make them different from each other, however, you can use the longhand `border-width`, `border-style`, and `border-color` properties, which accept different values for each side. Alternatively, you can target one border at a time with the physical (e.g., `border-top` ) and logical (e.g., `border-block-start`) border properties.
### Borders vs. outlines
Borders and outlines are very similar. However, outlines differ from borders in the following ways:
  * Outlines never take up space, as they are drawn outside of an element's content.
  * According to the spec, outlines don't have to be rectangular, although they usually are.


## Examples
>
### Setting a pink outset border
#### HTML
    
    <div>I have a border, an outline, and a box shadow! Amazing, isn't it?</div>
    
#### CSS
    
    div {
      border: 0.5rem outset pink;
      outline: 0.5rem solid khaki;
      box-shadow: 0 0 0 2rem skyblue;
      border-radius: 12px;
      font: bold 1rem sans-serif;
      margin: 2rem;
      padding: 1rem;
      outline-offset: 0.5rem;
    }
    
#### Result
# CSS pseudo-elements
The CSS pseudo-element module defines abstract elements that are not directly present in the document tree. These abstract elements, called pseudo-elements, represent portions of the render tree that can be selected and styled. Pseudo-elements are used to create abstractions about the document tree beyond those provided by the document tree.
Pseudo-elements are prefixed with a double colon (`::`). You add pseudo-elements to selectors (as in `p::first-line`) to target and style these faux elements.
Pseudo-elements enable targeting entities not included in HTML and sections of content that cannot be targeted otherwise without adding extra markup. Consider the placeholder of an `<input>` element. This is an abstract element and not a distinct node in the document tree. You can select this placeholder by using the `::placeholder` pseudo-element. As another example, the `::selection` pseudo-element matches the content currently highlighted by a user, allowing you to style what is matched as the user interacts with the content and changes the selection. Similarly, the `::first-line` pseudo-element targets the first line of an element, updating automatically if the character count of the first line changes, without having to query the element's line length.
## Reference
>
### Selectors
  * `::after`
  * `::before`
  * `::file-selector-button`
  * `::first-letter`
  * `::first-line`
  * `::grammar-error`
  * `::highlight()`
  * `::marker`
  * `::placeholder`
  * `::selection`
  * `::spelling-error`
  * `::target-text`


The specification also defines the `::details-content` and `::search-text` pseudo-elements and the `::postfix` and `::prefix` sub-pseudo elements. These are not yet supported by any browser. The `::highlight()` pseudo-element is included within this module, but most details are provided in the CSS custom highlight API.
### Interfaces
  * `CSSPseudoElement` interface 
    * `CSSPseudoElement.element` property
    * `CSSPseudoElement.type` property


### Terms
  * Pseudo-element glossary term


## Guides
CSS pseudo-elements
    
Alphabetical list of pseudo-elements defined by all the CSS specifications and WebVTT.
Learn: Pseudo-classes and pseudo-elements
    
Part of CSS building blocks section on selectors. This article defines what a pseudo-element is and how it can be combined with pseudo-classes and be used for generating content with `::before` and `::after` pseudo-elements.
How to create fancy boxes using pseudo-elements
    
Example of styling generated content using `::before` and `::after` pseudo-elements for visual effects.
## Related concepts
  * `::backdrop`
  * Web Video Text Tracks Format (WebVTT) cues:
    * `::cue`
    * `::cue()`
  * CSS multi-column layout module
    * `::column`
  * CSS overflow module
    * `::scroll-button()`
    * `::scroll-marker`
    * `::scroll-marker-group`
    * `:target-current`
  * CSS scoping module
    * `:host`
    * `:host()`
    * `:host-context()`
    * `::slotted()`
  * CSS shadow parts module
    * `::part`
  * CSS view transitions module
    * `::view-transition` Experimental
    * `::view-transition-image-pair()` Experimental
    * `::view-transition-group()` Experimental
    * `::view-transition-new()` Experimental
    * `::view-transition-old()` Experimental
  * CSS selectors
    * Attribute selectors
    * Combinators
    * Class selectors
    * ID selectors
    * Type selectors
    * Pseudo-classes
    * Universal selectors
  * `placeholder` attribute of the `<input>` element
  * `:placeholder-shown` selector
  * CSS generated content
    * `content` property
    * `quotes` property
  * Text fragments
  * `AnimationEvent.pseudoElement` property
  * `KeyframeEffect.pseudoElement` property
  * `TransitionEvent.pseudoElement` property


# line-height
The `line-height` CSS property sets the height of a line box in horizontal writing modes. In vertical writing modes, it sets the width of a line box. It's commonly used to set the distance between lines of text. On block-level elements in horizontal writing modes, it specifies the preferred height of line boxes within the element, and on non-replaced inline elements, it specifies the height that is used to calculate line box height.
## Try it
    
    line-height: normal;
    
    
    line-height: 2.5;
    
    
    line-height: 3em;
    
    
    line-height: 150%;
    
    
    line-height: 32px;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        Far out in the uncharted backwaters of the unfashionable end of the western
        spiral arm of the Galaxy lies a small unregarded yellow sun.
      </div>
    </section>
    
    
    #example-element {
      font-family: Georgia, sans-serif;
      max-width: 200px;
    }
    
## Syntax
    
    /* Keyword value */
    line-height: normal;
    
    /* Unitless values: use this number multiplied
    by the element's font size */
    line-height: 3.5;
    
    /* <length> values */
    line-height: 3em;
    
    /* <percentage> values */
    line-height: 34%;
    
    /* Global values */
    line-height: inherit;
    line-height: initial;
    line-height: revert;
    line-height: revert-layer;
    line-height: unset;
    
The `line-height` property is specified as any one of the following:
  * a `<number>`
  * a `<length>`
  * a `<percentage>`
  * the keyword `normal`.


### Values
`normal`
    
Depends on the user agent. Desktop browsers (including Firefox) use a default value of roughly `1.2`, depending on the element's `font-family`.
`<number>` (unitless)
    
The used value is this unitless `<number>` multiplied by the element's own font size. The computed value is the same as the specified `<number>`. In most cases, this is the preferred way to set `line-height` and avoid unexpected results due to inheritance.
`<length>`
    
The specified `<length>` is used in the calculation of the line box height. Values given in em units may produce unexpected results (see example below).
`<percentage>`
    
Relative to the font size of the element itself. The computed value is this `<percentage>` multiplied by the element's computed font size. Percentage values may produce unexpected results (see the second example below).
## Accessibility
Use a minimum value of `1.5` for `line-height` for main paragraph content. This will help people experiencing low vision conditions, as well as people with cognitive concerns such as Dyslexia. If the page is zoomed to increase the text size, using a unitless value ensures that the line height will scale proportionately.
W3C Understanding WCAG 2.2
## Examples
>
### Basic example
    
    /* All rules below have the same resultant line height */
    
    /* number/unitless */
    div {
      line-height: 1.2;
      font-size: 10pt;
    }
    
    /* length */
    div {
      line-height: 1.2em;
      font-size: 10pt;
    }
    
    /* percentage */
    div {
      line-height: 120%;
      font-size: 10pt;
    }
    
    /* font shorthand */
    div {
      font:
        10pt/1.2 Georgia,
        "Bitstream Charter",
        serif;
    }
    
It is often more convenient to set `line-height` by using the `font` shorthand as shown above, but this requires the `font-family` property to be specified as well.
### Prefer unitless numbers for line-height values
This example shows why it is better to use `<number>` values instead of `<length>` values. We will use two `<div>` elements. The first div, with the green border, uses a unitless `line-height` value. The second div, with the red border, uses a `line-height` value defined in `em`s.
#### HTML
    
    <div class="box green">
      <h1>Avoid unexpected results by using unitless line-height.</h1>
      Length and percentage line-heights have poor inheritance behavior.
    </div>
    
    <div class="box red">
      <h1>Avoid unexpected results by using unitless line-height.</h1>
      Length and percentage line-heights have poor inheritance behavior
    </div>
    
    <!-- The first <h1> line-height is calculated from its own font-size   (30px × 1.1) = 33px -->
    <!-- The second <h1> line-height results from the red div's font-size  (15px × 1.1) = 16.5px, probably not what you want -->
    
#### CSS
    
    .green {
      line-height: 1.1;
      border: solid limegreen;
    }
    
    .red {
      line-height: 1.1em;
      border: solid red;
    }
    
    h1 {
      font-size: 30px;
    }
    
    .box {
      width: 18em;
      display: inline-block;
      vertical-align: top;
      font-size: 15px;
    }
    
#### Result
### Space between lines in vertical writing modes
The `line-height` property can be used to adjust space between vertical lines in vertical writing modes.
    
    .haiku {
      border: 1px solid;
      margin-bottom: 1rem;
      padding: 0.5rem;
      background-color: wheat;
    
      writing-mode: vertical-rl;
    }
    
    .wide {
      line-height: 2;
    }
    
#### Result
# font-style
The `font-style` CSS property sets whether a font should be styled with a normal, italic, or oblique face from its `font-family`.
## Try it
    
    font-style: normal;
    
    
    font-style: italic;
    
    
    font-style: oblique;
    
    
    font-style: oblique 40deg;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: Amstelvar;
      font-style: normal;
    }
    
    section {
      font-size: 1.2em;
      font-family: Amstelvar, serif;
    }
    
Italic font faces are generally cursive in nature, usually using less horizontal space than their unstyled counterparts, while oblique faces are usually just sloped versions of the regular face. When the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use `font-synthesis` to control this behavior).
## Syntax
    
    font-style: normal;
    font-style: italic;
    font-style: oblique;
    font-style: oblique 10deg;
    
    /* Global values */
    font-style: inherit;
    font-style: initial;
    font-style: revert;
    font-style: revert-layer;
    font-style: unset;
    
The `font-style` property is specified as a single keyword chosen from the list of values below, which can optionally include an angle if the keyword is `oblique`.
### Values
`normal`
    
Selects a font that is classified as `normal` within a `font-family`.
`italic`
    
Selects a font that is classified as `italic`. If no italic version of the face is available, one classified as `oblique` is used instead. If neither is available, the style is artificially simulated.
`oblique`
    
Selects a font that is classified as `oblique`. If no oblique version of the face is available, one classified as `italic` is used instead. If neither is available, the style is artificially simulated.
`oblique` `<angle>`
    
Selects a font classified as `oblique`, and additionally specifies an angle for the slant of the text. If one or more oblique faces are available in the chosen font family, the one that most closely matches the specified angle is chosen. If no oblique faces are available, the browser will synthesize an oblique version of the font by slanting a normal face by the specified amount. Valid values are degree values of `-90deg` to `90deg` inclusive. If an angle is not specified, an angle of 14 degrees is used. Positive values are slanted to the end of the line, while negative values are slanted towards the beginning.
In general, for a requested angle of 14 degrees or greater, larger angles are preferred; otherwise, smaller angles are preferred (see the spec's font matching section for the precise algorithm).
### Variable fonts
Variable fonts can offer a fine control over the degree to which an oblique face is slanted. You can select this using the `<angle>` modifier for the `oblique` keyword.
For TrueType or OpenType variable fonts, the `"slnt"` variation is used to implement varying slant angles for oblique, and the `"ital"` variation with a value of 1 is used to implement italic values. See `font-variation-settings`.
Click "Play" in the code blocks below to edit the example in the MDN Playground. Change the angle value to see the slant of the text change.
    
    <p class="sample">
      ...it would not be wonderful to meet a Megalosaurus, forty feet long or so,
      waddling like an elephantine lizard up Holborn Hill.
    </p>
    
    
    @font-face {
      src: url("https://mdn.github.io/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: "AmstelvarAlpha";
      font-style: normal;
    }
    
    .sample {
      font:
        2rem "AmstelvarAlpha",
        sans-serif;
      /* font-variation-settings: "slnt" 12; */
      font-style: oblique 23deg;
    }
    
## Accessibility
Large sections of text set with a `font-style` value of `italic` may be difficult for people with cognitive concerns such as Dyslexia to read.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * W3C Understanding WCAG 2.2


## Examples
>
### Font styles
    
    .normal {
      font-style: normal;
    }
    
    .italic {
      font-style: italic;
    }
    
    .oblique {
      font-style: oblique;
    }
    
# initial
The `initial` CSS keyword applies the initial (or default) value of a property to an element. It can be applied to any CSS property, including the CSS shorthand property `all`. With `all` set to `initial`, all CSS properties can be restored to their respective initial values in one go instead of restoring each one separately.
On inherited properties, the initial value may be unexpected. You should consider using the `inherit`, `unset`, `revert`, or `revert-layer` keywords instead.
## Examples
>
### Using initial to reset color for an element
#### HTML
    
    <p>
      <span>This text is red.</span>
      <em>This text is in the initial color (typically black).</em>
      <span>This is red again.</span>
    </p>
    
#### CSS
    
    p {
      color: red;
    }
    
    em {
      color: initial;
    }
    
#### Result
With the `initial` keyword in this example, `color` value on the `em` element is restored to the initial value of `color`, as defined in the specification.
# mask-position
The `mask-position` CSS property sets the initial position, relative to the mask position layer set by `mask-origin`, for each defined mask image.
## Syntax
    
    /* Single <position> keyword value */
    /* Sets second value to 'center' */
    mask-position: left;
    mask-position: center;
    mask-position: right;
    mask-position: top;
    mask-position: bottom;
    
    /* Two <position> keyword values */
    mask-position: left center;
    mask-position: right top;
    
    /* One length or percentage <position> value */
    /* Horizontal position. Vertical position set to 'center' */
    mask-position: 25%;
    mask-position: 0px;
    mask-position: 8em;
    
    /* Two length or percentage <position> values */
    /* First value: horizontal position. Second value: vertical position */
    mask-position: 25% 75%;
    mask-position: 0px 0px;
    mask-position: 10% 8em;
    
    /* Edge offsets: Four <position> values */
    mask-position: bottom 10px right 20px;
    mask-position: right 3em bottom 10px;
    mask-position: bottom 10px right 0;
    
    /* Multiple <position> values */
    mask-position:
      top left,
      bottom 10px right 10px;
    mask-position:
      1rem 1rem,
      center;
    
    /* Global values */
    mask-position: inherit;
    mask-position: initial;
    mask-position: revert;
    mask-position: revert-layer;
    mask-position: unset;
    
### Values
One or more `<position>` values, separated by commas.
`<position>`
    
One, two, or four values representing a 2D position specifying the edges of the element's box. Relative or absolute offsets can be given.
## Description
The `mask-position` property defines the position of each mask layer. An element can have multiple mask layers applied. The number of layers is determined by the number of comma-separated values in the `mask-image` property value (even `none` values create a layer).
Each `mask-position` value in the comma-separated list of values is matched up with an associated mask layer as defined by the list of `mask-image` values, in order. If the number of values in the two properties differs:
  * If `mask-position` has more values than mask-image, the excess values of `mask-position` are not used.
  * If `mask-position` has fewer values than mask-image, the `mask-position` values are repeated.


Each `mask-position` defines the associated mask layer's position relative to the associated `mask-origin` value. The `mask-origin` property values are similarly matched up with the `mask-image` values, in order, with excess `mask-position` values being unused or `mask-position` values being repeated if they are fewer in number than the `mask-origin` values. Each mask layer, therefore, has an associated `mask-origin` and `mask-position` value.
If no `mask-origin` is set, the value defaults to `padding-box`, meaning the origin of each `mask-position` is the element's padding-box.
### One-value syntax
If only one `mask-position` value is specified, the second value is assumed to be `center`. If the value is a `<length>` or `<percentage>`, it defines the position of the mask along the horizontal axis, with the mask being vertically centered within the origin box. For example, `mask-position: 0%;` is equal to `mask-position: 0% center`.
If you use a single keyword for positioning, the other value will resolve to `center`. The default of `mask-position` is `0% 0%`, which equates to `mask-position: top left`. However:
  * `mask-position: top;` is equivalent to `mask-position: top center;`.
  * `mask-position: left;` is equivalent to `mask-position: center left`.
  * `mask-position: center;` is equal to `mask-position: center center`.


If the value is a `<length>` value, it represents the horizontal position as an offset from the left edge of the mask positioning. A positive value represents an offset inward from the left edge of the box container. The position can be set outside of the element's box using a negative value — this creates an outward offset that places the item outside the container's left edge.
#### Percentage values
A `<percentage>` value represents the mask's horizontal position value relative to the width of the container, positioned relative to the left edge. However, the offset is not from the mask edge to the box edge. Instead, the mask image dimension is subtracted from the container's dimension, and then a percentage of the resulting value is used as the direct offset from the box's left edge, which is the same as percentage values for `background-position`.
The equation is:
`(container dimension - mask dimension) * position percentage = dimension offset value`
Given a `100px`-wide mask and a `1000px`-wide origin box, setting `mask-position: 10%;` (the equivalent of `10% 50%`) results in the mask being vertically centered at `90px` from the left edge. The equation is `(1000 - 100) * 10% = 90`. If the left offset had been `0%`, the mask's left edge would be flush to the left of the container (`(1000 - 100) * 0% = 0`).
If the left offset had been `100%`, the mask's right edge would be flush to the right of the container as the left edge of the `100px` wide mask would be `900px` (`(1000 - 100) * 100% = 900`) from the left edge of the container (the `100px` mask width plus `900px` distance from the left edge means the right edge would be `1000px` from the left edge, which is the right edge of the container).
### Two-value syntax
A two-value `<position>` specifies the position of the mask image inside its mask positioning area, with length and percentage values specifying offsets from the `left` and `top` of the area.
If the two values are `<length>` values, `<percentage>` values, or the keyword `center`, the first value represents the horizontal position as an offset from the left edge of the mask positioning area, and the second value represents the vertical position as an offset from it's top edge, with percentages being offset by the mask's size in that dimension.
In addition, if `<percentage>` values are specified, the first value is also the horizontal position value relative to the left edge, and the second value is also the vertical position value relative to the top edge.
A pair of axis-specific keywords can be reordered, as can an axis-specific keyword and a length or percentage, but two length or percentage values are not interchangeable. If one of the two values is `top`, `right`, `bottom`, or `left`, the order of the two values doesn't matter. Any `center` or `<length-percentage>` value in the pair of values will be applied to the other dimension.
### Four-value syntax
The four-value syntax consists of two pairs of values, each pair containing a keyword specifying the edge to offset from, and a `<length>` and `<percentage>` value specifying the offset distance. For example, `mask-position: left 1em top 2em` specifies a `1em` horizontal offset from the left box edge and a `2em` vertical offset from the top edge. The two-value equivalent would be `mask-position: 1em 2em`.
Because we're defining the offset edges when using the four-value syntax, the order isn't important: `mask-position: top 2em left 1em` and `mask-position: left 1em top 2em` both produce the same result.
The real power of the four-value syntax is that it allows us to specify offset edges other than `left` and `top`. For example, `mask-position: bottom 10px right 20px` creates a `10px` vertical offset up from the bottom edge and a `20px` horizontal offset leftward from the right edge. Usually, the four-value syntax is used to offset from the bottom and/or right. But this syntax is also helpful if you can't remember the offset edge order for the two-value syntax.
One thing to note is that, unlike the `<bg-position>` data type values for `background-position`, the `<position>` values for `mask-position` do not allow for a 3-value syntax and do not allow offsetting from `center`. When offsetting the mask from the `bottom` or `right`, the `mask-position` requires all four values to be declared.
For the four-value syntax to be valid, it needs to specify either `top` or `bottom` as the vertical offset edge, along with the vertical length or percentage offset value, and either `left` or `right` as the horizontal offset edge, along with the horizontal length or percentage offset value.
## Examples
>
### Basic usage
    
    <section>
      <div></div>
    </section>
    
    
    section {
      border: 1px solid black;
      width: 250px;
      height: 250px;
    }
    
    div {
      width: 250px;
      height: 250px;
      margin-bottom: 10px;
      background: blue linear-gradient(red, blue);
    
      mask-image: url("/shared-assets/images/examples/mask-star.svg");
      mask-repeat: no-repeat;
      mask-position: top right;
    }
    
# <line-style>
The `<line-style>` enumerated value type represents keyword values that define the style of a line, or the lack of a line. The `<line-style>` keyword values are used in the following longhand and shorthand border and column properties:
  * `border`, `border-style`
  * `border-block`, `border-block-style`
  * `border-block-end`, `border-block-end-style`
  * `border-block-start`, `border-block-start-style`
  * `border-bottom`, `border-bottom-style`
  * `border-inline`, `border-inline-style`
  * `border-inline-end`, `border-inline-end-style`
  * `border-inline-start`, `border-inline-start-style`
  * `border-left`, `border-left-style`
  * `border-right`, `border-right-style`
  * `border-top`, `border-top-style`
  * `column-rule`, `column-rule-style`


## Syntax
>
### Values
The `<line-style>` enumerated type is specified using one of the values listed below:
`none`
    
Displays no line. The computed value of the line width is `0` even if a width value is specified. In the case of table cell and border collapsing, the `none` value has the lowest priority. If any other conflicting border is set, it will be displayed. The `none` value is similar to `hidden`.
`hidden`
    
Displays no line. The computed width of the line is `0` even if a width value is specified. In the case of table cell and border collapsing, the `hidden` value has the highest priority. If any other conflicting border is set, it won't be displayed. The `hidden` value is similar to `none`, but `hidden` is not a valid value for outline styles.
`dotted`
    
Displays a series of round dots. The radius of the dots is half the computed value of the line's width. The spacing of the dots is not defined by the specification and is implementation-specific.
`dashed`
    
Displays a series of short square-ended dashes or line segments. The exact size and length of the segments are not defined by the specification and are implementation-specific.
`solid`
    
Displays a single, straight solid line.
`double`
    
Displays two straight lines with some space between them. The length of the lines adds up to the pixel size defined by the line's width.
`groove`
    
Displays a border with a carved appearance. This value is the opposite of `ridge`.
`ridge`
    
Displays a border with an extruded appearance. This value is the opposite of `groove`.
`inset`
    
Displays a border that makes the element appear embedded. This value is the opposite of `outset`. When applied to a table cell border and `border-collapse` is set to `collapsed`, this value behaves like `groove`.
`outset`
    
Displays a border that makes the element appear embossed. This value is the opposite of `inset`. When applied to a table cell with `border-collapse` set to `collapsed`, this value behaves like `ridge`.
Note: When `<outline-style>` is used as the value type for `outline` and `outline-style` properties, it is similar to `<line-style>`, but does not support `hidden` and includes the `auto` value. When `auto` is set, the user-agent defined `<line-style>` value is used.
## Examples
The first example demonstrates all the `<line-style>` keyword values. The second example demonstrates how some line style colors may display in unexpected ways.
### Defining line styles
This example shows all the `<line-style>` values as values for the CSS `border-style` and `column-rule-style` properties.
#### HTML
This example uses multiple `<div>` elements, each with a class representing the `<line-style>` value that is being demonstrated.
    
    <div class="{line-style}">
      <p>{line-style}</p>
      <p>a b c d e f g h i j k l m n o p q r s t u v w x y z</p>
    </div>
    
#### CSS
In the CSS for this example, the border and the column-rule for all the `<p>` elements is defined to have a width of `7px` and the style value of `double`. For each paragraph, the `double` value is then overridden by specifying a different `<line-style>` value for the `border-style` and `column-rule-style` properties.
    
    p {
      padding: 5px;
      border: double 7px #bada55;
    }
    p + p {
      columns: 3;
      column-gap: 20px;
      column-rule: double 7px;
      border-color: black;
    }
    .none p {
      border-style: none;
      column-rule-style: none;
    }
    .hidden p {
      border-style: hidden;
      column-rule-style: hidden;
    }
    .dotted p {
      border-style: dotted;
      column-rule-style: dotted;
    }
    .dashed p {
      border-style: dashed;
      column-rule-style: dashed;
    }
    .solid p {
      border-style: solid;
      column-rule-style: solid;
    }
    .double p {
      border-style: double;
      column-rule-style: double;
    }
    .groove p {
      border-style: groove;
      column-rule-style: groove;
    }
    .ridge p {
      border-style: ridge;
      column-rule-style: ridge;
    }
    .inset p {
      border-style: inset;
      column-rule-style: inset;
    }
    .outset p {
      border-style: outset;
      column-rule-style: outset;
    }
    
#### Result
Notice that the black border is not always black.
### Defining line styles and colors
This example demonstrates line-style and color choice. With some `<line-style>` keyword values, the color of the line may not be what you expect. To create the required "3D" effect of `groove`, `ridge`, `inset`, and `outset` styles when displaying these values in black or white, user agents use different color calculations than any other color-line combinations.
#### CSS
The four sides of each `<div>` have a different `<line-style>` value, and each list item has a different `<color>` value. We use generated content to display the CSS declared inline.
    
    div {
      border-width: 10px;
      border-style: inset groove ridge outset;
      padding: 5px;
    }
    
#### JavaScript
The JavaScript dynamically creates `<div>` elements, each with a different `border-color` set.
    
    // prettier-ignore
    const colors = [
      "#000000", "#000001", "#ffffff",
      "#ff00ff", "#ffff00", "#00ffff",
      "#cc33cc", "#cccc33", "#33cccc",
      "#ff0000", "#00ff00", "#0000ff",
      "#cc3333", "#33cc33", "#3333cc",
      "#993333", "#339933", "#333399",
    ];
    
    for (const c of colors) {
      const div = document.createElement("div");
      div.style.borderColor = c;
      div.textContent = c;
      document.body.appendChild(div);
    }
    
#### Result
Notice that the almost-black color of `#000001` may be different from the actual black, and the contrast between the dark and light edges is more noticeable when using lighter colors.
# :popover-open
The `:popover-open` CSS pseudo-class represents a popover element (i.e., one with a `popover` attribute) that is in the showing state. You can use this to apply style to popover elements only when they are shown.
## Syntax
    
    :popover-open {
      /* ... */
    }
    
## Examples
By default, popovers appear in the middle of the viewport. The default styling is achieved like this in the UA stylesheet:
    
    [popover] {
      position: fixed;
      inset: 0;
      width: fit-content;
      height: fit-content;
      margin: auto;
      border: solid;
      padding: 0.25em;
      overflow: auto;
      color: CanvasText;
      background-color: Canvas;
    }
    
To override the default styles and get the popover to appear somewhere else on your viewport, you could override the above styles with something like this:
    
    :popover-open {
      width: 200px;
      height: 100px;
      position: absolute;
      inset: unset;
      bottom: 5px;
      right: 5px;
      margin: 0;
    }
    
# CSS logical properties and values
The CSS logical properties and values module defines logical properties and values that can control layout through logical rather than physical direction and dimension mappings. Logical properties define direction‐relative equivalents to their corresponding physical properties.
The start of a line is not always the left side of a line. Different writing systems operate in various directions. For example:
  * English and Portuguese are written from left to right with new lines added below the previous ones.
  * Hebrew and Arabic are right-to-left languages with new lines again being added below the previous ones.
  * In some writing modes, the text lines are vertical, written from top to bottom. Chinese, Vietnamese, Korean, and Japanese are traditionally written vertically, from top to bottom, with each new vertical line added to the left of the previous one.
  * Traditional Mongolian is also a top-to-bottom language, but new lines are to the right of previous ones.


The logical properties defined in this module enable defining properties relative to the content's writing direction, rather than a physical direction. This means content translated into languages with different writing modes will be rendered as intended.
Logical properties and values use the abstract terms block and inline to describe the direction in which they flow. The physical meaning of these terms depends on the writing mode.
The block dimension is perpendicular to the flow of text within a line, i.e., the vertical dimension in horizontal writing modes, and the horizontal dimension in vertical writing modes. For standard English text, it is the vertical dimension.
The inline dimension is parallel to the flow of text within a line, i.e., the horizontal dimension in horizontal writing modes, and the vertical dimension in vertical writing modes. For standard English text, it is the horizontal dimension.
CSS was initially designed with only physical coordinates. The logical properties and values module defines flow–relative equivalents for many values and properties. Properties that once only accepted physical values (`top`, `bottom`, `left`, `right`) now also accept flow-relative logical values (`block-start`, `block-end`, `inline-start`, `inline-end`).
## Reference
>
### Properties
  * `block-size`
  * `border-block`
  * `border-block-color`
  * `border-block-end`
  * `border-block-end-color`
  * `border-block-end-style`
  * `border-block-end-width`
  * `border-block-start`
  * `border-block-start-color`
  * `border-block-start-style`
  * `border-block-start-width`
  * `border-block-style`
  * `border-block-width`
  * `border-end-end-radius`
  * `border-end-start-radius`
  * `border-inline`
  * `border-inline-color`
  * `border-inline-end`
  * `border-inline-end-color`
  * `border-inline-end-style`
  * `border-inline-end-width`
  * `border-inline-start`
  * `border-inline-start-color`
  * `border-inline-start-style`
  * `border-inline-start-width`
  * `border-inline-style`
  * `border-inline-width`
  * `border-start-end-radius`
  * `border-start-start-radius`
  * `inline-size`
  * `inset`
  * `inset-block`
  * `inset-block-end`
  * `inset-block-start`
  * `inset-inline`
  * `inset-inline-end`
  * `inset-inline-start`
  * `margin-block`
  * `margin-block-end`
  * `margin-block-start`
  * `margin-inline`
  * `margin-inline-end`
  * `margin-inline-start`
  * `max-block-size`
  * `max-inline-size`
  * `min-block-size`
  * `min-inline-size`
  * `padding-block`
  * `padding-block-end`
  * `padding-block-start`
  * `padding-inline`
  * `padding-inline-end`
  * `padding-inline-start`


### Data types and values
Flow relative values:
  * `block-start`
  * `block-end`
  * `inline-start`
  * `inline-end`
  * `start`
  * `end`


### Glossary terms
  * Flow relative values
  * Inset properties
  * Logical properties
  * Physical properties


## Guides
Basic concepts of logical properties and values
    
Overview of flow relative properties and values.
Logical properties for sizing
    
Flow-relative mappings between physical properties and logical properties used for sizing elements on the page.
Logical properties for margins, borders, and padding
    
Flow-relative mappings for the various margin, border, and padding properties and their shorthands.
Logical properties for floating and positioning
    
Details mappings between the physical and logical values for `float` and `clear`, inset properties, and `resize`.
## Related concepts
  * `caption-side`
  * `clear`
  * `float`
  * `resize`
  * `text-align`


CSS box model
  * `margin` shorthand
  * `padding` shorthand


CSS box sizing
  * `max-height`
  * `max-width`
  * `min-height`
  * `min-width`


CSS backgrounds and borders
  * `border-color`
  * `border-style`
  * `border-width`
  * `border` shorthand
  * `border-radius`


CSS positioned layout
  * `top`
  * `right`
  * `bottom`
  * `left`


CSS writing modes
  * `direction`
  * `text-orientation`
  * `writing-mode`


CSS containment
  * `contain-intrinsic-block-size`
  * `contain-intrinsic-inline-size`


CSS overflow
  * `overflow-block`
  * `overflow-inline`


CSS overscroll behavior
  * `overscroll-behavior-block`
  * `overscroll-behavior-inline`


# border-inline-color
The `border-inline-color` CSS property defines the color of the logical inline borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-color: red;
    writing-mode: horizontal-tb;
    
    
    border-inline-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-inline-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border color in the other dimension can be set with `border-block-color` which sets `border-block-start-color`, and `border-block-end-color`.
## Syntax
    
    border-inline-color: yellow;
    border-inline-color: #f5f6f7;
    
    /* Global values */
    border-inline-color: inherit;
    border-inline-color: initial;
    border-inline-color: revert;
    border-inline-color: revert-layer;
    border-inline-color: unset;
    
### Values
`<color>`
    
The color of the border.
## Examples
>
### Border color with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-inline-color: red;
    }
    
#### Results
# border-end-start-radius
The `border-end-start-radius` CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode.
## Try it
    
    border-end-start-radius: 80px 80px;
    
    
    border-end-start-radius: 250px 100px;
    direction: rtl;
    
    
    border-end-start-radius: 50%;
    writing-mode: vertical-lr;
    
    
    border-end-start-radius: 50%;
    writing-mode: vertical-rl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a bottom left rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
This property affects the corner between the block-end and the inline-start sides of the element. For instance, in a `horizontal-tb` writing mode with `ltr` direction, it corresponds to the `border-bottom-left-radius` property.
## Syntax
    
    /* <length> values */
    /* With one value the corner will be a circle */
    border-end-start-radius: 10px;
    border-end-start-radius: 1em;
    
    /* With two values the corner will be an ellipse */
    border-end-start-radius: 1em 2em;
    
    /* Global values */
    border-end-start-radius: inherit;
    border-end-start-radius: initial;
    border-end-start-radius: revert;
    border-end-start-radius: revert-layer;
    border-end-start-radius: unset;
    
### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Border radius with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example</p>
    </div>
    
#### CSS
    
    div {
      background-color: rebeccapurple;
      width: 120px;
      height: 120px;
      border-end-start-radius: 10px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding: 10px;
      background-color: white;
      border-end-start-radius: 10px;
    }
    
#### Results
# image-rendering
The `image-rendering` CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other properties, and to its descendants.
## Try it
    
    image-rendering: auto;
    
    
    image-rendering: smooth;
    
    
    image-rendering: crisp-edges;
    
    
    image-rendering: pixelated;
    
    
    <section id="default-example">
      <img
        class="transition-all"
        id="example-element"
        src="/shared-assets/images/examples/lizard.png" />
    </section>
    
    
    #example-element {
      height: 480px;
      object-fit: cover;
    }
    
The user agent will scale an image when the page author specifies dimensions other than its natural size. Scaling may also occur due to user interaction (zooming). For example, if the natural size of an image is `100×100px`, but its actual dimensions are `200×200px` (or `50×50px`), then the image will be upscaled (or downscaled) using the algorithm specified by `image-rendering`. This property has no effect on non-scaled images.
## Syntax
    
    /* Keyword values */
    image-rendering: auto;
    image-rendering: smooth;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    
    /* Global values */
    image-rendering: inherit;
    image-rendering: initial;
    image-rendering: revert;
    image-rendering: revert-layer;
    image-rendering: unset;
    
### Values
`auto`
    
The scaling algorithm is UA dependent. Since version 1.9 (Firefox 3.0), Gecko uses bilinear resampling (high quality).
`smooth`
    
The image should be scaled with an algorithm that maximizes the appearance of the image. In particular, scaling algorithms that "smooth" colors are acceptable, such as bilinear interpolation. This is intended for images such as photos.
`crisp-edges`
    
The image is scaled with an algorithm such as "nearest neighbor" that preserves contrast and edges in the image. Generally intended for images such as pixel art or line drawings, no blurring or color smoothing occurs.
`pixelated`
    
The image is scaled with the "nearest neighbor" or similar algorithm to the nearest integer multiple of the original image size, then uses smooth interpolation to bring the image to the final desired size. This is intended to preserve a "pixelated" look without introducing scaling artifacts when the upscaled resolution isn't an integer multiple of the original.
Note: The values `optimizeQuality` and `optimizeSpeed` present in an early draft (and coming from its SVG counterpart `image-rendering`) are defined as synonyms for the `smooth` and `pixelated` values respectively.
Note: The CSS images module defines a `high-quality` value for the `image-rendering` property to provide a preference for higher-quality scaling, however, this is not supported in any browsers.
## Examples
>
### Setting image scaling algorithms
In this example, an image is repeated three times, with each having a different `image-rendering` value applied.
#### CSS
    
    .auto {
      image-rendering: auto;
    }
    
    .smooth {
      image-rendering: smooth;
    }
    
    .pixelated {
      image-rendering: pixelated;
    }
    
    .crisp-edges {
      image-rendering: crisp-edges;
    }
    
#### Result
# CSS text decoration
The CSS text decoration module defines features relating to text decoration, such as underlines, text shadows, and emphasis marks. Text decoration features can provide visual cues for spelling errors, grammar issues, and links. These features can help improve the usability, accessibility, functionality, and aesthetics of your text.
By varying the color, style, and thickness of text decoration using pseudo-classes and pseudo-elements, you can highlight the emphasis in text in ways that don't rely on color alone.
Several features can help improve text readability:
  * `text-decoration-skip-ink` can increase legibility by skipping descenders.
  * `text-underline-offset` enables you to fine-tune the underline placement to better match font metrics or design aesthetics, which can be especially useful for unique typefaces.
  * `text-shadow` colors that contrast with text `color` can make the text visually pop when placed on a background with insufficient contrast.


These features all help improve legibility, and therefore, accessibility. Reducing visual noise and improving text clarity is especially helpful for users with dyslexia or low vision.
In the writing systems of some languages, overlines and underlines carry semantic meaning. CSS lets you adapt styling to cultural norms. Text decoration features are especially useful for languages that do not use Latin-based scripts and instead follow different underline placements, such as Japanese and Korean.
Text decoration features also enable you to follow editorial and localization standards that come from print media. For example, with a strikethrough (line-through), you can indicate the status of content. Use it to inform users that content has been removed or that prices have been halved. This feature lets you present both the original and the updated content. Overlines or double underlines are commonly used for academic and editorial annotations.
## Text decoration in action
## Reference
>
### Properties
  * `text-decoration`
  * `text-decoration-color`
  * `text-decoration-line`
  * `text-decoration-skip`
  * `text-decoration-skip-ink`
  * `text-decoration-style`
  * `text-decoration-thickness`
  * `text-emphasis`
  * `text-emphasis-color`
  * `text-emphasis-position`
  * `text-emphasis-style`
  * `text-shadow`
  * `text-underline-offset`
  * `text-underline-position`


The specification also defines the `text-decoration-skip-box`, `text-decoration-skip-self`, `text-decoration-skip-spaces`, `text-decoration-trim`, and `text-emphasis-skip` properties, which are not yet supported by any browser.
## Guides
Introduction to text shadows
    
Overview of the components of the `text-shadow` property and creating multiple text shadows
## Related concepts
  * `::spelling-error`
  * `::grammar-error`
  * `::first-letter`
  * `::first-line`
  * `box-shadow`
  * `drop-shadow()`
  * `box-decoration-break`
  * `<line-style>`
  * `letter-spacing`
  * `word-spacing`
  * `font-size`
  * `font-variant-position`
  * `font-kerning`
  * `ruby-overhang`
  * `<ruby>`
  * `<rt>`
  * `<rp>`
  * `<sup>`
  * `<sub>`
  * Inline formatting context
  * Introduction to formatting contexts


# ::first-letter
The `::first-letter` CSS pseudo-element applies styles to the first letter of the first line of a block container, but only when not preceded by other content (such as images or inline tables).
## Try it
    
    p::first-letter {
      font-size: 1.5rem;
      font-weight: bold;
      color: brown;
    }
    
    
    <p>
      Scientists exploring the depths of Monterey Bay unexpectedly encountered a
      rare and unique species of dragonfish. This species is the rarest of its
      species.
    </p>
    
    <p>
      When Robison and a team of researchers discovered this fish, they were aboard
      a week-long expedition.
    </p>
    
The first letter of an element is not always trivial to identify:
  * Punctuation that precedes or immediately follows the first letter is included in the match. Punctuation includes any Unicode character defined in the open (Ps), close (Pe), initial quote (Pi), final quote (Pf), and other punctuation (Po) classes.
  * Some languages have digraphs that are always capitalized together, like the `IJ` in Dutch. In these cases, both letters of the digraph should be matched by the `::first-letter` pseudo-element.
  * A combination of the `::before` pseudo-element and the `content` property may inject some text at the beginning of the element. In that case, `::first-letter` will match the first letter of this generated content.


Note: CSS introduced the `::first-letter` notation (with two colons) to distinguish pseudo-classes from pseudo-elements. For backward compatibility, browsers also accept `:first-letter`, introduced earlier.
Browser support for digraphs such as `IJ` in Dutch is poor. Check the compatibility table below to see the current state of support.
## Allowable properties
Only a small subset of CSS properties can be used with the `::first-letter` pseudo-element:
  * All font properties: `font`, `font-style`, `font-feature-settings`, `font-kerning`, `font-language-override`, `font-stretch`, `font-synthesis`, `font-variant`, `font-variant-alternates`, `font-variant-caps`, `font-variant-east-asian`, `font-variant-ligatures`, `font-variant-numeric`, `font-variant-position`, `font-weight`, `font-size`, `font-size-adjust`, `line-height` and `font-family`
  * All background properties: `background`, `background-color`, `background-image`, `background-clip`, `background-origin`, `background-position`, `background-repeat`, `background-size`, `background-attachment`, and `background-blend-mode`
  * All margin properties: `margin`, `margin-top`, `margin-right`, `margin-bottom`, `margin-left`
  * All padding properties: `padding`, `padding-top`, `padding-right`, `padding-bottom`, `padding-left`
  * All border properties: the shorthands `border`, `border-style`, `border-color`, `border-width`, `border-radius`, `border-image`, and the longhands properties
  * The `color` property
  * The `text-decoration`, `text-shadow`, `text-transform`, `letter-spacing`, `word-spacing` (when appropriate), `line-height`, `text-decoration-color`, `text-decoration-line`, `text-decoration-style`, `box-shadow`, `float`, `vertical-align` (only if `float` is `none`) CSS properties


## Syntax
    
    ::first-letter {
      /* ... */
    }
    
## Examples
>
### Basic drop cap
In this example we will use the `::first-letter` pseudo-element to create a drop cap effect on the first letter of the paragraph coming right after the `<h2>`.
#### HTML
    
    <h2>My heading</h2>
    <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
      eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
      voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
      kasd gubergren, no sea takimata sanctus est.
    </p>
    <p>
      Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
      consequat.
    </p>
    
#### CSS
    
    p {
      width: 500px;
      line-height: 1.5;
    }
    
    h2 + p::first-letter {
      color: white;
      background-color: black;
      border-radius: 2px;
      box-shadow: 3px 3px 0 red;
      font-size: 250%;
      padding: 6px 3px;
      margin-right: 6px;
      float: left;
    }
    
#### Result
### Effect on special punctuation and non-Latin characters
This example illustrates the effect of `::first-letter` on special punctuation and non-Latin characters.
#### HTML
    
    <p>
      Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
      consequat.
    </p>
    <p>-The beginning of a special punctuation mark.</p>
    <p>_The beginning of a special punctuation mark.</p>
    <p>"The beginning of a special punctuation mark.</p>
    <p>'The beginning of a special punctuation mark.</p>
    <p>*The beginning of a special punctuation mark.</p>
    <p>#The beginning of a special punctuation mark.</p>
    <p>「特殊的汉字标点符号开头。</p>
    <p>《特殊的汉字标点符号开头。</p>
    <p>"特殊的汉字标点符号开头。</p>
    
#### CSS
    
    p::first-letter {
      color: red;
      font-size: 150%;
    }
    
#### Result
### Styling first letter in SVG text element
In this example, we use the `::first-letter` pseudo-element to style the first letter of a SVG `<text>` element.
Note: At time of writing this feature has limited support.
#### HTML
    
    <svg viewBox="0 0 300 40">
      <text y="30">First letter in &lt;text&gt; SVG</text>
    </svg>
    
#### CSS
    
    text {
      font-family: sans-serif;
    }
    
    text::first-letter {
      font-family: serif;
      font-size: 2rem;
      font-weight: 600;
      fill: tomato;
      stroke: indigo;
    }
    
#### Result
# :user-invalid
The `:user-invalid` CSS pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, after the user has interacted with it.
The `:user-invalid` pseudo-class must match an `:invalid`, `:out-of-range`, or blank-but `:required` element between the time the user has attempted to submit the form and before the user has interacted again with the form element.
## Syntax
    
    :user-invalid {
      /* ... */
    }
    
## Examples
>
### Setting a color and symbol on :user-invalid
In the following example, the red border and ❌ only display once the user has interacted with the field. Try typing something other than an email address to see it in action.
    
    <form>
      <label for="email">Email *: </label>
      <input id="email" name="email" type="email" required />
      <span></span>
    </form>
    
    
    input:user-invalid {
      border: 2px solid red;
    }
    
    input:user-invalid + span::before {
      content: "✖";
      color: red;
    }
    
# CSS values and units
Every CSS declaration consists of a property/value pair. The value can take various forms depending on the property, such as a single integer, keyword, function, or a combination of different items; some values have units, while others do not. Every property also accepts the CSS-wide values. The CSS values and units module defines the data types — values and units — that CSS properties accept. This module also defines the CSS value definition syntax, or formal grammar, used to define the set of valid values for every CSS property and function.
## Reference
>
### Properties
  * `interpolate-size`


### Functions
  * `abs()`
  * `acos()`
  * `asin()`
  * `atan()`
  * `atan2()`
  * `attr()`
  * `calc()`
  * `calc-size()`
  * `clamp()`
  * `cos()`
  * `exp()`
  * `hypot()`
  * `<ident()>`
  * `if()`
  * `inherit()`
  * `log()`
  * `max()`
  * `min()`
  * `mod()`
  * `pow()`
  * `rem()`
  * `round()`
  * `sibling-count()`
  * `sibling-index()`
  * `sign()`
  * `sin()`
  * `sqrt()`
  * `tan()`
  * `url()`


The CSS values and units module also introduces the `calc-mix()`, `crossorigin()`, `first-valid()`, `integrity()`, `progress()`, `random()`, `random-item()`, `referrerpolicy()`, `src()`, `type()`, and `toggle()` functions. Currently, no browsers support these features.
### Data types
  * `<angle-percentage>`
  * `<angle>`
  * `<animation-timeline>`
  * `<attr-name>`
  * `<attr-type>`
  * `<calc-keyword>` (`e`, `pi`, `infinity`, NaN)
  * `<calc-size-basis>`
  * `<calc-sum>`
  * `<custom-ident>`
  * `<dashed-ident>`
  * `<dimension>`
  * `<easing-function>`
  * `<first-valid()>`
  * `<ident>`
  * `<integer>`
  * `<length-percentage>`
  * `<length>`
  * `<number>`
  * `<percentage>`
  * `<position>`
  * `<ratio>`
  * `<resolution>`
  * `<rounding-strategy>` (`down`, `up`, `to-zero`)
  * `<string>`
  * `<syntax>`
  * `<time-percentage>`
  * `<time>`
  * `<url>`
  * `<url-modifier>`
  * `<view-timeline-name>`


The CSS values and units module also introduces the `<frequency>` and `<frequency-percentage>` data types. Currently, no browsers support these features.
#### Units
  * `%` (percentage)
  * `cap`
  * `ch`
  * `cm`
  * `deg`
  * `dpcm`
  * `dpi`
  * `dppx`
  * `dvb`
  * `dvh`
  * `dvi`
  * `dvmax`
  * `dvmin`
  * `dvw`
  * `em`
  * `ex`
  * `grad`
  * `Hz`
  * `ic`
  * `in`
  * `kHz`
  * `lh`
  * `lvb`
  * `lvh`
  * `lvi`
  * `lvmax`
  * `lvmin`
  * `lvw`
  * `mm`
  * `ms`
  * `pc`
  * `pt`
  * `px`
  * `Q`
  * `rad`
  * `rcap`
  * `rch`
  * `rem`
  * `rex`
  * `ric`
  * `rlh`
  * `s`
  * `svb`
  * `svh`
  * `svi`
  * `svmax`
  * `svmin`
  * `svw`
  * `turn`
  * `vb`
  * `vh`
  * `vi`
  * `vmax`
  * `vmin`
  * `vw`
  * `x`


Flex units (`fr`) and container units (`cqb`, `cqh`, `cqi`, `cqmax`, `cqmin`, `cqw`) are defined in the CSS grid layout and CSS conditional rules modules, respectively.
#### Unit categorizations
  * Absolute length units (`cm`, `in`, `mm`, `pc`, `pt`, `px`, `Q`)
  * Angle units (`deg`, `grad`, `rad`, `turn`)
  * Default viewport units (`vb` , `vh`, `vi` , `vmax`, `vmin`, `vw`)
  * Dynamic viewport units (`dvb`, `dvh`, `dvi`, `dvmax`, `dvmin`, `dvw`)
  * Frequency units (`Hz`, `kHz`)
  * Large viewport-percentage units (`lvb`, `lvh`, `lvi`, `lvmax`, `lvmin`, `lvw`)
  * Local font-relative length units (`cap`, `ch`, `em`, `ex`, `ic`, `lh`)
  * Physical units (`cm`, `in`, `mm`, `pc`, `pt`, `Q`)
  * Relative length units (`cap`, `ch`, `em`, `ex`, `ic`, `lh`, `rem`, `rlh`, `vb`, `vh`, `vi`, `vmax`, `vmin`, `vw`)
  * Resolution units (`dpcm`, `dpi` , `dppx`, `x`)
  * Root font-relative length units (`rcap`, `rch`, `rem`, `rex`, `ric`, `rlh`)
  * Small viewport-percentage unit (`svb`, `svh`, `svi`, `svmax`, `svmin`, `svw`)
  * Time units (`ms`, `s`)
  * Viewport units (`dvh`, `dvw`, `lvh`, `lvw`, `svh`, `svw`, `vb` , `vh`, `vi` , `vmax`, `vmin`, `vw`)
  * Visual angle unit (`px`)


### Key concepts
  * Advance measure
  * Bracketed range notation
  * Component value combinators
  * CSS-wide keywords
  * Device pixel
  * Functional notation
  * Identifier
  * Interpolation
  * Keyword
  * Math function
  * Numeric data types
  * Origin
  * Pixel
  * Textual data types
  * URL
  * Value definition syntax


## Guides
CSS data types
    
Introduction to CSS data types that define typical values accepted by CSS properties and functions.
Numeric data types
    
Overview of the numeric data types, including integers, numbers, percentages, and dimensions, along with relative and absolute dimensions, angles, and time units.
Textual data types
    
Overview of the textual data types, including pre-defined keyword values, global CSS keyword values, and URLs.
CSS value functions
    
Overview of the CSS statements that invoke special data processing or calculations to return a CSS value for a CSS property.
Using CSS math functions
    
The CSS math functions that allow a property value to be written as a mathematical expression.
Value definition syntax
    
The formal grammar used to define the set of valid values for CSS properties and functions.
Learn: Values and units
    
A look at some of the most frequently used value types, what they are, and how they work.
## Related
  * CSS cascading and inheritance module
    * `initial`
    * `inherit`
    * `revert`
    * `revert-layer`
    * `unset`
    * `all`
  * CSS grid layout module
    * `<flex>`
    * Flex units (`fr`)
  * CSS conditional rules module
    * Container units (`cqb`, `cqh`, `cqi`, `cqmax`, `cqmin`, `cqw`)
  * CSS colors module
    * `<color>`
    * `<system-color>`
    * `color-mix()`
  * CSS images module
    * `<image>`
    * `<gradient>`


# grid-template
The `grid-template` CSS property is a shorthand property for defining grid columns, grid rows, and grid areas.
## Try it
    
    grid-template:
      "a a a" 40px
      "b c c" 40px
      "b c c" 40px / 1fr 1fr 1fr;
    
    
    grid-template:
      "b b a" auto
      "b b c" 2ch
      "b b c" 1em / 20% 20px 1fr;
    
    
    grid-template:
      "a a ." minmax(50px, auto)
      "a a ." 80px
      "b b c" auto / 2em 3em auto;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-gap: 10px;
      width: 200px;
    }
    
    #example-element :nth-child(1) {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      grid-area: a;
    }
    
    #example-element :nth-child(2) {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
      grid-area: b;
    }
    
    #example-element :nth-child(3) {
      background-color: rgb(94 255 0 / 0.2);
      border: 3px solid green;
      grid-area: c;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `grid-template-areas`
  * `grid-template-columns`
  * `grid-template-rows`


## Syntax
    
    /* Keyword value */
    grid-template: none;
    
    /* grid-template-rows / grid-template-columns values */
    grid-template: 100px 1fr / 50px 1fr;
    grid-template: auto 1fr / auto 1fr auto;
    grid-template: [line-name] 100px / [column-name1] 30% [column-name2] 70%;
    grid-template: fit-content(100px) / fit-content(40%);
    
    /* grid-template-areas grid-template-rows / grid-template-column values */
    grid-template:
      "a a a"
      "b b b";
    grid-template:
      "a a a" 20%
      "b b b" auto;
    grid-template:
      [header-top] "a a a" [header-bottom]
      [main-top] "b b b" 1fr [main-bottom]
      / auto 1fr auto;
    
    /* Global values */
    grid-template: inherit;
    grid-template: initial;
    grid-template: revert;
    grid-template: revert-layer;
    grid-template: unset;
    
### Values
`none`
    
Sets all three longhand properties to `none`, meaning there is no explicit grid. There are no named grid areas. Rows and columns will be implicitly generated; their size will be determined by the `grid-auto-rows` and `grid-auto-columns` properties. This is the default value.
`<'grid-template-rows'> / <'grid-template-columns'>`
    
Sets `grid-template-rows` and `grid-template-columns` to the specified values, and sets `grid-template-areas` to `none`.
`[ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?`
    
Sets `grid-template-areas` to the strings listed, `grid-template-rows` to the track sizes following each string (filling in `auto` for any missing sizes), and splicing in the named lines defined before/after each size, and `grid-template-columns` to the track listing specified after the slash (or `none`, if not specified).
Note: The `repeat()` function isn't allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the "ASCII art".
Note: The `grid` shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values. Use `grid` (as opposed to `grid-template`) to prevent these values from cascading in separately.
## Examples
>
### Defining a grid template
#### CSS
    
    #page {
      display: grid;
      width: 100%;
      height: 200px;
      grid-template:
        [header-left] "head head" 30px [header-right]
        [main-left] "nav  main" 1fr [main-right]
        [footer-left] "nav  foot" 30px [footer-right]
        / 120px 1fr;
    }
    
    header {
      background-color: lime;
      grid-area: head;
    }
    
    nav {
      background-color: lightblue;
      grid-area: nav;
    }
    
    main {
      background-color: yellow;
      grid-area: main;
    }
    
    footer {
      background-color: red;
      grid-area: foot;
    }
    
#### HTML
    
    <div id="page">
      <header>Header</header>
      <nav>Navigation</nav>
      <main>Main area</main>
      <footer>Footer</footer>
    </div>
    
#### Result
# CSS reference
Use this CSS reference to browse an alphabetical index of all of the standard CSS properties, pseudo-classes, pseudo-elements, data types, functional notations and at-rules. You can also browse key CSS concepts and a list of selectors organized by type. Also included is a brief DOM-CSS / CSSOM reference.
## Basic rule syntax
>
### Style rule syntax
    
    style-rule ::=
        selectors-list {
          properties-list
        }
    
Where:
    
    selectors-list ::=
        selector[:pseudo-class] [::pseudo-element]
        [, selectors-list]
    
    properties-list ::=
        [property : value] [; properties-list]
    
See the index of selectors, pseudo-classes, and pseudo-elements below. The syntax for each specified value depends on the data type defined for each specified property.
#### Style rule examples
    
    strong {
      color: red;
    }
    
    div.menu-bar li:hover > ul {
      display: block;
    }
    
For a beginner-level introduction to the syntax of selectors, see our guide on CSS Selectors. Be aware that any syntax error in a rule definition invalidates the entire rule. Invalid rules are ignored by the browser. Note that CSS rule definitions are entirely (Unicode) text-based, whereas DOM-CSS / CSSOM (the rule management system) is object-based.
### At-rule syntax
As the structure of at-rules varies widely, please see At-rule to find the syntax of the specific one you want.
## Index
Note: This index does not include SVG-exclusive presentation attributes, which can be used as CSS properties on SVG elements.
Note: The property names in this index do not include the JavaScript names which do differ from the CSS standard names.
### -
  * `--*`
  * `-webkit-line-clamp`
  * `-webkit-text-fill-color`
  * `-webkit-text-stroke`
  * `-webkit-text-stroke-color`
  * `-webkit-text-stroke-width`


### A
  * `abs()`
  * `accent-color`
  * `acos()`
  * `:active`
  * `:active-view-transition`
  * `:active-view-transition-type()`
  * `additive-symbols (@counter-style)`
  * `::after (:after)`
  * `align-content`
  * `align-items`
  * `align-self`
  * `alignment-baseline`
  * `all`
  * `anchor()`
  * `anchor-name`
  * `anchor-scope`
  * `anchor-size()`
  * `<angle>`
  * `<angle-percentage>`
  * `animation`
  * `animation-composition`
  * `animation-delay`
  * `animation-direction`
  * `animation-duration`
  * `animation-fill-mode`
  * `animation-iteration-count`
  * `animation-name`
  * `animation-play-state`
  * `animation-range`
  * `animation-range-end`
  * `animation-range-start`
  * `animation-timeline`
  * `animation-timing-function`
  * `@annotation`
  * `:any-link`
  * `appearance`
  * `ascent-override (@font-face)`
  * `asin()`
  * `aspect-ratio`
  * `atan()`
  * `atan2()`
  * `attr()`
  * `:autofill`


### B
  * `::backdrop`
  * `backdrop-filter`
  * `backface-visibility`
  * `background`
  * `background-attachment`
  * `background-blend-mode`
  * `background-clip`
  * `background-color`
  * `background-image`
  * `background-origin`
  * `background-position`
  * `background-position-x`
  * `background-position-y`
  * `background-repeat`
  * `background-size`
  * `base-palette (@font-palette-values)`
  * `baseline-shift`
  * `<basic-shape>`
  * `::before (:before)`
  * `:blank`
  * `bleed (@page)`
  * `<blend-mode>`
  * `block-size`
  * `blur()`
  * `border`
  * `border-block`
  * `border-block-color`
  * `border-block-end`
  * `border-block-end-color`
  * `border-block-end-style`
  * `border-block-end-width`
  * `border-block-start`
  * `border-block-start-color`
  * `border-block-start-style`
  * `border-block-start-width`
  * `border-block-style`
  * `border-block-width`
  * `border-bottom`
  * `border-bottom-color`
  * `border-bottom-left-radius`
  * `border-bottom-right-radius`
  * `border-bottom-style`
  * `border-bottom-width`
  * `border-collapse`
  * `border-color`
  * `border-end-end-radius`
  * `border-end-start-radius`
  * `border-image`
  * `border-image-outset`
  * `border-image-repeat`
  * `border-image-slice`
  * `border-image-source`
  * `border-image-width`
  * `border-inline`
  * `border-inline-color`
  * `border-inline-end`
  * `border-inline-end-color`
  * `border-inline-end-style`
  * `border-inline-end-width`
  * `border-inline-start`
  * `border-inline-start-color`
  * `border-inline-start-style`
  * `border-inline-start-width`
  * `border-inline-style`
  * `border-inline-width`
  * `border-left`
  * `border-left-color`
  * `border-left-style`
  * `border-left-width`
  * `border-radius`
  * `border-right`
  * `border-right-color`
  * `border-right-style`
  * `border-right-width`
  * `border-spacing`
  * `border-start-end-radius`
  * `border-start-start-radius`
  * `border-style`
  * `border-top`
  * `border-top-color`
  * `border-top-left-radius`
  * `border-top-right-radius`
  * `border-top-style`
  * `border-top-width`
  * `border-width`
  * `bottom`
  * `@bottom-left-corner`
  * `box-decoration-break`
  * `box-shadow`
  * `box-sizing`
  * `break-after`
  * `break-before`
  * `break-inside`
  * `brightness()`
  * `:buffering`


### C
  * `calc()`
  * `calc-size()`
  * `cap`
  * `caption-side`
  * `caret`
  * `caret-color`
  * `caret-shape`
  * `ch`
  * `@character-variant`
  * `@charset`
  * `:checked`
  * `::checkmark`
  * `circle()`
  * `clamp()`
  * `clear`
  * `clip-path`
  * `clip-rule`
  * `cm`
  * `<color>`
  * `color`
  * `color-interpolation-filters`
  * `color-mix()`
  * `color-scheme`
  * `column-count`
  * `column-fill`
  * `column-gap`
  * `column-rule`
  * `column-rule-color`
  * `column-rule-style`
  * `column-rule-width`
  * `column-span`
  * `column-width`
  * `columns`
  * `conic-gradient()`
  * `contain`
  * `contain-intrinsic-block-size`
  * `contain-intrinsic-height`
  * `contain-intrinsic-inline-size`
  * `contain-intrinsic-size`
  * `contain-intrinsic-width`
  * `@container`
  * `container`
  * `container-name`
  * `container-type`
  * `content`
  * `content-visibility`
  * `contrast()`
  * `cos()`
  * `<counter>`
  * `counter-increment`
  * `counter-reset`
  * `counter-set`
  * `@counter-style`
  * `counters()`
  * `cross-fade()`
  * `cubic-bezier()`
  * `::cue`
  * `::cue()`
  * `::cue-region`
  * `::cue-region()`
  * `:current`
  * `cursor`
  * `<custom-ident>`
  * `cx`
  * `cy`


### D
  * `d`
  * `<dashed-ident>`
  * `:default`
  * `:defined`
  * `deg`
  * `descent-override (@font-face)`
  * `::details-content`
  * `<dimension>`
  * `:dir()`
  * `direction`
  * `:disabled`
  * `display`
  * `<display-box>`
  * `<display-inside>`
  * `<display-internal>`
  * `<display-legacy>`
  * `<display-listitem>`
  * `<display-outside>`
  * `dominant-baseline`
  * `dpcm`
  * `dpi`
  * `dppx`
  * `drop-shadow()`


### E
  * `<easing-function>`
  * `element()`
  * `ellipse()`
  * `em`
  * `:empty`
  * `empty-cells`
  * `:enabled`
  * `env()`
  * `ex`
  * `exp()`


### F
  * `fallback (@counter-style)`
  * `field-sizing`
  * `::file-selector-button`
  * `fill`
  * `fill-opacity`
  * `fill-rule`
  * `filter`
  * `<filter-function>`
  * `:first`
  * `:first-child`
  * `::first-letter (:first-letter)`
  * `::first-line (:first-line)`
  * `:first-of-type`
  * `fit-content()`
  * `<flex>`
  * `flex`
  * `flex-basis`
  * `flex-direction`
  * `flex-flow`
  * `flex-grow`
  * `flex-shrink`
  * `flex-wrap`
  * `float`
  * `flood-color`
  * `flood-opacity`
  * `:focus`
  * `:focus-visible`
  * `:focus-within`
  * `font`
  * `font-display (@font-face)`
  * `@font-face`
  * `font-family`
  * `font-family (@font-face)`
  * `font-family (@font-palette-values)`
  * `font-feature-settings`
  * `font-feature-settings (@font-face)`
  * `@font-feature-values`
  * `font-kerning`
  * `font-language-override`
  * `font-optical-sizing`
  * `font-palette`
  * `@font-palette-values`
  * `font-size`
  * `font-size-adjust`
  * `font-style`
  * `font-style (@font-face)`
  * `font-synthesis`
  * `font-synthesis-position`
  * `font-synthesis-small-caps`
  * `font-synthesis-style`
  * `font-synthesis-weight`
  * `font-variant`
  * `font-variant-alternates`
  * `font-variant-caps`
  * `font-variant-east-asian`
  * `font-variant-emoji`
  * `font-variant-ligatures`
  * `font-variant-numeric`
  * `font-variant-position`
  * `font-variation-settings`
  * `font-variation-settings (@font-face)`
  * `font-weight`
  * `font-weight (@font-face)`
  * `font-width`
  * `forced-color-adjust`
  * `format()`
  * `fr`
  * `<frequency>`
  * `<frequency-percentage>`
  * `:fullscreen`
  * `:future`


### G
  * `gap`
  * `grad`
  * `<gradient>`
  * `::grammar-error`
  * `grayscale()`
  * `grid`
  * `grid-area`
  * `grid-auto-columns`
  * `grid-auto-flow`
  * `grid-auto-rows`
  * `grid-column`
  * `grid-column-end`
  * `grid-column-start`
  * `grid-row`
  * `grid-row-end`
  * `grid-row-start`
  * `grid-template`
  * `grid-template-areas`
  * `grid-template-columns`
  * `grid-template-rows`


### H
  * `Hz`
  * `hanging-punctuation`
  * `:has()`
  * `:has-slotted`
  * `height`
  * `::highlight()`
  * `@historical-forms`
  * `:host`
  * `:host()`
  * `:host-context()`
  * `:hover`
  * `hsl()`
  * `hue-rotate()`
  * `hwb()`
  * `hyphenate-character`
  * `hyphenate-limit-chars`
  * `hyphens`
  * `hypot()`


### I
  * `ic`
  * `<ident>`
  * `<image>`
  * `image()`
  * `image-orientation`
  * `image-rendering`
  * `image-resolution`
  * `image-set()`
  * `@import`
  * `in`
  * `:in-range`
  * `:indeterminate`
  * `inherit`
  * `inherits (@property)`
  * `initial`
  * `initial-letter`
  * `initial-letter-align`
  * `initial-value (@property)`
  * `inline-size`
  * `inset`
  * `inset()`
  * `inset-block`
  * `inset-block-end`
  * `inset-block-start`
  * `inset-inline`
  * `inset-inline-end`
  * `inset-inline-start`
  * `<integer>`
  * `interpolate-size`
  * `:invalid`
  * `invert()`
  * `:is()`
  * `isolation`


### J
  * `justify-content`
  * `justify-items`
  * `justify-self`


### K
  * `kHz`
  * `@keyframes`


### L
  * `lab()`
  * `:lang()`
  * `:last-child`
  * `:last-of-type`
  * `@layer`
  * `layer()`
  * `layer() (@import)`
  * `lch()`
  * `leader()`
  * `:left`
  * `left`
  * `@left-top`
  * `<length>`
  * `<length-percentage>`
  * `letter-spacing`
  * `light-dark()`
  * `lighting-color`
  * `line-break`
  * `line-clamp`
  * `line-gap-override (@font-face)`
  * `line-height`
  * `line-height-step`
  * `<line-style>`
  * `linear()`
  * `linear-gradient()`
  * `:link`
  * `list-style`
  * `list-style-image`
  * `list-style-position`
  * `list-style-type`
  * `local()`
  * `:local-link`
  * `log()`


### M
  * `margin`
  * `margin-block`
  * `margin-block-end`
  * `margin-block-start`
  * `margin-bottom`
  * `margin-inline`
  * `margin-inline-end`
  * `margin-inline-start`
  * `margin-left`
  * `margin-right`
  * `margin-top`
  * `margin-trim`
  * `::marker`
  * `marker`
  * `marker-end`
  * `marker-mid`
  * `marker-start`
  * `marks (@page)`
  * `mask`
  * `mask-border`
  * `mask-border-mode`
  * `mask-border-outset`
  * `mask-border-repeat`
  * `mask-border-slice`
  * `mask-border-source`
  * `mask-border-width`
  * `mask-clip`
  * `mask-composite`
  * `mask-image`
  * `mask-mode`
  * `mask-origin`
  * `mask-position`
  * `mask-repeat`
  * `mask-size`
  * `mask-type`
  * `math-depth`
  * `math-shift`
  * `math-style`
  * `matrix()`
  * `matrix3d()`
  * `max()`
  * `max-block-size`
  * `max-height`
  * `max-inline-size`
  * `max-lines`
  * `max-width`
  * `@media`
  * `min()`
  * `min-block-size`
  * `min-height`
  * `min-inline-size`
  * `min-width`
  * `minmax()`
  * `mix-blend-mode`
  * `mm`
  * `mod()`
  * `:modal`
  * `ms`
  * `:muted`


### N
  * `@namespace`
  * `navigation (@view-transition)`
  * `negative (@counter-style)`
  * `:not()`
  * `:nth-child()`
  * `:nth-last-child()`
  * `:nth-last-of-type()`
  * `:nth-of-type()`
  * `<number>`


### O
  * `object-fit`
  * `object-position`
  * `object-view-box`
  * `offset`
  * `offset-anchor`
  * `offset-distance`
  * `offset-path`
  * `offset-position`
  * `offset-rotate`
  * `oklab()`
  * `oklch()`
  * `:only-child`
  * `:only-of-type`
  * `opacity`
  * `opacity()`
  * `:open`
  * `:optional`
  * `order`
  * `@ornaments`
  * `orphans`
  * `:out-of-range`
  * `outline`
  * `outline-color`
  * `outline-offset`
  * `outline-style`
  * `outline-width`
  * `overflow`
  * `overflow-anchor`
  * `overflow-block`
  * `overflow-clip-margin`
  * `overflow-inline`
  * `overflow-wrap`
  * `overflow-x`
  * `overflow-y`
  * `overlay`
  * `override-colors (@font-palette-values)`
  * `overscroll-behavior`
  * `overscroll-behavior-block`
  * `overscroll-behavior-inline`
  * `overscroll-behavior-x`
  * `overscroll-behavior-y`


### P
  * `Pseudo-classes`
  * `Pseudo-elements`
  * `pad (@counter-style)`
  * `padding`
  * `padding-block`
  * `padding-block-end`
  * `padding-block-start`
  * `padding-bottom`
  * `padding-inline`
  * `padding-inline-end`
  * `padding-inline-start`
  * `padding-left`
  * `padding-right`
  * `padding-top`
  * `@page`
  * `page`
  * `page-orientation (@page)`
  * `paint()`
  * `paint-order`
  * `palette-mix()`
  * `::part()`
  * `:past`
  * `path()`
  * `:paused`
  * `pc`
  * `<percentage>`
  * `perspective`
  * `perspective()`
  * `perspective-origin`
  * `::picker()`
  * `::picker-icon`
  * `:picture-in-picture`
  * `place-content`
  * `place-items`
  * `place-self`
  * `::placeholder`
  * `:placeholder-shown`
  * `:playing`
  * `pointer-events`
  * `polygon()`
  * `:popover-open`
  * `<position>`
  * `position`
  * `position-anchor`
  * `position-area`
  * `@position-try`
  * `position-try`
  * `position-try-fallbacks`
  * `position-try-order`
  * `position-visibility`
  * `pow()`
  * `prefix (@counter-style)`
  * `print-color-adjust`
  * `@property`
  * `pt`
  * `px`


### Q
  * `Q`
  * `quotes`


### R
  * `r`
  * `rad`
  * `radial-gradient()`
  * `range (@counter-style)`
  * `<ratio>`
  * `ray()`
  * `:read-only`
  * `:read-write`
  * `rect()`
  * `rem()`
  * `repeat()`
  * `repeating-conic-gradient()`
  * `repeating-linear-gradient()`
  * `repeating-radial-gradient()`
  * `:required`
  * `resize`
  * `<resolution>`
  * `reversed()`
  * `revert`
  * `rgb()`
  * `:right`
  * `right`
  * `@right-top`
  * `:root`
  * `rotate`
  * `rotate()`
  * `rotate3d()`
  * `rotateX()`
  * `rotateY()`
  * `rotateZ()`
  * `round()`
  * `row-gap`
  * `ruby-align`
  * `ruby-merge`
  * `ruby-overhang`
  * `ruby-position`
  * `rx`
  * `ry`


### S
  * `s`
  * `saturate()`
  * `scale`
  * `scale()`
  * `scale3d()`
  * `scaleX()`
  * `scaleY()`
  * `scaleZ()`
  * `:scope`
  * `@scope`
  * `scroll()`
  * `scroll-behavior`
  * `scroll-initial-target`
  * `scroll-margin`
  * `scroll-margin-block`
  * `scroll-margin-block-end`
  * `scroll-margin-block-start`
  * `scroll-margin-bottom`
  * `scroll-margin-inline`
  * `scroll-margin-inline-end`
  * `scroll-margin-inline-start`
  * `scroll-margin-left`
  * `scroll-margin-right`
  * `scroll-margin-top`
  * `::scroll-marker`
  * `::scroll-marker-group`
  * `scroll-padding`
  * `scroll-padding-block`
  * `scroll-padding-block-end`
  * `scroll-padding-block-start`
  * `scroll-padding-bottom`
  * `scroll-padding-inline`
  * `scroll-padding-inline-end`
  * `scroll-padding-inline-start`
  * `scroll-padding-left`
  * `scroll-padding-right`
  * `scroll-padding-top`
  * `scroll-snap-align`
  * `scroll-snap-stop`
  * `scroll-snap-type`
  * `scroll-state()`
  * `scroll-timeline`
  * `scroll-timeline-axis`
  * `scroll-timeline-name`
  * `scrollbar-color`
  * `scrollbar-gutter`
  * `scrollbar-width`
  * `:seeking`
  * `::selection`
  * `selector()`
  * `sepia()`
  * `shape-image-threshold`
  * `shape-margin`
  * `shape-outside`
  * `shape-rendering`
  * `sign()`
  * `sin()`
  * `size (@page)`
  * `size-adjust (@font-face)`
  * `skew()`
  * `skewX()`
  * `skewY()`
  * `::slotted()`
  * `speak-as`
  * `speak-as (@counter-style)`
  * `::spelling-error`
  * `sqrt()`
  * `src (@font-face)`
  * `:stalled`
  * `@starting-style`
  * `:state()`
  * `steps()`
  * `stop-color`
  * `stop-opacity`
  * `<string>`
  * `stroke`
  * `stroke-color`
  * `stroke-dasharray`
  * `stroke-dashoffset`
  * `stroke-linecap`
  * `stroke-linejoin`
  * `stroke-miterlimit`
  * `stroke-opacity`
  * `stroke-width`
  * `style()`
  * `@styleset`
  * `@stylistic`
  * `suffix (@counter-style)`
  * `@supports`
  * `supports() (@import)`
  * `@swash`
  * `symbols (@counter-style)`
  * `symbols()`
  * `syntax (@property)`
  * `system (@counter-style)`


### T
  * `tab-size`
  * `table-layout`
  * `tan()`
  * `:target`
  * `target-counter()`
  * `target-counters()`
  * `:target-current`
  * `::target-text`
  * `target-text()`
  * `:target-within`
  * `text-align`
  * `text-align-last`
  * `text-anchor`
  * `text-box`
  * `text-box-edge`
  * `text-box-trim`
  * `text-combine-upright`
  * `text-decoration`
  * `text-decoration-color`
  * `text-decoration-line`
  * `text-decoration-skip`
  * `text-decoration-skip-ink`
  * `text-decoration-style`
  * `text-decoration-thickness`
  * `<text-edge>`
  * `text-emphasis`
  * `text-emphasis-color`
  * `text-emphasis-position`
  * `text-emphasis-style`
  * `text-indent`
  * `text-justify`
  * `text-orientation`
  * `text-overflow`
  * `text-rendering`
  * `text-shadow`
  * `text-size-adjust`
  * `text-spacing-trim`
  * `text-transform`
  * `text-underline-offset`
  * `text-underline-position`
  * `text-wrap`
  * `text-wrap-mode`
  * `text-wrap-style`
  * `<time>`
  * `<time-percentage>`
  * `timeline-scope`
  * `top`
  * `@top-left-corner`
  * `touch-action`
  * `transform`
  * `transform-box`
  * `<transform-function>`
  * `transform-origin`
  * `transform-style`
  * `transition`
  * `transition-behavior`
  * `transition-delay`
  * `transition-duration`
  * `transition-property`
  * `transition-timing-function`
  * `translate`
  * `translate()`
  * `translate3d()`
  * `translateX()`
  * `translateY()`
  * `translateZ()`
  * `turn`
  * `type()`
  * `types (@view-transition)`


### U
  * `unicode-bidi`
  * `unicode-range (@font-face)`
  * `unset`
  * `<url>`
  * `url()`
  * `:user-invalid`
  * `user-select`
  * `:user-valid`


### V
  * `:valid`
  * `var()`
  * `vector-effect`
  * `vertical-align`
  * `vh`
  * `view()`
  * `view-timeline`
  * `view-timeline-axis`
  * `view-timeline-inset`
  * `view-timeline-name`
  * `::view-transition`
  * `@view-transition`
  * `view-transition-class`
  * `::view-transition-group()`
  * `::view-transition-image-pair()`
  * `view-transition-name`
  * `::view-transition-new()`
  * `::view-transition-old()`
  * `visibility`
  * `:visited`
  * `vmax`
  * `vmin`
  * `:volume-locked`
  * `vw`


### W
  * `:where()`
  * `white-space`
  * `white-space-collapse`
  * `widows`
  * `width`
  * `will-change`
  * `word-break`
  * `word-spacing`
  * `word-wrap`
  * `writing-mode`


### X
  * `x`
  * `:xr-overlay`
  * `xywh()`


### Y
  * `y`


### Z
  * `z-index`
  * `zoom`


## Selectors
The following are the various selectors, which allow styles to be conditional based on various features of elements within the DOM.
### Basic selectors
Basic selectors are fundamental selectors; these are the most basic selectors that are frequently combined to create other, more complex selectors.
  * Universal selector `*`
  * Type selector `elementname`
  * Class selector `.classname`
  * ID selector `#idname`
  * Attribute selector `[attr=value]`


### Grouping selectors
Selector list `A, B`
    
Specifies that both `A` and `B` elements are selected. This is a grouping method to select several matching elements.
### Combinators
Combinators are selectors that establish a relationship between two or more simple selectors, such as "`A` is a child of `B`" or "`A` is adjacent to `B`", creating a complex selector.
Next-sibling combinator `A + B`
    
Specifies that the elements selected by both `A` and `B` have the same parent and that the element selected by `B` immediately follows the element selected by `A` horizontally.
Subsequent-sibling combinator `A ~ B`
    
Specifies that the elements selected by both `A` and `B` share the same parent and that the element selected by `A` comes before—but not necessarily immediately before—the element selected by `B`.
Child combinator `A > B`
    
Specifies that the element selected by `B` is the direct child of the element selected by `A`.
Descendant combinator `A B`
    
Specifies that the element selected by `B` is a descendant of the element selected by `A`, but is not necessarily a direct child.
Column combinator `A || B` Experimental
    
Specifies that the element selected by `B` is located within the table column specified by `A`. Elements which span multiple columns are considered to be a member of all of those columns.
### Pseudo
Pseudo classes `:`
    
Specifies a special state of the selected element(s).
Pseudo elements `::`
    
Represents entities that are not included in HTML.
See also selectors in the Selectors specification and the pseudo-element specification.
## Concepts
>
### Syntax and semantics
  * CSS syntax
  * At-rules
  * Cascade
  * Comments
  * Descriptor
  * Inheritance
  * Shorthand properties
  * Specificity
  * Value definition syntax
  * CSS values and units
  * CSS functional notations


### Values
  * Actual value
  * Computed value
  * Initial value
  * Resolved value
  * Specified value
  * Used value


### Layout
  * Block formatting context
  * Box model
  * Containing block
  * Layout mode
  * Margin collapsing
  * Replaced elements
  * Stacking context
  * Visual formatting model


## DOM-CSS / CSSOM
>
### Major object types
  * `Document.styleSheets`
  * `HTMLElement.style`
  * `Element.className`
  * `Element.classList`
  * `StyleSheetList`
  * `CSSRuleList`
  * `CSSRule`
  * `CSSStyleRule`
  * `CSSStyleDeclaration`


### Important methods
  * `CSSStyleSheet.insertRule()`
  * `CSSStyleSheet.deleteRule()`


## External Links
  * CSS Indices (w3.org)


# revert
The `revert` CSS keyword reverts the cascaded value of the property from its current value to the value the property would have had if no changes had been made by the current style origin to the current element. Thus, it resets the property either to user agent set value, to user set value, to its inherited value (if it is inheritable), or to initial value. It can be applied to any CSS property, including the CSS shorthand property `all`.
This keyword removes from the cascade all of the styles that have been overridden until the style being rolled back to is reached.
  * If used by a site's own styles (the author origin), `revert` rolls back the property's cascaded value to the user's custom style, if one exists; otherwise, it rolls the style back to the user agent's default style.
  * If used in a user's custom stylesheet, or if the style was applied by the user (the user origin), `revert` rolls back the cascaded value to the user agent's default style.
  * If used within the user agent's default styles, this keyword is functionally equivalent to `unset`.


The `revert` keyword works exactly the same as `unset` in many cases. The only difference is for properties that have values set by the browser or by custom stylesheets created by users (set on the browser side).
Revert will not affect rules applied to children of an element you reset (but will remove effects of a parent rule on a child). So if you have a `color: green` for all sections and `all: revert` on a specific section, the color of the section will be black. But if you have a rule to make all paragraphs red, then all paragraphs will still be red in all sections.
Note: Revert is just a value. It is still possible to override the `revert` value using specificity.
Note: The `revert` keyword is different from and should not be confused with the `initial` keyword, which uses the initial value defined on a per-property basis by the CSS specifications. In contrast, user-agent stylesheets set default values on the basis of CSS selectors.
For example, the initial value for the `display` property is `inline`, whereas a normal user-agent stylesheet sets the default `display` value of `<div>`s to `block`, of `<table>`s to `table`, etc.
## Examples
>
### Revert vs. unset
Although `revert` and `unset` are similar, they differ for some properties for some elements.
So in the below example, we set custom `font-weight`, but then try to `revert` and `unset` it inline in the HTML document. The `revert` keyword will revert the text to bold because that is the default value for headers in most browsers. The `unset` keyword will keep the text normal because, as an inherited property, the `font-weight` would then inherit its value from the body.
#### HTML
    
    <h3 style="font-weight: revert; color: revert;">
      This should have its original font-weight (bold) and color: black
    </h3>
    <p>Just some text</p>
    <h3 style="font-weight: unset; color: unset;">
      This will still have font-weight: normal, but color: black
    </h3>
    <p>Just some text</p>
    
#### CSS
    
    h3 {
      font-weight: normal;
      color: blue;
    }
    
#### Result
### Revert all
Reverting all values is useful in a situation where you've made several style changes and then you want to revert to the browser default values. So in the above example, instead of reverting `font-weight` and `color` separately, you could just revert all of them at once - by applying the `revert` keyword on `all`.
#### HTML
    
    <h3>This will have custom styles</h3>
    <p>Just some text</p>
    <h3 style="all: revert">This should be reverted to browser/user defaults.</h3>
    <p>Just some text</p>
    
#### CSS
    
    h3 {
      font-weight: normal;
      color: blue;
      border-bottom: 1px solid grey;
    }
    
#### Result
### Revert on a parent
Reverting effectively removes the value for the element you select with some rule and this happens only for that element. To illustrate this, we will set a green color on a section and red color on a paragraph.
#### HTML
    
    <main>
      <section>
        <h3>This h3 will be dark green</h3>
        <p>Text in paragraph will be red.</p>
        This stray text will also be dark green.
      </section>
      <section class="with-revert">
        <h3>This h3 will be steelblue</h3>
        <p>Text in paragraph will be red.</p>
        This stray text will also be steelblue.
      </section>
    </main>
    
#### CSS
    
    main {
      color: steelblue;
    }
    section {
      color: darkgreen;
    }
    p {
      color: red;
    }
    section.with-revert {
      color: revert;
    }
    
#### Result
Notice how the paragraph is still red even though a `color` property for the section was reverted. Also, note that both the header and plain text node are `steelblue`. The result of reverting makes it as if `section { color: darkgreen; }` did not exist for the section with `color: revert` applied.
Also, if neither the user agent nor the user override the `<h3>` or `<section>` color values, then the `steelblue` color is inherited from `<main>`, as the `color` property is an inherited property.
# ruby-overhang
The `ruby-overhang` CSS property specifies whether or not a `<ruby>` annotation overhangs any surrounding text.
## Try it
    
    ruby-overhang: auto;
    
    
    ruby-overhang: none;
    
    
    <section id="default-example">
      <p id="example-element">
        あの<ruby>表<rp>(</rp><rt>ひょう</rt><rp>)</rp></ruby
        ><ruby>現<rp>(</rp><rt>げん</rt><rp>)</rp></ruby>は面白い。
      </p>
    </section>
    
    
    #default-example {
      font-size: 2em;
    }
    
## Syntax
    
    /* Keyword values */
    ruby-overhang: auto;
    ruby-overhang: none;
    
    /* Global values */
    ruby-overhang: inherit;
    ruby-overhang: initial;
    ruby-overhang: revert;
    ruby-overhang: revert-layer;
    ruby-overhang: unset;
    
### Values
`auto`
    
When a ruby annotation container is longer than its corresponding base container, the annotation may partially overlap adjacent text. Whether, and how much to overhang are determined by the user agent.
`none`
    
A keyword indicating that the ruby is never allowed to extend past adjacent containers.
## Description
The `ruby-overhang` property controls whether the ruby annotation text box (`<rt>`) may overlap adjacent text outside the `<ruby>` container box.
When ruby annotation text is not allowed to overhang — when `ruby-overhang: none` is set on the `<ruby>` element — that element behaves like an inline box, as if its `display` property were set to `inline` with only its own contents rendered within its boundaries and adjacent elements not crossing the boundary box.
By default, the content of an `<rt>` element is allowed to overhang, so content may overlap the `<ruby>` container box, partially rendering over or under surrounding inline-level content. With `auto`, the default, content may overhang, but it will not overhang if doing so would overlap adjacent `<rt>` elements or elements with a `display` value resolving to `ruby-base` or `ruby-text`.
## Examples
>
### Ruby overhanging base text
This examples demonstrates both values of the `ruby-overhang` property.
#### HTML
We include two paragraphs with identical `<ruby>` content and structures, other than their class names.
    
    <p class="auto">
      あの<ruby>表<rp>(</rp><rt>ひょう</rt><rp>)</rp></ruby
      ><ruby>現<rp>(</rp><rt>げん</rt><rp>)</rp></ruby>は面白い。
    </p>
    
    <p class="none">
      あの<ruby>表<rp>(</rp><rt>ひょう</rt><rp>)</rp></ruby
      ><ruby>現<rp>(</rp><rt>げん</rt><rp>)</rp></ruby>は面白い。
    </p>
    
#### CSS
A red `outline` of `1px` helps highlight the text annotation of `<rt>` elements. The first paragraph has `ruby-overhang: auto` and the second has `ruby-overhang: none`.
    
    p {
      font-size: 40px;
      display: block;
      margin: 0.5rem;
    }
    rt {
      font-size: 28px;
      outline: 1px solid red;
    }
    .auto {
      ruby-overhang: auto;
    }
    .none {
      ruby-overhang: none;
    }
    
#### Results
When `ruby-overhang` is set to `none`, the annotation text is not allowed to overlap the adjacent boxes of base ruby text. If you look closely, you may notice that in the first paragraph, the red box encasing the ruby text slightly overlaps parts of non-associated `<ruby>` content, whereas in the `none` example in supporting browsers, there is no overlap between ruby content and not-associated ruby text.
# text-emphasis-color
The `text-emphasis-color` CSS property sets the color of emphasis marks. This value can also be set using the `text-emphasis` shorthand.
## Try it
    
    text-emphasis-color: currentColor;
    
    
    text-emphasis-color: red;
    
    
    text-emphasis-color: rgb(90 200 160 / 0.8);
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
    #example-element {
      text-emphasis: filled;
    }
    
## Syntax
    
    /* Initial value */
    text-emphasis-color: currentColor;
    
    /* <color> */
    text-emphasis-color: #555555;
    text-emphasis-color: blue;
    text-emphasis-color: rgb(90 200 160 / 80%);
    text-emphasis-color: transparent;
    
    /* Global values */
    text-emphasis-color: inherit;
    text-emphasis-color: initial;
    text-emphasis-color: revert;
    text-emphasis-color: revert-layer;
    text-emphasis-color: unset;
    
### Values
`<color>`
    
Defines the color of the emphasis marks. If no color is present, it defaults to `currentColor`.
## Examples
>
### Emphasis with a color and custom character
#### CSS
    
    em {
      text-emphasis-color: green;
      text-emphasis-style: "*";
    }
    
#### HTML
    
    <p>Here's an example:</p>
    
    <em>This has emphasis marks!</em>
    
#### Result
# outline-style
The `outline-style` CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the `border`.
## Try it
    
    outline-style: none;
    
    
    outline-style: dotted;
    
    
    outline-style: solid;
    
    
    outline-style: groove;
    
    
    outline-style: inset;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with an outline around it.
      </div>
    </section>
    
    
    #example-element {
      outline: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
It is often more convenient to use the shorthand property `outline` when defining the appearance of an outline.
## Syntax
    
    /* Keyword values */
    outline-style: auto;
    outline-style: none;
    outline-style: dotted;
    outline-style: dashed;
    outline-style: solid;
    outline-style: double;
    outline-style: groove;
    outline-style: ridge;
    outline-style: inset;
    outline-style: outset;
    
    /* Global values */
    outline-style: inherit;
    outline-style: initial;
    outline-style: revert;
    outline-style: revert-layer;
    outline-style: unset;
    
The `outline-style` property is specified as any one of the values listed below.
### Values
`auto`
    
Permits the user agent to render a custom outline style.
`none`
    
No outline is used. The `outline-width` is `0`.
`dotted`
    
The outline is a series of dots.
`dashed`
    
The outline is a series of short line segments.
`solid`
    
The outline is a single line.
`double`
    
The outline is two single lines. The `outline-width` is the sum of the two lines and the space between them.
`groove`
    
The outline looks as though it were carved into the page.
`ridge`
    
The opposite of `groove`: the outline looks as though it were extruded from the page.
`inset`
    
The outline makes the box look as though it were embedded in the page.
`outset`
    
The opposite of `inset`: the outline makes the box look as though it were coming out of the page.
## Examples
>
### Setting outline style to auto
The `auto` value indicates a custom outline style, described in the specification as "typically a style [that] is either a user interface default for the platform, or perhaps a style that is richer than can be described in detail in CSS, e.g., a rounded edge outline with semi-translucent outer pixels that appears to glow".
#### HTML
    
    <div>
      <p class="auto">Outline Demo</p>
    </div>
    
#### CSS
    
    .auto {
      outline-style: auto; /* same result as "outline: auto" */
    }
    
    /* To make the Demo clearer */
    * {
      outline-width: 10px;
      padding: 15px;
    }
    
#### Result
### Setting outline style to dashed and dotted
#### HTML
    
    <div>
      <div class="dotted">
        <p class="dashed">Outline Demo</p>
      </div>
    </div>
    
#### CSS
    
    .dotted {
      outline-style: dotted; /* same result as "outline: dotted" */
    }
    .dashed {
      outline-style: dashed;
    }
    
    /* To make the Demo clearer */
    * {
      outline-width: 10px;
      padding: 15px;
    }
    
#### Result
### Setting outline style to solid and double
#### HTML
    
    <div>
      <div class="solid">
        <p class="double">Outline Demo</p>
      </div>
    </div>
    
#### CSS
    
    .solid {
      outline-style: solid;
    }
    .double {
      outline-style: double;
    }
    
    /* To make the Demo clearer */
    * {
      outline-width: 10px;
      padding: 15px;
    }
    
#### Result
### Setting outline style to groove and ridge
#### HTML
    
    <div>
      <div class="groove">
        <p class="ridge">Outline Demo</p>
      </div>
    </div>
    
#### CSS
    
    .groove {
      outline-style: groove;
    }
    .ridge {
      outline-style: ridge;
    }
    
    /* To make the Demo clearer */
    * {
      outline-width: 10px;
      padding: 15px;
    }
    
#### Result
### Setting outline style to inset and outset
#### HTML
    
    <div>
      <div class="inset">
        <p class="outset">Outline Demo</p>
      </div>
    </div>
    
#### CSS
    
    .inset {
      outline-style: inset;
    }
    .outset {
      outline-style: outset;
    }
    
    /* To make the Demo clearer */
    * {
      outline-width: 10px;
      padding: 15px;
    }
    
#### Result
# contain-intrinsic-block-size
The `contain-intrinsic-block-size` CSS logical property defines the block size of an element that a browser can use for layout when the element is subject to size containment.
Block size is the size of an element in the dimension perpendicular to the flow of text within a line. In a horizontal writing mode like standard English, block size is the vertical dimension (height); in a vertical writing mode, block size is the horizontal dimension.
## Syntax
    
    /* Keyword values */
    contain-intrinsic-block-size: none;
    
    /* <length> values */
    contain-intrinsic-block-size: 1000px;
    contain-intrinsic-block-size: 10rem;
    
    /* auto <length> */
    contain-intrinsic-block-size: auto 300px;
    
    /* Global values */
    contain-intrinsic-block-size: inherit;
    contain-intrinsic-block-size: initial;
    contain-intrinsic-block-size: revert;
    contain-intrinsic-block-size: revert-layer;
    contain-intrinsic-block-size: unset;
    
### Values
The following values can be specified for the intrinsic block size of an element:
`none`
    
The element has no intrinsic block size.
`<length>`
    
The element has the specified block size, expressed using the (`<length>`) data type.
`auto <length>`
    
When the element is in size containment and skipping its contents (for example, when it is offscreen and `content-visibility: auto` is set) the block size is remembered from the actual size of the element when it was last able to render its child elements. If the element has never rendered its child elements and hence has no remembered value for the normally rendered element size, or if it is not skipping its contents, the block size is the specified `<length>`.
## Description
The property is commonly applied alongside elements that can trigger size containment, such as `contain: size` and `content-visibility`.
Size containment allows a user agent to lay out an element as though it had a fixed size. This prevents unnecessary reflows by avoiding the re-rendering of child elements to determine the actual size (thereby improving user experience). By default, size containment treats elements as though they had no contents and may collapse the layout in the same way as if the contents had no width or height. The `contain-intrinsic-block-size` property allows authors to specify an appropriate value to be used as the block-size for layout.
The `auto <length>` value allows the block-size of an element to be stored if the element is ever "normally rendered" (with its child elements) and then used instead of the specified value when the element does not have any content. This allows offscreen elements with `content-visibility: auto` to benefit from size containment without developers having to be precise in their estimates of element size. The remembered value is not used if the child elements are being rendered; if size containment is enabled, the `<length>` value will be used.
## Examples
>
### Setting the intrinsic block size
The HTML below defines an element "contained_element" that will be subject to size constraint, and which contains a child element.
    
    <div id="contained_element">
      <div class="child_element"></div>
    </div>
    
The CSS below sets the `content-visibility` of `contained_element` to `auto`, so if the element is hidden it will be size constrained. The intrinsic block size and inline size that are used when it is size constrained are set at the same time using `contain-intrinsic-block-size` and `contain-intrinsic-inline-size`, respectively.
    
    #contained_element {
      border: 2px solid green;
      inline-size: 151px;
      content-visibility: auto;
      contain-intrinsic-inline-size: 152px;
      contain-intrinsic-block-size: 52px;
    }
    .child_element {
      border: 1px solid red;
      background: blue;
      block-size: 50px;
      inline-size: 150px;
    }
    
# :stalled
The `:stalled` CSS pseudo-class selector represents an element that is playable, such as `<audio>` or `<video>`, when playback is stalled. A resource is considered to be stalled if the user has requested playback of a specific position in the media resource, but it has failed to receive any data for some amount of time. This is different from `:buffering` in that the media element is unexpectedly not loading data when stalled (e.g., due to a network error) for around 3 seconds (the exact time is user agent dependent).
Note: Like with the `:buffering` pseudo-class, the element is still considered to be "playing" when it is "stalled". If `:stalled` matches an element, `:playing` will also match that element.
## Syntax
    
    :stalled {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :stalled {
      outline: 5px solid red;
    }
    
    audio:stalled {
      background-color: red;
    }
    
# ::-webkit-slider-thumb
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-webkit-slider-thumb` CSS pseudo-element represents the "thumb" that the user can move within the "groove" of an `<input>` of `type="range"` to alter its numerical value.
## Syntax
    
    ::-webkit-slider-thumb {
      /* ... */
    }
    
Not part of any standard.
# CSS fonts
The CSS fonts module defines font-related properties and how font resources are loaded. It lets you define the style of a font, such as its family, size and weight, and the glyph variants to use when multiple are available for a single character.
A font is a resource file containing the visual representation of characters, mapping character codes to glyphs that represent letters, numbers, punctuation and even emojis of a typeface. A font family is a group of fonts that share common design styles and font properties, with each member of the group providing different ways of displaying the glyphs, varying by stroke weight, slant, or relative width, among other attributes. A font typically represents a single style of a typeface, such as Helvetica that is Bold and Italic. A font family is the complete set of styles. Including such a font in a document or design is done by defining a separate `@font-face` declaration for each font resource.
The properties, at-rules, and descriptors of the CSS fonts module enable the downloading of multiple variations of a font. They also define the font file to use for a particular font characteristic, along with fallback instructions in case a resource fails to load. The CSS font selection mechanism describes the process of matching a given set of CSS font properties to a single font face.
The CSS fonts module also supports variable fonts. Unlike regular fonts, where each style is implemented as a separate font file, variable fonts can contain all styles within a single file. By using a single `@font-face` declaration, you can import a variable font that includes all the styles. Depending on the font, this can include a multitude of font variants. Variable fonts are a part of the OpenType font specification.
## Reference
>
### Properties
  * `font` shorthand
  * `font-family`
  * `font-feature-settings`
  * `font-kerning`
  * `font-language-override`
  * `font-optical-sizing`
  * `font-palette`
  * `font-size`
  * `font-size-adjust`
  * `font-stretch`
  * `font-style`
  * `font-weight`
  * `font-synthesis` shorthand
  * `font-synthesis-position`
  * `font-synthesis-small-caps`
  * `font-synthesis-style`
  * `font-synthesis-weight`
  * `font-variant` shorthand
  * `font-variant-alternates`
  * `font-variant-caps`
  * `font-variant-east-asian`
  * `font-variant-emoji`
  * `font-variant-ligatures`
  * `font-variant-numeric`
  * `font-variant-position`
  * `font-variation-settings`


The specification also defines the `font-width` property, which is not yet supported by any browser.
### At-rules and descriptors
At-rule: `@font-face`
    
Descriptors:
  * `ascent-override`
  * `descent-override`
  * `font-display`
  * `font-family`
  * `font-feature-settings`
  * `font-stretch`
  * `font-style`
  * `font-variation-settings`
  * `font-weight`
  * `line-gap-override`
  * `size-adjust`
  * `src`
  * `unicode-range`


The CSS fonts module also defines the `font-language-override`, `font-named-instance`, `font-width`, `font-size`, `subscript-position-override`, `subscript-size-override`, `superscript-position-override`, and `superscript-size-override` descriptors. Currently, no browsers support these features.
  * At-rule: `@font-feature-values`


The CSS fonts module also defines the `font-display` descriptor. Currently, no browsers support this feature.
At-rule: `@font-palette-values`
    
Descriptors:
  * `base-palette`
  * `font-family`
  * `override-colors`


### Data types
`font-size` types:
  * `<absolute-size>`
  * `<relative-size>`


`font-family` type:
  * `<generic-family>`


`font-feature-settings` type:
  * `<feature-tag-value>`


`font-format` type:
  * `<font-format>`


`font-stretch` type:
  * `<font-stretch-css3>`


`font-tech` types:
  * `<color-font-tech>`
  * `<font-features-tech>`
  * `<font-tech>`


`font-variant` types:
  * `<font-variant-css2>`
  * `<east-asian-variant-values>`
  * `<east-asian-width-values>`


`font-variant-ligatures` types:
  * `<common-lig-values>`
  * `<contextual-alt-values>`
  * `<discretionary-lig-values>`
  * `<historical-lig-values>`


`font-variant-numeric` types:
  * `<numeric-figure-values>`
  * `<numeric-fraction-values>`
  * `<numeric-spacing-values>`


`font-weight` type:
  * `<font-weight-absolute>`


### Interfaces
  * `CSSFontFaceRule`
  * `CSSFontFeatureValuesRule`
  * `CSSFontPaletteValuesRule`


## Guides
Learn: Fundamental text and font styling
    
This beginner's learning article covers the basic fundamentals of text and font styling. It covers how to set the font weight, family, and style by using the `font` shorthand and how to align text and manage line and letter spacing.
Learn: Web fonts
    
This beginner's learning article explains how to use custom fonts on your web page to allow for more varied and custom text styling.
OpenType font features
    
Font features or variants refer to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. These are all referred to as OpenType Features, and are made available to use on the web via specific properties and a low-level control property — `font-feature-settings`. This article provides you with all you need to know about using OpenType font features in CSS.
Variable fonts
    
This article will help you get started with using variable fonts.
Improving font performance
    
This article, part of the CSS performance guide, discusses font loading, loading only the required glyphs, and defining font display behavior with the `font-display` descriptor.
## Related concepts
  * `letter-spacing` CSS property
  * `line-height` CSS property
  * `text-transform` CSS property


# box-pack
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This is a property of the original CSS flexible box layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard.
The `-moz-box-pack` and `-webkit-box-pack` CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box.
The direction of layout depends on the element's orientation: horizontal or vertical.
## Syntax
    
    /* Keyword values */
    box-pack: start;
    box-pack: center;
    box-pack: end;
    box-pack: justify;
    
    /* Global values */
    box-pack: inherit;
    box-pack: initial;
    box-pack: unset;
    
The `box-pack` property is specified as one of the keyword values listed below.
### Values
`start`
    
The box packs contents at the start, leaving any extra space at the end.
`center`
    
The box packs contents in the center, dividing any extra space equally between the start and the end.
`end`
    
The box packs contents at the end, leaving any extra space at the start.
`justify`
    
The space is divided evenly in-between each child, with none of the extra space placed before the first child or after the last child. If there is only one child, treat the value as if it were `start`.
## Notes
The edge of the box designated the start for packing purposes depends on the box's orientation and direction:
  * For horizontal elements, the start is the top edge.
  * For vertical elements, the start is the left edge.


Normal Reverse  
Horizontal left right  
Vertical top bottom  
The edge opposite to the start is designated the end.
If the packing is set using the element's `pack` attribute, then the style is ignored.
## Examples
>
### Examples of box-pack
    
    div.example {
      border-style: solid;
    
      display: -moz-box; /* Mozilla */
      display: -webkit-box; /* WebKit */
    
      /* Make this box taller than the children,
         so there is room for the box-pack */
      height: 300px;
      /* Make this box wide enough to show the contents
         are centered horizontally */
      width: 300px;
    
      /* Children should be oriented vertically */
      -moz-box-orient: vertical; /* Mozilla */
      -webkit-box-orient: vertical; /* WebKit */
    
      /* Align children to the horizontal center of this box */
      -moz-box-align: center; /* Mozilla */
      -webkit-box-align: center; /* WebKit */
    
      /* Pack children to the bottom of this box */
      -moz-box-pack: end; /* Mozilla */
      -webkit-box-pack: end; /* WebKit */
    }
    
    div.example p {
      /* Make children narrower than their parent,
         so there is room for the box-align */
      width: 200px;
    }
    
    
    <div class="example">
      <p>I will be second from the bottom of div.example, centered horizontally.</p>
      <p>I will be on the bottom of div.example, centered horizontally.</p>
    </div>
    
Not part of any standard.
# border-inline-width
The `border-inline-width` CSS property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-inline-width: thick;
    writing-mode: vertical-rl;
    
    
    border-inline-width: 4px;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border width in the other dimension can be set with `border-block-width`, which sets `border-block-start-width`, and `border-block-end-width`.
## Syntax
    
    /* <'border-width'> values */
    border-inline-width: 5px 10px;
    border-inline-width: 5px;
    border-inline-width: thick;
    
    /* Global values */
    border-inline-width: inherit;
    border-inline-width: initial;
    border-inline-width: revert;
    border-inline-width: revert-layer;
    border-inline-width: unset;
    
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-inline-width: 5px 10px;
    }
    
# CSS text
The CSS text module defines how to perform text manipulation, like line breaking, justification and alignment, white space handling, and text transformation.
## Reference
>
### Properties
  * `hanging-punctuation`
  * `hyphenate-character`
  * `hyphenate-limit-chars`
  * `hyphens`
  * `letter-spacing`
  * `line-break`
  * `overflow-wrap` (and the `word-wrap` alias)
  * `tab-size`
  * `text-align`
  * `text-align-last`
  * `text-indent`
  * `text-justify`
  * `text-autospace`
  * `text-spacing-trim` Experimental
  * `text-transform`
  * `text-wrap`
  * `text-wrap-mode`
  * `text-wrap-style`
  * `white-space`
  * `white-space-collapse`
  * `word-break`
  * `word-spacing`


The specification also defines the `hyphenate-limit-last`, `hyphenate-limit-lines`, `hyphenate-limit-zone`, `line-padding`, `text-align-all`, `text-autospace`, `text-group-align`, `text-spacing`, `white-space-trim`, `word-space-transform`, `wrap-after`, `wrap-before`, and `wrap-inside` properties, which are not yet supported by any browser.
### Guides
Wrapping and breaking text
    
A guide to the various ways in which overflowing text can be managed in CSS.
## Related concepts
>
### Properties
  * `direction`
  * `font-feature-settings`
  * `initial-letter`
  * `orphans`
  * `text-combine-upright`
  * `text-orientation`
  * `text-overflow`
  * `text-size-adjust` Experimental
  * `unicode-bidi`
  * `widows`
  * `writing-mode`


### Values
  * `min-content`
  * `max-content`


### HTML
  * `<pre>`
  * `<wbr>`


# border-top
The `border-top` shorthand CSS property sets all the properties of an element's top border.
## Try it
    
    border-top: solid;
    
    
    border-top: dashed red;
    
    
    border-top: 1rem solid;
    
    
    border-top: thick double #32a1ce;
    
    
    border-top: 4mm ridge rgb(211 220 50 / 0.6);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
As with all shorthand properties, `border-top` always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. Consider the following code:
    
    border-top-style: dotted;
    border-top: thick green;
    
It is actually the same as this one:
    
    border-top-style: dotted;
    border-top: none thick green;
    
The value of `border-top-style` given before `border-top` is ignored. Since the default value of `border-top-style` is `none`, not specifying the `border-style` part results in no border.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-top-color`
  * `border-top-style`
  * `border-top-width`


## Syntax
    
    border-top: 1px;
    border-top: 2px dotted;
    border-top: medium dashed green;
    
    /* Global values */
    border-top: inherit;
    border-top: initial;
    border-top: revert;
    border-top: revert-layer;
    border-top: unset;
    
The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.
### Values
`<br-width>`
    
See `border-top-width`.
`<br-style>`
    
See `border-top-style`.
`<color>`
    
See `border-top-color`.
## Examples
>
### Applying a top border
#### HTML
    
    <div>This box has a border on the top side.</div>
    
#### CSS
    
    div {
      border-top: 4px dashed blue;
      background-color: gold;
      height: 100px;
      width: 100px;
      font-weight: bold;
      text-align: center;
    }
    
#### Results
# ::picker()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
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(<ident>) {
      /* ... */
    }
    
### Parameters
`<ident>`
    
A string representing the element whose picker you want to target. The following values are available:
`select`
    
The drop-down picker of customizable select elements.
## Description
The `::picker()` pseudo-element targets the picker part of a form control, that is, the pop-up part that appears to allow you to make a selection when you press the control button. It is only available to target when the originating element has a picker and has base appearance set on it via the `appearance` property `base-select` value.
The `::picker(select)` selector targets all descendants of customizable `<select>` element except for the first `<button>` child; these descendants are grouped together by the browser and rendered as the picker. The first `<button>` child represents the control button that opens the picker when pressed.
This allows you to target all of the picker contents as a single entity, for example if you want to customize its border, animate it when it appears and disappears, or position it somewhere different to the default position. Our customizable select elements guide shows many examples of `::picker(select)` usage.
### Picker popover behavior
The `<select>` element and the picker have an implicit invoker/popover relationship assigned to them automatically, as specified by the Popover API. See Using the Popover API for more details of popover behavior, and see Animating the picker drop-down using popover states for a typical use case allowed by the implicit popover association.
### Picker anchor positioning
A further side-effect of the implicit invoker/popover relationship mentioned above is that the `<select>` element and the picker also have an implicit anchor reference, meaning that the picker is automatically associated with the select via CSS anchor positioning. This has several advantages, most notably:
  * The browser default styles position the picker relative to the button (the anchor) and you can customize this position as explained in Positioning elements relative to their anchor. For reference, the related default styles are as follows:
        inset: auto;
        margin: 0;
        min-inline-size: anchor-size(self-inline);
        min-block-size: 1lh;
        /* Go to the edge of the viewport, and add scrollbars if needed. */
        max-block-size: stretch;
        overflow: auto;
        /* Below and span-right, by default. */
        position-area: block-end span-inline-end;
        
  * The browser default styles also define some position-try fallbacks that reposition the picker if it is in danger of overflowing the viewport. Position-try fallbacks are explained in the Fallback options and conditional hiding for overflow guide. For reference, the related default fallback styles are as follows:
        position-try-order: most-block-size;
        position-try-fallbacks:
          /* First try above and span-right, */
          /* then below but span-left, */
          /* then above and span-left. */
          block-start span-inline-end,
          block-end span-inline-start,
          block-start span-inline-start;
        


## Examples
>
### Basic custom select usage
To opt-in to the custom select functionality and minimal browser base styles (and remove the OS-provided styling), the `<select>` element and its picker both need to have an `appearance` value of `base-select` set on them:
    
    select,
    ::picker(select) {
      appearance: base-select;
    }
    
You could then, for example, remove the picker's default black `border`:
    
    ::picker(select) {
      border: none;
    }
    
# CSS basic user interface
The CSS basic user interface module allows you to define the rendering and functionality of features related to the user interface, including outline properties, visual feedback for pointing devices and keyboards, and modifying the default appearance of UI widgets.
Basic user interface properties can be used to improve user experience and accessibility by providing visual cues to elements that are being interacted with, including styling mouse cursors and keyboard directional focus navigation, and styling caret cursors when an editable element has focus. The module includes features for providing outlines to focused (or unfocused) elements without impacting an element's box model dimensions and styling. This UI module also enables the styling of user interface controls.
## Basic user interface in action
To view how basic user interface properties can alter the appearance of UI features, interact with the elements in this sample. Note that some features in this sample improve usability while others harm user experience.
The CSS `outline` and `outline-offset` properties were used to provide feedback to users on which element currently has focus. An `accent-color` provides a theme color to all the form controls. The caret that appears when the text is edited has the same color thanks to the `caret-color` property. These can all be considered UI improvements.
Some features harm usability. The `cursor` property was used to change cursors from the browser default, which is confusing. The `resize` property prevents the second `<textarea>` from being resizable while the `pointer-events` property prevents the third `<textarea>` from receiving click events. It is still focusable using the keyboard.
Click "Play" in the example above to see or edit the code for the animation in the MDN Playground.
## Reference
>
### Properties
  * `accent-color`
  * `appearance`
  * `caret-animation`
  * `caret-color`
  * `caret-shape`
  * `cursor`
  * `outline`, shorthand for: 
    * `outline-color`
    * `outline-style`
    * `outline-width`
  * `outline-offset`
  * `pointer-events`
  * `resize`
  * `user-select`


The CSS basic user interface module also defines the `caret`, `nav-down`, `nav-left`, `nav-right`, and `nav-up` properties. Currently, no browsers support these features.
## Guides
Learn forms: advanced form styling
    
Explains how `appearance` can be used to style form controls.
## Related concepts
  * CSS `cursor` property
  * SVG `cursor` attribute
  * CSS `:focus`, `:focus-within`, and `:focus-visible` pseudoclasses
  * `CaretPosition` Interface


# animation-duration
The `animation-duration` CSS property sets the length of time that an animation takes to complete one cycle.
## Try it
    
    animation-duration: 750ms;
    
    
    animation-duration: 3s;
    
    
    animation-duration: 0s;
    
    
    <section class="flex-column" id="default-example">
      <div class="animating" id="example-element"></div>
      <button id="play-pause">Play</button>
    </section>
    
    
    #example-element {
      animation-direction: alternate;
      animation-iteration-count: infinite;
      animation-name: slide;
      animation-play-state: paused;
      animation-timing-function: ease-in;
      background-color: #1766aa;
      border-radius: 50%;
      border: 5px solid #333333;
      color: white;
      height: 150px;
      margin: auto;
      margin-left: 0;
      width: 150px;
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    #play-pause {
      font-size: 2rem;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const button = document.getElementById("play-pause");
    
    button.addEventListener("click", () => {
      if (el.classList.contains("running")) {
        el.classList.remove("running");
        button.textContent = "Play";
      } else {
        el.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Single animation */
    animation-duration: auto; /* Default */
    animation-duration: 6s;
    animation-duration: 120ms;
    
    /* Multiple animations */
    animation-duration: 1.64s, 15.22s;
    animation-duration: 10s, 35s, 230ms;
    
    /* Global values */
    animation-duration: inherit;
    animation-duration: initial;
    animation-duration: revert;
    animation-duration: revert-layer;
    animation-duration: unset;
    
### Values
`auto`
    
For time-based animations, `auto` is equivalent to a value of `0s` (see below). For CSS scroll-driven animations, `auto` fills the entire timeline with the animation.
`<time>`
    
The time that an animation takes to complete one cycle. This may be specified in either seconds (`s`) or milliseconds (`ms`). The value must be positive or zero and the unit is required.
If no value is provided, the default value of `0s` is used, in which case the animation still executes (the `animationStart` and `animationEnd` events are fired). Whether or not the animation will be visible when the duration is `0s` will depend on the value of `animation-fill-mode`, as explained below:
  * If `animation-fill-mode` is set to `backwards` or `both`, the first frame of the animation as defined by `animation-direction` will be displayed during `animation-delay` countdown.
  * If `animation-fill-mode` is set to `forwards` or `both`, the last frame of the animation will be displayed, as defined by `animation-direction`, after the `animation-delay` expires.
  * If `animation-fill-mode` is set to `none`, the animation will have no visible effect.


Note: Negative values are invalid, causing the declaration to be ignored. Some early, prefixed, implementations may consider them as identical to `0s`.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: When creating CSS scroll-driven animations, specifying an `animation-duration` value in seconds or milliseconds doesn't really make sense. In tests, it seemed to have no effect on scroll progress timeline animations, while on view progress timeline animations it seemed to push the animation to happen nearer the end of the timeline. However, Firefox requires an `animation-duration` to be set for it to successfully apply the animation. You are therefore advised to set `animation-duration` to `1ms` so that animations will work in Firefox, but the effect is not altered too much by it.
## Examples
>
### Setting animation duration
This animation has an animation-duration of 0.7 seconds.
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
    }
    
    .box:hover {
      animation-name: rotate;
      animation-duration: 0.7s;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
Hover over the rectangle to start the animation.
See CSS animations for more examples.
# ::placeholder
The `::placeholder` CSS pseudo-element represents the placeholder text in an `<input>` or `<textarea>` element.
## Try it
    
    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" />
    
Only the subset of CSS properties that apply to the `::first-line` pseudo-element can be used in a rule using `::placeholder` in its selector.
Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.
## Syntax
    
    ::placeholder {
      /* ... */
    }
    
## Accessibility
>
### Color contrast
#### Contrast Ratio
Placeholder text typically has a lighter color treatment to indicate that it is a suggestion for what kind of input will be valid, and is not actual input of any kind.
It is important to ensure that the contrast ratio between the color of the placeholder text and the background of the input is high enough that people experiencing low vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and input text color that users do not mistake the placeholder for inputted data.
Color contrast ratio is determined by comparing the luminosity of the placeholder text and the input background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


#### Usability
Placeholder text with sufficient color contrast may be interpreted as entered input. Placeholder text will also disappear when a person enters content into an `<input>` element. Both of these circumstances can interfere with successful form completion, especially for people with cognitive concerns.
An alternate approach to providing placeholder information is to include it outside of the input in close visual proximity, then use `aria-describedby` to programmatically associate the `<input>` with its hint.
With this implementation, the hint content is available even if information is entered into the input field, and the input appears free of preexisting input when the page is loaded. Most screen reading technology will use `aria-describedby` to read the hint after the input's label text is announced, and the person using the screen reader can mute it if they find the extra information unnecessary.
    
    <label for="user-email">Your email address</label>
    <span id="user-email-hint" class="input-hint">Example: jane@sample.com</span>
    <input
      id="user-email"
      aria-describedby="user-email-hint"
      name="email"
      type="email" />
    
  * Placeholders in Form Fields Are Harmful — Nielsen Norman Group


### Windows High Contrast Mode
Placeholder text will appear with the same styling as user-entered text content when rendered in Windows High Contrast Mode. This will make it difficult for some people to determine which content has been entered, and which content is placeholder text.
### Labels
Placeholders are not a replacement for the `<label>` element. Without a label that has been programmatically associated with an input using a combination of the `for` and `id` attributes, assistive technology such as screen readers cannot parse `<input>` elements.
  * Placeholders in Form Fields Are Harmful — Nielsen Norman Group


## Examples
>
### Change placeholder appearance
This example shows some of the adjustments that you can make to the styles of placeholder text.
#### HTML
    
    <input placeholder="Type here" />
    
#### CSS
    
    input::placeholder {
      color: red;
      font-size: 1.2em;
      font-style: italic;
      opacity: 0.5;
    }
    
#### Result
### Opaque text
Some browsers make placeholder text less opaque. If you want fully opaque text, then set the `color` property value explicitly. The `currentColor` value can be used to have the same color as the corresponding input element.
#### HTML
    
    <input placeholder="Color set by browser" />
    <input placeholder="Same color as input" class="explicit-color" />
    <input placeholder="Semi-opaque text color" class="opacity-change" />
    
#### CSS
    
    input {
      font-weight: bold;
      color: green;
    }
    
    .explicit-color::placeholder {
      /* use the same color as input element to avoid the browser set default color */
      color: currentColor;
    }
    
    .opacity-change::placeholder {
      /* less opaque text */
      color: color-mix(in srgb, currentColor 70%, transparent);
    }
    
#### Result
Note: Note that browsers use different default colors for placeholder text. For example, Firefox uses the input element's color with 54% opacity, and Chrome uses `darkgray` color. If you want consistent placeholder text color across the browsers, then set the `color` explicitly.
# max-block-size
The `max-block-size` CSS property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by `writing-mode`. That is, if the writing direction is horizontal, then `max-block-size` is equivalent to `max-height`; if the writing direction is vertical, `max-block-size` is the same as `max-width`.
The other dimension's maximum length is specified using the `max-inline-size` property.
This is useful because the `max-width` is always used for horizontal sizes and `max-height` is always used for vertical sizes, and if you need to set lengths based on the size of your text content, you need to be able to do so with the writing direction in mind.
Any time you would normally use `max-height` or `max-width`, you should instead use `max-block-size` to set the maximum "height" of the content (even though this may not be a vertical value) and `max-inline-size` to set the maximum "width" of the content (although this may instead be vertical rather than horizontal). See `writing-mode` examples, which show the different writing modes in action.
## Try it
    
    max-block-size: 150px;
    writing-mode: horizontal-tb;
    
    
    max-block-size: 150px;
    writing-mode: vertical-rl;
    
    
    max-block-size: 20px;
    writing-mode: horizontal-tb;
    
    
    max-block-size: 75%;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the maximum block size. <br />This will
        limit the size in the block dimension, potentially causing an overflow.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    max-block-size: 300px;
    max-block-size: 25em;
    max-block-size: anchor-size(--my-anchor self-inline, 250px);
    max-block-size: calc(anchor-size(width) / 2);
    
    /* <percentage> values */
    max-block-size: 75%;
    
    /* Keyword values */
    max-block-size: none;
    max-block-size: max-content;
    max-block-size: min-content;
    max-block-size: fit-content;
    max-block-size: fit-content(20em);
    
    /* Global values */
    max-block-size: inherit;
    max-block-size: initial;
    max-block-size: revert;
    max-block-size: revert-layer;
    max-block-size: unset;
    
### Values
The `max-block-size` property's value can be any value that's legal for the `max-width` and `max-height` properties:
`<length>`
    
Defines the `max-block-size` as an absolute value.
`<percentage>`
    
Defines the `max-block-size` as a percentage of the containing block's size in block axis.
`none`
    
No limit on the size of the box.
`max-content`
    
The intrinsic preferred `max-block-size`.
`min-content`
    
The intrinsic minimum `max-block-size`.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the `fit-content` formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, argument))`.
### How writing-mode affects directionality
The values of `writing-mode` affect the mapping of `max-block-size` to `max-width` or `max-height` as follows:
Values of `writing-mode` `max-block-size` is equivalent to  
`horizontal-tb`, `lr`, `lr-tb`, `rl`, `rb`, `rb-rl` `max-height`  
`vertical-rl`, `vertical-lr`, `sideways-rl`, `sideways-lr`, `tb`, `tb-rl` `max-width`  
Note: The `writing-mode` values `sideways-lr` and `sideways-rl` were removed from the CSS Writing Modes Level 3 specification late in its design process. They may be restored in Level 4.
Note: The writing modes `lr`, `lr-tb`, `rl`, `rb`, and `rb-tl` are no longer allowed in HTML contexts; they may only be used in SVG 1.x contexts.
## Examples
>
### Setting max-block-size with horizontal and vertical text
In this example, the same text (the opening sentences from Herman Melville's novel Moby-Dick) is presented in both the `horizontal-tb` and `vertical-rl` writing modes.
Everything else about the two boxes is identical, including the values used for `max-block-size`.
#### HTML
The HTML establishes the two `<div>` blocks that will be presented with their `writing-mode` set using the classes `horizontal` or `vertical`. Both boxes share the `standard-box` class, which establishes coloring, padding, and their respective values of `max-block-size`.
    
    <p>Writing mode <code>horizontal-tb</code> (the default):</p>
    <div class="standard-box horizontal">
      Call me Ishmael. Some years ago—never mind how long precisely—having little or
      no money in my purse, and nothing particular to interest me on shore, I
      thought I would sail about a little and see the watery part of the world. It
      is a way I have of driving off the spleen and regulating the circulation.
    </div>
    
    <p>Writing mode <code>vertical-rl</code>:</p>
    <div class="standard-box vertical">
      Call me Ishmael. Some years ago—never mind how long precisely—having little or
      no money in my purse, and nothing particular to interest me on shore, I
      thought I would sail about a little and see the watery part of the world. It
      is a way I have of driving off the spleen and regulating the circulation.
    </div>
    
#### CSS
The CSS defines three classes. The first, `standard-box`, is applied to both boxes, as seen above. It provides standard styling including the minimum and maximum block sizes, font size, and so forth.
After that come the classes `horizontal` and `vertical`, which add the `writing-mode` property to the box, with the value set to `horizontal-tb` or `vertical-rl` depending on which class is used.
    
    .standard-box {
      padding: 4px;
      background-color: #abcdef;
      color: black;
      font:
        16px "Open Sans",
        "Helvetica",
        "Arial",
        sans-serif;
      max-block-size: 160px;
      min-block-size: 100px;
    }
    
    .horizontal {
      writing-mode: horizontal-tb;
    }
    
    .vertical {
      writing-mode: vertical-rl;
    }
    
#### Result
# <ratio>
The `<ratio>` CSS data type describes the proportional relationship between two values. It mostly represents the aspect ratio, which relates width to height. For example, the `<ratio>` is used as a value for the `aspect-ratio` media feature in `@media` media queries, the `aspect-ratio` size feature in `@container` container queries, and as a value for the CSS `aspect-ratio` property.
## Syntax
The `<ratio>` data type is a `<number>` followed by a forward slash ('/', Unicode `U+002F SOLIDUS`) and a second `<number>`. Both numbers must be positive. Spaces before and after the slash are optional. The first number represents the width, while the second represents the height. In addition a single `<number>` as a value is allowable.
Two ratios are compared using the quotients' numeric values. For example, 16/16 is less than 16/9 because it resolves to 1 while the second resolves to 1.7. This means a tall screen's aspect ratio is smaller than a wide screen's, and portrait images have smaller aspect ratios than landscape images.
### Common aspect ratios
Ratio Usage  
`4/3` or `1.33333` Traditional TV format in the twentieth century.  
`16/9` or `1.7777778` Modern "widescreen" TV format.  
`185/100` or `1.85` The most common movie format since the 1960s.  
`239/100` or `2.39` "Widescreen," anamorphic movie format.  
## Examples
>
### Use in a media query
    
    @media screen and (aspect-ratio >= 16/9) {
      /* … */
    }
    
### Use in a @container size query
    
    @container (aspect-ratio > 1) and (width < 20em) {
      /* … */
    }
    
### Use as a CSS property value
    
    .square {
      aspect-ratio: 1 / 1;
    }
    .circle {
      aspect-ratio: 1;
      border-radius: 50%;
    }
    .portrait {
      aspect-ratio: 5 / 7;
    }
    
# initial-letter
The `initial-letter` CSS property sets the size and sink for dropped, raised, and sunken initial letters. This property applies to `::first-letter` pseudo-elements and inline-level first children of block containers.
## Syntax
    
    /* Keyword values */
    initial-letter: normal;
    
    /* One value */
    initial-letter: 3; /* 3 lines tall, baseline at line 3 */
    initial-letter: 1.5; /* 1.5 lines tall, baseline at line 2 */
    
    /* Two values */
    initial-letter: 3 2; /* 3 lines tall, baseline at line 2 (raised 1 line) */
    initial-letter: 3 1; /* 3 lines tall, baseline unchanged (raised 2 lines) */
    
    /* Global values */
    initial-letter: inherit;
    initial-letter: initial;
    initial-letter: revert;
    initial-letter: revert-layer;
    initial-letter: unset;
    
### Values
The keyword value `normal`, or a `<number>` optionally followed by an `<integer>`.
`normal`
    
No special initial-letter effect. Text behaves as normal.
`<number>`
    
Defines the size of the initial letter, in terms of how many lines it occupies. Negative values are not allowed.
`<integer>`
    
Defines the number of lines the initial letter should sink when the size of it is given. Values must be greater than zero. If omitted, it duplicates the size value, floored to the nearest positive whole number.
## Examples
>
### Setting initial letter size
#### HTML
    
    <p class="normal">Initial letter is normal</p>
    <p class="onefive">Initial letter occupies 1.5 lines</p>
    <p class="three">Initial letter occupies 3 lines</p>
    
#### CSS
    
    .normal::first-letter {
      -webkit-initial-letter: normal;
      initial-letter: normal;
    }
    
    .onefive::first-letter {
      -webkit-initial-letter: 1.5;
      initial-letter: 1.5;
    }
    
    .three::first-letter {
      -webkit-initial-letter: 3;
      initial-letter: 3;
    }
    
    p {
      outline: 1px dashed red;
    }
    
#### Result
### Setting the sink value
In this example, all the initial letters are the same size, but with different sink values.
#### HTML
    
    <p class="four">Initial letter: Sink value = 4</p>
    <p class="same">Initial letter: Sink value not declared (same as size)</p>
    <p class="two">Initial letter: Sink value = 2</p>
    <p class="one">Initial letter: Sink value = 1</p>
    
#### CSS
    
    .four::first-letter {
      -webkit-initial-letter: 3 4;
      initial-letter: 3 4;
    }
    
    .same::first-letter {
      -webkit-initial-letter: 3;
      initial-letter: 3;
    }
    
    .two::first-letter {
      -webkit-initial-letter: 3 2;
      initial-letter: 3 2;
    }
    
    .one::first-letter {
      -webkit-initial-letter: 3 1;
      initial-letter: 3 1;
    }
    
    p {
      outline: 1px dashed red;
    }
    
#### Result
# hanging-punctuation
The `hanging-punctuation` CSS property specifies whether a punctuation mark should hang at the start or end of a line of text. Hanging punctuation may be placed outside the line box.
## Syntax
    
    /* Keyword values */
    hanging-punctuation: none;
    hanging-punctuation: first;
    hanging-punctuation: last;
    hanging-punctuation: allow-end;
    
    /* Two keywords */
    hanging-punctuation: first allow-end;
    hanging-punctuation: first last;
    hanging-punctuation: last allow-end;
    
    /* Three keywords */
    hanging-punctuation: first allow-end last;
    
    /* Global values */
    hanging-punctuation: inherit;
    hanging-punctuation: initial;
    hanging-punctuation: revert;
    hanging-punctuation: revert-layer;
    hanging-punctuation: unset;
    
The `hanging-punctuation` property may be specified with one, two, or three space-separated values.
### Values
`none`
    
No character hangs.
`first`
    
An opening bracket or quote at the start of the first formatted line of an element hangs. This applies to:
  * all characters in the Unicode categories Ps, Pf, Pi
  * the quote marks `U+0027` APOSTROPHE (`'`) and `U+0022` QUOTATION MARK (`"`).


`last`
    
A closing bracket or quote at the end of the last formatted line of an element hangs. This applies to:
  * all characters in the Unicode categories Pe, Pf, Pi
  * the quote marks `U+0027` APOSTROPHE (`'`) and `U+0022` QUOTATION MARK (`"`).


`allow-end`
    
A stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.
Stops and commas that are allowed to hang include:
  * `U+002C`, COMMA
  * `U+002E`, FULL STOP
  * `U+060C`, ARABIC COMMA
  * `U+06D4`, ARABIC FULL STOP
  * `U+3001`, IDEOGRAPHIC COMMA
  * `U+3002`, IDEOGRAPHIC FULL STOP
  * `U+FF0C`, FULLWIDTH COMMA
  * `U+FF0E`, FULLWIDTH FULL STOP
  * `U+FE50`, SMALL COMMA
  * `U+FE51`, SMALL IDEOGRAPHIC COMMA
  * `U+FE52`, SMALL FULL STOP
  * `U+FF61`, HALFWIDTH IDEOGRAPHIC FULL STOP
  * `U+FF64`, HALFWIDTH IDEOGRAPHIC COMMA


User agents may include additional characters.
## Examples
>
### Setting opening and closing quotes to hang
#### HTML
    
    <p>
      «For a moment, nothing happened. Then, after a second or so, nothing continued
      to happen.»
    </p>
    
    <p class="hanging">
      «For a moment, nothing happened. Then, after a second or so, nothing continued
      to happen.»
    </p>
    
    <p class="hanging right">
      «For a moment, nothing happened. Then, after a second or so, nothing continued
      to happen.»
    </p>
    
#### CSS
    
    p {
      width: 15em;
      border: 1px solid #cccccc;
      font-size: 2rem;
      font-style: italic;
      margin: 1em;
    }
    
    p.hanging {
      hanging-punctuation: first last;
    }
    
    p.right {
      text-align: right;
    }
    
#### Result
# <length-percentage>
The `<length-percentage>` CSS data type represents a value that can be either a `<length>` or a `<percentage>`.
## Syntax
Refer to the documentation for `<length>` and `<percentage>` for details of the individual syntaxes allowed by this type.
## Examples
>
### length-percentage examples
This example demonstrates several properties that use `<length-percentage>` values.
#### HTML
    
    <p>You can use percentages and lengths in so many places.</p>
    
#### CSS
    
    p {
      /* length-percentage examples */
      width: 75%;
      height: 200px;
      margin: 3rem;
      padding: 1%;
      border-radius: 10px 10%;
      font-size: 250%;
      line-height: 1.5em;
    
      /* length examples */
      text-shadow: 1px 1px 1px red;
      border: 5px solid red;
      letter-spacing: 3px;
    
      /* percentage example */
      text-size-adjust: 20%;
    }
    
#### Result
### Use in calc()
Where a `<length-percentage>` is specified as an allowable type, this means that the percentage resolves to a length and therefore can be used in a `calc()` expression. Therefore, all of the following values are acceptable for `width`:
    
    width: 200px;
    width: 20%;
    width: calc(100% - 200px);
    
# corner-inline-end-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-inline-end-shape` CSS property specifies the shape of both the corners on a box's inline-end edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-inline-end-shape` property is a shorthand for the following physical properties:
  * `corner-start-end-shape`
  * `corner-end-end-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-inline-end-shape: squircle;
    corner-inline-end-shape: scoop;
    
    /* Single superellipse() value set for both corners */
    corner-inline-end-shape: superellipse(1.5);
    corner-inline-end-shape: superellipse(-0.8);
    
    /* Block-start/inline-end corner, block-end/inline-end corner */
    corner-inline-end-shape: squircle scoop;
    corner-inline-end-shape: squircle superellipse(-0.8);
    
    /* Global values */
    corner-inline-end-shape: inherit;
    corner-inline-end-shape: initial;
    corner-inline-end-shape: revert;
    corner-inline-end-shape: revert-layer;
    corner-inline-end-shape: unset;
    
### Values
The `corner-inline-end-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both inline-end corners.
  * If two values are used, the first one specifies the shape of the block-start/inline-end corner, and the second one specifies the shape of the block-end/inline-end corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-inline-end-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `15% 30%`, and a `corner-inline-end-shape` of `bevel squircle`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 15% 30%;
      corner-inline-end-shape: bevel squircle;
    }
    
#### Result
The rendered result looks like this:
# :scope
The `:scope` CSS pseudo-class represents elements that are a reference point, or scope, for selectors to match against.
    
    /* Selects a scoped element */
    :scope {
      background-color: lime;
    }
    
Which element(s) `:scope` matches depends on the context in which it is used:
  * When used at the root level of a stylesheet, `:scope` is equivalent to `:root`, which in a regular HTML document matches the `<html>` element.
  * When used inside a `@scope` block, `:scope` matches the block's defined scope root. It provides a way to apply styles to the root of the scope from inside the `@scope` block itself.
  * When used within a DOM API call — such as `querySelector()`, `querySelectorAll()`, `matches()`, or `Element.closest()` — `:scope` matches the element on which the method was called.


## Syntax
    
    :scope {
      /* ... */
    }
    
## Examples
>
### Using `:scope` as an alternative to `:root`
This example shows that `:scope` is equivalent to `:root` when used at the root level of a stylesheet. In this case, the provided CSS colors the background of the `<html>` element orange.
    
    :scope {
      background-color: orange;
    }
    
### Using `:scope` to style the scope root in a `@scope` block
In this example, we use two separate `@scope` blocks to match links inside elements with a `.light-scheme` and `.dark-scheme` class respectively. Note how `:scope` is used to select and provide styling to the scope roots themselves. In this example, the scope roots are the `<div>` elements that have the classes applied to them.
#### HTML
    
    <div class="light-scheme">
      <p>
        MDN contains lots of information about
        <a href="/en-US/docs/Web/HTML">HTML</a>,
        <a href="/en-US/docs/Web/CSS">CSS</a>, and
        <a href="/en-US/docs/Web/JavaScript">JavaScript</a>.
      </p>
    </div>
    
    <div class="dark-scheme">
      <p>
        MDN contains lots of information about
        <a href="/en-US/docs/Web/HTML">HTML</a>,
        <a href="/en-US/docs/Web/CSS">CSS</a>, and
        <a href="/en-US/docs/Web/JavaScript">JavaScript</a>.
      </p>
    </div>
    
#### CSS
    
    @scope (.light-scheme) {
      :scope {
        background-color: plum;
      }
    
      a {
        color: darkmagenta;
      }
    }
    
    @scope (.dark-scheme) {
      :scope {
        background-color: darkmagenta;
        color: antiquewhite;
      }
    
      a {
        color: plum;
      }
    }
    
#### Result
### Using `:scope` in JavaScript
This example demonstrates using the `:scope` pseudo-class in JavaScript. This can be useful if you need to get a direct descendant of an already retrieved `Element`.
#### HTML
    
    <div id="context">
      <div id="element-1">
        <div id="element-1.1"></div>
        <div id="element-1.2"></div>
      </div>
      <div id="element-2">
        <div id="element-2.1"></div>
      </div>
    </div>
    <p>
      Selected element ids :
      <span id="results"></span>
    </p>
    
#### JavaScript
    
    const context = document.getElementById("context");
    const selected = context.querySelectorAll(":scope > div");
    
    document.getElementById("results").textContent = Array.prototype.map
      .call(selected, (element) => `#${element.getAttribute("id")}`)
      .join(", ");
    
#### Result
The scope of `context` is the element with the `id` of `context`. The selected elements are the `<div>` elements that are direct children of that context — `element-1` and `element-2` — but not their descendants.
# mask-mode
The `mask-mode` CSS property is set on the element being masked. It sets whether the mask reference defined by the `mask-image` is treated as a luminance or alpha mask.
## Syntax
    
    /* Keyword values */
    mask-mode: alpha;
    mask-mode: luminance;
    mask-mode: match-source;
    
    /* Multiple values */
    mask-mode: alpha, match-source;
    
    /* Global values */
    mask-mode: inherit;
    mask-mode: initial;
    mask-mode: revert;
    mask-mode: revert-layer;
    mask-mode: unset;
    
### Values
The `mask-mode` property can take multiple comma-separated `<masking-mode>` keyword values, including:
`alpha`
    
Indicates that the alpha (transparency) values of the mask image should be used.
`luminance`
    
Indicates that the luminance (brightness) values of the mask image should be used.
`match-source`
    
Indicates that the type of mask is determined by the source. This is the default property value.
  * If the `mask-image` references an SVG `<mask>`, its `mask-type` property value is used, or it's `mask-type` attribute, if present. If neither is explicitly set, this value defaults to `luminance`.
  * If the mask image source is an `<image>` or a `<gradient>`, the `alpha` values of the mask image are used.


## Description
A mask transfers its transparency, and depending on the mask type, it's luminance, to the element it is masking. If the mask is of type `<image>`, by default the alpha values of the mask image determine the visibility of each part of the masked element: where the mask is opaque, the corresponding part of the masked element is visible; where the mask is translucent, the element is as well, with those areas of the element being hidden. This is the default behavior for `<image>` masks when the `mask-mode` property is set to or defaults to `match-source`, and it is always the case when the `mask-mode` is explicitly set to `alpha`.
### Understanding luminance
In the case of `luminance` masks, the visibility of the masked element depends on both the opacity of the mask and the lightness of the color of the opaque areas. White (100% luminance) opaque areas (alpha = 1) will be masked and visible, and black areas (0% luminance) transparent (alpha = 0) will be clipped. Areas with colors in between white and black and with partial opacity will be partially masked, reflecting the luminance and alpha transparency of each color making up the mask.
The opacity of a `luminance` mask is determined by the `R`, `G`, `B`, and `A` values of an `rgb()` color using the formula:
`((0.2125 * R) + (0.7154 * G) + (0.0721 * B)) * A`
For example, the color `green` is `#008000` or `rgb(0% 50% 0% / 1)`. In a `luminance` mask, any area masked by a solid `green` mask will be `35.77%` opaque. If the `mask-mode` for this mask is set to `alpha`, since `green` is a fully opaque color, the masked area will be `100%` opaque.
### Multiple values
Each `mask-mode` value is a comma-separated list of values. When multiple values are present, each value corresponds to a mask layer in the same position in the `mask-image` property. The values define whether the associated mask images are treated as a `luminance` or an `alpha` mask.
### Understanding `match-source`
In the case of `match-source`, whether `luminance` or `alpha` is used depends on the mask mode of the mask source. If the `mask-image` property values is a reference to an SVG `<mask>` element, the `<mask>` element's `mask-type` property value is used. If there is no CSS `mask-type` property set on the `<mask>` element, the value of the `<mask>` element's `mask-type` attribute is used, if present and supported. If neither is explicitly set, this value defaults to `luminance`; but only in the case of the `<mask>` element as the mask source. Otherwise, as noted before, if the mask image source is an `<image>`, rather than an SVG `<mask>`, the `alpha` values of the mask layer image is used.
## Examples
>
### Usage and values
This example demonstrates the basic usage and different values of the `mask-mode` property.
#### HTML
We include three `<div>` elements, so we can demonstrate the three enumerated `mask-mode` keyword values.
    
    <div class="alpha">ALPHA</div>
    <div class="luminance">LUMINANCE</div>
    <div class="matchSource">MATCH-SOURCE</div>
    
#### CSS
Each `<div>` is provided with the same background and masking image. The only difference between each `<div>` is the value of the `mask-mode` property:
    
    div {
      background: blue linear-gradient(red, blue);
      mask-image: url("https://mdn.github.io/shared-assets/images/examples/mdn.svg");
    }
    
    .alpha {
      mask-mode: alpha;
    }
    
    .luminance {
      mask-mode: luminance;
    }
    
    .matchSource {
      mask-mode: match-source;
    }
    
#### Results
Because the mask source is an `<image>` and not an SVG `<mask>`, the `match-source` value resolves to `alpha`.
# margin-right
The `margin-right` CSS property sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
## Try it
    
    margin-right: 1em;
    
    
    margin-right: 10%;
    
    
    margin-right: 10px;
    
    
    margin-right: 0;
    
    
    <section id="default-example">
      <div id="container">
        <div class="col"></div>
        <div class="col transition-all" id="example-element"></div>
        <div class="col"></div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      justify-content: flex-start;
    }
    
    .col {
      width: 33.33%;
      border: solid #5b6dcd 10px;
      background-color: rgb(229 232 252 / 0.6);
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffc129;
      background-color: rgb(255 244 219 / 0.6);
    }
    
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
## Syntax
    
    /* <length> values */
    margin-right: 20px; /* An absolute length */
    margin-right: 1em; /* relative to the text size */
    margin-right: 5%; /* relative to the nearest block container's width */
    margin-right: anchor-size(self-block);
    margin-right: calc(anchor-size(--my-anchor height, 20px) / 4);
    
    /* Keyword values */
    margin-right: auto;
    
    /* Global values */
    margin-right: inherit;
    margin-right: initial;
    margin-right: revert;
    margin-right: revert-layer;
    margin-right: unset;
    
The `margin-right` property is specified as the keyword `auto`, or a `<length>`, or a `<percentage>`. Its value can be positive, zero, or negative.
### Values
`<length>`
    
The size of the margin as a fixed value.
  * For anchor-positioned elements, the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element margin based on anchor size).


`<percentage>`
    
The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
`auto`
    
The right margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. If the values of `margin-left` and `margin-right` are both `auto`, the calculated space is evenly distributed. This table summarizes the different cases:
Value of `display` Value of `float` Value of `position` Computed value of `auto` Comment  
`inline`, `inline-block`, `inline-table` any `static` or `relative` `0` Inline layout mode  
`block`, `inline`, `inline-block`, `block`, `table`, `inline-table`, `list-item`, `table-caption` any `static` or `relative` `0`, except if both `margin-left` and `margin-right` are set to `auto`. In this case, it is set to the value centering the element inside its parent.  Block layout mode  
`block`, `inline`, `inline-block`, `block`, `table`, `inline-table`, `list-item`, `table-caption` `left` or `right` `static` or `relative` `0` Block layout mode (floating element)  
any `table-*`, except `table-caption` any any `0` Internal `table-*` elements don't have margins, use `border-spacing` instead   
any, except `flex`, `inline-flex`, or `table-*` any `fixed` or `absolute` `0`, except if both `margin-left` and `margin-right` are set to `auto`. In this case, it is set to the value centering the border area inside the available `width`, if fixed.  Absolutely positioned layout mode  
`flex`, `inline-flex` any any `0`, except if there is any positive horizontal free space. In this case, it is evenly distributed to all horizontal `auto` margins.  Flexbox layout mode  
## Examples
>
### Setting right margin using pixels and percentages
    
    .content {
      margin-right: 5%;
    }
    .side-box {
      margin-right: 10px;
    }
    .logo {
      margin-right: -5px;
    }
    
# CSS inline layout
The CSS inline layout module defines the block-axis alignment and sizing of inline-level content and adds a special layout mode for drop-caps. It describes the CSS formatting model for a flow of elements and text inside a container to be wrapped across multiple lines.
## Reference
>
### Properties
  * `alignment-baseline`
  * `dominant-baseline`
  * `initial-letter`
  * `line-height`
  * `text-box-edge`
  * `text-box-trim`
  * `text-box` shorthand
  * `vertical-align`


The specification also defines the `baseline-shift`, `baseline-source`, `initial-letter-align`, `initial-letter-wrap`, `inline-sizing`, and `line-fit-edge` properties, which are not yet supported by any browser.
### Data types
  * `<text-edge>`


### Glossary terms
  * baseline
  * leading


## Guides
Inline formatting context
    
Explains the inline formatting context.
## Related concepts
  * `font-size` property
  * `font-feature-settings` property
  * `letter-spacing` property
  * `text-anchor` property
  * `::first-letter` pseudo-element
  * `:first-child` pseudo-class


# -webkit-text-stroke
The `-webkit-text-stroke` CSS property specifies the width and color of strokes for text characters. This is a shorthand property for the longhand properties `-webkit-text-stroke-width` and `-webkit-text-stroke-color`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `-webkit-text-stroke-color`
  * `-webkit-text-stroke-width`


## Syntax
    
    /* Width and color values */
    -webkit-text-stroke: 4px navy;
    
    /* Global values */
    -webkit-text-stroke: inherit;
    -webkit-text-stroke: initial;
    -webkit-text-stroke: revert;
    -webkit-text-stroke: revert-layer;
    -webkit-text-stroke: unset;
    
### Values
`<length>`
    
The width of the stroke.
`<color>`
    
The color of the stroke.
## Examples
>
### Adding a red text stroke
#### HTML
    
    <p id="example">The stroke of this text is red.</p>
    
#### CSS
    
    #example {
      font-size: 3em;
      margin: 0;
      -webkit-text-stroke: 2px red;
    }
    
#### Result
# ::-moz-range-track
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-moz-range-track` CSS pseudo-element is a Mozilla extension that represents the track (i.e., groove) in which the indicator slides in an `<input>` of `type="range"`.
Note: Using `::-moz-range-track` with anything but an `<input type="range">` doesn't match anything and has no effect.
## Syntax
    
    ::-moz-range-track {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <input type="range" min="0" max="100" step="5" value="50" />
    
### CSS
    
    input[type="range"]::-moz-range-track {
      background-color: green;
    }
    
### Result
A range slider using this style might look something like this:
Not part of any standard.
# transform
The `transform` CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
## Try it
    
    transform: matrix(1, 2, 3, 4, 5, 6);
    
    
    transform: translate(120px, 50%);
    
    
    transform: scale(2, 0.5);
    
    
    transform: rotate(0.5turn);
    
    
    transform: skew(30deg, 20deg);
    
    
    transform: scale(0.5) translate(-100%, -100%);
    
    
    <section id="default-example">
      <img
        class="transition-all"
        id="example-element"
        src="/shared-assets/images/examples/firefox-logo.svg"
        width="200" />
    </section>
    
If the property has a value different from `none`, a stacking context will be created. In that case, the element will act as a containing block for any `position: fixed;` or `position: absolute;` elements that it contains.
Warning: Only transformable elements can be `transform`ed. That is, all elements whose layout is governed by the CSS box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes.
## Syntax
    
    /* Keyword values */
    transform: none;
    
    /* Function values */
    transform: matrix(1, 2, 3, 4, 5, 6);
    transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    transform: perspective(17px);
    transform: rotate(0.5turn);
    transform: rotate3d(1, 2, 3, 10deg);
    transform: rotateX(10deg);
    transform: rotateY(10deg);
    transform: rotateZ(10deg);
    transform: translate(12px, 50%);
    transform: translate3d(12px, 50%, 3em);
    transform: translateX(2em);
    transform: translateY(3in);
    transform: translateZ(2px);
    transform: scale(2, 0.5);
    transform: scale3d(2.5, 1.2, 0.3);
    transform: scaleX(2);
    transform: scaleY(0.5);
    transform: scaleZ(0.3);
    transform: skew(30deg, 20deg);
    transform: skewX(30deg);
    transform: skewY(1.07rad);
    
    /* Multiple function values */
    transform: translateX(10px) rotate(10deg) translateY(5px);
    transform: perspective(500px) translate3d(10px, 0, 20px) rotateY(30deg);
    
    /* Global values */
    transform: inherit;
    transform: initial;
    transform: revert;
    transform: revert-layer;
    transform: unset;
    
The `transform` property may be specified as either the keyword value `none` or as one or more `<transform-function>` values.
### Values
`<transform-function>`
    
One or more of the CSS transform functions to be applied. The transform functions are multiplied in order from left to right, meaning that composite transforms are effectively applied in order from right to left.
`none`
    
Specifies that no transform should be applied.
## Accessibility
Scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine. If you need to include such animations on your website, you should provide a control to allow users to turn off animations, preferably site-wide.
Also, consider making use of the `prefers-reduced-motion` media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences.
Find out more:
  * MDN Understanding WCAG, Guideline 2.3 explanations
  * Understanding Success Criterion 2.3.3 | W3C Understanding WCAG 2.1


## Examples
>
### Translating and rotating an element
#### HTML
    
    <div>Transformed element</div>
    
#### CSS
    
    div {
      border: solid red;
      transform: translate(30px, 20px) rotate(20deg);
      width: 140px;
      height: 60px;
    }
    
#### Result
### Transform order
The order of transform functions matters. In this example, two boxes are rotated and translated by the same values; only the transform function order is different.
#### HTML
    
    <div class="original"></div>
    <div class="one">1</div>
    <div class="two">2</div>
    
#### CSS
    
    .one {
      transform: translateX(200px) rotate(135deg);
    }
    .two {
      transform: rotate(135deg) translateX(200px);
    }
    
#### Result
When an element is rotated before being translated, the translate direction is on the rotated axis. The axis as indicated with the dotted lines.
### More examples
Please see Using CSS transforms and `<transform-function>` for more examples.
# grid-template-columns
The `grid-template-columns` CSS property defines the line names and track sizing functions of the grid columns.
## Try it
    
    grid-template-columns: 60px 60px;
    
    
    grid-template-columns: 1fr 60px;
    
    
    grid-template-columns: 1fr 2fr;
    
    
    grid-template-columns: 8ch auto;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      width: 200px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Syntax
    
    /* Keyword value */
    grid-template-columns: none;
    
    /* <track-list> values */
    grid-template-columns: 100px 1fr;
    grid-template-columns: [line-name] 100px;
    grid-template-columns: [line-name1] 100px [line-name2 line-name3];
    grid-template-columns: minmax(100px, 1fr);
    grid-template-columns: fit-content(40%);
    grid-template-columns: repeat(3, 200px);
    grid-template-columns: subgrid;
    grid-template-columns: masonry;
    
    /* <auto-track-list> values */
    grid-template-columns: 200px repeat(auto-fill, 100px) 300px;
    grid-template-columns:
      minmax(100px, max-content)
      repeat(auto-fill, 200px) 20%;
    grid-template-columns:
      [line-name1] 100px [line-name2]
      repeat(auto-fit, [line-name3 line-name4] 300px)
      100px;
    grid-template-columns:
      [line-name1 line-name2] 100px
      repeat(auto-fit, [line-name1] 300px) [line-name3];
    
    /* Global values */
    grid-template-columns: inherit;
    grid-template-columns: initial;
    grid-template-columns: revert;
    grid-template-columns: revert-layer;
    grid-template-columns: unset;
    
### Values
`none`
    
Indicates that there is no explicit grid. Any columns will be implicitly generated and their size will be determined by the `grid-auto-columns` property.
`[line-name]`
    
A `<custom-ident>` specifying a name for the line in that location. The ident may be any valid string other than the reserved words `span` and `auto`. Lines may have multiple names separated by a space inside the square brackets, for example `[line-name-a line-name-b]`.
`<length>`
    
A non-negative length, giving the width of the column.
`<percentage>`
    
A non-negative `<percentage>` value relative to the inline size of the grid container. If the size of the grid container depends on the size of its tracks, the browser treats the percentage as `auto`. The browser may adjust the intrinsic size contributions of the track to the size of the grid container and may increase the final size of the track by the minimum amount that would result in honoring the percentage.
`<flex>`
    
Is a non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor.
When appearing outside a `minmax()` notation, it implies an automatic minimum (i.e., `minmax(auto, <flex>)`).
`max-content`
    
Is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. For example, if the first element of the grid track contains the sentence "Repetitio est mater studiorum" and the second element contains the sentence "Dum spiro, spero", maximal content contribution will be defined by the size of the largest sentence among all of the grid elements - "Repetitio est mater studiorum".
`min-content`
    
Is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. For example, if the first element of the grid track contains the sentence "Repetitio est mater studiorum" and the second element contains the sentence "Dum spiro, spero", minimal content contribution will be defined by the size of the largest word among all of the sentences in the grid elements - "studiorum".
`minmax(min, max)`
    
Is a functional notation that defines a size range greater than or equal to min and less than or equal to max. If max is smaller than min, then max is ignored and the function is treated as min. As a maximum, a `<flex>` value sets the track's flex factor. It is invalid as a minimum.
`auto`
    
As a maximum value, it represents the largest `max-content` size of the items in that track.
As a minimum value, it represents the largest minimum size of items in that track (specified by the `min-width`/`min-height` properties of the items). This often corresponds to the `min-content` size, but not always.
If used outside of `minmax()` notation, `auto` represents the range between the minimum and maximum values described above. In most cases, this behaves similarly to `minmax(min-content,max-content)`.
Note: `auto` track sizes (and only `auto` track sizes) can be stretched by the `align-content` and `justify-content` properties. Therefore, by default, an `auto`-sized track will take up any remaining space in the grid container.
`fit-content( [ <length> | <percentage> ] )`
    
Represents the formula `max(minimum, min(limit, max-content))`, where minimum represents an `auto` minimum (which is often, but not always, equal to a `min-content` minimum), and limit is the track sizing function passed as an argument to fit-content(). This is essentially calculated as the smaller of `minmax(auto, max-content)` and `minmax(auto, limit)`.
`repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> )`
    
Represents a repeated fragment of the track list, allowing a large number of columns that exhibit a recurring pattern to be written in a more compact form.
`masonry`
    
The masonry value indicates that this axis should be laid out according to the masonry algorithm.
`subgrid`
    
The `subgrid` value indicates that the grid will adopt the spanned portion of its parent grid in that axis. Rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid's definition.
## Examples
>
### Specifying grid column sizes
#### HTML
    
    <div id="grid">
      <div id="areaA">A</div>
      <div id="areaB">B</div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      width: 100%;
      grid-template-columns: 50px 1fr;
    }
    
    #areaA {
      background-color: lime;
    }
    
    #areaB {
      background-color: yellow;
    }
    
#### Result
# @supports
The `@supports` CSS at-rule lets you specify CSS declarations that depend on a browser's support for CSS features. Using this at-rule is commonly called a feature query. The rule must be placed at the top level of your code or nested inside any other conditional group at-rule.
## Try it
    
    .flex-container > * {
      padding: 0.3em;
      list-style-type: none;
      text-shadow: 0 0 2px red;
      float: left;
    }
    
    @supports (display: flex) {
      .flex-container > * {
        text-shadow: 0 0 2px blue;
        float: none;
      }
    
      .flex-container {
        display: flex;
      }
    }
    
    
    <ul class="flex-container">
      <li><a href="#">Index</a></li>
      <li><a href="#">About me</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
    
In JavaScript, `@supports` can be accessed via the CSS object model interface `CSSSupportsRule`.
## Syntax
    
    @supports (<supports-condition>) {
      /* If the condition is true, use the CSS in this block. */
    }
    
    @supports (<supports-condition>) and (<supports-condition>) {
      /* If both conditions are true, use the CSS in this block. */
    }
    
The `@supports` at-rule consists of a block of statements with a supports condition. The conditions can be combined by conjunctions (`and`), disjunctions (`or`), and/or negations (`not`). The precedence of operators can be defined with parentheses.
Supports conditions can use either a `<property>: <value>` declaration syntax or a `<function()>` syntax. The following sections describe the use of each type of supports condition.
### Declaration syntax
The declaration syntax checks if a browser supports the specified `<property>: <value>` declaration. The declaration must be surrounded by parentheses. The following example returns true if the browser supports the expression `transform-origin: 5% 5%`:
    
    @supports (transform-origin: 5% 5%) {
    }
    
### Function syntax
The function syntax checks if a browser supports values or expressions within the function. The functions supported in the function syntax are described in the following sections.
#### `selector()`
This function evaluates if a browser supports the specified selector syntax. The following example returns true and applies the CSS style if the browser supports the child combinator:
    
    @supports selector(h2 > p) {
    }
    
#### `font-tech()`
This function checks if a browser supports the specified font technology for layout and rendering. The following example returns true and applies the CSS style if the browser supports the `COLRv1` font technology:
    
    @supports font-tech(color-COLRv1) {
    }
    
The table below describes the font technologies (`<font-tech>`), including color font technologies (`<color-font-tech>`), font feature technologies (`<font-features-tech>`), and other available font technologies that can be queried using the `font-tech()` function:
Technology Supports  
`<color-font-tech>`  
`color-colrv0` Multi-colored glyphs via COLR version 0 table  
`color-colrv1` Multi-colored glyphs via COLR version 1 table  
`color-svg` SVG multi-colored tables  
`color-sbix` Standard bitmap graphics tables  
`color-cbdt` Color bitmap data tables  
`<font-features-tech>`  
`features-opentype` OpenType `GSUB` and `GPOS` tables  
`features-aat` TrueType `morx` and `kerx` tables  
`features-graphite` Graphite features, namely `Silf`, `Glat`, `Gloc`, `Feat`, and `Sill` tables  
`<font-tech>`  
`incremental-patch` Incremental font loading using the patch subset method  
`incremental-range` Incremental font loading using the range request method  
`incremental-auto` Incremental font loading using method negotiation  
`variations` Font variations in TrueType and OpenType fonts to control the font axis, weight, glyphs, etc.  
`palettes` Font palettes by means of `font-palette` to select one of many color palettes in the font  
#### `font-format()`
This function checks if a browser supports the specified font format for layout and rendering. The following example returns true and applies the CSS style if the browser supports the `opentype` font format:
    
    @supports font-format(opentype) {
    }
    
The following table describes the available formats (`<font-format>` values) that can be queried with this function:
Format Description File extensions  
`collection` OpenType Collection `.otc`, `.ttc`  
`embedded-opentype` Embedded OpenType `.eot`  
`opentype` OpenType `.ttf`, `.otf`  
`svg` SVG Font (deprecated) `.svg`, `.svgz`  
`truetype` TrueType `.ttf`  
`woff` WOFF 1.0 (Web Open Font Format) `.woff`  
`woff2` WOFF 2.0 (Web Open Font Format) `.woff2`  
### The not operator
The `not` operator precedes an expression resulting in the negation of the expression. The following returns true if the browser's `transform-origin` property considers `10em 10em 10em` to be invalid:
    
    @supports not (transform-origin: 10em 10em 10em) {
    }
    
As with any operator, the `not` operator can be applied to a declaration of any complexity. The following examples are both valid:
    
    @supports not (not (transform-origin: 2px)) {
    }
    @supports (display: grid) and (not (display: inline-grid)) {
    }
    
Note: There is no need to enclose the `not` operator between two parentheses at the top level. To combine it with other operators, like `and` and `or`, the parentheses are required.
### The and operator
The `and` operator creates a new expression from the conjunction of two shorter expressions. It returns true only if both of the shorter expressions are also true. The following example returns true if and only if the two shorter expressions are simultaneously true:
    
    @supports (display: table-cell) and (display: list-item) {
    }
    
Multiple conjunctions can be juxtaposed without the need of more parentheses. The following are both equivalent:
    
    @supports (display: table-cell) and (display: list-item) and (display: contents) {
    }
    @supports (display: table-cell) and
      ((display: list-item) and (display: contents)) {
    }
    
### The or operator
The `or` operator creates a new expression from the disjunction of two shorter expressions. It returns true if one or both of the shorter expressions is also true. The following example returns true if at least one of the two shorter expressions is true:
    
    @supports (transform-style: preserve) or (-moz-transform-style: preserve) {
    }
    
Multiple disjunctions can be juxtaposed without the need of more parentheses. The following are both equivalent:
    
    @supports (transform-style: preserve) or (-moz-transform-style: preserve) or
      (-webkit-transform-style: preserve) {
    }
    
    @supports (transform-style: preserve-3d) or
      (
        (-moz-transform-style: preserve-3d) or
          (-webkit-transform-style: preserve-3d)
      ) {
    }
    
Note: When using both `and` and `or` operators, the parentheses must be used to define the order in which they apply. Otherwise, the condition is invalid and the whole rule is ignored.
## Examples
>
### Testing for the support of a CSS property
    
    @supports (animation-name: test) {
      /* CSS applied when animations are supported without a prefix */
      @keyframes {
        /* Other at-rules can be nested inside */
      }
    }
    
### Testing for the support of a given CSS property or a prefixed version
    
    @supports (text-stroke: 10px) or (-webkit-text-stroke: 10px) {
      /* CSS applied when text-stroke, prefixed or not, is supported */
    }
    
### Testing for the non-support of a specific CSS property
    
    @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) {
      /* CSS to provide fallback alternative for text-align-last: justify */
    }
    
### Testing for the support of a selector
CSS conditional rules provide the ability to test for the support of a selector such as `:has()`.
    
    /* This rule won't be applied in browsers that don't support :has() */
    ul:has(> li li) {
      /* CSS is applied when the :has(…) pseudo-class is supported */
    }
    
    @supports not selector(:has(a, b)) {
      /* Fallback for when :has() is unsupported */
      ul > li,
      ol > li {
        /* The above expanded for browsers that don't support :has(…) */
      }
    }
    
    /* Note: So far, there's no browser that supports the `of` argument of :nth-child(…) */
    @supports selector(:nth-child(1n of a, b)) {
      /* This rule needs to be inside the @supports block, otherwise
         it will be partially applied in browsers which don't support
         the `of` argument of :nth-child(…) */
      :is(:nth-child(1n of ul, ol) a, details > summary) {
        /* CSS applied when the :is(…) selector and
           the `of` argument of :nth-child(…) are both supported */
      }
    }
    
### Testing for the support of a font technology
The following example applies the CSS style if the browser supports the `COLRv1` font technology:
    
    @import "https://fonts.googleapis.com/css2?family=Bungee+Spice";
    
    @supports font-tech(color-COLRv1) {
      p {
        font-family: "Bungee Spice", fantasy;
      }
    }
    
It's also possible to test for the support of a font technology by using the `tech` function inside the `@font-face` at-rule. If a browser doesn't support the font technology, a fallback font (`Bungee-fallback.otf`) can be used instead.
    
    @font-face {
      font-family: "Bungee Spice";
      src:
        url("https://fonts.googleapis.com/css2?family=Bungee+Spice")
          tech(color-COLRv1),
        url("Bungee-fallback.otf") format("opentype");
    }
    
### Testing for the support of a font format
The following example applies the CSS style if the browser supports the `woff2` font format:
    
    @supports font-format(woff2) {
      p {
        font-family: "Open Sans", sans-serif;
        src: url("open-sans.woff2") format("woff2");
      }
    }
    
# caret-animation
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `caret-animation` CSS property is used to enable or disable the blinking behavior of the insertion caret, the visible marker that appears in editable elements to indicate where the next character will be inserted or deleted.
When applying a custom animation to the caret, you should stop the default blinking so that it doesn't interfere with the animation.
## Syntax
    
    /* Keyword values */
    caret-animation: auto;
    caret-animation: manual;
    
    /* Global values */
    caret-animation: inherit;
    caret-animation: initial;
    caret-animation: revert;
    caret-animation: revert-layer;
    caret-animation: unset;
    
### Values
The `caret-animation` property is specified as one of the keyword values listed below.
`auto`
    
The caret blinks on and off. This is the default (initial) value.
`manual`
    
The caret does not blink on and off.
## Examples
>
### Basic `caret-animation` usage
This example shows the difference between having `caret-animation` set to `auto` versus `manual` on an editable element.
#### HTML
The markup features two `<p>` elements with `contenteditable` set to make them editable.
    
    <p contenteditable="true">
      My caret animates because <code>caret-animation</code> is set to
      <code>auto</code>.
    </p>
    <p contenteditable="true">
      My caret doesn't animate because <code>caret-animation</code> is set to
      <code>manual</code>.
    </p>
    
#### CSS
The CSS sets the `caret-color` value to `red`. It then gives the first paragraph a `caret-animation` value of `auto` and the second paragraph a `caret-animation` value of `manual`.
    
    p {
      caret-color: red;
    }
    
    p:first-of-type {
      caret-animation: auto;
    }
    
    p:last-of-type {
      caret-animation: manual;
    }
    
#### Result
The rendered result looks like so:
Try focusing the two paragraphs to see the difference in caret behavior.
### Creating a custom caret animation
In this example, a custom caret animation is applied to an editable paragraph and a text input.
#### HTML
The markup features a `<p>` element and two text `<input>` elements. The `<p>` element has the `contenteditable` attribute set on it to make it editable. The paragraph and first text input have a `class` of `custom-caret` set on them.
    
    <p contenteditable="true" class="custom-caret">
      This paragraph has a custom animation applied to it, plus
      <code>caret-animation: manual</code> to stop the default caret blinking and
      allow the smooth animation to be seen.
    </p>
    
    <input
      type="text"
      class="custom-caret"
      value="I've got a custom caret animation" />
    
    <input type="text" value="I've got the default blinking caret" />
    
#### CSS
We first define a set of `@keyframes` that change the `caret-color` from `transparent` to `darkblue`.
    
    @keyframes custom-caret-animation {
      from {
        caret-color: transparent;
      }
    
      to {
        caret-color: darkblue;
      }
    }
    
We then style the `<p>` and the first `<input>` with the custom `@keyframes` animation, a `caret-color`, and a `caret-animation` value of `manual` to turn the default caret blinking behavior off.
    
    .custom-caret {
      animation: custom-caret-animation infinite linear alternate 0.75s;
      caret-color: darkblue;
      caret-animation: manual;
    }
    
    p,
    input {
      font-size: 1.6rem;
    }
    
#### Result
The rendered result looks like so:
Try focusing the first two elements to see what the custom caret animation looks like. To compare it with the default blinking caret, you can focus the third element.
# <position-area>
The `<position-area>` CSS data type defines the cell or spanned cells of a position-area grid, a 3x3 grid whose center cell is an anchor element.
The `<position-area>` keyword values can be set as the value of the `position-area` property to place an anchor-positioned element in a specific location relative to its associated anchor element.
## Syntax
    
    <position-area> = [
      [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ]
    ||
      [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ]
    |
      [ block-start | center | block-end | span-block-start | span-block-end | span-all ]
    ||
      [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ]
    |
      [ self-block-start | self-block-end | span-self-block-start | span-self-block-end | span-all ]
    ||
      [ self-inline-start | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ]
    |
      [ start | center | end | span-start | span-end | span-all ]{1,2}
    |
      [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2}
    ]
    
## Description
Position areas work on the concept of a position-area grid, a 3x3 grid of tiles composed of four grid lines, two on each axis, with an anchor element being the center tile:
When used as the value of a positioned element's `position-area` property, the dimensions of the center tile are defined by the containing block of the element's default anchor element. The dimensions of the grid's outer edge are defined by the positioned element's containing block. Logical keyterms are generally based on the writing mode and direction of the containing block, except for the `self-*` keyterms, which are calculated from the writing mode of the anchor-positioned element.
The grid tiles are broken up into rows and columns:
  * The three rows are represented by the physical values `top`, `center`, and `bottom`. They also have logical equivalents such as `block-start`, `center`, and `block-end`, and coordinate equivalents — `y-start`, `center`, and `y-end`.
  * The three columns are represented by the physical values `left`, `center`, and `right`. They also have logical equivalents such as `inline-start`, `center`, and `inline-end`, and coordinate equivalents — `x-start`, `center`, and `x-end`.


`<position-area>` values contain one or two keywords defining a specific area of the position-area grid. Setting a `position-area` value on a positioned element places its containing block in the specified grid area:
    
    /* Examples: Two keywords to place the element in a single specific tile */
    position-area: top left;
    position-area: bottom right;
    position-area: start end;
    position-area: center end;
    position-area: block-start center;
    position-area: inline-start block-end;
    position-area: x-start y-end;
    position-area: center y-self-end;
    
    /* Examples: Two keywords to span the element across two tiles */
    position-area: top span-left;
    position-area: span-bottom right;
    position-area: center span-start;
    position-area: inline-start span-block-end;
    position-area: y-start span-x-end;
    
    /* Examples: Two keywords to span the element across three tiles */
    position-area: top span-all;
    position-area: block-end span-all;
    position-area: x-self-start span-all;
    
    /* Examples: One keyword with an implicit second keyword  */
    position-area: top; /* equiv: top span-all */
    position-area: inline-start; /* equiv: inline-start span-all */
    position-area: center; /* equiv: center center */
    position-area: span-all; /* equiv: center center */
    position-area: start; /* equiv: start start */
    position-area: end; /* equiv: end end */
    
The different types of keywords that can be used include:
  * Physical grid keywords
  * Generic logical row and column keywords
  * Explicit inline and block logical keywords
  * Coordinate grid keywords


Note: Generally, you can't mix different types in one value, e.g., physical and logical. To do so results in invalid values. For example, `position-area: bottom inline-end` is not a valid value because it mixes physical and logical keywords.
## Physical grid keywords
The physical grid keywords specify a cell or section of the `position-area` grid using physical values. These values are not affected by `writing-mode` or `direction` settings.
With physical row and column keywords, you can specify one keyword from each of the two lists below to select a single specific grid tile:
  * `top`, `center`, or `bottom`: The top, center, or bottom row of the grid.
  * `left`, `center`, or `right`: The left-hand, center, or right-hand column of the grid.


For example, `top left` selects the top left tile, while `center right` selects the center tile of the right-hand column.
### Physical spanning grid keywords
The physical spanning keywords — when combined with a physical row or column keyword — specify a second grid tile for the position area to expand into. When such a combination is set as a `position-area` property value, a selected element is initially placed in the center of the specified row or column; it then spans in the direction specified in the spanning keyword, spanning two grid tiles:
`span-left`
    
Span the center column and the left-hand column of the grid.
`span-right`
    
Span the center column and the right-hand column of the grid.
`span-top`
    
Span the center row and the top row of the grid.
`span-bottom`
    
Span the center row and the bottom row of the grid.
`span-all`
    
Valid with all the keyword types, spans the cell listed as well as the adjacent cells in the same row or column. See `span-all` below.
For example, `top span-left` spans the top-center and top-left grid cells.
Note: Trying to pair a row or column keyword with an inappropriate spanning keyword will result in an invalid value. For example, `right span-right` is invalid — you can't select the center-right grid tile and then try to span further to the right.
### Physical grid keyword defaults
If only a single physical keyword is specified in the `position-area` value, the other value is implied as follows:
`left`, `right`, `top`, or `bottom`
    
The other value defaults to `span-all`, causing the element to span all three tiles of the grid or row it was initially placed in. For example, `left` is equivalent to `left span-all`.
`center`, `span-left`, `span-right`, `span-top`, or `span-bottom`
    
The other value defaults to `center`. For example, `span-left` is equivalent to `center span-left` and `center` is equivalent to `center center`.
## Logical grid keywords
The logical grid keywords specify an area of the position area grid using logical values. With these values, the position and direction are affected by `writing-mode` and `direction` settings on either the element's containing block or, in the case of the `self` keywords, the positioned element itself. There are two types of logical keywords; generic and explicit.
### Generic logical row and column keywords
The generic logical keywords use the same terms for the inline and block directions, with the direction determined by the position of the keyterm within a pair of `<position-area>` values. The first value defines the block direction position and the second value defines the inline value. You can specify one or two keyterms from the following list. Specifying two from this list defines a single specific grid tile. The keyword position or direction is:
`start`
    
The start of the grid's block or inline direction, calculated from the containing block's writing mode.
`end`
    
The end of the grid's block or inline direction, calculated from the containing block's writing mode.
`self-start`
    
The start of the grid's block or inline direction, calculated from the element's own writing mode.
`self-end`
    
The end of the grid's block or inline direction, calculated from the element's own writing mode.
`center`
    
The center of the grid's block direction (if this keyword is specified first) or inline direction (if this keyword is specified second).
For example, `start end` and `self-start self-end` both describe the position at the start of the block direction and the end of the inline direction. With `writing-mode: horizontal-tb` set, this is the top right of the anchor element, whereas with `writing-mode: vertical-rl` it is the bottom right of the anchor.
#### Generic logical spanning row and column keywords
The generic logical spanning keywords — when combined with a logical row or column keyword — specify a second grid tile for the position area to expand into. When such a combination is set as a `position-area` property value, a selected element is initially placed in the center of the specified row or column, and it then spans in the direction specified in the spanning keyword, spanning two grid tiles:
`span-start`
    
Span the center tile and the start tile of the grid row/column, with the direction referring to the writing mode of the element's containing block.
`span-end`
    
Span the center tile and the end tile of the grid row/column, with the direction referring to the writing mode of the element's containing block.
`span-self-start`
    
Span the center tile and the start tile of the grid row/column for the positioned element's own writing mode.
`span-self-end`
    
Span the center tile and the end tile of the grid row/column, calculated from the element's own writing mode.
For example, `start span-end` and `self-start span-self-end` both specify a grid position area that starts in the center of the start block row, and spans across the tiles in that row that sit in the inline center and end columns. With `writing-mode: horizontal-tb` set, this would span over the top center and top right of the anchor, whereas with `writing-mode: vertical-rl` set it would span the element over the right center and bottom right.
### Explicit inline and block logical keywords
The explicit inline and block logical row and column keywords refer explicitly to a block (row) or inline (column) position. You can specify one keyword for the block direction and one for the inline direction to select a single specific grid tile. Unlike with generic logical keyword values, the keyword order doesn't matter. However, declaring two keywords in the same axis invalidates the value.
`block-start`
    
The start of the grid's block direction calculated from the containing block's writing mode.
`block-end`
    
The end of the grid's block direction calculated from the containing block's writing mode.
`inline-start`
    
The start of the grid's inline direction calculated from the containing block's writing mode.
`inline-end`
    
The end of the grid's inline direction calculated from the containing block's writing mode.
For example, `block-start inline-end` specifies the tile at the start of the block direction and the end of the inline direction. With `writing-mode: horizontal-tb` set, this would be the tile at the top-right of the anchor, whereas with `writing-mode: vertical-rl` set this would be the tile at the bottom-right.
Note: The specification defines `self` equivalents of these keywords — `block-self-start`, `block-self-end`, `inline-self-start`, and `inline-self-end`. However, these are not currently supported in any browser.
#### Explicit inline and block logical spanning keywords
The explicit logical spanning keywords — when combined with a logical row or column keyword — specify a second grid tile for the position area to expand into. When such a combination is set as a `position-area` property value, a selected element is initially placed in the center of the specified row or column, based on the containing block's writing mode, and it then spans in the direction specified in the spanning keyword, spanning two grid tiles:
`span-block-start`
    
Span the center tile and the block-start tile of the specified inline column.
`span-block-end`
    
Span the center tile and the block-end tile of the specified inline column.
`span-inline-start`
    
Span the center tile and the inline-start tile of the specified block row.
`span-inline-end`
    
Span the center tile and the inline-end tile of the specified block row.
For example, `block-end span-inline-start` selects the center tile of the end block row and spans across the tiles in that row that sit in the inline center and start columns. With `writing-mode: horizontal-tb` set, this would span the bottom-center and bottom-left grid tiles, whereas with `writing-mode: vertical-rl` set it would span the left-center and top-left grid tiles.
Note: The specification defines `self` equivalents of these keywords, for example — `span-self-block-start`, `span-self-block-end`, `span-self-inline-start`, and `span-self-inline-end`. However, these are not currently supported in any browser.
Note: Trying to pair a row or column keyword with an inappropriate spanning keyword will result in an invalid property value. For example, `block-end span-block-end` is invalid — you can't select the center block-end row and then try to span one tile further past the block end direction.
### Logical grid keyword defaults
If only a single logical `<position-area>` keyword is specified, the other value is implied as follows:
`start`, `end`, `self-start`, or `self-end`
    
The other value defaults to the same as the first value, selecting the grid cell at the start row and column, or the end row and column.
`span-start`, `span-self-start`, `span-end`, `span-self-end`
    
The other value defaults to `center`. For example, `span-start` is equivalent to `span-start center`.
`block-start`, `block-end`, `inline-start`, `inline-end`
    
The other value defaults to `span-all`, spanning all three tiles of the column or row set. For example, `block-start` is equivalent to `block-start span-all`.
`span-block-start`, `span-block-end`, `span-inline-start`, `span-inline-end`
    
The other value defaults to `center`. For example, `span-inline-start` is equivalent to `span-inline-start center`.
## Coordinate grid keywords
These keywords specify the cells of the `position-area` grid using x- and y-coordinate values. Its position/direction will be affected by `writing-mode` and/or `direction` settings on either an element's containing block or, in the case of the `self` keywords, the element itself.
However, the grid cells are defined according to physical axes rather than block/inline directions:
  * For `writing-mode: horizontal-tb` and `vertical-lr`, the x-axis runs left-to-right and the y-axis runs top-to-bottom.
  * For `writing-mode: horizontal-tb; direction: rtl` and `writing-mode: vertical-rl`, the x-axis runs right-to-left and the y-axis runs top-to-bottom.


With coordinate row and column keywords, you can specify one keyword from the x-axis and one from the y-axis to define a single specific grid tile.
The x-axis keywords include:
`x-start`
    
The start tile along the grid's x-axis, calculated from the containing block's writing mode.
`x-end`
    
The end tile along the grid's x-axis, calculated from the containing block's writing mode.
`x-self-start`
    
The start tile along the grid's x-axis, calculated from the element's own writing mode.
`x-self-end`
    
The end tile along the grid's x-axis, calculated from the element's own writing mode.
`center`
    
The center of the grid's x-axis, calculated from the element's own writing mode.
The y-axis keywords include:
`y-start`
    
The start tile along the grid's y-axis, calculated from the containing block's writing mode.
`y-end`
    
The end tile along the grid's y-axis, calculated from the containing block's writing mode.
`y-self-start`
    
The start tile along the grid's y-axis, calculated from the element's own writing mode.
`y-self-end`
    
The end tile along the grid's y-axis, calculated from the element's own writing mode.
`center`
    
The center of the grid's y-axis, calculated from the element's own writing mode.
For example, `x-end y-start` and `x-self-end y-self-start` both select the grid cell at end of the x-axis and the start of the y-axis. With `writing-mode: horizontal-tb` set, this would be the cell to the top right of the anchor, whereas with `writing-mode: vertical-rl` is at the top left.
### Coordinate spanning keywords
When combined with a coordinate row or column keyword, the coordinate-spanning keywords specify a second grid tile for the position area to expand into. When such a combination is set as a `position-area` property value, a selected element is initially placed in the center of the specified row or column, and it then spans in the direction specified in the spanning keyword, spanning two grid tiles:
`span-x-start`
    
Span the center tile and the x-start tile of the specified y-axis row.
`span-x-end`
    
Span the center tile and the x-end tile of the specified y-axis row.
`span-y-start`
    
Span the center tile and the y-start tile of the specified x-axis column.
`span-y-end`
    
Span the center tile and the y-end tile of the specified x-axis column.
For example, `y-end span-x-end` selects the tile at the center of the end y-row, and spans across the tiles in that row that sit in the x-center and x-end columns. With `writing-mode: horizontal-tb` set, the position grid area would span the grid tiles at the bottom-center and bottom-right, whereas with `writing-mode: vertical-rl` set it would span the bottom-center and bottom-left tiles.
Note: The specification doesn't define separate coordinate `self` spanning keywords, but these are not needed — the spanning keywords can be used with both coordinate row and column keywords.
### Coordinate grid keyword defaults
If only a single coordinate grid `<position-area>` keyword is specified, the other value is implied as follows:
`x-start`, `x-self-start`, `x-end`, `x-self-end`, `y-start`, `y-self-start`, `y-end`, or `y-self-end`
    
The other value defaults to `span-all`, selecting the grid tiles spanning all three tiles of the column or row it was initially placed in. For example, `x-start` is equivalent to `x-start span-all`.
`span-x-start`, `span-x-end`, `span-y-start`, or `span-y-end`
    
The other value defaults to `center`. For example, `span-start` is equivalent to `span-start center`.
## `span-all`
`span-all` is a special keyword usable with all of the row and column keywords listed in the sections above. When you specify two values — a row/column keyword and `span-all`, the element is placed in the specified row or column, and it then spans all of the tiles in that row or column.
## Examples
See the `position-area` property page.
For detailed information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
# zoom
The `zoom` CSS property can be used to control the magnification level of an element. `transform: scale()` can be used as an alternative to this property.
The `zoom` CSS property scales the targeted element, which can affect the page layout. When scaling, the zoomed element scales from `top` and `center` when using the default `writing-mode`.
In contrast, an element scaled using `scale()` will not cause layout recalculation or move other elements on the page. If using `scale()` makes the contents larger than the containing element, then `overflow` comes into effect. Additionally, elements adjusted using `scale()` transform from the `center` by default; this can be changed with the `transform-origin` CSS property.
## Syntax
    
    /* <percentage> values */
    zoom: 50%;
    zoom: 200%;
    
    /* <number> values */
    zoom: 1.1;
    zoom: 0.7;
    
    /* Non-standard keyword values */
    zoom: normal;
    zoom: reset;
    
    /* Global values */
    zoom: inherit;
    zoom: initial;
    zoom: revert;
    zoom: revert-layer;
    zoom: unset;
    
### Values
`<percentage>`
    
Zoom factor. `100%` is equivalent to `normal`. Values larger than `100%` zoom in. Values smaller than `100%` zoom out.
`<number>`
    
Zoom factor. Equivalent to the corresponding percentage (`1.0` = `100%` = `normal`). Values larger than `1.0` zoom in. Values smaller than `1.0` zoom out.
Two non-standard keyword values are not recommended. Check browser compatibility data:
`normal`
    
Render the element at its normal size; equal to `zoom: 1`. Use the global `unset` keyword value instead.
`reset`
    
Resets the value to `zoom: 1` and prevents the element from being (de)magnified if the user applies non-pinch-based zooming (e.g., by pressing `Ctrl` \- `-` or `Ctrl` \+ `+` keyboard shortcuts) to the document.
## Examples
>
### Resizing paragraphs
In this example the paragraph elements are zoomed, on hovering a paragraph the `zoom` value is `unset`.
#### HTML
    
    <p class="small">Small</p>
    <p class="normal">Normal</p>
    <p class="big">Big</p>
    
#### CSS
    
    .small {
      zoom: 75%;
    }
    .normal {
      zoom: normal;
    }
    .big {
      zoom: 2.5;
    }
    p:hover {
      zoom: unset;
    }
    
#### Result
### Resizing elements
In this example the `div` elements are zoomed using the `normal`, `<percentage>`, and `<number>` values.
#### HTML
    
    <div id="a" class="circle"></div>
    <div id="b" class="circle"></div>
    <div id="c" class="circle"></div>
    
#### CSS
    
    div.circle {
      width: 25px;
      height: 25px;
      border-radius: 100%;
      vertical-align: middle;
      display: inline-block;
    }
    div#a {
      background-color: gold;
      zoom: normal; /* circle is 25px diameter */
    }
    div#b {
      background-color: green;
      zoom: 200%; /* circle is 50px diameter */
    }
    div#c {
      background-color: blue;
      zoom: 2.9; /* circle is 72.5px diameter */
    }
    
#### Result
### Creating a zoom control
In this example a `select` field is used to change the zoom level of the element.
#### HTML
In this first block, of HTML, a `select` field is defined with the different `zoom` values to be used.
    
    <section class="controls">
      <label for="zoom"
        >Zoom level
        <select name="zoom" id="zoom">
          <option value="0.5">Extra Small</option>
          <option value="0.75">Small</option>
          <option value="normal" selected>Normal</option>
          <option value="1.5">Large</option>
          <option value="2">Extra Large</option>
        </select>
      </label>
    </section>
    
In this second block a not supported message is added that will be hidden if the browser supports `zoom`.
    
    <p class="zoom-notice">CSS zoom is not supported</p>
    
The final block just defines the content that will be zoomed.
    
    <section class="content">
      <h1>This is the heading</h1>
      <p>
        Lorem ipsum dolor, sit amet consectetur adipisicing elit. Placeat inventore
        ea eveniet, fugiat in consequatur molestiae nostrum repellendus nam
        provident repellat officiis facilis alias facere obcaecati quos sunt
        voluptas! Iste.
      </p>
      <p>
        Lorem ipsum dolor, sit amet consectetur adipisicing elit. Placeat inventore
        ea eveniet, fugiat in consequatur molestiae nostrum repellendus nam
        provident repellat officiis facilis alias facere obcaecati quos sunt
        voluptas! Iste.
      </p>
    </section>
    
#### CSS
In this first block, of CSS, we are setting the starting value for the `--zoom-level` using custom properties and then using that as the value for `zoom` on the content block.
    
    html {
      --zoom-level: normal;
    }
    .content {
      max-width: 60ch;
      margin: auto;
      zoom: var(--zoom-level);
    }
    
In this final CSS block we are checking to see if the browser supports `zoom` and if so setting the not supported message to `display: none;`.
    
    @supports (zoom: 1) {
      .zoom-notice {
        display: none;
      }
    }
    
#### JavaScript
This JavaScript watches for a change in the select field and sets the new value for `--zoom-level` on the content `section`, e.g., `style="--zoom-level: 1.5;"`.
    
    const zoomControl = document.querySelector("#zoom");
    const content = document.querySelector(".content");
    const updateZoom = () => {
      content.style = `--zoom-level: ${zoomControl.value}`;
    };
    zoomControl.addEventListener("change", updateZoom);
    
#### Result
# margin-inline-start
The `margin-inline-start` CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    margin-inline-start: 20px;
    writing-mode: horizontal-tb;
    
    
    margin-inline-start: 20px;
    writing-mode: vertical-rl;
    
    
    margin-inline-start: 20%;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div id="container">
        <div class="col">One</div>
        <div class="col transition-all" id="example-element">Two</div>
        <div class="col">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      justify-content: flex-start;
    }
    
    .col {
      width: 33.33%;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    margin-inline-start: 10px; /* An absolute length */
    margin-inline-start: 1em; /* relative to the text size */
    margin-inline-start: 5%; /* relative to the nearest block container's width */
    margin-inline-start: anchor-size(block);
    margin-inline-start: calc(anchor-size(--my-anchor width, 30px) / 4);
    
    /* Keyword values */
    margin-inline-start: auto;
    
    /* Global values */
    margin-inline-start: inherit;
    margin-inline-start: initial;
    margin-inline-start: revert;
    margin-inline-start: revert-layer;
    margin-inline-start: unset;
    
It relates to `margin-block-start`, `margin-block-end`, and `margin-inline-end`, which define the other margins of the element.
### Values
The `margin-inline-start` property takes the same values as the `margin-left` property.
## Examples
>
### Setting inline start margin
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      margin-inline-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# margin-top
The `margin-top` CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
## Try it
    
    margin-top: 1em;
    
    
    margin-top: 10%;
    
    
    margin-top: 10px;
    
    
    margin-top: 0;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row"></div>
        <div class="row transition-all" id="example-element"></div>
        <div class="row"></div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
This property has no effect on non-replaced inline elements, such as `<span>` or `<code>`.
## Syntax
    
    /* <length> values */
    margin-top: 10px; /* An absolute length */
    margin-top: 1em; /* relative to the text size */
    margin-top: 5%; /* relative to the nearest block container's width */
    margin-top: anchor-size(height);
    margin-top: calc(anchor-size(--my-anchor self-inline, 25px) / 4);
    
    /* Keyword values */
    margin-top: auto;
    
    /* Global values */
    margin-top: inherit;
    margin-top: initial;
    margin-top: revert;
    margin-top: revert-layer;
    margin-top: unset;
    
The `margin-top` property is specified as the keyword `auto`, or a `<length>`, or a `<percentage>`. Its value can be positive, zero, or negative.
### Values
`<length>`
    
The size of the margin as a fixed value.
  * For anchor-positioned elements, the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element margin based on anchor size).


`<percentage>`
    
The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
`auto`
    
The browser selects a suitable value to use. See `margin`.
## Examples
>
### Setting positive and negative top margins
    
    .content {
      margin-top: 5%;
    }
    .side-box {
      margin-top: 10px;
    }
    .logo {
      margin-top: -5px;
    }
    #footer {
      margin-top: 1em;
    }
    
# round()
The `round()` CSS function returns a rounded number based on a selected rounding strategy.
Authors should use a custom CSS property (e.g., `--my-property`) for the rounding value, interval, or both; using the `round()` function is redundant if these have known values.
## Syntax
    
    width: round(var(--width), 50px);
    width: round(up, 101px, var(--interval));
    width: round(down, var(--height), var(--interval));
    margin: round(to-zero, -105px, 10px);
    
### Parameters
The `round(<rounding-strategy>, valueToRound, roundingInterval)` function specifies an optional rounding strategy, a value (or mathematical expression) to be rounded and a rounding interval (or mathematical expression). The `valueToRound` is rounded according to the rounding strategy, to the nearest integer multiple of `roundingInterval`.
`<rounding-strategy>`
    
The rounding strategy. This may be one of the following values:
`up`
    
Round `valueToRound` up to the nearest integer multiple of `roundingInterval` (if the value is negative, it will become "more positive"). This is equivalent to the JavaScript `Math.ceil()` method.
`down`
    
Round `valueToRound` down to the nearest integer multiple of `roundingInterval` (if the value is negative, it will become "more negative"). This is equivalent to the JavaScript `Math.floor()` method.
`nearest` (default)
    
Round `valueToRound` to the nearest integer multiple of `roundingInterval`, which may be either above or below the value. If the `valueToRound` is half way between the rounding targets above and below (neither is "nearest"), it will be rounded up. Equivalent to JavaScript `Math.round()`.
`to-zero`
    
Round `valueToRound` to the nearest integer multiple of `roundingInterval` closer to/towards zero (a positive number will decrease, while a negative value will become "less negative"). This is equivalent to the JavaScript `Math.trunc()` method.
`valueToRound`
    
The value to be rounded. This must be a `<number>`, `<dimension>`, or `<percentage>`, or a mathematical expression that resolves to one of those values.
`roundingInterval`
    
The rounding interval. This is a `<number>`, `<dimension>`, or `<percentage>`, or a mathematical expression that resolves to one of those values. If `valueToRound` is a `<number>`, `roundingInterval` may be omitted and defaults to `1`. Otherwise, omitting it results in an invalid expression.
### Return value
The value of `valueToRound`, rounded to the nearest lower or higher integer multiple of `roundingInterval`, depending on the `rounding strategy`.
  * If `roundingInterval` is 0, the result is `NaN`.
  * If `valueToRound` and `roundingInterval` are both `infinite`, the result is `NaN`.
  * If `valueToRound` is infinite but `roundingInterval` is finite, the result is the same `infinity`.
  * If `valueToRound` is finite but `roundingInterval` is infinite, the result depends on the rounding strategy and the sign of `A`:
    * `up` \- If `valueToRound` is positive (not zero), return `+∞`. If `valueToRound` is `0⁺`, return `0⁺`. Otherwise, return `0⁻`.
    * `down` \- If `valueToRound` is negative (not zero), return `−∞`. If `valueToRound` is `0⁻`, return `0⁻`. Otherwise, return `0⁺`.
    * `nearest`, `to-zero` \- If `valueToRound` is positive or `0⁺`, return `0⁺`. Otherwise, return `0⁻`.
  * The argument calculations can resolve to `<number>`, `<dimension>`, or `<percentage>`, but must have the same type, or else the function is invalid; the result will have the same type as the arguments.
  * If `valueToRound` is exactly equal to an integer multiple of `roundingInterval`, `round()` resolves to `valueToRound` exactly (preserving whether `valueToRound` is `0⁻` or `0⁺`, if relevant). Otherwise, there are two integer multiples of `roundingInterval` that are potentially "closest" to `valueToRound`, lower `roundingInterval` which is closer to `−∞` and upper `roundingInterval` which is closer to `+∞`.


## Examples
>
### Round positive values
This example demonstrates how the `round()` function's rounding strategies work for positive values.
Of the five boxes below, the `round()` function is used to set the height of the last four. The value to be rounded is between 100 px and 125 px in each case, and the rounding value is 25px in all cases. The height of the boxes is therefore either rounded up to 125 px or down to 100 px.
#### HTML
The HTML defines 5 `div` elements that will be rendered as boxes by the CSS. The elements contain text indicating the rounding strategy, initial value, and expected final height of the box (in parentheses).
    
    <div class="box box-1">height: 100px</div>
    <div class="box box-2">up 101px (125px)</div>
    <div class="box box-3">down 122px (100px)</div>
    <div class="box box-4">to-zero 120px (100px)</div>
    <div class="box box-5">nearest 117px (125px)</div>
    
#### CSS
The CSS that is applied to all boxes is shown below. Note that we apply a custom CSS property named `--rounding-interval`, that we will use for the rounding interval.
    
    div.box {
      width: 100px;
      height: 100px;
      background: lightblue;
      --rounding-interval: 25px;
    }
    
The first `div` from the left isn't targeted with specific CSS rules, so it will have a default height of 100px. The CSS for `div` two, three, and four is shown below, which round, up, down, and to-zero, respectively.
    
    div.box-2 {
      height: round(up, 101px, var(--rounding-interval));
    }
    div.box-3 {
      height: round(down, 122px, var(--rounding-interval));
    }
    div.box-4 {
      height: round(to-zero, 120px, var(--rounding-interval));
    }
    
Notice how above we indicate the rounding interval using `var()` and the custom CSS property `--rounding-interval`.
The last box is set without specifying a rounding strategy, and hence defaults to `nearest`. In this case, the nearest interval to 117 px is 125px, so it will round up. Just for contrast, here we specified hard coded values for both the rounding value and interval. While this is allowed, you wouldn't do this normally because there is no point rounding a number when you already know what the result must be.
    
    div.box-5 {
      height: round(117px, 25px);
    }
    
#### Result
If the browser supports the CSS `round()` function, you should see five columns with heights that are rounded as indicated by their contained text.
# <box-edge>
The `<box-edge>` value types represent a box edge keyword, such as `content-box` and `border-box`. The box-edge keywords are used to define different aspects of an element's box model and how elements are positioned and rendered on screen.
The box-edge keywords are the components of, but not limited to, the data types `<visual-box>`, `<layout-box>`, `<paint-box>`, `<coord-box>`, and `<geometry-box>`. These types are applied to properties such as `transform-box` and `background-clip`.
## Syntax
    
    <visual-box> = content-box | padding-box | border-box /* the three <box> values */
    <layout-box> = <visual-box> | margin-box /* the <shape-box> values */
    <paint-box> = <visual-box> | fill-box | stroke-box
    <coord-box> = <paint-box> | fill-box | stroke-box | view-box
    <geometry-box> = <shape-box> | fill-box | stroke-box | view-box
    
### Values
A `<box-edge>` can be of the type `<visual-box>`, `<layout-box>`, `<paint-box>`, `<coord-box>`, or `<geometry-box>`.
`<visual-box>`
    
Refers to the rectangular box generated for an element as seen by a user on a web page. It includes the element's content, padding, and border. Also referred to as `<box>`, this value excludes the margin area. This value type is used for the `background-clip` and `overflow-clip-margin` properties.
`<layout-box>`
    
Refers to the space occupied by an element, including its content, padding, border, and margin. This value type is used for layout and positioning purposes. Also referred to as `<shape-box>`, this value type is used for the `shape-outside` property.
`<paint-box>`
    
Refers to the area within the layout box that is used to visually render the content. This includes the area where the element's background and borders are painted. As an element's paintable area does not include its margins, this value excludes `margin-box`.
`<coord-box>`
    
Refers to the coordinate box used for positioning and sizing an element within its parent container. It is used to control how content flows around the edges of the box. It excludes the margin area. This value type is used for the `offset-path` property.
`<geometry-box>`
    
Defines the reference box for a basic shape, or if specified by itself, causes the edges of the specified box, including any corner shaping (such as a `border-radius`), to be the clipping path. This value type is used for the `clip-path`, `mask-clip`, and `mask-origin` properties and the SVG `clip-path` attribute.
### Keywords
The `<box-edge>` keywords are defined as follows:
`content-box`
    
Refers to the outer edge of the box's content area. The content box is the innermost box. The content area contains the actual content, such as text, images, or other HTML elements. In SVG, this value is treated as `fill-box`.
`padding-box`
    
Refers to the outer edge of the padding of the box. If there is no padding on a side, then the value is the same as `content-box`. In SVG, `padding-box` is treated as `fill-box`. The padding area surrounds the content area, starting at the outer edge of the content box.
`border-box`
    
Refers to the outer edge of the border of the box. If there is no border on a side, then the value is the same as `padding-box`. In SVG, `border-box` is treated as `stroke-box`. The border area surrounds the padding area, starting at the outer edge of the padding box.
`margin-box`
    
Refers to the outer edge of the margin of the box. If there is no margin on a side, then the value is the same as `border-box`. In SVG, `margin-box` is treated as `stroke-box`.
`fill-box`
    
Refers to the object bounding box in SVG. In CSS, `fill-box` is treated as `content-box`. It is used to wrap the content around the edges defined by the `coord-box` values.
`stroke-box`
    
Refers to the stroke bounding box in SVG. In CSS, `stroke-box` is treated as `border-box`. It is used to define the shape of the element when strokes are applied.
`view-box`
    
Refers to the nearest SVG viewport element's origin box. The origin box is a rectangle with the width and height of the initial SVG user coordinate system established by the `viewBox` attribute for that element. The origin box is positioned such that its top left corner is anchored at the coordinate system origin. In CSS, `view-box` is treated as `border-box`.
Note: When the SVG viewport is not anchored at the origin, the origin box does not correspond to the SVG viewport.
# marker-start
The `marker-start` CSS property points to a marker that will be drawn on the first vertex of the element's path; that is, at its starting vertex. The marker must have been defined using an SVG `<marker>` element, and can only be referenced with a `<url>` value. The value of the CSS property overrides any values of the `marker-start` attribute in the SVG.
For many marker-supporting shapes, the first and last vertices are in the same place: for example, the top left corner of a `<rect>`. In such shapes, if both the first and last markers are defined, two markers will be drawn at that point, though they may not point in the same direction.
Note: The `marker-start` property will only have an effect for elements that can use SVG markers. See `marker-start` for a list.
## Syntax
    
    marker-start: none;
    marker-start: url("markers.svg#arrow");
    
    /* Global values */
    marker-start: inherit;
    marker-start: initial;
    marker-start: revert;
    marker-start: revert-layer;
    marker-start: unset;
    
### Values
`none`
    
This means no marker will be drawn at the first vertex of the element's path.
`<marker-ref>`
    
A `<url>` that refers to a marker defined by an SVG `<marker>` element, to be drawn at the first vertex of the element's path. If the URL reference is invalid, no marker will be drawn at the path's first vertex.
## Example
    
    <svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <marker
          id="triangle"
          viewBox="0 0 10 10"
          markerWidth="10"
          markerHeight="10"
          refX="1"
          refY="5"
          markerUnits="strokeWidth"
          orient="auto">
          <path d="M 0 0 L 10 5 L 0 10 z" fill="red" />
        </marker>
      </defs>
      <polyline
        id="test"
        fill="none"
        stroke="black"
        points="20,100 40,60 70,80 100,20" />
    </svg>
    
    
    polyline#test {
      marker-start: url("#triangle");
    }
    
# @import
The `@import` CSS at-rule is used to import style rules from other valid stylesheets. An `@import` rule must be defined at the top of the stylesheet, before any other at-rule (except @charset and @layer) and style declarations, or it will be ignored.
## Syntax
    
    @import url;
    @import url layer;
    @import url layer(layer-name);
    @import url layer(layer-name) supports(supports-condition);
    @import url layer(layer-name) supports(supports-condition) list-of-media-queries;
    @import url layer(layer-name) list-of-media-queries;
    @import url supports(supports-condition);
    @import url supports(supports-condition) list-of-media-queries;
    @import url list-of-media-queries;
    
where:
url
    
Is a `<string>` or a `<url>` type representing the location of the resource to import. The URL may be absolute or relative.
list-of-media-queries
    
Is a comma-separated list of media queries, which specify the media-dependent conditions for applying the CSS rules defined in the linked URL. If the browser does not support any of these queries, it does not load the linked resource.
layer-name
    
Is the name of a cascade layer into which the contents of the linked resource are imported. See `layer()` for more information.
supports-condition
    
Indicates the feature(s) that the browser must support in order for the stylesheet to be imported. If the browser does not conform to the conditions specified in the supports-condition, it may not fetch the linked stylesheet, and even if downloaded through some other path, will not load it. The syntax of `supports()` is almost identical to that described in `@supports`, and that topic can be used as a more complete reference.
Use `@import` together with the `layer` keyword or `layer()` function to import external style sheets (from frameworks, widget stylesheets, libraries, etc.) into layers.
## Description
Imported rules must come before all other types of rules, except `@charset` rules and layer creating `@layer` statements.
    
    * {
      margin: 0;
      padding: 0;
    }
    /* more styles */
    @import "my-imported-styles.css";
    
As the `@import` at-rule is declared after the styles it is invalid and hence ignored.
    
    @import "my-imported-styles.css";
    * {
      margin: 0;
      padding: 0;
    }
    /* more styles */
    
The `@import` rule is not a nested statement. Therefore, it cannot be used inside conditional group at-rules.
So that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent import conditions. These conditional imports specify comma-separated media queries after the URL. In the absence of any media query, the import is not conditional on the media used. Specifying `all` for the `list-of-media-queries` has the same effect.
Similarly, user agents can use the `supports()` function in an `@import` at-rule to only fetch resources if a particular feature set is (or is not) supported. This allows authors to take advantage of recently introduced CSS features, while providing graceful fallbacks for older browser versions. Note that the conditions in the `supports()` function of an `@import` at-rule can be obtained in JavaScript using `CSSImportRule.supportsText`.
The `@import` rule can also be used to create a cascade layer by importing rules from a linked resource. Rules can also be imported into an existing cascade layer. The `layer` keyword or the `layer()` function is used with `@import` for this purpose. Declarations in style rules from imported stylesheets interact with the cascade as if they were written literally into the stylesheet at the point of the import.
## Examples
>
### Importing CSS rules
    
    @import "custom.css";
    @import url("chrome://communicator/skin/");
    
The two examples above show how to specify the url as a `<string>` and as a `url()` function.
### Importing CSS rules conditional on media queries
    
    @import "fine-print.css" print;
    @import "bluish.css" print, screen;
    @import "common.css" screen;
    @import "landscape.css" screen and (orientation: landscape);
    
The `@import` rules in the above examples show media-dependent conditions that will need to be true before the linked CSS rules are applied. So for instance, the last `@import` rule will load the `landscape.css` stylesheet only on a screen device in landscape orientation.
### Importing CSS rules conditional on feature support
    
    @import "grid.css" supports(display: grid) screen and (width <= 400px);
    @import "flex.css" supports((not (display: grid)) and (display: flex)) screen
      and (width <= 400px);
    
The `@import` rules above illustrate how you might import a layout that uses a grid if `display: grid` is supported, and otherwise imports CSS that uses `display: flex`. While you can only have one `supports()` statement, you can combine any number of feature checks with `not`, `and`, and `or`. However, you must use parenthesis to define precedence when you mix them, e.g., `supports((..) or (..) and not (..))` is invalid, but `supports((..) or ((..) and (not (..))))` is valid. Note that if you just have a single declaration then you don't need to wrap it in additional parentheses: this is shown in the first example above.
The examples above show support conditions using basic declaration syntax. You can also specify CSS functions in `supports()`, and it will evaluate to `true` if they are supported and can be evaluated on the user-agent. For example, the code below shows an `@import` that is conditional on both child combinators (`selector()`) and the `font-tech()` function:
    
    @import "whatever.css"
      supports((selector(h2 > p)) and (font-tech(color-COLRv1)));
    
### Importing CSS rules into a cascade layer
    
    @import "theme.css" layer(utilities);
    
In the above example, a cascade layer named `utilities` is created and it will include rules from the imported stylesheet `theme`.
    
    @import "headings.css" layer(default);
    @import "links.css" layer(default);
    
    @layer default {
      audio[controls] {
        display: block;
      }
    }
    
In the above example, the rules in `headings.css` and `links.css` stylesheets cascade within the same layer as the `audio[controls]` rule.
    
    @import "theme.css" layer();
    @import "style.css" layer;
    
This is an example of creating two separate unnamed cascade layers and importing the linked rules into each one separately. A cascade layer declared without a name is an unnamed cascade layer. Unnamed cascade layers are finalized when created: they do not provide any means for re-arranging or adding styles and they cannot be referenced from outside.
# stroke-miterlimit
The `stroke-miterlimit` CSS property defines a limit on the ratio of the miter length to the `stroke-width` when the shape to be used at the corners of an SVG element's stroked path is a mitered join. If the limit defined by this property is exceeded, the join is converted from `miter` to `bevel`, thus making the corner appear truncated.
This property applies to any SVG corner-generating shape or text-content element (see `stroke-miterlimit` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes. If present, it overrides the element's `stroke-miterlimit` attribute.
## Description
When two line segments meet at a sharp angle and `miter` joins have been specified for `stroke-linejoin`, or if they default to that value, it is possible for the miter to extend far beyond the thickness of the line stroking the path. The `stroke-miterlimit` ratio is used to define a limit, past which the join is converted from a miter to a bevel.
The ratio of miter length (the distance between the outer tip and the inner corner of the miter) to `stroke-width` is directly related to the angle (theta) between the segments in user space by the formula:
stroke-miterlimit=miterLengthstroke-width=1sin(θ2)\text{stroke-miterlimit} = \frac{\text{miterLength}}{\text{stroke-width}} = \frac{1}{\sin\left(\frac{\theta}{2}\right)}
For example, a miter limit of `1.414` converts miters to bevels for a theta value of less than 90 degrees, a limit of `4.0` converts them for a theta less than approximately 29 degrees, and a limit of `10.0` converts them for theta less than approximately 11.5 degrees.
## Syntax
    
    /* number values */
    stroke-miterlimit: 1;
    stroke-miterlimit: 3.1416;
    
    /* Global values */
    stroke-miterlimit: inherit;
    stroke-miterlimit: initial;
    stroke-miterlimit: revert;
    stroke-miterlimit: revert-layer;
    stroke-miterlimit: unset;
    
### Values
`<number>`
    
Any real positive number equal to or greater than `1`; values below that are invalid. The initial value is `4`.
## Examples
>
### Various miter limits
This example demonstrates the effect of different values for the `stroke-miterlimit` property.
#### HTML
We set up five multi-segment paths, all of which use a black stroke with a width of one, and no fill. Each path creates a series of mountain symbols, going from left (a shallow corner angle) to right (an extreme corner angle).
    
    <svg viewBox="0 0 39 36" xmlns="http://www.w3.org/2000/svg">
      <g stroke="black" stroke-width="1" fill="none">
        <path
          d="M1,5 l7   ,-3 l7   ,3
             m2,0 l3.5 ,-3 l3.5 ,3
             m2,0 l2   ,-3 l2   ,3
             m2,0 l0.75,-3 l0.75,3
             m2,0 l0.5 ,-3 l0.5 ,3" />
        <path
          d="M1,12 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,19 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,26 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,33 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
      </g>
    </svg>
    
#### CSS
We apply increasingly large values of `stroke-miterlimit` to the paths, such that for the first path, only the first (leftmost) subpath is mitered; for the second path, the first two subpaths are mitered; and so on until for the fifth path, all five subpaths are mitered.
    
    path:nth-child(1) {
      stroke-miterlimit: 1.1;
    }
    path:nth-child(2) {
      stroke-miterlimit: 1.4;
    }
    path:nth-child(3) {
      stroke-miterlimit: 1.9;
    }
    path:nth-child(4) {
      stroke-miterlimit: 4.2;
    }
    path:nth-child(5) {
      stroke-miterlimit: 6.1;
    }
    
# inset-block-start
The `inset-block-start` CSS property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    writing-mode: horizontal-tb;
    
    
    writing-mode: vertical-rl;
    
    
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="example-container" id="example-element">
        <div id="abspos">
          I am absolutely positioned with inset-block-start: 50px
        </div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    #example-element {
      border: 0.75em solid;
      padding: 0.75em;
      position: relative;
      width: 100%;
      min-height: 200px;
      unicode-bidi: bidi-override;
    }
    
    #abspos {
      background-color: yellow;
      color: black;
      border: 3px solid red;
      position: absolute;
      inset-block-start: 50px;
      inline-size: 140px;
    }
    
## Syntax
    
    /* <length> values */
    inset-block-start: 3px;
    inset-block-start: 2.4em;
    inset-block-start: anchor(end);
    inset-block-start: calc(anchor-size(--my-anchor height, 70px) * 2);
    
    /* <percentage>s of the width or height of the containing block */
    inset-block-start: 10%;
    
    /* Keyword value */
    inset-block-start: auto;
    
    /* Global values */
    inset-block-start: inherit;
    inset-block-start: initial;
    inset-block-start: revert;
    inset-block-start: revert-layer;
    inset-block-start: unset;
    
### Values
The `inset-block-start` property takes the same values as the `left` property.
## Examples
>
### Setting block start offset
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      position: relative;
      inset-block-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# cos()
The `cos()` CSS function is a trigonometric function that returns the cosine of a number, which is a value between `-1` and `1`. The function contains a single calculation that must resolve to either a `<number>` or an `<angle>` by interpreting the result of the argument as radians. That is, `cos(45deg)`, `cos(0.125turn)`, and `cos(3.14159 / 4)` all represent the same value, approximately `0.707`.
## Try it
    
    transform: translateX(calc(cos(0deg) * 140px))
      translateY(calc(sin(0deg) * -140px));
    
    
    transform: translateX(calc(cos(90deg) * 140px))
      translateY(calc(sin(90deg) * -140px));
    
    
    transform: translateX(calc(cos(135deg) * 140px))
      translateY(calc(sin(135deg) * -140px));
    
    
    transform: translateX(calc(cos(180deg) * 140px))
      translateY(calc(sin(180deg) * -140px));
    
    
    transform: translateX(calc(cos(-45deg) * 140px))
      translateY(calc(sin(-45deg) * -140px));
    
    
    <div class="circle">
      <span class="dot" id="example-element"></span>
    </div>
    
    
    :root {
      --radius: 140px;
      --dot-size: 10px;
    }
    .circle {
      display: grid;
      place-content: center;
      margin: 0 auto;
      width: calc(var(--radius) * 2);
      aspect-ratio: 1;
      border-radius: 50%;
      border: 2px solid #666666;
      background-image:
        radial-gradient(black var(--dot-size), transparent var(--dot-size)),
        linear-gradient(135deg, blue, deepskyblue, lightgreen, lavender, honeydew);
    }
    .dot {
      display: block;
      width: var(--dot-size);
      aspect-ratio: 1;
      border-radius: 50%;
      border: 2px solid #666666;
      background-color: #ff6666;
      transform: translateX(calc(cos(0deg) * var(--radius)))
        translateY(calc(sin(0deg) * var(--radius) * -1));
    }
    
## Syntax
    
    /* Single <angle> values */
    width: calc(100px * cos(45deg));
    width: calc(100px * cos(0.125turn));
    width: calc(100px * cos(0.785398163rad));
    
    /* Single <number> values */
    width: calc(100px * cos(63.673));
    width: calc(100px * cos(2 * 0.125));
    
    /* Other values */
    width: calc(100px * cos(pi));
    width: calc(100px * cos(e / 2));
    
### Parameters
The `cos(angle)` function accepts only one value as its parameter.
`angle`
    
A calculation which resolves to a `<number>` or an `<angle>`. When specifying unitless numbers they are interpreted as a number of radians, representing an `<angle>`.
### Return value
The cosine of an `angle` will always return a number between `−1` and `1`.
  * If `angle` is `infinity`, `-infinity`, or `NaN`, the result is `NaN`.


## Examples
>
### Keep the size of a rotated box
The `cos()` function can be used to keep the size of a rotated box.
When the element is rotated using `rotate()`, it goes beyond its initial size. To fix this, we will use `cos()` to update the element size.
For example, if you rotate a `100px`/`100px` square `45deg`, the diamond it creates will be wider and taller than the original square. To shrink the diamond into the box allotted for the original square, you would have to scale down the diamond using this formula: `width = height = 100px * cos(45deg) = 100px * 0.707 = 70.7px`. You need to also adjust the `transform-origin` and add `translate()` to correct the position:
#### HTML
    
    <div class="original-square"></div>
    <div class="rotated-diamond"></div>
    <div class="rotated-scaled-diamond"></div>
    
#### CSS
    
    div.original-square {
      width: 100px;
      height: 100px;
      background-color: blue;
    }
    div.rotated-diamond {
      width: 100px;
      height: 100px;
      background-color: red;
      transform: rotate(45deg);
    }
    div.rotated-scaled-diamond {
      width: calc(100px * cos(45deg));
      height: calc(100px * cos(45deg));
      margin: calc(100px / 4 * cos(45deg));
      transform: rotate(45deg);
      transform-origin: center;
      background-color: green;
    }
    
#### Result
# border-top-width
The `border-top-width` CSS property sets the width of the top border of an element.
## Try it
    
    border-top-width: thick;
    
    
    border-top-width: 2em;
    
    
    border-top-width: 4px;
    
    
    border-top-width: 2ex;
    
    
    border-top-width: 0;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* Keyword values */
    border-top-width: thin;
    border-top-width: medium;
    border-top-width: thick;
    
    /* <length> values */
    border-top-width: 10em;
    border-top-width: 3vmax;
    border-top-width: 6px;
    
    /* Global keywords */
    border-top-width: inherit;
    border-top-width: initial;
    border-top-width: revert;
    border-top-width: revert-layer;
    border-top-width: unset;
    
### Values
`<line-width>`
    
Defines the width of the border, either as an explicit nonnegative `<length>` or a keyword. If it's a keyword, it must be one of the following values:
  * `thin`
  * `medium`
  * `thick`


Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern `thin ≤ medium ≤ thick`, and the values are constant within a single document.
## Examples
>
### HTML
    
    <div>Element 1</div>
    <div>Element 2</div>
    
### CSS
    
    div {
      border: 1px solid red;
      margin: 1em 0;
    }
    
    div:nth-child(1) {
      border-top-width: thick;
    }
    div:nth-child(2) {
      border-top-width: 2em;
    }
    
### Result
# :autofill
The `:autofill` CSS pseudo-class matches when an `<input>` element has its value autofilled by the browser. The class stops matching if the user edits the field.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:is(:-webkit-autofill, :autofill) {
      border: 3px solid darkorange;
    }
    
    
    <form>
      <p>Click on the text box and choose any option suggested by your browser.</p>
    
      <label for="name">Name</label>
      <input id="name" name="name" type="text" autocomplete="name" />
    
      <label for="email">Email Address</label>
      <input id="email" name="email" type="email" autocomplete="email" />
    
      <label for="country">Country</label>
      <input id="country" name="country" type="text" autocomplete="country-name" />
    </form>
    
Note: The user agent style sheets of many browsers use `!important` in their `:-webkit-autofill` style declarations, making them non-overridable by webpages without resorting to JavaScript hacks. For example Chrome has the following in its internal stylesheet:
    
    background-color: rgb(232 240 254) !important;
    background-image: none !important;
    color: -internal-light-dark(black, white) !important;
    
This means that you cannot set the `background-color`, `background-image`, or `color` in your own rules.
## Syntax
    
    :autofill {
      /* ... */
    }
    
## Examples
The following example demonstrates the use of the `:autofill` pseudo-class to change the border of a text field that has been autocompleted by the browser. To ensure we don't create an invalid selector list, both `:-webkit-autofill` and `:autofill` are matched using a forgiving selector list with `:is()`.
    
    input {
      border-radius: 3px;
    }
    
    input:is(:-webkit-autofill, :autofill) {
      border: 3px dotted orange;
    }
    
    
    <form method="post" action="">
      <label for="email">Email</label>
      <input type="email" name="email" id="email" autocomplete="email" />
    </form>
    
# Selector list
The CSS selector list (`,`) selects all the matching nodes. A selector list is a comma-separated list of selectors.
## Description
When multiple selectors share the same declarations, they can be grouped together into a comma-separated list. Selector lists can also be passed as parameters to some functional CSS pseudo-classes. White space may appear before and/or after the comma.
The following three declarations are equivalent:
    
    span {
      border: red 2px solid;
    }
    div {
      border: red 2px solid;
    }
    
    
    span,
    div {
      border: red 2px solid;
    }
    
    
    :is(span, div) {
      border: red 2px solid;
    }
    
## Examples
When applying the same styles to elements matching different criteria, grouping the selectors in a comma-separated list can improve consistency while reducing the size of style sheets.
### Single line grouping
This example shows grouping selectors in a single line using a comma-separated list.
    
    h1, h2, h3, h4, h5, h6 {
      font-family: Helvetica, Arial;
    }
    
### Multi line grouping
This example shows grouping selectors in multiple lines using a comma-separated list.
    
    #main,
    .content,
    article,
    h1 + p {
      font-size: 1.1em;
    }
    
## Valid and invalid selector lists
An invalid selector represents, and therefore matches, nothing. When a selector list contains an invalid selector, the entire style block is ignored, except for the `:is()` and `:where()` pseudo-classes that accept forgiving selector lists.
### Invalid selector list
A downside to using a selector list is that a single unsupported selector in the selector list invalidates the entire rule.
Consider the following two CSS rule sets:
    
    h1 {
      font-family: sans-serif;
    }
    h2:invalid-pseudo {
      font-family: sans-serif;
    }
    h3 {
      font-family: sans-serif;
    }
    
    
    h1,
    h2:invalid-pseudo,
    h3 {
      font-family: sans-serif;
    }
    
They are not equivalent. In the first rule set, styles will be applied on the `h1` and `h3` elements, but the `h2:invalid-pseudo` rule will not be parsed. In the second rule set, because one selector in the list is invalid, the entire rule will not be parsed. Because of this, no style will be applied to the `h1` and `h3` elements as when any selector in a list of selectors in invalid, the entire style block will be ignored.
### Forgiving selector list
A way to remedy the invalid selector list problem is to use the `:is()` or the `:where()` pseudo-class, which accept a forgiving selector list. Each selector in a forgiving selector list is parsed individually. So any invalid selectors in the list are ignored and the valid ones are used.
Carrying on from the previous example, the following two CSS rule sets are now equivalent:
    
    h1 {
      font-family: sans-serif;
    }
    h2:maybe-unsupported {
      font-family: sans-serif;
    }
    h3 {
      font-family: sans-serif;
    }
    
    
    :is(h1, h2:maybe-unsupported, h3) {
      font-family: sans-serif;
    }
    
The difference between the two is that the specificity of `:is()` is its most specific argument, whereas the `:where()` selector and the forgiving selector list parameter do not add any specificity weight.
### Relative selector list
A relative selector list is a comma-separated selector list parsed as relative selectors, which begin with an explicit or implied combinator.
    
    h2:has(+ p, + ul.red) {
      font-style: italic;
    }
    
In the above example, the italic style will be applied to any `h2` heading that is immediately followed by `<p>` or `<ul class="red">`. Note that pseudo-elements and the `:has()` selector are not valid within the `:has()` relative selector list.
# CSS generated content
The CSS generated content module defines how an element's content can be replaced and content can be added to a document with CSS.
Generated content can be used for content replacement, in which case the content of a DOM node is replaced with a CSS `<image>`. The CSS generated content also enables generating language-specific quotes, creating custom list item numbers and bullets, and visually adding content by generating content on select pseudo-elements as anonymous replaced elements.
## Generated content in action
The HTML for this sample is a single, empty `<div>` inside an otherwise empty `<body>`. The snowman was created with CSS images and CSS backgrounds and borders. The carrot nose was added using generated content: an empty box with a wide orange left border added to the `::before` pseudo-element. The text is also generated content: "only one <div>" was generated with the `content` property applied to the `::after` pseudo-element.
Click "Play" in the example above to see or edit the code in the MDN Playground.
## Reference
>
### Properties
  * `content`
  * `quotes`


The CSS generated content module also introduces four at-risk properties: `string-set`, `bookmark-label`, `bookmark-level`, and `bookmark-state`. Currently, no browsers support these features.
### Functions
The CSS generated content module introduces six yet-to-be implemented CSS functions including `content()`, `string()`, and `leader()`, and the three `<target>` functions `target-counter()`, `target-counters()`, and `target-text()`.
### Data types
  * `<content-list>`
  * `<content-replacement>` (see `<image>`)
  * `<image>`
  * `<counter>`
  * `<quote>`
  * `<target>`


## Guides
"How to" guide for generated content
    
Learn how to add text or image content to a document using the `content` property.
Create fancy boxes with generated content
    
Example of styling generated content for visual effects.
## Related concepts
  * CSS pseudo-elements module
    * `::before` pseudo-element
    * `::after` pseudo-element
    * `::marker` pseudo-element
  * CSS lists and counters module
    * `counter()` function
    * `counters()` function
    * `counter-increment` property
    * `counter-reset` property
  * CSS overflow module
    * `::scroll-button()` pseudo-element
    * `::scroll-marker` pseudo-element
    * `:target-current` pseudo-class
  * CSS values and units module
    * `attr()` function
    * `<string>` data type
    * `<image>` data type


# hyphenate-limit-chars
The `hyphenate-limit-chars` CSS property specifies the minimum word length to allow hyphenation of words as well as the minimum number of characters before and after the hyphen.
This property provides you with fine-grained control over hyphenation in text. This control enables you to avoid awkward hyphenations and set appropriate hyphenation for different languages, which, in turn, allows for better typography.
## Syntax
    
    /* Numeric values */
    hyphenate-limit-chars: 10 4 4;
    hyphenate-limit-chars: 10 4;
    hyphenate-limit-chars: 10;
    
    /* Keyword values */
    hyphenate-limit-chars: auto auto auto;
    hyphenate-limit-chars: auto auto;
    hyphenate-limit-chars: auto;
    
    /* Mix of numeric and keyword values */
    hyphenate-limit-chars: 10 auto 4;
    hyphenate-limit-chars: 10 auto;
    hyphenate-limit-chars: auto 3;
    
    /* Global values */
    hyphenate-limit-chars: inherit;
    hyphenate-limit-chars: initial;
    hyphenate-limit-chars: revert;
    hyphenate-limit-chars: revert-layer;
    hyphenate-limit-chars: unset;
    
The `hyphenate-limit-chars` property takes 1–3 values that can be numeric or `auto`, as explained below.
### Values
`<number> <number> <number>`
    
The first value is the minimum word length before words should be hyphenated. The second value is the minimum number of characters before the hyphen. The third value is the minimum number of characters after the hyphen.
`<number> <number>`
    
The first value is the minimum word length before words should be hyphenated. The second value is the minimum number of characters before the hyphen. The minimum number of characters after the hyphen will be set equal to the second value.
`<number>`
    
The value is the minimum word length before words should be hyphenated. The minimum number of characters before and after the hyphen will be set to `auto`.
If `auto` is set for any of the values, the user agent will choose an appropriate value for the current layout. Unless the user agent can calculate a better value, the following default values will be used:
  * Minimum word length to allow hyphenation: 5
  * Minimum number of characters before the hyphen: 2
  * Minimum number of characters after the hyphen: 2


Note that if a word is too short to meet the given constraints, it will not be hyphenated. For example, given a value like `hyphenate-limit-chars: auto 3 4`, words shorter than 7 characters will never be hyphenated, since it is impossible to have 3 characters before the hyphen and 4 characters after it.
## Examples
>
### Setting hyphenation limits
In this example, we have four boxes each containing the same text. For the purpose of comparison, the first box shows the default hyphenation applied by the browser. The next three boxes demonstrate the result of constraining the browser's default behavior using different `hyphenate-limit-chars` values.
#### HTML
    
    <div class="container">
      <p id="ex1">juxtaposition and acknowledgement</p>
      <p id="ex2">juxtaposition and acknowledgement</p>
      <p id="ex3">juxtaposition and acknowledgement</p>
      <p id="ex4">juxtaposition and acknowledgement</p>
    </div>
    
#### CSS
    
    .container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    p {
      margin: 1rem;
      width: 120px;
      border: 2px dashed #999999;
      font-size: 1.5rem;
      hyphens: auto;
    }
    
    #ex2 {
      hyphenate-limit-chars: 14;
    }
    
    #ex3 {
      hyphenate-limit-chars: 5 9 2;
    }
    
    #ex4 {
      hyphenate-limit-chars: 5 2 7;
    }
    
#### Result
In the first box, we don't set `hyphenate-limit-chars`, allowing the browser to apply its default algorithm. By default, the browser uses the values `5 2 2` unless it can find better values.
In the second box, we prevent the browser from hyphenating words unless they are at least 14 characters long by setting `hyphenate-limit-chars: 14`. As a result, "juxtaposition" is not hyphenated in the second box because it is only 13 characters long.
In the third box, we constrain the browser to include at least 9 characters before the hyphen by setting `hyphenate-limit-chars: 5 9 2`. The effect is that "acknowledgement" is now hyphenated as "acknowledge-ment" rather than the default version "acknowl-edgement", as shown in the first box.
Note that the browser does not have to include exactly 9 characters before the hyphen: as long as the constraints given in `hyphenate-limit-chars` are satisfied, the browser can break the word in the place it considers best. So in this case, for example, it chooses "acknowledge-ment" rather than the less readable "acknowled-gement".
In the fourth box, we make the browser include at least 7 characters after the hyphen by setting `hyphenate-limit-chars: 5 2 7`. The effect is that "juxtaposition" is hyphenated as "juxta-position" rather than the default "juxtaposi-tion".
# speak-as
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `speak-as` CSS property is used to define how HTML content is spoken. The one to three enumerated key terms determine the manner by which elements and text get rendered by aural technologies, such as screen readers and digital assistants.
This property applies to all content, including pseudo-elements, with the exception `::marker` pseudo-elements constructed via a `@counter-style` with a defined `speak-as` descriptor, which takes precedence over any inherited `speak-as` property value.
## Syntax
    
    /* single value syntax */
    speak-as: normal;
    speak-as: spell-out;
    speak-as: literal-punctuation;
    speak-as: digits;
    speak-as: no-punctuation;
    
    /* multiple value syntax */
    speak-as: spell-out literal-punctuation;
    speak-as: spell-out no-punctuation;
    speak-as: digits literal-punctuation;
    speak-as: digits no-punctuation;
    speak-as: spell-out digits literal-punctuation;
    speak-as: spell-out digits no-punctuation;
    
### Values
`normal`
    
Normal pronunciation rules with punctuation replaced by pauses. For example, "Hello, world!" would be pronounced as "Hello (pause) world (pause)". This is the default value.
`spell-out`
    
Content is spelled out letter by letter. For example, "role" would be pronounced as "r" "o" "l" "e".
`literal-punctuation`
    
Punctuation marks are spelled out literally. For example, "Hello, world!" would be pronounced as "Hello comma world exclamation mark."
`digits`
    
Numbers are pronounced as individual digits. For example, "31" would be pronounced as "three one".
`no-punctuation`
    
Content is pronounced normally without any punctuation. For example, "Hello, world!" would be pronounced as "Hello" "world".
Note: Support of the `speak-as` property is limited and inconsistently implemented across different assistive technologies, such as screen readers or speech synthesizers. To ensure any pronunciation-dependent critical information remains user-friendly and accessible to a wide audience, do not rely solely on this CSS property to define how this information content is presented aurally.
## Examples
>
### HTML
    
    <p class="normal">Hello, world! I'm 25.</p>
    <p class="spell-out">Hello, world! I'm 25.</p>
    <p class="literal-punctuation">Hello, world! I'm 25.</p>
    <p class="no-punctuation">Hello, world! I'm 25.</p>
    <p class="digits">Hello, world! I'm 25.</p>
    <p class="multi">Hello, world! I'm 25.</p>
    
### CSS
    
    .normal {
      speak-as: normal;
    }
    
    .spell-out {
      speak-as: spell-out;
    }
    
    .literal-punctuation {
      speak-as: literal-punctuation;
    }
    
    .no-punctuation {
      speak-as: no-punctuation;
    }
    
    .digits {
      speak-as: digits;
    }
    .multi {
      speak-as: literal-punctuation digits;
    }
    
# Pseudo-elements
A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s).
## Syntax
    
    selector::pseudo-element {
      property: value;
    }
    
For example, `::first-line` can be used to change the font of the first line of a paragraph.
    
    /* The first line of every <p> element. */
    p::first-line {
      color: blue;
      text-transform: uppercase;
    }
    
Double colons (`::`) are used for pseudo-elements. This distinguishes pseudo-elements from pseudo-classes that use a single colon (`:`) in their notation. Note, browsers support single colon syntax for the original four pseudo-elements: `::before`, `::after`, `::first-line`, and `::first-letter`.
Pseudo-elements do not exist independently. The element of which a pseudo-element is a part is called its originating element. A pseudo-element must appear after all the other components in the complex or compound selector. The last element in the selector is the originating element of the pseudo-element. For example, you can select a paragraph's first line using `p::first-line` but not the first-line's children. So `p::first-line > *` is invalid.
A pseudo-element can be selected based on the current state of the originating element. For example, `p:hover::first-line` selects the first line (pseudo-element) of a paragraph when the paragraph itself is being hovered (pseudo-class).
Note: When a selector list contains an invalid selector, the entire style block is ignored.
## Typographic pseudo-elements
`::first-line`
    
The first line-box of the originating element.
`::first-letter`
    
The first letter, number, or symbol character on the first line of its originating element.
`::cue`
    
The WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks. The CSS pseudo-elements module also defines the `::postfix` and `::prefix` sub-pseudo elements. These are not yet supported by any browser.
## Highlight pseudo-elements
Selects document sections based on content and document status, enabling those areas to be styled differently to indicate that status to the user.
`::selection`
    
The portion of a document that has been selected.
`::target-text`
    
The document's target element. The target element is identified using the URL's fragment identifier.
`::spelling-error`
    
A portion of text that the browser thinks is misspelled.
`::grammar-error`
    
A portion of text that the browser thinks is grammatically incorrect.
`::highlight()`
    
The elements in the highlight registry. It is used to create custom highlights.
## Tree-Abiding pseudo-elements
These pseudo-elements behave like regular elements, fitting seamlessly within the box model. They act as a child element that can be styled directly within the originating element hierarchy.
`::before`
    
Creates a pseudo-element that is the first child of the selected element.
`::after`
    
Creates a pseudo-element that is the last child of the selected element.
`::column`
    
Each column fragment of a multi-column layout.
`::marker`
    
The automatically generated marker box of a list item.
`::backdrop`
    
The backdrop of the originating element rendered in the top layer.
`::scroll-button()`
    
Creates a button that can control the scrolling of the scroll container to which it is applied.
`::scroll-marker`
    
Creates a pseudo-element that is a scroll marker — a scroll target button for its originating element nested in a scroll-marker group.
`::scroll-marker-group`
    
Generates a container before or after a scroll container to contain the `::scroll-marker` pseudo-elements generated on the element or its descendants.
## Element-backed pseudo-elements
These pseudo-elements are real elements that are not otherwise selectable.
`::details-content`
    
The expandable/collapsible contents of a `<details>` element.
`::part()`
    
Any element within a shadow tree that has a matching `part` attribute.
`::slotted()`
    
Any element placed into a slot inside an HTML template.
## Form-related pseudo-elements
The pseudo-elements are related to form controls.
`::checkmark`
    
Targets the checkmark placed inside the currently-selected `<option>` element of a customizable select element to provide a visual indication of which one is selected.
`::file-selector-button`
    
The button of an `<input>` of `type="file"`.
`::picker()`
    
The picker part of an element, for example the drop-down picker of a customizable select element.
`::picker-icon`
    
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 that points down when the select is closed.
`::placeholder`
    
The placeholder text in an input field.
## Alphabetical index
Pseudo-elements defined by a set of CSS specifications include the following:
A
  * `::after`


B
  * `::backdrop`
  * `::before`


C
  * `::column`
  * `::checkmark`
  * `::cue` (and `::cue()`)


D
  * `::details-content`


F
  * `::file-selector-button`
  * `::first-letter`
  * `::first-line`


G
  * `::grammar-error`


H
  * `::highlight()`


M
  * `::marker`


P
  * `::part()`
  * `::picker()`
  * `::picker-icon`
  * `::placeholder`


S
  * `::scroll-button()`
  * `::scroll-marker`
  * `::scroll-marker-group`
  * `::selection`
  * `::slotted()`
  * `::spelling-error`


T
  * `::target-text`


V
  * `::view-transition`
  * `::view-transition-image-pair()`
  * `::view-transition-group()`
  * `::view-transition-new()`
  * `::view-transition-old()`


## Nesting pseudo-elements
You can chain some pseudo-element selectors together to style pseudo-elements nested inside other pseudo-elements. The following nested pseudo-element combinations are supported:
  * `::after`
    * `::after::marker`: Selects the `::marker` pseudo-element of an `::after` pseudo-element, when `::after` is styled as a list item, with `display: list-item`.
  * `::before`
    * `::before::marker`: Selects the `::marker` pseudo-element of a `::before` pseudo-element, when `::before` is styled as a list item, with `display: list-item`.


Check out the individual pseudo-element reference pages for examples and browser compatibility information.
## Highlight pseudo-elements inheritance
Highlight pseudo-elements, such as `::selection`, `::target-text`, `::highlight()`, `::spelling-error`, and `::grammar-error`, follow a consistent inheritance model that differs from regular element inheritance.
When you apply styles to highlight pseudo-elements, they inherit from both:
  1. Their parent elements (following normal inheritance).
  2. The highlight pseudo-elements of their parent elements (following highlight inheritance).


This means that if you style both a parent element's highlight pseudo-element and a child element's highlight pseudo-element, the child's highlighted text will combine properties from both sources.
Here is a concrete example.
First, we have some HTML that includes two nested `<div>` elements. Some of the included text content is contained directly inside the parent `<div>`, and some is nested inside the child `<div>`.
    
    <div class="parent">
      Parent text
      <div class="child">Child text</div>
    </div>
    
Next we include some CSS, which selects the parent and child `<div>` elements separately and gives them different `color` values, and selects the parent and child's selected text (`::selection`). This gives each `<div>` a different `background-color` and sets a different text `color` on the parent selection.
    
    /* Style for the parent element */
    .parent {
      color: blue;
    }
    
    /* Style for the parent's selected text */
    .parent::selection {
      background-color: yellow;
      color: red;
    }
    
    /* Style for the child element */
    .child {
      color: green;
    }
    
    /* Style for the child's selected text */
    .child::selection {
      background-color: orange;
    }
    
The example renders as follows:
Try selecting the text in both the parent and child elements. Notice that:
  1. When you select the parent text, it uses the yellow background and red text color defined in `.parent::selection`.
  2. When you select the child text, it uses: 
     * The orange background from `.child::selection`.
     * The red text color inherited from the parent's `::selection` pseudo-element.


This demonstrates how the child's highlight pseudo-element inherits from both its parent element and the parent's highlight pseudo-element.
CSS custom properties (variables) in highlight pseudo-elements inherit from their originating element (the element they're being applied to), not through the highlight inheritance chain. For example:
    
    :root {
      --selection-color: lightgreen;
    }
    
    ::selection {
      color: var(--selection-color);
    }
    
    .blue {
      --selection-color: blue;
    }
    
When using the universal selector with highlight pseudo-elements, it prevents highlight inheritance. For example:
    
    /* This prevents highlight inheritance */
    *::selection {
      color: lightgreen;
    }
    
    /* Prefer this to allow inheritance */
    :root::selection {
      color: lightgreen;
    }
    
# grid-auto-flow
The `grid-auto-flow` CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid.
## Try it
    
    grid-auto-flow: row;
    
    
    grid-auto-flow: column;
    
    
    grid-auto-flow: row dense;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element > div:nth-child(1) {
      grid-column: auto / span 2;
    }
    
    #example-element > div:nth-child(2) {
      grid-column: auto / span 2;
    }
    
Note: The `masonry-auto-flow` property was dropped from CSS Masonry layout in favor of `grid-auto-flow`. See csswg-drafts #10231 for details.
## Syntax
    
    /* Keyword values */
    grid-auto-flow: row;
    grid-auto-flow: column;
    grid-auto-flow: dense;
    grid-auto-flow: row dense;
    grid-auto-flow: column dense;
    
    /* Global values */
    grid-auto-flow: inherit;
    grid-auto-flow: initial;
    grid-auto-flow: revert;
    grid-auto-flow: revert-layer;
    grid-auto-flow: unset;
    
This property may take one of two forms:
  * a single keyword: one of `row`, `column`, or `dense`.
  * two keywords: `row dense` or `column dense`.


### Values
`row`
    
Items are placed by filling each row in turn, adding new rows as necessary. If neither `row` nor `column` is provided, `row` is assumed.
`column`
    
Items are placed by filling each column in turn, adding new columns as necessary.
`dense`
    
"dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause items to appear out-of-order, when doing so would fill in holes left by larger items.
If it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. This ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items.
## Examples
>
### Setting grid auto-placement
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
      <div id="item4"></div>
      <div id="item5"></div>
    </div>
    <select id="direction">
      <option value="column">column</option>
      <option value="row">row</option>
    </select>
    <input id="dense" type="checkbox" />
    <label for="dense">dense</label>
    
#### CSS
    
    #grid {
      height: 200px;
      width: 200px;
      display: grid;
      gap: 10px;
      grid-template: repeat(4, 1fr) / repeat(2, 1fr);
      grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */
    }
    
    #item1 {
      background-color: lime;
      grid-row-start: 3;
    }
    
    #item2 {
      background-color: yellow;
    }
    
    #item3 {
      background-color: blue;
    }
    
    #item4 {
      grid-column-start: 2;
      background-color: red;
    }
    
    #item5 {
      background-color: aqua;
    }
    
#### Result
# border-top-color
The `border-top-color` CSS property sets the color of an element's top border. It can also be set with the shorthand CSS properties `border-color` or `border-top`.
## Try it
    
    border-top-color: red;
    
    
    border-top-color: #32a1ce;
    
    
    border-top-color: rgb(170 50 220 / 0.6);
    
    
    border-top-color: hsl(60 90% 50% / 0.8);
    
    
    border-top-color: transparent;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <color> values */
    border-top-color: red;
    border-top-color: #ffbb00;
    border-top-color: rgb(255 0 0);
    border-top-color: hsl(100deg 50% 25% / 75%);
    border-top-color: currentColor;
    border-top-color: transparent;
    
    /* Global values */
    border-top-color: inherit;
    border-top-color: initial;
    border-top-color: revert;
    border-top-color: revert-layer;
    border-top-color: unset;
    
The `border-top-color` property is specified as a single value.
### Values
`<color>`
    
The color of the top border.
## Examples
>
### A div with a border
#### HTML
    
    <div class="my-box">
      <p>
        This is a box with a border around it. Note which side of the box is
        <span class="red-text">red</span>.
      </p>
    </div>
    
#### CSS
    
    .my-box {
      border: solid 0.3em gold;
      border-top-color: red;
      width: auto;
    }
    
    .red-text {
      color: red;
    }
    
#### Result
# padding-bottom
The `padding-bottom` CSS property sets the height of the padding area on the bottom of an element.
## Try it
    
    padding-bottom: 1em;
    
    
    padding-bottom: 10%;
    
    
    padding-bottom: 20px;
    
    
    padding-bottom: 1ch;
    
    
    padding-bottom: 0;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
    }
    
An element's padding area is the space between its content and its border.
Note: The `padding` property can be used to set paddings on all four sides of an element with a single declaration.
## Syntax
    
    /* <length> values */
    padding-bottom: 0.5em;
    padding-bottom: 0;
    padding-bottom: 2cm;
    
    /* <percentage> value */
    padding-bottom: 10%;
    
    /* Global values */
    padding-bottom: inherit;
    padding-bottom: initial;
    padding-bottom: revert;
    padding-bottom: revert-layer;
    padding-bottom: unset;
    
The `padding-bottom` property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Examples
>
### Setting padding bottom with pixels and percentages
    
    .content {
      padding-bottom: 5%;
    }
    .side-box {
      padding-bottom: 10px;
    }
    
# corner-inline-start-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-inline-start-shape` CSS property specifies the shape of both the corners on a box's inline-start edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-inline-start-shape` property is a shorthand for the following physical properties:
  * `corner-start-start-shape`
  * `corner-end-start-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-inline-start-shape: round;
    corner-inline-start-shape: bevel;
    
    /* Single superellipse() value set for both corners */
    corner-inline-start-shape: superellipse(0.5);
    corner-inline-start-shape: superellipse(-3);
    
    /* Block-start/inline-start corner, block-end/inline-start corner */
    corner-inline-start-shape: round bevel;
    corner-inline-start-shape: round superellipse(0.5);
    
    /* Global values */
    corner-inline-start-shape: inherit;
    corner-inline-start-shape: initial;
    corner-inline-start-shape: revert;
    corner-inline-start-shape: revert-layer;
    corner-inline-start-shape: unset;
    
### Values
The `corner-inline-start-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both inline-start corners.
  * If two values are used, the first one specifies the shape of the block-start/inline-start corner, and the second one specifies the shape of the block-end/inline-start corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-inline-start-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of 60 pixels, and a `corner-inline-start-shape` of `square bevel`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px;
      corner-inline-start-shape: square bevel;
    }
    
#### Result
The rendered result looks like this:
# corner-top-left-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-top-left-shape` CSS property specifies the shape of a box's top-left corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-top-left-shape: notch;
    corner-top-left-shape: squircle;
    
    /* superellipse() function values */
    corner-top-left-shape: superellipse(3);
    corner-top-left-shape: superellipse(-1.5);
    
    /* Global values */
    corner-top-left-shape: inherit;
    corner-top-left-shape: initial;
    corner-top-left-shape: revert;
    corner-top-left-shape: revert-layer;
    corner-top-left-shape: unset;
    
### Values
The `corner-top-left-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-top-left-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `25% 100px`, and a `corner-top-left-shape` of `scoop`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 25% 100px;
      corner-top-left-shape: scoop;
    }
    
#### Result
The rendered result looks like this:
# CSS conditional rules
The CSS conditional rules module defines CSS media and support queries, enabling you to define styles that are only applied if specific conditions are met. The conditional rules defined in this module are based on device, user-agent, and viewport capabilities. With conditional rules, you can target CSS styles based on query values or browser and device features, independent of the document being rendered.
The first CSS conditional rules were media types specifying the intended destination medium for the linked styles, for example `screen` or `print`. These were set as the value of the HTML `<link>` and `<style>` elements' `media` attributes or as a comma-separated list of media types within an `@import` statement or at-rule. The ability to conditionally apply CSS rules has been greatly expanded since the CSS 2.1 and HTML 4.01 implementations that limited conditional queries to a few media types.
CSS conditional rules now include feature queries; the `@supports` at-rule enables targeting CSS styles based on a user-agent's CSS capabilities. Additional conditions include which selector, font-formats, and font-techs are supported.
The CSS conditional rules module also expands `@media` to enable nesting at-rules, with the related CSS media queries module removing unused media types and adding many media features and conditions that can be targeted.
The CSS container queries module defines similar conditional rules, but based on an element's parent rather than the viewport.
There are plans to further extend possible queries by adding the generalized conditional rule `@when` and the chained conditional rule `@else`. These two at-rules are not yet supported.
## Reference
>
### Properties
  * `container`
  * `container-name`
  * `container-type`


### At-rules
  * `@container`
  * `@media`
  * `@supports`


The CSS conditional rules module also introduces the `@else` and `@when` at-rules. Currently, no browsers support these features.
### Functions
  * `style()`
  * `font-tech()`
  * `font-format()`
  * `selector()`
  * `supports()`


The CSS conditional rules module also introduces a `media()` CSS function. Currently, no browsers support this feature.
### data types
  * `<container-name>`
  * `<style-feature>`
  * Container relative `<length>` units
  * `<media-query>`
  * `<supports-condition>`
  * `<supports-feature>` (see `supports()`)


### Interfaces
  * `CSSConditionRule`
  * `CSSMediaRule`
  * `CSSSupportsRule`
  * `supports()` method


### Terms and glossary definitions
  * Media
  * Supports query (See feature query)


## Guides
Using CSS feature queries
    
Selectively applying CSS rules after checking browser support for the specified properties and values via feature queries.
Using CSS media queries
    
Introduces media queries, their syntax, and the operators and media features that are used to construct media query expressions.
Supporting older browsers: feature queries
    
How to use feature queries to target CSS based on the browser's level of support for web features.
Browser feature detection: CSS `@supports`
    
A look at JavaScript and CSS feature detection, including CSS `@supports`.
Using container scroll-state queries
    
Using container scroll-state queries, with an example of each type.
## Related concepts
  * CSS cascading and inheritance module
    * `@import` at-rule
  * CSS media queries module
    * `<media-feature>`
    * `<media-type>`
    * `<media-condition>`
    * `<media-query-list>`
    * CSS logical operators (`not`, `or`, and `and`)
  * CSSOM view module
    * `CSS` API
    * `CSSGroupingRule` API
    * `MediaQueryList` API
    * `CSSRule` API
    * `MediaList` interface 
      * `MediaList.mediaText` property
  * CSS syntax module
    * `@charset` declaration
    * `at-rule` term
    * `invalid` term
    * parse term
    * style rule term
  * CSS namespaces module
    * `@namespace` at-rule


# margin-inline-end
The `margin-inline-end` CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    margin-inline-end: 20px;
    writing-mode: horizontal-tb;
    
    
    margin-inline-end: 20px;
    writing-mode: vertical-rl;
    
    
    margin-inline-end: 20%;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div id="container">
        <div class="col">One</div>
        <div class="col transition-all" id="example-element">Two</div>
        <div class="col">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      justify-content: flex-start;
    }
    
    .col {
      width: 33.33%;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    margin-inline-end: 10px; /* An absolute length */
    margin-inline-end: 1em; /* relative to the text size */
    margin-inline-end: 5%; /* relative to the nearest block container's width */
    margin-inline-end: anchor-size(height);
    margin-inline-end: calc(anchor-size(--my-anchor self-inline, 25px) / 5);
    
    /* Keyword values */
    margin-inline-end: auto;
    
    /* Global values */
    margin-inline-end: inherit;
    margin-inline-end: initial;
    margin-inline-end: revert;
    margin-inline-end: revert-layer;
    margin-inline-end: unset;
    
It relates to `margin-block-start`, `margin-block-end`, and `margin-inline-start`, which define the other margins of the element.
### Values
The `margin-inline-end` property takes the same values as the `margin-left` property.
## Examples
>
### Setting inline end margin
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      margin-inline-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# CSS color adjustment
The CSS color adjustment module provides a model and controls automatic color adjustment by the user agent to handle user preferences, such as "Dark Mode", contrast adjustment, and other color scheme preferences.
Together with the `@media` features `prefers-color-scheme`, `prefers-contrast` and `forced-colors`, this module defines how and when colors are automatically adjusted by the browser.
## Reference
>
### Properties
  * `color-scheme`
  * `forced-color-adjust`
  * `print-color-adjust`


## Related concepts
  * `<color>` CSS data type
  * Related `@media` features: 
    * `prefers-color-scheme`
    * `prefers-contrast`
    * `forced-colors`
  * Properties affected by forced colors mode 
    * `accent-color`
    * `background-color`
    * `background-image`
    * `border-color`
    * `box-shadow`
    * `caret-color`
    * `color`
    * `color-scheme`
    * `column-rule-color`
    * `fill`
    * `flood-color`
    * `flood-opacity`
    * `lighting-color`
    * `outline-color`
    * `scrollbar-color`
    * `stop-color`
    * `stroke`
    * `text-decoration-color`
    * `text-emphasis-color`
    * `text-shadow`
    * `-webkit-tap-highlight-color`


# corner-block-start-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-block-start-shape` CSS property specifies the shape of both the corners on a box's block-start edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-block-start-shape` property is a shorthand for the following physical properties:
  * `corner-start-start-shape`
  * `corner-start-end-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-block-start-shape: notch;
    corner-block-start-shape: squircle;
    
    /* Single superellipse() value set for both corners */
    corner-block-start-shape: superellipse(2.7);
    corner-block-start-shape: superellipse(-2.5);
    
    /* Block-start/inline-start corner, block-start/inline-end corner */
    corner-block-start-shape: notch squircle;
    corner-block-start-shape: notch superellipse(-2.5);
    
    /* Global values */
    corner-block-start-shape: inherit;
    corner-block-start-shape: initial;
    corner-block-start-shape: revert;
    corner-block-start-shape: revert-layer;
    corner-block-start-shape: unset;
    
### Values
The `corner-block-start-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both block-start corners.
  * If two values are used, the first one specifies the shape of the block-start/inline-start corner, and the second one specifies the shape of the block-start/inline-end corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-block-start-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `40px 60px`, and a `corner-block-start-shape` of `scoop notch`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 40px 60px;
      corner-block-start-shape: scoop notch;
    }
    
#### Result
The rendered result looks like this:
# cross-fade()
The `cross-fade()` CSS function can be used to blend two or more images at a defined transparency. It can be used for many basic image manipulations, such as tinting an image with a solid color or highlighting a particular area of the page by combining an image with a radial gradient.
## Syntax
Warning: The specification and current implementations have different syntaxes. The specification syntax is explained first.
### Specification syntax
The `cross-fade()` function takes a list of images with a percentage defining how much of each image is retained in terms of opacity when it is blended with the other images. The percent value must be coded without quotes, must contain the `'%'` symbol, and its value must be between 0% and 100%.
The function can be used in CSS anywhere an ordinary image reference can be used.
#### Cross-fade percentages
Think of the percentage as an opacity value for each image. This means a value of 0% means the image is fully transparent while a value of 100% makes the image fully opaque.
    
    cross-fade(url("white.png") 0%, url("black.png") 100%); /* fully black */
    cross-fade(url("white.png") 25%, url("black.png") 75%); /* 25% white, 75% black */
    cross-fade(url("white.png") 50%, url("black.png") 50%); /* 50% white, 50% black */
    cross-fade(url("white.png") 75%, url("black.png") 25%); /* 75% white, 25% black */
    cross-fade(url("white.png") 100%, url("black.png") 0%); /* fully white */
    cross-fade(url("green.png") 75%, url("red.png") 75%); /* both green and red at 75% */
    
If any percentages are omitted, all the specified percentages are summed together and subtracted from `100%`. If the result is greater than 0%, the result is then divided equally between all images with omitted percentages.
In the simplest case, two images are faded between each other. To do that, only one of the images needs to have a percentage, the other one will be faded accordingly. For example, a value of 0% defined for the first image yields only the second image, while 100% yields only the first. A 25% value renders the first image at 25% and the second at 75%. The 75% value is the inverse, showing the first image at 75% and the second at 25%.
The above could also have been written as:
    
    cross-fade(url("white.png") 0%, url("black.png")); /* fully black */
    cross-fade(url("white.png") 25%, url("black.png")); /* 25% white, 75% black */
    cross-fade(url("white.png"), url("black.png")); /* 50% white, 50% black */
    cross-fade(url("white.png") 75%, url("black.png")); /* 75% white, 25% black */
    cross-fade(url("white.png") 100%, url("black.png")); /* fully white */
    cross-fade(url("green.png") 75%, url("red.png") 75%); /* both green and red at 75% */
    
If no percentages are declared, both the images will be 50% opaque, with a cross-fade rendering as an even merge of both images. The 50%/50% example seen above did not need to have the percentages listed, as when a percentage value is omitted, the included percentages are added together and subtracted from 100%. The result, if greater than 0, is then divided equally between all images with omitted percentages.
In the last example, the sum of both percentages is not 100%, and therefore both images include their respective opacities.
If no percentages are declared and three images are included, each image will be 33.33% opaque. The two following are lines (almost) identical:
    
    cross-fade(url("red.png"), url("yellow.png"), url("blue.png")); /* all three will be 33.3333% opaque */
    cross-fade(url("red.png") 33.33%, url("yellow.png") 33.33%, url("blue.png") 33.33%);
    
### Older, implemented syntax
    
    cross-fade( <image>, <image>, <percentage> )
    
The specification for the `cross-fade()` function allows for multiple images and for each image to have transparency values independent of the other values. This was not always the case. The original syntax, which has been implemented in some browsers, only allowed for two images, with the sum of the transparency of those two images being exactly 100%. The original syntax is supported in Safari and supported with the `-webkit-` prefix in Chrome, Opera, and other blink-based browsers.
    
    cross-fade(url("white.png"), url("black.png"), 0%);   /* fully black */
    cross-fade(url("white.png"), url("black.png"), 25%);  /* 25% white, 75% black */
    cross-fade(url("white.png"), url("black.png"), 50%);  /* 50% white, 50% black */
    cross-fade(url("white.png"), url("black.png"), 75%);  /* 75% white, 25% black */
    cross-fade(url("white.png"), url("black.png"), 100%); /* fully white */
    
In the implemented syntax, the two comma-separated images are declared first, followed by a comma and required percent value. Omitting the comma or percent invalidates the value. The percent is the opacity of the first declared image. The included percentage is subtracted from 100%, with the difference being the opacity of the second image.
The green/red example (with the percentages totaling 150%) and the yellow/red/blue example (with three images) from the specification syntax section, are not possible in this implementation.
## Accessibility
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. When using background images, make sure the contrast in color is great enough that any text is legible over the image as well as if the images are missing.
  * MDN Understanding WCAG, Guideline 1.1 explanations
  * Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0


## Examples
>
### Older syntax for cross-fade
#### HTML
    
    <div class="cross-fade"></div>
    
#### CSS
    
    .cross-fade {
      width: 300px;
      height: 300px;
      background-image: -webkit-cross-fade(url("br.png"), url("tr.png"), 75%);
      background-image: cross-fade(url("br.png"), url("tr.png"), 75%);
    }
    
#### Result
# scroll-margin-inline-start
The `scroll-margin-inline-start` property defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-inline-start: 0;
    
    
    scroll-margin-inline-start: 20px;
    
    
    scroll-margin-inline-start: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-inline-start: 10px;
    scroll-margin-inline-start: 1em;
    
    /* Global values */
    scroll-margin-inline-start: inherit;
    scroll-margin-inline-start: initial;
    scroll-margin-inline-start: revert;
    scroll-margin-inline-start: revert-layer;
    scroll-margin-inline-start: unset;
    
### Values
`<length>`
    
An outset from the inline start edge of the scroll container.
## Examples
>
### Basic demonstration
This example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
The aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block.
#### HTML
The HTML includes a scroller with four children:
    
    <div class="scroller">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
    </div>
    
#### CSS
Let's walk through the CSS. The outer container is styled like this:
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
The main parts relevant to the scroll snapping are `overflow-x: scroll`, which makes sure the contents will scroll and not be hidden, and `scroll-snap-type: x mandatory`, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
The child elements are styled as follows:
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(2n) {
      background-color: white;
      color: rebeccapurple;
    }
    
The most relevant part here is `scroll-snap-align: start`, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points.
Last of all we specify the scroll margin-values, a different one for the second and third child elements:
    
    .scroller > div:nth-child(2) {
      scroll-margin-inline-start: 1rem;
    }
    
    .scroller > div:nth-child(3) {
      scroll-margin-inline-start: 2rem;
    }
    
This means that when scrolling past the middle child elements, the scrolling will snap to `1rem` outside the inline start edge of the second `<div>`, and `2rems` outside the inline start edge of the third `<div>`.
#### Result
Try it for yourself:
# :active-view-transition
The `:active-view-transition` CSS pseudo-class matches the root element of a document when a view transition is in progress (active) and stops matching once the transition has completed.
## Syntax
    
    :root:active-view-transition ... {
      /* ... */
    }
    
## Examples
>
### Styling an active view transition
This example extends on the same-document view transition example on the `startViewTransition` page.
    
    <main>
      <section class="color">
        <h2>Color is changing!</h2>
      </section>
      <button id="change-color">Change Color</button>
    </main>
    
A `<h2>` element initially has a `display: none` style, and this is overwritten using the `:active-view-transition` pseudo-class setting the `<h2>` style to `display: block`. The button is hidden using `visibility: hidden`, when the view transition is in progress:
    
    h2 {
      display: none;
      color: white;
    }
    :root:active-view-transition h2 {
      display: block;
    }
    :root:active-view-transition button {
      visibility: hidden;
    }
    
# border-right-style
The `border-right-style` CSS property sets the line style of an element's right `border`.
## Try it
    
    border-right-style: none;
    
    
    border-right-style: dotted;
    
    
    border-right-style: dashed;
    
    
    border-right-style: solid;
    
    
    border-right-style: groove;
    
    
    border-right-style: inset;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
    body {
      background-color: white;
    }
    
Note: The specification doesn't define how borders of different styles connect in the corners.
## Syntax
    
    /* Keyword values */
    border-right-style: none;
    border-right-style: hidden;
    border-right-style: dotted;
    border-right-style: dashed;
    border-right-style: solid;
    border-right-style: double;
    border-right-style: groove;
    border-right-style: ridge;
    border-right-style: inset;
    border-right-style: outset;
    
    /* Global values */
    border-right-style: inherit;
    border-right-style: initial;
    border-right-style: revert;
    border-right-style: revert-layer;
    border-right-style: unset;
    
The `border-right-style` property is specified as a single `<line-style>` keyword value.
## Examples
>
### Border styles
#### HTML
    
    <table>
      <tr>
        <td class="b1">none</td>
        <td class="b2">hidden</td>
        <td class="b3">dotted</td>
        <td class="b4">dashed</td>
      </tr>
      <tr>
        <td class="b5">solid</td>
        <td class="b6">double</td>
        <td class="b7">groove</td>
        <td class="b8">ridge</td>
      </tr>
      <tr>
        <td class="b9">inset</td>
        <td class="b10">outset</td>
      </tr>
    </table>
    
#### CSS
    
    /* Define look of the table */
    table {
      border-width: 2px;
      background-color: #52e385;
    }
    tr,
    td {
      padding: 3px;
    }
    
    /* border-right-style example classes */
    .b1 {
      border-right-style: none;
    }
    .b2 {
      border-right-style: hidden;
    }
    .b3 {
      border-right-style: dotted;
    }
    .b4 {
      border-right-style: dashed;
    }
    .b5 {
      border-right-style: solid;
    }
    .b6 {
      border-right-style: double;
    }
    .b7 {
      border-right-style: groove;
    }
    .b8 {
      border-right-style: ridge;
    }
    .b9 {
      border-right-style: inset;
    }
    .b10 {
      border-right-style: outset;
    }
    
#### Result
# font-variation-settings
The `font-variation-settings` CSS property provides low-level control over variable font characteristics by letting you specify the four letter axis names of the characteristics you want to vary along with their values.
## Try it
    
    font-variation-settings: "wght" 50;
    
    
    font-variation-settings: "wght" 850;
    
    
    font-variation-settings: "wdth" 25;
    
    
    font-variation-settings: "wdth" 75;
    
    
    <section id="default-example">
      <p id="example-element">
        ...it would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: Amstelvar;
      font-style: normal;
    }
    
    p {
      font-size: 1.5rem;
      font-family: Amstelvar, serif;
    }
    
## Syntax
    
    /* Use the default settings */
    font-variation-settings: normal;
    
    /* Set values for variable font axis names */
    font-variation-settings: "xhgt" 0.7;
    
    /* Global values */
    font-variation-settings: inherit;
    font-variation-settings: initial;
    font-variation-settings: revert;
    font-variation-settings: revert-layer;
    font-variation-settings: unset;
    
### Values
This property's value can take one of two forms:
`normal`
    
Text is laid out using default settings.
`<string> <number>`
    
When rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features. Each setting is always one or more pairs consisting of a `<string>` of 4 ASCII characters followed by a `<number>` indicating the axis value to set. If the `<string>` has more or fewer characters or contains characters outside the U+20 - U+7E code point range, the whole property is invalid. The `<number>` can be fractional or negative, depending on the value range available in your font, as defined by the font designer.
## Description
This property is a low-level mechanism designed to set variable font features where no other way to enable or access those features exist. You should only use it when no basic properties exist to set those features (e.g., `font-weight`, `font-style`).
Font characteristics set using `font-variation-settings` will always override those set using the corresponding basic font properties, e.g., `font-weight`, no matter where they appear in the cascade. In some browsers, this is currently only true when the `@font-face` declaration includes a `font-weight` range.
### Registered and custom axes
Variable font axes come in two types: registered and custom.
Registered axes are the most commonly encountered — common enough that the authors of the specification felt they were worth standardizing. Note that this doesn't mean that the author has to include all of these in their font.
Here are the registered axes along with their corresponding CSS properties:
Axis Tag CSS Property  
"wght" `font-weight`  
"wdth" `font-stretch`  
"slnt" (slant) `font-style`: `oblique + angle`  
"ital" `font-style`: `italic`  
"opsz" `font-optical-sizing`  
Custom axes can be anything the font designer wants to vary in their font, for example ascender or descender heights, the size of serifs, or anything else they can imagine. Any axis can be used as long as it is given a unique 4-character axis. Some will end up becoming more common, and may even become registered over time.
Note: Registered axis tags are identified using lower-case tags, whereas custom axes should be given upper-case tags. Note that font designers aren't forced to follow this practice in any way, and some won't. The important takeaway here is that axis tags are case-sensitive.
To use variable fonts on your operating system, you need to make sure that it is up to date. For example Linux OSes need the latest Linux FreeType version, and macOS before 10.13 does not support variable fonts. If your operating system is not up to date, you will not be able to use variable fonts in web pages or the Firefox Developer Tools.
## Examples
You can find a number of other variable font examples in our Variable fonts guide.
### Controlling variable font weight (wght)
Click "Play" in the code blocks below to edit the example in the MDN Playground.Edit the CSS to play with different font weight values. See what happens when you specify a value outside the weight range.
    
    /* weight range is 300 to 900 */
    .p1 {
      font-weight: 625;
    }
    
    /* weight range is 300 to 900 */
    .p2 {
      font-variation-settings: "wght" 625;
    }
    
    /* Adjust with slider & custom property */
    .p3 {
      font-variation-settings: "wght" var(--text-axis);
    }
    
### Controlling variable font slant (slnt)
Click "Play" in the code blocks below to edit the example in the MDN Playground.Edit the CSS to play with different font slant/oblique values.
    
    /* slant range is from 0deg to 12deg */
    .p1 {
      font-style: oblique 14deg;
    }
    
    /* slant range is from 0 to 12 */
    .p2 {
      font-variation-settings: "slnt" 12;
    }
    
    /* Adjust with slider & custom property */
    .p3 {
      font-variation-settings: "slnt" var(--text-axis);
    }
    
# :muted
The `:muted` CSS pseudo-class selector represents an element that is capable of making sound, such as `<audio>` or `<video>`, but is muted (forced silent).
Muted is different from `:volume-locked` in that the page author has control over whether a media element can be muted or un-muted. User agents may set media `muted` value according to use preferences (e.g., remembering the last set value across sessions, on a per-site basis, or otherwise). An element that is `:volume-locked` cannot be muted, un-muted, or have its volume changed via JavaScript because of an operating system or user agent preference.
## Syntax
    
    :muted {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :muted {
      outline: 5px solid red;
    }
    
    video:muted {
      outline: 5px solid blue;
    }
    
# column-count
The `column-count` CSS property breaks an element's content into the specified number of columns.
## Try it
    
    column-count: 2;
    
    
    column-count: 3;
    
    
    column-count: 4;
    
    
    column-count: auto;
    column-width: 8rem;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      width: 100%;
      text-align: left;
    }
    
## Syntax
    
    /* Keyword value */
    column-count: auto;
    
    /* <integer> value */
    column-count: 3;
    
    /* Global values */
    column-count: inherit;
    column-count: initial;
    column-count: revert;
    column-count: revert-layer;
    column-count: unset;
    
### Values
`auto`
    
The number of columns is determined by other CSS properties, such as `column-width`.
`<integer>`
    
Is a strictly positive `<integer>` describing the ideal number of columns into which the content of the element will be flowed. If the `column-width` is also set to a non-`auto` value, it merely indicates the maximum allowed number of columns.
## Examples
>
### Splitting a paragraph across three columns
#### HTML
    
    <p class="content-box">
      This is a bunch of text split into three columns using the CSS
      <code>column-count</code>
      property. The text is equally distributed over the columns.
    </p>
    
#### CSS
    
    .content-box {
      column-count: 3;
    }
    
#### Result
# contain-intrinsic-height
The `contain-intrinsic-height` CSS property sets the height of an element that a browser can use for layout when the element is subject to size containment.
## Syntax
    
    /* Keyword values */
    contain-intrinsic-height: none;
    
    /* <length> values */
    contain-intrinsic-height: 1000px;
    contain-intrinsic-height: 10rem;
    
    /* auto <length> */
    contain-intrinsic-height: auto 300px;
    
    /* Global values */
    contain-intrinsic-height: inherit;
    contain-intrinsic-height: initial;
    contain-intrinsic-height: revert;
    contain-intrinsic-height: revert-layer;
    contain-intrinsic-height: unset;
    
### Values
The following values may be specified for an element.
`none`
    
The element has no intrinsic height.
`<length>`
    
The element has the specified height (`<length>`).
`auto <length>`
    
A remembered value of the "normally rendered" element height if one exists and the element is skipping its contents (for example, when it is offscreen); otherwise the specified `<length>`.
## Description
The property is commonly applied alongside elements that can trigger size containment, such as `contain: size` and `content-visibility`, and may also be set using the `contain-intrinsic-size` shorthand property.
Size containment allows a user agent to lay out an element as though it had a fixed size, preventing unnecessary reflows by avoiding the re-rendering of child elements to determine the actual size (thereby improving user experience). By default, size containment treats elements as though they had no contents, and may collapse the layout in the same way as if the contents had no height (or width). The `contain-intrinsic-height` property allows authors to specify an appropriate value to be used as the height for layout.
The `auto <length>` value allows the height of the element to be stored if the element is ever "normally rendered" (with its child elements), and then used instead of the specified height when the element is skipping its contents. This allows offscreen elements with `content-visibility: auto` to benefit from size containment without developers having to be as precise in their estimates of element size. The remembered value is not used if the child elements are being rendered (if size containment is enabled, the `<length>` will be used).
## Examples
In addition to the example below, the `contain-intrinsic-size` page contains a live example that demonstrates the effect of modifying the intrinsic width and height.
### Setting the intrinsic height
The HTML below defines an element "contained_element" that will be subject to size constraint, and which contains a child element.
    
    <div id="contained_element">
      <div class="child_element"></div>
    </div>
    
The CSS below sets the `content-visibility` of `contained_element` to `auto`, so if the element is hidden it will be size constrained. The width and height that are used when it is size constrained are set at the same time using `contain-intrinsic-width` and `contain-intrinsic-height`, respectively.
    
    #contained_element {
      border: 2px solid green;
      width: 151px;
      content-visibility: auto;
      contain-intrinsic-width: 152px;
      contain-intrinsic-height: 52px;
    }
    .child_element {
      border: 1px solid red;
      background: blue;
      height: 50px;
      width: 150px;
    }
    
# border-inline
The `border-inline` CSS property is a shorthand property for setting the individual logical inline border property values in a single place in the style sheet.
## Try it
    
    border-inline: solid;
    writing-mode: horizontal-tb;
    
    
    border-inline: dashed red;
    writing-mode: vertical-rl;
    
    
    border-inline: 1rem solid;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The physical borders to which `border-inline` maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top` and `border-bottom` or `border-right`, and `border-left` properties, depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
The borders in the other dimension can be set with `border-block`, which sets `border-block-start`, and `border-block-end`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-inline-color`
  * `border-inline-style`
  * `border-inline-width`


## Syntax
    
    border-inline: 1px;
    border-inline: 2px dotted;
    border-inline: medium dashed blue;
    
    /* Global values */
    border-inline: inherit;
    border-inline: initial;
    border-inline: revert;
    border-inline: revert-layer;
    border-inline: unset;
    
### Values
The `border-inline` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### Border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-inline: 5px dashed blue;
    }
    
#### Results
# <angle>
The `<angle>` CSS data type represents an angle value expressed in degrees, gradians, radians, or turns. It is used, for example, in `<gradient>`s and in some `transform` functions.
## Try it
    
    transform: rotate(45deg);
    
    
    transform: rotate(3.1416rad);
    
    
    transform: rotate(-50grad);
    
    
    transform: rotate(1.75turn);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This box can rotate to different angles.
      </div>
    </section>
    
    
    #example-element {
      background-color: #0118f3;
      padding: 0.75em;
      width: 180px;
      height: 120px;
      color: white;
    }
    
## Syntax
The `<angle>` data type consists of a `<number>` followed by one of the units listed below. As with all dimensions, there is no space between the unit literal and the number. The angle unit is optional after the number `0`.
Optionally, it may be preceded by a single `+` or `-` sign. Positive numbers represent clockwise angles, while negative numbers represent counterclockwise angles. For static properties of a given unit, any angle can be represented by various equivalent values. For example, `90deg` equals `-270deg`, and `1turn` equals `4turn`. For dynamic properties, like when applying an `animation` or `transition`, the effect will nevertheless be different.
### Units
`deg`
    
Represents an angle in degrees. One full circle is `360deg`. Examples: `0deg`, `90deg`, `14.23deg`.
`grad`
    
Represents an angle in gradians. One full circle is `400grad`. Examples: `0grad`, `100grad`, `38.8grad`.
`rad`
    
Represents an angle in radians. One full circle is 2π radians which approximates to `6.2832rad`. `1rad` is 180/π degrees. Examples: `0rad`, `1.0708rad`, `6.2832rad`.
`turn`
    
Represents an angle in a number of turns. One full circle is `1turn`. Examples: `0turn`, `0.25turn`, `1.2turn`.
## Examples
>
### Setting a clockwise right angle
`90deg = 100grad = 0.25turn ≈ 1.5708rad`  
### Setting a flat angle
`180deg = 200grad = 0.5turn ≈ 3.1416rad`  
### Setting a counterclockwise right angle
`-90deg = -100grad = -0.25turn ≈ -1.5708rad`  
### Setting a null angle
`0 = 0deg = 0grad = 0turn = 0rad`  
# <baseline-position>
The `<baseline-position>` enumerated value type represents the `baseline` keyword values and `first` and `last` modifiers, used for the `align-content`, `align-items`, `align-self`, `justify-items` and `justify-self` properties as well as the `place-content`, `place-items`, and `place-self` shorthand properties.
The `first` and `last` values give a box a baseline alignment preference, defaulting to `first` if the modifier is omitted.
## Syntax
    
    <baseline-position> = [ first | last ]? && baseline
    
## Values
The `<baseline-position>` enumerated value type is specified using an optional `first` or `last` modifier with the `baseline` value. If a box does not belong to a shared alignment context, then the fallback alignment is used. The fallback alignment is also used to align the baseline-sharing group within its alignment container.
`baseline`
    
Computes to `first baseline`, as defined below.
`first baseline`
    
Aligns the alignment baseline of the box's first baseline set with the corresponding baseline of its baseline-sharing group. The fallback alignment is `safe self-start` for self-alignment or `safe start` for content distribution.
`last baseline`
    
Aligns the alignment baseline of the box's last baseline set with the corresponding baseline of its baseline-sharing group. The fallback alignment is `safe self-end` for self-alignment or `safe end` for content distribution.
# ::-moz-range-progress
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-moz-range-progress` CSS pseudo-element is a Mozilla extension that represents the lower portion of the track (i.e., groove) in which the indicator slides in an `<input>` of `type="range"`. This portion corresponds to values lower than the value currently selected by the thumb (i.e., virtual knob).
Note: Using `::-moz-range-progress` with anything but an `<input type="range">` doesn't match anything and has no effect.
## Syntax
    
    ::-moz-range-progress {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <input type="range" min="0" max="100" step="5" value="50" />
    
### CSS
    
    input[type="range"]::-moz-range-progress {
      background-color: green;
      height: 1em;
    }
    
### Result
A progress bar using this style might look something like this:
Not part of any standard.
# <color-interpolation-method>
The `<color-interpolation-method>` CSS data type represents the color space used for interpolation between `<color>` values. It can be used to override the default interpolation color space for color-related functional notations such as `color-mix()` and `linear-gradient()`.
When interpolating `<color>` values, the interpolation color space defaults to Oklab.
## Syntax
The `<color-interpolation-method>` specifies whether interpolation should use a rectangular color space or a polar color space with an optional hue interpolation method:
    
    in <rectangular-color-space>
    // or
    in <polar-color-space>[ <hue-interpolation method>]
    
### Values
`<rectangular-color-space>`
    
One of the keywords `srgb`, `srgb-linear`, `display-p3`, `a98-rgb`, `prophoto-rgb`, `rec2020`, `lab`, `oklab`, `xyz`, `xyz-d50`, or `xyz-d65`.
`<polar-color-space>`
    
One of the keywords `hsl`, `hwb`, `lch`, or `oklch`.
`<hue-interpolation-method>` Optional
    
The algorithm for hue interpolation. It defaults to `shorter hue`.
`<custom-color-space>`
    
A `<dashed-ident>` referring to a custom @color profile.
## Examples
>
### Comparing interpolation color spaces using gradients
The following example shows the effect of using different interpolation color spaces for `linear-gradient()`.
#### HTML
    
    <div>sRGB:</div>
    <div class="gradient srgb"></div>
    <div>Oklab:</div>
    <div class="gradient oklab"></div>
    <div>Oklch (with <code>longer hue</code>):</div>
    <div class="gradient oklch-longer"></div>
    
#### CSS
    
    .gradient {
      height: 50px;
      width: 100%;
    }
    .srgb {
      background-image: linear-gradient(in srgb to right, blue, red);
    }
    .oklab {
      background-image: linear-gradient(in oklab to right, blue, red);
    }
    .oklch-longer {
      background-image: linear-gradient(in oklch longer hue to right, blue, red);
    }
    
#### Result
### Color interpolation in repeating gradients
The following example shows how to specify a color space when interpolating colors in repeating gradients. Three boxes show different types of repeating gradients using the `repeating-conic-gradient()`, `repeating-linear-gradient()`, and `repeating-radial-gradient()` functions. The first box uses the Lab color space to interpolate between two color values. The second and third boxes use Oklch and additionally provide a `<hue-interpolation-method>` to specify how to interpolate between hue values.
#### HTML
    
    <div class="gradient conic">conic</div>
    <div class="gradient linear">linear</div>
    <div class="gradient radial">radial</div>
    
#### CSS
We used the same two colors in each gradient to demonstrate the different effects of `<hue-interpolation-method>` and color space on color interpolation in gradients.
    
    .conic {
      background-image: repeating-conic-gradient(
        in lab,
        burlywood,
        blueviolet 120deg
      );
    }
    
    .linear {
      background-image: repeating-linear-gradient(
        in oklch,
        burlywood,
        blueviolet 75px
      );
    }
    
    .radial {
      background-image: repeating-radial-gradient(
        in oklch longer hue,
        blueviolet 50px,
        burlywood 100px
      );
    }
    
#### Result
Comparing the first and second boxes demonstrates the difference of interpolating between two colors in differing color spaces. Comparing the second and third boxes shows the difference between `<hue-interpolation-method>`s, with the linear gradient using the shorter method (default) and the radial gradient using the longer method.
# @namespace
`@namespace` is an at-rule that defines XML namespaces to be used in a CSS style sheet.
## Try it
    
    @namespace svg url("http://www.w3.org/2000/svg");
    
    a {
      color: orangered;
      text-decoration: underline dashed;
      font-weight: bold;
    }
    
    svg|a {
      fill: blueviolet;
      text-decoration: underline solid;
      text-transform: uppercase;
    }
    
    
    <p>
      <a href="#">This is an ordinary HTML link</a>
    </p>
    
    <svg width="250px" viewBox="0 0 250 20" xmlns="http://www.w3.org/2000/svg">
      <a href="#">
        <text x="0" y="15">This is a link created in SVG</text>
      </a>
    </svg>
    
## Syntax
    
    /* Default namespace */
    @namespace url("XML-namespace-URL");
    @namespace "XML-namespace-URL";
    
    /* Prefixed namespace */
    @namespace prefix url("XML-namespace-URL");
    @namespace prefix "XML-namespace-URL";
    
## Description
The defined namespaces can be used to restrict the universal, type, and attribute selectors to only select elements within that namespace. The `@namespace` rule is generally only useful when dealing with documents containing multiple namespaces—such as HTML with inline SVG or MathML, or XML that mixes multiple vocabularies.
Any `@namespace` rules must follow all `@charset` and `@import` rules, and precede all other at-rules and style declarations in a style sheet.
`@namespace` can be used to define the default namespace for the style sheet. When a default namespace is defined, all universal and type selectors (but not attribute selectors, see note below) apply only to elements in that namespace.
The `@namespace` rule can also be used to define a namespace prefix. When a universal, type, or attribute selector is prefixed with a namespace prefix, then that selector only matches if the namespace and name of the element or attribute matches.
In HTML, known foreign elements will automatically be assigned namespaces. This means that HTML elements will act as though they are in the XHTML namespace (`http://www.w3.org/1999/xhtml`), even if there is no `xmlns` attribute anywhere in the document, and the `<svg>` and `<math>` elements will be assigned their proper namespaces (`http://www.w3.org/2000/svg` and `http://www.w3.org/1998/Math/MathML`, respectively).
Note: In XML, unless a prefix is defined directly on an attribute (e.g., `xlink:href`), that attribute has no namespace. In other words, attributes do not inherit the namespace of the element they're on. To match this behavior, the default namespace in CSS does not apply to attribute selectors.
## Examples
>
### Specifying default and prefixed namespaces
    
    @namespace url("http://www.w3.org/1999/xhtml");
    @namespace svg url("http://www.w3.org/2000/svg");
    
    /* This matches all XHTML <a> elements, as XHTML is the default unprefixed namespace */
    a {
    }
    
    /* This matches all SVG <a> elements */
    svg|a {
    }
    
    /* This matches both XHTML and SVG <a> elements */
    *|a {
    }
    
# <corner-shape-value>
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `<corner-shape-value>` CSS data type describes the shape of a container corner. It is used by the `corner-shape` shorthand property and its constituent properties to specify the shape to apply to affected container corners.
## Syntax
The `<corner-shape-value>` data type can take a `superellipse()` function that defines a custom shape, or one of six keyword values that describe common `superellipse()` values.
### Values
`superellipse()`
    
Defines a custom corner superellipse shape. A negative parameter creates an inward, or concave, curve while a positive parameter creates an outward, or convex, curve.
Keywords
    
The available keyword values are as follows:
`bevel`
    
Defines a straight, diagonal corner, which is neither convex nor concave. The `bevel` keyword is equivalent to `superellipse(0)`.
`notch`
    
Defines a 90-degree concave square corner. The `notch` keyword is equivalent to `superellipse(-infinity)`.
`round`
    
Defines a convex ordinary ellipse, which is the standard rounded corner created by `border-radius` without a `corner-shape` applied. The `round` keyword is equivalent to `superellipse(1)`. This is the default (initial) value for all `corner-shape` properties.
`scoop`
    
Defines a concave ordinary ellipse. The `scoop` keyword is equivalent to `superellipse(-1)`.
`square`
    
Defines a 90-degree convex square corner, which is the default corner shape when no `border-radius` (or `border-radius: 0`) is applied. The `square` keyword is equivalent to `superellipse(infinity)`.
`squircle`
    
Defines a "squircle", which is a convex curve in between `round` and `square`. The `squircle` keyword is equivalent to `superellipse(2)`.
Note: You can smoothly animate between different `superellipse()` values, and between different corner shape keywords, as the animation interpolates between their `superellipse()` equivalents.
## Examples
>
###  `<corner-shape-value>` value comparison
In this example, we provide a drop-down menu allowing you to select different `<corner-shape-value>` values and a slider that updates the container's `border-radius`. This enables visualizing the effect of the different keywords and `superellipse()` parameter values.
The `corner-shape` property defines the shape of the box's corners while the region the shape is applied to is specified by the `border-radius` property. The code is hidden for brevity, but you can find a full explanation of `corner-shape` values along with other related examples on the `corner-shape` reference page.
Note: See also the `superellipse()` function value comparison example.
# corner-block-end-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-block-end-shape` CSS property specifies the shape of both the corners on a box's block-end edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-block-end-shape` property is a shorthand for the following physical properties:
  * `corner-end-start-shape`
  * `corner-end-end-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-block-end-shape: square;
    corner-block-end-shape: scoop;
    
    /* Single superellipse() value set for both corners */
    corner-block-end-shape: superellipse(3.5);
    corner-block-end-shape: superellipse(-1.9);
    
    /* Block-end/inline-start corner, block-end/inline-end corner */
    corner-block-end-shape: square scoop;
    corner-block-end-shape: square superellipse(-1.9);
    
    /* Global values */
    corner-block-end-shape: inherit;
    corner-block-end-shape: initial;
    corner-block-end-shape: revert;
    corner-block-end-shape: revert-layer;
    corner-block-end-shape: unset;
    
### Values
The `corner-block-end-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both block-end corners.
  * If two values are used, the first one specifies the shape of the block-end/inline-start corner, and the second one specifies the shape of the block-end/inline-end corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-block-end-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `80px / 40px`, and a `corner-block-end-shape` of `notch square`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 80px / 40px;
      corner-block-end-shape: notch square;
    }
    
#### Result
The rendered result looks like this:
# text-spacing-trim
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `text-spacing-trim` CSS property controls the internal spacing set on Chinese/Japanese/Korean (CJK) punctuation characters between adjacent characters (kerning) and at the start or end of text lines.
## Syntax
    
    /* Keyword values */
    text-spacing-trim: normal;
    text-spacing-trim: space-all;
    text-spacing-trim: space-first;
    text-spacing-trim: trim-start;
    
    /* Global values */
    text-spacing-trim: inherit;
    text-spacing-trim: initial;
    text-spacing-trim: revert;
    text-spacing-trim: revert-layer;
    text-spacing-trim: unset;
    
### Values
`<spacing-trim>`
    
Defines the different spacing trim options. Available values are:
`normal`
    
Sets CJK full-width opening punctuation characters to be full-width at the start of each line. Sets CJK full-width closing punctuation characters to be full-width at the end of each line, or half-width if they do not fit on the line before justification. Collapses spacing between punctuation characters.
`space-all`
    
All CJK full-width punctuation characters are set to be full-width.
`space-first`
    
Behaves as `normal`, except that CJK full-width opening punctuation characters are set to be full-width at the start of the first line of the text's block container, and the start of every subsequent line coming after an explicit line break such as a newline character.
`trim-start`
    
Behaves as `normal`, except that CJK full-width opening punctuation characters are set to be half-width at the start of each line.
Note: The CSS Text module also defines `trim-both`, `trim-all`, and `auto` values. However, these are not currently implemented in any browser.
## Description
The `text-spacing-trim` property applies spacing/kerning to CJK punctuation characters to produce visually pleasing typography as defined by the Requirements for Japanese text layout (JLREQ) and the Requirements for Chinese text layout (CLREQ).
Many CJK punctuation characters include glyph-internal spacing. For example, the CJK full stop and the CJK close parenthesis usually have glyph-internal spacing on their right-hand side, to give them a constant advance measure consistent with other ideographic characters. However, when they appear in a row, the glyph-internal spacing can become excessive.
`text-spacing-trim` can be used to adjust such excessive spacing between adjacent characters (kerning) and at the start or end of text lines. Generally speaking:
  * If a full-width punctuation character is set to be full-width, it has internal spacing set on both sides and is the full width of an ideograph.
  * If a full-width punctuation character is set to be half-width, it has internal spacing set on one side only, and its other side is flush to the start (in the case of opening punctuation characters) or end (in the case of closing punctuation characters). Half-width characters are typically half the width of an ideograph.


Note: To avoid the risk of excessive kerning, fonts must have the OpenType Alternate Half Widths (`halt`) feature, the Contextual Half-width Spacing (`chws`) feature, or both. If the font doesn't have either feature, `text-spacing-trim` is disabled.
### Full-width punctuation collapsing
When pairs of punctuation characters are adjacent to one another, the space between them is collapsed according to the following rules:
  * Set a full-width opening punctuation character to half-width if the previous character is a fullwidth opening punctuation character, a fullwidth middle dot, an ideographic space (U+3000), a fullwidth closing punctuation character of an equivalent or larger font size, or a character belonging to Unicode general category "Open punctuation" Ps. Otherwise, set it to full-width.
  * Set a full-width closing punctuation character to half-width if the next character is a fullwidth closing punctuation character, a fullwidth middle dot, an ideographic space (U+3000), a fullwidth opening punctuation character with larger font size, or a character belonging to Unicode general category "Close punctuation" (Pe). Otherwise, set it to full-width.


## Examples
>
###  `text-spacing-trim` value comparison
This example compares the effect of four different `text-spacing-trim` properties, applying them to four identical paragraphs so you can see the visual differences between each one.
#### HTML
    
    <main>
      <div id="normal">
        <h2>normal</h2>
        <p>
          （東）、【「（東）」】。<br />
          「東」「東」「東」東東東「東」。
        </p>
      </div>
      <div id="space-all">
        <h2>space-all</h2>
        <p>
          （東）、【「（東）」】。<br />
          「東」「東」「東」東東東「東」。
        </p>
      </div>
      <div id="space-first">
        <h2>space-first</h2>
        <p>
          （東）、【「（東）」】。<br />
          「東」「東」「東」東東東「東」。
        </p>
      </div>
      <div id="trim-start">
        <h2>trim-start</h2>
        <p>
          （東）、【「（東）」】。<br />
          「東」「東」「東」東東東「東」。
        </p>
      </div>
    </main>
    
#### CSS
    
    main {
      font-family:
        "Yu Gothic", "YuGothic", "Noto Sans JP", "Hiragino Sans",
        "Hiragino Kaku Gothic ProN", sans-serif;
      display: grid;
      gap: 0.5em;
      grid-template-columns: 1fr 1fr;
      width: 70%;
      margin: 0 auto;
    }
    h2 {
      font-size: 80%;
      margin: 0;
    }
    p {
      font-size: 20px;
      border: 1px solid blue;
      margin: 0;
    }
    #normal {
      text-spacing-trim: normal;
      grid-column: 1;
      grid-row: 1;
    }
    #space-all {
      text-spacing-trim: space-all;
      grid-column: 2;
      grid-row: 1;
    }
    #space-first {
      text-spacing-trim: space-first;
      grid-column: 1;
      grid-row: 2;
    }
    #trim-start {
      text-spacing-trim: trim-start;
      grid-column: 2;
      grid-row: 2;
    }
    
#### Result
# CSS writing modes
The CSS writing modes module defines various international writing modes, such as left-to-right (e.g., used by Latin and Indic scripts), right-to-left (e.g., used by Hebrew or Arabic scripts), bidirectional (used when mixing left-to-right and right-to-left scripts), and vertical (e.g., used by some Asian scripts).
## Reference
>
### Properties
  * `direction`
  * `text-combine-upright`
  * `text-orientation`
  * `unicode-bidi`
  * `writing-mode`


## Guides
Creating vertical form controls
    
The article explains how to use the CSS `writing-mode` and `direction` properties to create and configure vertical form controls.
# url()
The `url()` CSS function is used to include a file. The parameter is an absolute URL, a relative URL, a blob URL, or a data URL. The `url()` function can be passed as a parameter of another CSS function, like the `attr()` function. Depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. The `url()` functional notation is the value for the `<url>` data type.
Note: There is a difference between a URI and a URL. A URI identifies a resource. A URL is a type of URI, and describes the location of a resource. A URI can be either a URL or a name (URN) of a resource.
In CSS Level 1, the `url()` functional notation described only true URLs. In CSS Level 2, the definition of `url()` was extended to describe any URI, whether a URL or a URN. Confusingly, this meant that `url()` could be used to create a `<uri>` CSS data type. This change was not only awkward but, debatably, unnecessary, since URNs are almost never used in actual CSS. To alleviate the confusion, CSS Level 3 returned to the narrower, initial definition. Now, `url()` denotes only true `<url>`s.
Relative URLs, if used, are relative to the URL of the stylesheet (not to the URL of the web page).
The `url()` function can be included as a value for `background`, `background-image`, `border`, `border-image`, `border-image-source`, `content`, `cursor`, `filter`, `list-style`, `list-style-image`, `mask`, `mask-image`, `offset-path`, `clip-path`, src as part of a `@font-face` block, and @counter-style/`symbol`
## Syntax
    
    /* Basic usage */
    url("https://example.com/images/myImg.jpg");
    url('https://example.com/images/myImg.jpg');
    url(https://example.com/images/myImg.jpg);
    url("data:image/jpeg;base64,iRxVB0…");
    url(myImg.jpg);
    url(#IDofSVGpath);
    
    /* associated properties */
    background-image: url("star.gif");
    list-style-image: url('../images/bullet.jpg');
    content: url("my-icon.jpg");
    cursor: url(my-cursor.cur);
    border-image-source: url(/media/diamonds.png);
    src: url('fantastic-font.woff');
    offset-path: url(#path);
    mask-image: url("masks.svg#mask1");
    
    /* Properties with fallbacks */
    cursor: url(pointer.cur), pointer;
    
    /* Associated short-hand properties */
    background: url('star.gif') bottom right repeat-x blue;
    border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space;
    
    /* As a parameter in another CSS function */
    background-image: cross-fade(20% url(first.png), url(second.png));
    mask-image: image(url(mask.png), skyblue, linear-gradient(black, transparent));
    
    /* as part of a non-shorthand multiple value */
    content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg);
    
    /* at-rules */
    @document url("https://www.example.com/") { /* … */ }
    @import url("https://www.example.com/style.css");
    @namespace url(http://www.w3.org/1999/xhtml);
    
### Values
`<string>`
    
A string specifying a URL, which is a relative or absolute address, or pointer, to the web resource to be included, or a data URL. You can also use a hash URL to reference the ID of an SVG shape or an SVG filter.
The quotes are generally optional—they are required if the URL includes parentheses, whitespace, or quotes (unless these characters are escaped), or if the address includes control characters above 0x7e. Normal string syntax rules apply: double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped.
`<url-modifier>`
    
In the future, the `url()` function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the URL string. This is not supported and not fully defined in the specification.
## Examples
>
### As the background property value
    
    body {
      background: url("https://mdn.github.io/shared-assets/images/examples/leopard.jpg")
        #0000dd no-repeat fixed;
    }
    
### For setting an image as a list bullet
    
    ul {
      list-style: outside
        url("https://mdn.github.io/shared-assets/images/examples/firefox-logo.svg");
    }
    
### Usage in the content property
#### HTML
    
    <ul>
      <li>One</li>
      <li>Two</li>
      <li>Three</li>
    </ul>
    
#### CSS
    
    li::after {
      content: " - "
        url("https://mdn.github.io/shared-assets/images/examples/star-white_16x16.png");
    }
    
#### Result
### Using a data URL
#### CSS
    
    body {
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='45'%3E%3Cpath d='M10 10h60' stroke='%2300F' stroke-width='5'/%3E%3Cpath d='M10 20h60' stroke='%230F0' stroke-width='5'/%3E%3Cpath d='M10 30h60' stroke='red' stroke-width='5'/%3E%3C/svg%3E");
    }
    
### Usage in filters
When a URL is used as a path for a filter, the URL must be one of the following:
  1. The path to an SVG file with the ID of the filter appended.
  2. the ID of the filter, if the SVG already exists on the page.


    
    .blur {
      filter: url("my-file.svg#svg-blur"); /* the URL of an SVG file used as a filter */
    }
    
    .inline-blur {
      filter: url("#svg-blur"); /* the ID of an SVG that is embedded in the HTML page */
    }
    
# contain-intrinsic-width
The `contain-intrinsic-width` CSS property sets the width of an element that a browser will use for layout when the element is subject to size containment.
## Syntax
    
    /* Keyword values */
    contain-intrinsic-width: none;
    
    /* <length> values */
    contain-intrinsic-width: 1000px;
    contain-intrinsic-width: 10rem;
    
    /* auto <length> */
    contain-intrinsic-width: auto 300px;
    
    /* Global values */
    contain-intrinsic-width: inherit;
    contain-intrinsic-width: initial;
    contain-intrinsic-width: revert;
    contain-intrinsic-width: revert-layer;
    contain-intrinsic-width: unset;
    
### Values
The following values may be specified for an element.
`none`
    
The element has no intrinsic width.
`<length>`
    
The element has the specified width (`<length>`).
`auto <length>`
    
A remembered value of the "normally rendered" element width if one exists and the element is skipping its contents (for example, when it is offscreen); otherwise the specified `<length>`.
## Description
The property is commonly applied alongside elements that can trigger size containment, such as `contain: size` and `content-visibility`, and may also be set using the `contain-intrinsic-size` shorthand property.
Size containment allows a user agent to lay out an element as though it had a fixed size, preventing unnecessary reflows by avoiding the re-rendering of child elements to determine the actual size (thereby improving user experience). By default, size containment treats elements as though they had no contents, and may collapse the layout in the same way as if the contents had no width or height. The `contain-intrinsic-width` property allows authors to specify an appropriate value to be used as the width for layout.
The `auto <length>` value allows the width of the element to be stored if the element is ever "normally rendered" (with its child elements), and then used instead of the specified width when the element is skipping its contents. This allows offscreen elements with `content-visibility: auto` to benefit from size containment without developers having to be as precise in their estimates of element size. The remembered value is not used if the child elements are being rendered (if size containment is enabled, the `<length>` will be used).
## Examples
In addition to the example below, the `contain-intrinsic-size` page contains a live example that demonstrates the effect of modifying the intrinsic width and height.
### Setting the intrinsic width
The HTML below defines an element "contained_element" that will be subject to size constraint, and which contains a child element.
    
    <div id="contained_element">
      <div class="child_element"></div>
    </div>
    
The CSS below sets the `content-visibility` of `contained_element` to `auto`, so if the element is hidden it will be size constrained. The width and height that are used when it is size constrained are set at the same time using `contain-intrinsic-width` and `contain-intrinsic-height`, respectively.
    
    #contained_element {
      border: 2px solid green;
      width: 151px;
      content-visibility: auto;
      contain-intrinsic-width: 152px;
      contain-intrinsic-height: 52px;
    }
    .child_element {
      border: 1px solid red;
      background: blue;
      height: 50px;
      width: 150px;
    }
    
# CSS shadow parts
The CSS shadow parts module defines the `::part()` pseudo-element that can be set on a shadow host. Using this pseudo-element, you can enable shadow hosts to expose the selected element in the shadow tree to the outside page for styling purposes.
By default, elements in a shadow tree can be styled only within their respective shadow roots. The CSS shadow parts module enables including a `part` attribute on `<template>` descendants that make up the custom element, exposing the shadow tree node to external styling via the `::part()` pseudo-element.
## Reference
>
### Selectors
  * `::part()`


### HTML attributes
  * `part`
  * `exportparts`


### Definitions
  * Shadow tree


## Guides
CSS pseudo-elements
    
Alphabetical list of pseudo-elements defined by all the CSS specifications and WebVTT
Web components
    
Overview of the different APIs that enable creating reusable custom elements or web components.
## Related concepts
  * HTML `<template>` element
  * HTML `<slot>` element
  * `Element.part` property
  * `Element.shadowRoot` property
  * `Element.attachShadow()` method
  * `ShadowRoot` interface
  * CSS scoping module 
    * `:host`
    * `:host()`
    * `:host-context()`
    * `::slotted`


# CSS transitions
The CSS transitions module specifies functionality for creating gradual transitions between different CSS property values. The behavior of these transitions can be controlled by specifying their easing function, duration, and other values.
Normally, when the value of a CSS property changes, the result of the change from the old value to the new value is immediate. The CSS transitions module enables controlling a progression from the old property state to the new state over a specified period of time. It also provides event handlers to allow code to be run in response to different stages of a transition being reached.
In certain cases, there is no originating "from" value for a transition. For example, if an element gets added to the DOM, the styles defined are for the "to" state. This module provides the `@starting-style` at-rule, which enables defining starting styles for such cases. The module also defines how discrete property values should be transitioned, such as transitioning the discretely animated `display` property from the `none` value to a displayed value.
## Reference
>
### Properties
  * `transition`
  * `transition-behavior`
  * `transition-delay`
  * `transition-duration`
  * `transition-property`
  * `transition-timing-function`


### At rules
  * `@starting-style`


### Interfaces
  * `CSSStartingStyleRule`
  * `CSSTransition`
    * `transitionProperty` property
  * `TransitionEvent`
    * `TransitionEvent()` constructor
    * `TransitionEvent.propertyName` property
    * `TransitionEvent.elapsedTime` property
    * `TransitionEvent.pseudoElement` property
    * `transitioncancel` event
    * `transitionend` event
    * `transitionrun` event
    * `transitionstart` event


## Guides
Using CSS transitions
    
Step-by-step tutorial explaining how to create transitions using CSS. This article describes each relevant CSS property and explains how they interact with each other.
Animating `display`
    
Transitioning to and from the `none` value of the discretely animated `display` property.
Transitioning a popover and transitioning a `<dialog>`
    
Examples of transitioning from `@starting-style` to final `:popover-open` and `:open` pseudo-class styles.
## Related concepts
  * `interpolate-size` property
  * `calc-size()` function
  * Intrinsic size glossary term
  * CSS easing functions module
    * `<easing-function>` data-type
  * CSS animations module.
    * `animation` shorthand
    * `animation-delay`
    * `animation-direction`
    * `animation-duration`
    * `animation-fill-mode`
    * `animation-iteration-count`
    * `animation-name`
    * `animation-play-state`
    * `animation-timing-function`
  * CSS transforms module.
    * `transform`
    * `transform-box`
    * `transform-origin`
    * `transform-style`
  * CSS scroll snap module
    * `scroll-snap-type`
    * `scroll-padding`
    * `scroll-snap-align`
    * `scroll-margin`
    * `scroll-snap-stop`


# minmax()
The `minmax()` CSS function defines a size range greater than or equal to min and less than or equal to max. It is used with CSS grids.
## Try it
    
    grid-template-columns: minmax(20px, auto) 1fr 1fr;
    
    
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    
    
    grid-template-columns: minmax(2ch, 10ch) 1fr 1fr;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One. This column has more text in it.</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-gap: 10px;
      width: 250px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      text-align: left;
    }
    
## Syntax
    
    /* <inflexible-breadth>, <track-breadth> values */
    minmax(200px, 1fr)
    minmax(400px, 50%)
    minmax(30%, 300px)
    minmax(100px, max-content)
    minmax(min-content, 400px)
    minmax(max-content, auto)
    minmax(auto, 300px)
    minmax(min-content, auto)
    
    /* <fixed-breadth>, <track-breadth> values */
    minmax(200px, 1fr)
    minmax(30%, 300px)
    minmax(400px, 50%)
    minmax(50%, min-content)
    minmax(300px, max-content)
    minmax(200px, auto)
    
    /* <inflexible-breadth>, <fixed-breadth> values */
    minmax(400px, 50%)
    minmax(30%, 300px)
    minmax(min-content, 200px)
    minmax(max-content, 200px)
    minmax(auto, 300px)
    
A function taking two parameters, min and max.
Each parameter can be a `<length>`, a `<percentage>`, a `<flex>` value, or one of the keyword values `max-content`, `min-content`, or `auto`.
If max < min, then max is ignored and `minmax(min,max)` is treated as min. As a maximum, a `<flex>` value sets the flex factor of a grid track; it is invalid as a minimum.
### Values
`<length>`
    
A non-negative length.
`<percentage>`
    
A non-negative percentage relative to the inline size of the grid container in column grid tracks, and the block size of the grid container in row grid tracks. If the size of the grid container depends on the size of its tracks, then the `<percentage>` must be treated as `auto`. The user agent may adjust the intrinsic size contributions of the track to the size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage.
`<flex>`
    
A non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor.
`max-content`
    
Represents the largest max-content contribution of the grid items occupying the grid track.
`min-content`
    
Represents the largest min-content contribution of the grid items occupying the grid track.
`auto`
    
As `min`, it represents the largest minimum size (as specified by `min-width`/`min-height`) of the grid items occupying the grid track. As `max`, it is identical to `max-content`. However, unlike `max-content`, it allows expansion of the track by the `align-content` and `justify-content` property values like `normal` and `stretch`.
### CSS properties
`minmax()` function can be used within:
  * `grid-template-columns`
  * `grid-template-rows`
  * `grid-auto-columns`
  * `grid-auto-rows`


## Examples
>
### CSS
    
    #container {
      display: grid;
      grid-template-columns: minmax(min-content, 300px) minmax(200px, 1fr) 150px;
      grid-gap: 5px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background-color: #8cffa0;
      padding: 10px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      padding: 5px;
    }
    
### HTML
    
    <div id="container">
      <div>Item as wide as the content, but at most 300 pixels.</div>
      <div>Item with flexible width but a minimum of 200 pixels.</div>
      <div>Inflexible item of 150 pixels width.</div>
    </div>
    
### Result
# word-spacing
The `word-spacing` CSS property sets the length of space between words and between tags.
## Try it
    
    word-spacing: normal;
    
    
    word-spacing: 1rem;
    
    
    word-spacing: 4px;
    
    
    word-spacing: -0.4ch;
    
    
    <section id="default-example">
      <p id="example-element">
        As much mud in the streets as if the waters had but newly retired from the
        face of the earth, and it would not be wonderful to meet a Megalosaurus,
        forty feet long or so, waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: Amstelvar;
      font-style: normal;
    }
    
    section {
      font-size: 1.2em;
      font-family: Amstelvar, serif;
    }
    
## Syntax
    
    /* Keyword value */
    word-spacing: normal;
    
    /* <length> values */
    word-spacing: 3px;
    word-spacing: 0.3em;
    
    /* Global values */
    word-spacing: inherit;
    word-spacing: initial;
    word-spacing: revert;
    word-spacing: revert-layer;
    word-spacing: unset;
    
### Values
`normal`
    
The normal inter-word spacing, as defined by the current font and/or the browser.
`<length>`
    
Specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font.
## Accessibility
A large positive or negative `word-spacing` value will make the sentences the styling is applied to unreadable. For text styled with a very large positive value, the words will be so far apart that it will no longer appear to be a sentence. For text styled with a large negative value, the words will overlap each other to the point where the beginning and end of each word is unrecognizable.
Legible `word-spacing` must be determined on a case-by-case basis, as different font families have different character widths. There is no one value that can ensure all font families automatically maintain their legibility.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0


## Examples
>
### HTML
    
    <div id="mozdiv1">Lorem ipsum dolor sit amet.</div>
    <div id="mozdiv2">Lorem ipsum dolor sit amet.</div>
    
### CSS
    
    #mozdiv1 {
      word-spacing: 15px;
    }
    
    #mozdiv2 {
      word-spacing: 5em;
    }
    
# border-bottom-right-radius
The `border-bottom-right-radius` CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
## Try it
    
    border-bottom-right-radius: 80px 80px;
    
    
    border-bottom-right-radius: 250px 100px;
    
    
    border-bottom-right-radius: 50%;
    
    
    border-bottom-right-radius: 50%;
    border: black 10px double;
    background-clip: content-box;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a bottom right rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
The rounding can be a circle or an ellipse, or if one of the value is `0` no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the `background-clip` property.
Note: If the value of this property is not set in a `border-radius` shorthand property that is applied to the element after the `border-bottom-right-radius` CSS property, the value of this property is then reset to its initial value by the shorthand property.
## Syntax
    
    /* The corner is a circle */
    /* border-bottom-right-radius: radius */
    border-bottom-right-radius: 3px;
    
    /* Percentage values */
    border-bottom-right-radius: 20%; /* corner of a circle if box is a square or else corner of a rectangle */
    border-bottom-right-radius: 20% 20%; /* same as above */ /* 20% of horizontal(width) and vertical(height) */
    border-bottom-right-radius: 20% 10%; /* 20% of horizontal(width) and 10% of vertical(height) */
    
    /*The corner is an ellipse */
    /* border-bottom-right-radius: horizontal vertical */
    border-bottom-right-radius: 0.5em 1em;
    
    /* Global values */
    border-bottom-right-radius: inherit;
    border-bottom-right-radius: initial;
    border-bottom-right-radius: revert;
    border-bottom-right-radius: revert-layer;
    border-bottom-right-radius: unset;
    
With one value:
  * the value is a `<length>` or a `<percentage>` denoting the radius of the circle to use for the border in that corner.


With two values:
  * the first value is a `<length>` or a `<percentage>` denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
  * the second value is a `<length>` or a `<percentage>` denoting the vertical semi-major axis of the ellipse to use for the border in that corner.


### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Arc of a circle
A single `<length>` value produces an arc of a circle.
    
    div {
      border-bottom-right-radius: 40px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Arc of an ellipse
Two different `<length>` values produce an arc of an ellipse.
    
    div {
      border-bottom-right-radius: 40px 20px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Square element with percentage radius
A square element with a single `<percentage>` value produces an arc of a circle.
    
    div {
      border-bottom-right-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Non-square element with percentage radius
A non-square element with a single `<percentage>` value produces an arc of an ellipse.
    
    div {
      border-bottom-right-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 200px;
      height: 100px;
    }
    
# border-block-end
The `border-block-end` CSS property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet.
## Try it
    
    border-block-end: solid;
    writing-mode: horizontal-tb;
    
    
    border-block-end: dashed red;
    writing-mode: vertical-rl;
    
    
    border-block-end: 1rem solid;
    writing-mode: horizontal-tb;
    
    
    border-block-end: thick double #32a1ce;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-block-end-color`
  * `border-block-end-style`
  * `border-block-end-width`


## Syntax
    
    border-block-end: 1px;
    border-block-end: 2px dotted;
    border-block-end: medium dashed blue;
    
    /* Global values */
    border-block-end: inherit;
    border-block-end: initial;
    border-block-end: revert;
    border-block-end: revert-layer;
    border-block-end: unset;
    
`border-block-end` can be used to set the values for one or more of `border-block-end-width`, `border-block-end-style`, and `border-block-end-color`. The physical border to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top`, `border-right`, `border-bottom`, or `border-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
Related properties are `border-block-start`, `border-inline-start`, and `border-inline-end`, which define the other borders of the element.
### Values
The `border-block-end` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### Border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-block-end: 5px dashed blue;
    }
    
#### Results
# caret-color
The `caret-color` CSS property sets the color of the insertion caret, sometimes referred to as the text input cursor. This is the visible marker appearing at the insertion point where the next character typed will be added or where the next character deleted will be removed.
## Try it
    
    caret-color: red;
    
    
    caret-color: auto;
    
    
    caret-color: transparent;
    
    
    <section class="default-example container" id="default-example">
      <div>
        <p>Enter text in the field to see the caret:</p>
        <p><input id="example-element" type="text" /></p>
      </div>
    </section>
    
    
    #example-element {
      font-size: 1.2rem;
    }
    
## Syntax
    
    /* Keyword values */
    caret-color: auto;
    caret-color: transparent;
    caret-color: currentColor;
    
    /* <color> values */
    caret-color: red;
    caret-color: #5729e9;
    caret-color: rgb(0 200 0);
    caret-color: hsl(228deg 4% 24% / 80%);
    
    /* Global values */
    caret-color: inherit;
    caret-color: initial;
    caret-color: revert;
    caret-color: revert-layer;
    caret-color: unset;
    
### Values
`auto`
    
Generally resolves to `currentColor`, the `color` of the text that will be modified.
`<color>`
    
The color of the caret.
## Description
An insertion caret is a visible indicator of the spot within editable text — or within an element that accepts text input — where content will be inserted (or deleted) by the user. The caret is typically a thin vertical line indicating where the addition or deletion of characters will occur. It generally blinks (flashes on and off), so it is more noticeable. The caret only appears when the editable element has focus. By default, this caret is the color of the text. The `caret-color` property can be used to set the color of this caret to something other than the `currentColor`, or to reset a colored caret back to its default.
The `auto` value sets the insertion caret to `currentColor`, which is the `color` of the text that is being added or deleted. User agents may choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the `color`, `background-color`, shadows, and other factors. In practice, however, all browsers use the current color by default, and when `caret-color` is set to `auto`. You can set any valid `<color>` as the value.
### Understanding insertion carets
The insertion caret, and therefore this property, only applies to text or elements that can accept text input. The caret appears in focused user interface elements where users can update content, such as `<input>` elements that accept freeform text, the `<textarea>` element, and elements with the `contenteditable` attribute set.
The caret may appear in `<input>` elements of type `password`, `text`, `search`, `tel`, and `email`. No caret exists with date, `color`, `hidden`, `radio`, or `checkbox` input types. Some browsers display a caret with the `number` input type. It is possible in some browsers to make a caret appear in elements that never have text content — for example, by setting `appearance: none` and adding the `contenteditable` attribute. However, this is not recommended.
A caret may be displayed in an editable element or its descendants, provided the editability is not disabled, for example by setting a descendant element's `contentEditable` attribute to `false`. If an element is not editable or selectable, for example if `user-select` is set to `none`, the caret should not appear.
### Caret versus cursor
There are multiple types of carets. The insertion caret is the only type affected by the `caret-color` property.
Many browsers have a navigation caret, which acts similarly to an insertion caret but can be moved around in non-editable text.
The mouse cursor image shown for certain `cursor` property values (for example, `auto` or `text`) may resemble a caret, but it's not. It's a cursor.
### Animating from `auto`
Generally, when the `caret-color` is set to or defaults to `auto`, user agents use `currentColor`, which is animatable. However, `auto` is not an animatable value by default: when animating or transitioning the `caret-color` from `auto` to any color value, no interpolation happens. The animation is discrete; the color switches from or to the `currentColor` color at the midpoint of the `animation-duration` or `transition-duration`.
## Examples
>
### Setting a custom caret color
#### HTML
    
    <input value="This field uses a default caret." size="64" />
    <input class="custom" value="I have a custom caret color!" size="64" />
    <p contenteditable class="custom">
      This paragraph can be edited, and its caret has a custom color as well!
    </p>
    
#### CSS
    
    input {
      caret-color: auto;
      display: block;
      margin-bottom: 0.5em;
    }
    
    input.custom {
      caret-color: orange;
    }
    
    p.custom {
      caret-color: green;
    }
    
#### Result
# scroll-margin-top
The `scroll-margin-top` property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-top: 0;
    
    
    scroll-margin-top: 20px;
    
    
    scroll-margin-top: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-top: 10px;
    scroll-margin-top: 1em;
    
    /* Global values */
    scroll-margin-top: inherit;
    scroll-margin-top: initial;
    scroll-margin-top: revert;
    scroll-margin-top: revert-layer;
    scroll-margin-top: unset;
    
### Values
`<length>`
    
An outset from the top edge of the scroll container.
# scroll-margin-inline-end
The `scroll-margin-inline-end` property defines the margin of the scroll snap area at the end of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-inline-end: 0;
    
    
    scroll-margin-inline-end: 20px;
    
    
    scroll-margin-inline-end: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-inline-end: 10px;
    scroll-margin-inline-end: 1em;
    
    /* Global values */
    scroll-margin-inline-end: inherit;
    scroll-margin-inline-end: initial;
    scroll-margin-inline-end: revert;
    scroll-margin-inline-end: revert-layer;
    scroll-margin-inline-end: unset;
    
### Values
`<length>`
    
An outset from the inline end edge of the scroll container.
## Examples
>
### Basic demonstration
This example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
The aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block.
#### HTML
The HTML includes a scroller with four children:
    
    <div class="scroller">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
    </div>
    
#### CSS
Let's walk through the CSS. The outer container is styled like this:
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
The main parts relevant to the scroll snapping are `overflow-x: scroll`, which makes sure the contents will scroll and not be hidden, and `scroll-snap-type: x mandatory`, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
The child elements are styled as follows:
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(2n) {
      background-color: white;
      color: rebeccapurple;
    }
    
The most relevant part here is `scroll-snap-align: end`, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points.
Last of all we specify the scroll margin values, a different one for the second and third child elements:
    
    .scroller > div:nth-child(2) {
      scroll-margin-inline-end: 1rem;
    }
    
    .scroller > div:nth-child(3) {
      scroll-margin-inline-end: 2rem;
    }
    
This means that when scrolling past the middle child elements, the scrolling will snap to `1rem` outside the inline end edge of the second `<div>`, and `2rems` outside the inline end edge of the third `<div>`.
#### Result
Try it for yourself:
# font-optical-sizing
The `font-optical-sizing` CSS property sets whether text rendering is optimized for viewing at different sizes.
## Try it
    
    font-optical-sizing: auto;
    
    
    font-optical-sizing: none;
    
    
    <section id="default-example">
      <div id="example-element">
        <h2>Chapter 3</h2>
        <p>
          On this particular Thursday, something was moving quietly through the
          ionosphere many miles above the surface of the planet; several somethings
          in fact, several dozen huge yellow chunky slablike somethings, huge as
          office blocks, silent as birds.
        </p>
      </div>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: Amstelvar;
      font-style: normal;
    }
    
    #example-element {
      font-family: Amstelvar, serif;
      text-align: left;
    }
    
    #example-element h2 {
      font-size: 36px;
    }
    
    #example-element p {
      font-size: 12px;
    }
    
## Syntax
    
    /* keyword values */
    font-optical-sizing: none;
    font-optical-sizing: auto; /* default */
    
    /* Global values */
    font-optical-sizing: inherit;
    font-optical-sizing: initial;
    font-optical-sizing: revert;
    font-optical-sizing: revert-layer;
    font-optical-sizing: unset;
    
### Values
none
    
The browser will not modify the shape of glyphs for optimal viewing.
auto
    
The browser will modify the shape of glyphs for optimal viewing.
## Description
Optical sizing is enabled by default for fonts that have an optical size variation axis. The optical size variation axis is represented by `opsz` in `font-variation-settings`.
When optical sizing is used, small text sizes are often rendered with thicker strokes and larger serifs, whereas larger text is often rendered more delicately with more contrast between thicker and thinner strokes.
## Examples
>
### Disabling optical sizing
    
    <p class="optical-sizing">
      This paragraph is optically sized. This is the default across browsers.
    </p>
    
    <p class="no-optical-sizing">
      This paragraph is not optically sized. You should see a difference in
      supporting browsers.
    </p>
    
    
    @font-face {
      src: url("AmstelvarAlpha-VF.ttf");
      font-family: "Amstelvar";
      font-style: normal;
    }
    
    p {
      font-size: 36px;
      font-family: Amstelvar, serif;
    }
    
    .no-optical-sizing {
      font-optical-sizing: none;
    }
    
Note: The font referenced above — which includes optical sizing and is freely-licensed — is good for testing. You can download it on GitHub.
# border-image-source
The `border-image-source` CSS property sets the source image used to create an element's border image.
## Try it
    
    border-image-source: url("/shared-assets/images/examples/border-diamonds.png");
    
    
    border-image-source: url("/shared-assets/images/examples/border-stars.png");
    
    
    border-image-source: repeating-linear-gradient(
      45deg,
      transparent,
      #4d9f0c 20px
    );
    
    
    border-image-source: none;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
The `border-image-slice` property is used to divide the source image into regions, which are then dynamically applied to the final border image.
## Syntax
    
    /* Keyword value */
    border-image-source: none;
    
    /* <image> values */
    border-image-source: url("image.jpg");
    border-image-source: linear-gradient(to top, red, yellow);
    
    /* Global values */
    border-image-source: inherit;
    border-image-source: initial;
    border-image-source: revert;
    border-image-source: revert-layer;
    border-image-source: unset;
    
### Values
`none`
    
No border image is used. The appearance defined by `border-style` is displayed instead.
`<image>`
    
Image reference to use for the border.
## Examples
>
### Basic example
    
    .box {
      border-image-source: url("image.png");
    }
    
# ::after
In CSS, `::after` creates a pseudo-element that is the last child of the selected element. It is often used to add cosmetic content to an element with the `content` property. It is inline by default.
## Try it
    
    a::after {
      content: " (" attr(href) ")";
    }
    
    .dead-link {
      text-decoration: line-through;
    }
    
    .dead-link::after {
      content: url("/shared-assets/images/examples/warning.svg");
      display: inline-block;
      width: 12px;
      height: 12px;
    }
    
    
    <p>
      The sailfish is named for its sail-like dorsal fin and is widely considered
      the fastest fish in the ocean.
      <a href="https://en.wikipedia.org/wiki/Sailfish"
        >You can read more about it here</a
      >.
    </p>
    
    <p>
      The red lionfish is a predatory scorpionfish that lives on coral reefs of the
      Indo-Pacific Ocean and more recently in the western Atlantic.
      <a href="" class="dead-link">You can read more about it here</a>.
    </p>
    
## Syntax
    
    ::after {
      content: /* value */;
      /* properties */
    }
    
## Description
The `::after` pseudo-element is an inline box generated as an immediate child of the element it is associated with, or the "originating element". It is often used to add cosmetic content to an element via the `content` property, such as icons, quote marks, or other decoration.
`::after` pseudo-elements can't be applied to replaced elements such as `<img>`, whose contents are determined by external resources and not affected by the current document's styles.
An `::after` pseudo-element with a `display` value of `list-item` behaves like a list item, and can therefore generate a `::marker` pseudo-element just like an `<li>` element.
If the `content` property is not specified, has an invalid value, or has `normal` or `none` as a value, then the `::after` pseudo-element is not rendered. It behaves as if `display: none` is set.
Note: The Selectors Level 3 specification introduced the double-colon notation `::after` to distinguish pseudo-classes from pseudo-elements. Browsers also accept single-colon notation `:after`, introduced in CSS2.
By default, the `::before` and `::after` pseudo-elements share the same stacking context as their parent. If no `z-index` is explicitly set, the `::after` pseudo-element's generated content will appear above the `::before` pseudo-element's generated content because `::after` is rendered later in the DOM flow.
## Accessibility
Using an `::after` pseudo-element to add content is discouraged, as it is not reliably accessible to screen readers.
## Examples
>
### Basic usage
Let's create two classes: one for boring paragraphs and one for exciting ones. We can use these classes to add pseudo-elements to the end of paragraphs.
#### HTML
    
    <p class="boring-text">Here is some plain old boring text.</p>
    <p>Here is some normal text that is neither boring nor exciting.</p>
    <p class="exciting-text">Contributing to MDN is easy and fun.</p>
    
#### CSS
    
    .exciting-text::after {
      content: " <- EXCITING!";
      color: darkgreen;
      font-weight: bolder;
    }
    
    .boring-text::after {
      content: " <- BORING";
      color: darkviolet;
      font-weight: bolder;
    }
    
#### Result
### Decorative example
We can style text or images in the `content` property almost any way we want.
#### HTML
    
    <span class="ribbon">Look at the orange box after this text. </span>
    
#### CSS
    
    .ribbon {
      background-color: #5bc8f7;
    }
    
    .ribbon::after {
      content: "This is a fancy orange box.";
      background-color: #ffba10;
      border-color: black;
      border-style: dotted;
    }
    
#### Result
### Tooltips
This example uses `::after`, in conjunction with the `attr()` CSS expression and a `data-description` custom data attribute, to create tooltips. No JavaScript is required!
We can also support keyboard users with this technique, by adding a `tabindex` of `0` to make each `span` keyboard focusable, and using a CSS `:focus` selector. This shows how flexible `::before` and `::after` can be, though for the most accessible experience a semantic disclosure widget created in some other way (such as with details and summary elements) is likely to be more appropriate.
#### HTML
    
    <p>
      Here we have some
      <span tabindex="0" data-description="collection of words and punctuation">
        text
      </span>
      with a few
      <span tabindex="0" data-description="small popups that appear when hovering">
        tooltips</span
      >.
    </p>
    
#### CSS
    
    span[data-description] {
      position: relative;
      text-decoration: underline;
      color: blue;
      cursor: help;
    }
    
    span[data-description]:hover::after,
    span[data-description]:focus::after {
      content: attr(data-description);
      position: absolute;
      left: 0;
      top: 24px;
      min-width: 200px;
      border: 1px #aaaaaa solid;
      border-radius: 10px;
      background-color: #ffffcc;
      padding: 12px;
      color: black;
      font-size: 14px;
      z-index: 1;
    }
    
#### Result
###  `::after::marker` nested pseudo-elements
The `::after::marker` nested pseudo-element selects the list `::marker` of an `::after` pseudo-element that is itself a list item, that is, it has its `display` property set to `list-item`.
In this demo, we generate extra list items before and after a list navigation menu using `::before` and `::after` (setting them to `display: list-item` so they behave like list items). We then use `ul::before::marker` and `ul::after::marker` to give their list markers a different color.
#### HTML
    
    <ul>
      <li><a href="#">Introduction</a></li>
      <li><a href="#">Getting started</a></li>
      <li><a href="#">Understanding the basics</a></li>
    </ul>
    
#### CSS
    
    ul {
      font-size: 1.5rem;
      font-family: Arial, Helvetica, sans-serif;
    }
    
    ul::before,
    ul::after {
      display: list-item;
      color: orange;
    }
    
    ul::before {
      content: "Start";
    }
    
    ul::after {
      content: "End";
    }
    
    ul::before::marker,
    ul::after::marker {
      color: red;
    }
    
#### Result
While the list bullets of the three navigation items are generated because they are `<li>` elements, "Start" and "End" have been inserted via pseudo-elements and `::marker` is used to style their bullets.
# :target-current
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:target-current` CSS pseudo-class selects the active scroll marker — the `::scroll-marker` pseudo-element of a `scroll-marker-group` that is currently scrolled to. This selector can be used to style the active navigation position within a scroll marker group.
Note: The `:target-current` pseudo-class is only valid on `::scroll-marker` pseudo-elements.
## Syntax
    
    :target-current {
      /* ... */
    }
    
## Examples
See Creating CSS carousels and `::scroll-marker` for complete examples that use the `:target-current` pseudo-class.
### Basic usage
    
    ::scroll-marker {
      background-color: white;
    }
    
    ::scroll-marker:target-current {
      background-color: black;
    }
    
# place-self
The `place-self` CSS shorthand property allows you to align an individual item in both the block and inline directions at once (i.e., the `align-self` and `justify-self` properties). This property applies to block-level boxes, absolutely-positioned boxes, and grid items. If the second value is not present, the first value is also used for it.
## Try it
    
    place-self: stretch center;
    
    
    place-self: center start;
    
    
    place-self: start end;
    
    
    place-self: end center;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      width: 220px;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 80px;
      grid-gap: 10px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `align-self`
  * `justify-self`


## Syntax
    
    /* Positional alignment */
    place-self: auto center;
    place-self: normal start;
    place-self: center normal;
    place-self: start auto;
    place-self: end normal;
    place-self: self-start auto;
    place-self: self-end normal;
    place-self: flex-start auto;
    place-self: flex-end normal;
    place-self: anchor-center;
    
    /* Baseline alignment */
    place-self: baseline normal;
    place-self: first baseline auto;
    place-self: last baseline normal;
    place-self: stretch auto;
    
    /* Global values */
    place-self: inherit;
    place-self: initial;
    place-self: revert;
    place-self: revert-layer;
    place-self: unset;
    
### Values
`auto`
    
Computes to the parent's `align-items` value.
`normal`
    
The effect of this keyword is dependent of the layout mode we are in:
  * In absolutely-positioned layouts, the keyword behaves like `start` on replaced absolutely-positioned boxes, and as `stretch` on all other absolutely-positioned boxes.
  * In static position of absolutely-positioned layouts, the keyword behaves as `stretch`.
  * For flex items, the keyword behaves as `stretch`.
  * For grid items, this keyword leads to a behavior similar to the one of `stretch`, except for boxes with an aspect ratio or an intrinsic size where it behaves like `start`.
  * The property doesn't apply to block-level boxes, and to table cells.


`self-start`
    
Aligns the items to be flush with the edge of the alignment container corresponding to the item's start side in the cross axis.
`self-end`
    
Aligns the items to be flush with the edge of the alignment container corresponding to the item's end side in the cross axis.
`flex-start`
    
The cross-start margin edge of the flex item is flushed with the cross-start edge of the line.
`flex-end`
    
The cross-end margin edge of the flex item is flushed with the cross-end edge of the line.
`center`
    
The flex item's margin box is centered within the line on the cross-axis. If the cross-size of the item is larger than the flex container, it will overflow equally in both directions.
`baseline`, `first baseline`. `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group. The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`stretch`
    
If the combined size of the items along the cross axis is less than the size of the alignment container and the item is `auto`-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size of all `auto`-sized items exactly fills the alignment container along the cross axis.
`anchor-center`
    
In the case of anchor-positioned elements, aligns the item to the center of the associated anchor element in the block and inline direction. See Centering on the anchor using `anchor-center`.
## Examples
>
### Basic demonstration
In the following example we have a 2 x 2 grid layout. Initially the grid container has `justify-items` and `align-items` values of `stretch` — the defaults — which causes the grid items to stretch across the entire width of their cells.
The second, third, and fourth grid items are then given different values of `place-self`, to show how these override the default placements. These values cause the grid items to span only as wide/tall as their content width/height, and align in different positions across their cells, in the block and inline directions.
#### HTML
    
    <article class="container">
      <span>First</span>
      <span>Second</span>
      <span>Third</span>
      <span>Fourth</span>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
      letter-spacing: 1px;
    }
    
    article {
      background-color: red;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 80px;
      grid-gap: 10px;
      margin: 20px;
      width: 300px;
    }
    
    span:nth-child(2) {
      place-self: start center;
    }
    
    span:nth-child(3) {
      place-self: center start;
    }
    
    span:nth-child(4) {
      place-self: end;
    }
    
    article span {
      background-color: black;
      color: white;
      margin: 1px;
      text-align: center;
    }
    
    article,
    span {
      padding: 10px;
      border-radius: 7px;
    }
    
#### Result
# scroll-padding-top
The `scroll-padding-top` property defines offsets for the top of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-top: 0;
    
    
    scroll-padding-top: 20px;
    
    
    scroll-padding-top: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-top: auto;
    
    /* <length> values */
    scroll-padding-top: 10px;
    scroll-padding-top: 1em;
    scroll-padding-top: 10%;
    
    /* Global values */
    scroll-padding-top: inherit;
    scroll-padding-top: initial;
    scroll-padding-top: revert;
    scroll-padding-top: revert-layer;
    scroll-padding-top: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the top edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# font-variant-position
The `font-variant-position` CSS property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript.
The glyphs are positioned relative to the baseline of the font, which remains unchanged. These glyphs are typically used in `<sub>` and `<sup>` elements.
When the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs.
These alternate glyphs share the same em-box and the same baseline as the rest of the font. They are merely graphically enhanced, and have no effect on the line-height and other box characteristics.
## Syntax
    
    /* Keyword values */
    font-variant-position: normal;
    font-variant-position: sub;
    font-variant-position: super;
    
    /* Global values */
    font-variant-position: inherit;
    font-variant-position: initial;
    font-variant-position: revert;
    font-variant-position: revert-layer;
    font-variant-position: unset;
    
The `font-variant-position` property is specified as one of the keyword values listed below.
### Values
`normal`
    
Deactivates alternate superscript and subscript glyphs.
`sub`
    
Activates subscript alternate glyphs. If, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs.
`super`
    
Activates superscript alternate glyphs. If, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs.
## Examples
>
### Setting superscript and subscript forms
#### HTML
    
    <p class="normal">Normal!</p>
    <p class="super">Super!</p>
    <p class="sub">Sub!</p>
    
#### CSS
    
    p {
      display: inline;
    }
    
    .normal {
      font-variant-position: normal;
    }
    
    .super {
      font-variant-position: super;
    }
    
    .sub {
      font-variant-position: sub;
    }
    
#### Result
# caret-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `caret-shape` CSS property sets the shape of the insertion caret, the visible marker that appears in editable elements to indicate where the next character will be inserted or deleted.
## Try it
    
    caret-shape: auto;
    
    
    caret-shape: bar;
    
    
    caret-shape: block;
    
    
    caret-shape: underscore;
    
    
    <section class="default-example container" id="default-example">
      <div>
        <label for="example-element">Edit text field:</label>
        <input id="example-element" type="text" value="Sample text" />
      </div>
    </section>
    
    
    div {
      text-align: left;
    }
    
    #example-element {
      font-size: 1.2rem;
      padding: 8px;
      width: 300px;
    }
    
## Syntax
    
    /* Keyword values */
    caret-shape: auto;
    caret-shape: bar;
    caret-shape: block;
    caret-shape: underscore;
    
    /* Global values */
    caret-shape: inherit;
    caret-shape: initial;
    caret-shape: revert;
    caret-shape: revert-layer;
    caret-shape: unset;
    
### Values
`auto`
    
The default value. The browser determines the caret shape. This typically follows platform conventions and may change based on context.
`bar`
    
The caret appears as a thin vertical line at the insertion point, positioned between characters rather than over them.
`block`
    
The caret appears as a rectangle that overlaps the next character after the insertion point. If no character follows, it appears after the last character.
`underscore`
    
The caret appears as a thin horizontal line underneath the next character after the insertion point. If no character follows, it appears after the last character.
## Description
The insertion caret is the blinking cursor that indicates where text will be inserted when typing. Different caret shapes can provide visual feedback about the current editing mode or offer visual customization.
### Editing modes and caret shapes
Text editors typically operate in one of two modes:
  * Insert mode: New characters are inserted at the caret position, pushing existing text to the end of the line. This is the default behavior in most modern applications.
  * Overtype mode (also called "overwrite mode"): New characters replace existing characters at the caret position instead of being inserted between them. This mode is often toggled with the `Insert` key.


Different caret shapes have traditional uses, for example:
  * Bar carets are positioned between characters and are most common in modern interfaces.
  * Block carets overlay the next character and are often used in terminal applications or to indicate overtype mode.
  * Underscore carets appear below characters and can be useful for certain design aesthetics, such as mimicking typewriter or underline text input styles.


### Caret positioning and behavior
The `caret-shape` property affects how the caret is visually rendered but doesn't change its logical position in the text. The caret always represents the insertion point between characters, regardless of its visual shape.
### Interaction with writing modes
The caret shape adapts to the `writing-mode` of the text. In vertical writing modes, bar carets become horizontal, and underscore carets position themselves appropriately relative to the text direction.
## Examples
>
### Retro terminal with animated caret
This example shows how to create a vintage terminal interface using `caret-shape: block` with animated caret color, replacing the old technique of using borders.
The key part is using the modern caret properties instead of the old border-based technique. We set the caret to block shape, disable the default blinking, and create our own custom animation.
#### HTML
    
    <label for="terminal">Enter a command</label>
    <div class="old-screen">
      <span>></span>
      <textarea id="terminal" class="terminal-input"></textarea>
    </div>
    
#### CSS
    
    .terminal-input {
      caret-shape: block;
      caret-animation: manual;
      animation: old-caret 2s infinite;
    }
    
    @keyframes old-caret {
      0%,
      50% {
        caret-color: #00ad00;
      }
      75%,
      100% {
        caret-color: transparent;
      }
    }
    
#### Result
### Console interface with underscore caret
This example demonstrates using `caret-shape: underscore` to create a console-style interface where the underscore caret complements the terminal aesthetic.
#### HTML
    
    <label for="console">Enter a command</label>
    <div class="console-demo">
      <div class="console-output">
        <p>user@host:css-ui-4 $ ls -a</p>
        <p>. .. Overview.bs Overview.html</p>
      </div>
      <div class="console-input">
        <span class="prompt">user@host:css-ui-4 $ </span>
        <input type="text" id="console" class="console" value="cd" />
      </div>
    </div>
    
#### CSS
    
    .console {
      caret-shape: underscore;
    }
    
#### Result
This feature does not appear to be defined in any specification.>
# inline-size
The `inline-size` CSS property defines the size of an element's block along the inline axis. If the `writing-mode` is horizontal, it corresponds to the `width`; if the writing mode is vertical, it corresponds to the `height`. A related property is `block-size`, which defines the other dimension of the element.
## Try it
    
    inline-size: 150px;
    writing-mode: horizontal-tb;
    
    
    inline-size: 150px;
    writing-mode: vertical-rl;
    
    
    inline-size: auto;
    writing-mode: horizontal-tb;
    
    
    inline-size: auto;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the inline-size.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    inline-size: 300px;
    inline-size: 25em;
    inline-size: anchor-size(width);
    inline-size: anchor-size(--my-anchor inline);
    
    /* <percentage> values */
    inline-size: 75%;
    
    /* Keyword values */
    inline-size: max-content;
    inline-size: min-content;
    inline-size: fit-content;
    inline-size: fit-content(20em);
    inline-size: auto;
    
    /* Global values */
    inline-size: inherit;
    inline-size: initial;
    inline-size: revert;
    inline-size: revert-layer;
    inline-size: unset;
    
### Values
The `inline-size` property takes the same values as the `width` and `height` properties.
## Examples
>
### Setting inline size in pixels
#### HTML
    
    <p class="exampleText">Example text</p>
    
#### CSS
    
    .exampleText {
      writing-mode: vertical-rl;
      background-color: yellow;
      inline-size: 110px;
    }
    
#### Result
# border-bottom-left-radius
The `border-bottom-left-radius` CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
## Try it
    
    border-bottom-left-radius: 80px 80px;
    
    
    border-bottom-left-radius: 250px 100px;
    
    
    border-bottom-left-radius: 50%;
    
    
    border-bottom-left-radius: 50%;
    border: black 10px double;
    background-clip: content-box;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a bottom left rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
The rounding can be a circle or an ellipse, or if one of the value is `0` no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the `background-clip` property.
Note: If the value of this property is not set in a `border-radius` shorthand property that is applied to the element after the `border-bottom-left-radius` CSS property, the value of this property is then reset to its initial value by the shorthand property.
## Syntax
    
    /* the corner is a circle */
    /* border-bottom-left-radius: radius */
    border-bottom-left-radius: 3px;
    
    /* Percentage values */
    
    /* circle if box is a square or ellipse if box is a rectangle */
    border-bottom-left-radius: 20%;
    
    /* same as above: 20% of horizontal(width) and vertical(height) */
    border-bottom-left-radius: 20% 20%;
    
    /* 20% of horizontal(width) and 10% of vertical(height) */
    border-bottom-left-radius: 20% 10%;
    
    /* the corner is an ellipse */
    /* border-bottom-left-radius: horizontal vertical */
    border-bottom-left-radius: 0.5em 1em;
    
    /* Global values */
    border-bottom-left-radius: inherit;
    border-bottom-left-radius: initial;
    border-bottom-left-radius: revert;
    border-bottom-left-radius: revert-layer;
    border-bottom-left-radius: unset;
    
With one value:
  * the value is a `<length>` or a `<percentage>` denoting the radius of the circle to use for the border in that corner.


With two values:
  * the first value is a `<length>` or a `<percentage>` denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
  * the second value is a `<length>` or a `<percentage>` denoting the vertical semi-major axis of the ellipse to use for the border in that corner.


### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Arc of a circle
A single `<length>` value produces an arc of a circle.
    
    div {
      border-bottom-left-radius: 40px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Arc of an ellipse
Two different `<length>` values produce an arc of an ellipse.
    
    div {
      border-bottom-left-radius: 40px 20px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Square element with percentage radius
A square element with a single `<percentage>` value produces an arc of a circle.
    
    div {
      border-bottom-left-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Non-square element with percentage radius
A non-square element with a single `<percentage>` value produces an arc of an ellipse.
    
    div {
      border-bottom-left-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 200px;
      height: 100px;
    }
    
# flex
The `flex` CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container.
## Try it
    
    flex: 1;
    
    
    flex: 2;
    
    
    flex: 1 30px;
    
    
    flex: 1 1 100px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Change me</div>
      <div>flex: 1</div>
      <div>flex: 1</div>
    </section>
    
    
    .default-example {
      border: 1px solid #c5c5c5;
      width: auto;
      max-height: 300px;
      display: flex;
    }
    
    .default-example > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex-grow: 1;
      flex-shrink: 1;
      flex-basis: 0;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `flex-grow`
  * `flex-shrink`
  * `flex-basis`


## Syntax
    
    /* Keyword value */
    flex: none; /* 0 0 auto */
    
    /* One value, unitless number: flex-grow
    flex-basis is then equal to 0%. */
    flex: 2; /* 2 1 0% */
    
    /* One value, width/height: flex-basis */
    flex: auto; /* 1 1 auto */
    flex: 10em; /* 1 1 10em */
    flex: 30%;
    flex: min-content;
    
    /* Two values: flex-grow | flex-basis */
    flex: 1 30px; /* 1 1 30px */
    
    /* Two values: flex-grow | flex-shrink */
    flex: 2 2; /* 2 2 0% */
    
    /* Three values: flex-grow | flex-shrink | flex-basis */
    flex: 2 2 10%;
    
    /* Global values */
    flex: inherit;
    flex: initial; /* 0 1 auto */
    flex: revert;
    flex: revert-layer;
    flex: unset;
    
The `flex` property may be specified using one, two, or three values.
  * One-value syntax: the value must be one of:
    * a valid value for `<flex-grow>`: then, in all the browsers, the shorthand expands to `flex: <flex-grow> 1 0%`. However the specification says it should expand to `flex: <flex-grow> 1 0`.
    * a valid value for `<flex-basis>`: then the shorthand expands to `flex: 1 1 <flex-basis>`.
    * the keyword `none` or one of the global keywords.
  * Two-value syntax:
    * The first value must be a valid value for `flex-grow`.
    * The second value must be one of:
      * a valid value for `flex-shrink`: then, in all the browsers, the shorthand expands to `flex: <flex-grow> <flex-shrink> 0%`.
      * a valid value for `flex-basis`: then the shorthand expands to `flex: <flex-grow> 1 <flex-basis>`.
  * Three-value syntax: the values must be in the following order:
    1. a valid value for `flex-grow`.
    2. a valid value for `flex-shrink`.
    3. a valid value for `flex-basis`.


### Values
`<'flex-grow'>`
    
Defines the `flex-grow` of the flex item. Negative values are considered invalid. Defaults to `1` when omitted. (initial is `0`)
`<'flex-shrink'>`
    
Defines the `flex-shrink` of the flex item. Negative values are considered invalid. Defaults to `1` when omitted. (initial is `1`)
`<'flex-basis'>`
    
Defines the `flex-basis` of the flex item. Defaults to `0%` when omitted. The initial value is `auto`.
`none`
    
The item is sized according to its `width` and `height` properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container. This is equivalent to setting `flex: 0 0 auto`.
Commonly desired flexbox effects can be achieved using the following `flex` values:
  * `initial`: Flex item doesn't grow but can shrink. This default value expands to `flex: 0 1 auto`. The item is sized according to its `width` or `height` properties, depending on the `flex-direction`. If there is negative available space, the item will shrink to its minimum size to fit within the container but will not grow to absorb any positive space available in the flex container.
  * `auto`: Flex item can grow and shrink. This value expands to `flex: 1 1 auto`. The item is sized according to its `width` or `height` properties, depending on the `flex-direction`, but grows to absorb available positive space in the flex container or shrink down to its minimum size to fit the container in the case of negative space. The flex item is fully flexible.
  * `none`: The flex item neither grows nor shrinks. This value expands to `flex: 0 0 auto`. The item is sized according to its `width` or `height` properties, depending on the direction of the flex container. The flex item is fully inflexible.
  * `flex: <number [1,∞]>`: The flex item's main size will be proportional to the number set. This value expands to `flex: <number> 1 0`. This sets the `flex-basis` to zero and makes the flex item flexible. The item will be at least as wide or tall as its minimum size, with the container's positive available space being proportionally distributed based on the growth factors of this item and its sibling flex items. If all the flex items use this pattern, all will be sized in proportion to their numeric values.
Warning: The browsers use `flex-basis` value `0%` when the `flex-basis` is not specified in a `flex` value. This is not the same as `flex-basis` value `0` which is what the specification says. This may affect flex layout in some cases. See this effect demonstrated in the Flex-basis `0` versus `0%` example.


## Description
For most purposes, authors should set `flex` to one of the following values: `auto`, `initial`, `none`, or a positive unitless number. To see the effect of these values, try resizing the flex containers below:
By default flex items don't shrink below their `min-content` size. To change this, set the item's `min-width` or `min-height`.
## Examples
>
### Setting flex: auto
This example shows how a flex item with `flex: auto` grows to absorb any free space in the container.
#### HTML
    
    <div id="flex-container">
      <div id="flex-auto">
        flex: auto (click to remove/add the `flex: initial` box)
      </div>
      <div id="default">flex: initial</div>
    </div>
    
#### CSS
    
    #flex-container {
      border: 2px dashed gray;
      display: flex;
    }
    
    #flex-auto {
      cursor: pointer;
      background-color: wheat;
    
      flex: auto;
    }
    
    #default {
      background-color: lightblue;
    }
    
#### JavaScript
    
    const flexAutoItem = document.getElementById("flex-auto");
    const defaultItem = document.getElementById("default");
    flexAutoItem.addEventListener("click", () => {
      defaultItem.style.display =
        defaultItem.style.display === "none" ? "block" : "none";
    });
    
#### Result
The flex container contains two flex items:
  * The `#flex-auto` item has a `flex` value of `auto`. The `auto` value expands to `1 1 auto`, i.e., the item is allowed to expand.
  * The `#default` item has no `flex` value set so it defaults to the `initial` value. The `initial` value expands to `0 1 auto`, i.e., the item is not allowed to expand.


The `#default` item takes up as much space as its width requires, but does not expand to take up any more space. All the remaining space is taken up by the `#flex-auto` item.
When you click the `#flex-auto` item, we set the `#default` item's `display` property to `none`, removing it from the layout. The `#flex-auto` item then expands to occupy all the available space in the container. Clicking the `#flex-auto` item again adds the `#default` item back to the container.
# right
The `right` CSS property participates in specifying the horizontal position of a positioned element. This inset property has no effect on non-positioned elements.
## Try it
    
    right: 0;
    
    
    right: 4em;
    
    
    right: 10%;
    
    
    right: 20px;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #264653;
      border: 4px solid #ffb500;
      color: white;
      position: absolute;
      width: 140px;
      height: 60px;
    }
    
## Syntax
    
    /* <length> values */
    right: 3px;
    right: 2.4em;
    right: anchor(--my-anchor 50%);
    right: anchor-size(--my-anchor height, 65px);
    
    /* <percentage>s of the width of the containing block */
    right: 10%;
    
    /* Keyword value */
    right: auto;
    
    /* Global values */
    right: inherit;
    right: initial;
    right: revert;
    right: revert-layer;
    right: unset;
    
### Values
`<length>`
    
A negative, null, or positive `<length>`:
  * for absolutely positioned elements, it represents the distance to the right edge of the containing block.
  * for anchor-positioned elements, the `anchor()` function resolves to a `<length>` value relative to the position of the associated anchor element's left or right edge (see Using inset properties with `anchor()` function values), and the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element position based on anchor size).
  * for relatively positioned elements, it represents the distance that the element is moved to the left of its normal position.


`<percentage>`
    
A `<percentage>` of the containing block's width.
`auto`
    
Specifies that:
  * for absolutely positioned elements, the position of the element is based on the `left` property, while `width: auto` is treated as a width based on the content; or if `left` is also `auto`, the element is positioned where it should horizontally be positioned if it were a static element.
  * for relatively positioned elements, the distance of the element from its normal position is based on the `left` property; or if `left` is also `auto`, the element is not moved horizontally at all.


## Description
The effect of `right` depends on how the element is positioned (i.e., the value of the `position` property):
  * When `position` is set to `absolute` or `fixed`, the `right` property specifies the distance between the element's outer margin of right edge and the inner border of the right edge of its containing block. If the positioned element has an associated anchor element, and the property value includes an `anchor()` function, `right` positions the right edge of the positioned element relative to the specified `<anchor-side>` edge. The `right` property is compatible with the `left`, `right`, `start`, `end`, `self-start`, `self-end`, `center`, and `<percentage>` values.
  * When `position` is set to `relative`, the `right` property specifies the distance the element's right edge is moved to the left from its normal position.
  * When `position` is set to `sticky`, the `right` property is used to compute the sticky-constraint rectangle.
  * When `position` is set to `static`, the `right` property has no effect.


When both `left` and `right` are defined, if not prevented from doing so by other properties, the element will stretch to satisfy both. If the element cannot stretch to satisfy both — for example, if a `width` is declared — the position of the element is over-constrained. When this is the case, the `left` value has precedence when the container is left-to-right; the `right` value has precedence when the container is right-to-left.
## Examples
>
### Absolute and relative positioning using right
#### HTML
    
    <div id="relative">Relatively positioned</div>
    <div id="absolute">Absolutely positioned</div>
    
#### CSS
    
    #relative {
      width: 100px;
      height: 100px;
      background-color: #ffc7e4;
      position: relative;
      top: 20px;
      left: 20px;
    }
    
    #absolute {
      width: 100px;
      height: 100px;
      background-color: #ffd7c2;
      position: absolute;
      bottom: 10px;
      right: 20px;
    }
    
#### Result
### Declaring both left and right
When both `left` and `right` are declared, the element will stretch to meet both, unless other constraints prevent it from doing so. If the element will not stretch or shrink to meet both. When the position of the element is overspecified, the precedence is based on the container's direction: The `left` will take precedence if the container's direction is left-to-right. The `right` will take precedence if the container's direction is right-to-left.
#### HTML
    
    <div id="parent">
      Parent
      <div id="noWidth">No width</div>
      <div id="width">width: 100px</div>
    </div>
    
#### CSS
    
    div {
      outline: 1px solid #cccccc;
    }
    #parent {
      width: 200px;
      height: 200px;
      background-color: #ffc7e4;
      position: relative;
    }
    /* declare both a left and a right */
    #width,
    #noWidth {
      background-color: #c2ffd7;
      position: absolute;
      left: 0;
      right: 0;
    }
    /* declare a width */
    #width {
      width: 100px;
      top: 60px;
    }
    
#### Result
# stroke-width
The `stroke-width` CSS property defines the width of a stroke applied to the SVG shape. If present, it overrides the element's `stroke-width` attribute.
This property applies to any SVG shape or text-content element (see `stroke-width` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes. If the value evaluates to zero, the stroke is not drawn.
## Syntax
    
    /* Length and percentage values */
    stroke-width: 0%;
    stroke-width: 1.414px;
    
    /* Global values */
    stroke-width: inherit;
    stroke-width: initial;
    stroke-width: revert;
    stroke-width: revert-layer;
    stroke-width: unset;
    
### Values
`<length>`
    
Pixel units are handled the same as SVG units (see `<number>`, above) and font-based lengths such as `em` are calculated with respect to the element's SVG value for the text size; the effects of other length units may depend on the browser.
`<percentage>`
    
Percentages refer to the normalized diagonal of the current SVG viewport, which is calculated as <width>2+<height>22.
`<number>` Non-standard
    
A number of SVG units, the size of which defined by the current unit space.
## Examples
>
### Various stroke widths
This example demonstrates various value syntaxes for the `stroke-width` property.
#### HTML
First, we set up five multi-segment paths, all of which use a black stroke with a width of one, and no fill. Each path creates a series of mountain symbols, going from left (a shallow corner angle) to right (an extreme corner angle).
    
    <svg viewBox="0 0 39 30" xmlns="http://www.w3.org/2000/svg">
      <g stroke="black" stroke-width="1" fill="none">
        <path
          d="M1,5 l7   ,-3 l7   ,3
             m2,0 l3.5 ,-3 l3.5 ,3
             m2,0 l2   ,-3 l2   ,3
             m2,0 l0.75,-3 l0.75,3
             m2,0 l0.5 ,-3 l0.5 ,3" />
        <path
          d="M1,8 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,14 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,18 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,26 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
      </g>
    </svg>
    
#### CSS
To the first four paths, we apply stroke width values as pairs to show how bare number values and pixel values are functionally equivalent. For the first two paths, the values are `.25` and `.25px`. For the second two paths, the values are `1` and `1px`.
For the fifth and last path, a value of `5%` is applied, thus setting a stroke width that is five percent as wide as the SVG viewport's diagonal measure is long.
    
    path:nth-child(1) {
      stroke-width: 0.25;
    }
    path:nth-child(2) {
      stroke-width: 0.25px;
    }
    path:nth-child(3) {
      stroke-width: 1;
    }
    path:nth-child(4) {
      stroke-width: 1px;
    }
    path:nth-child(5) {
      stroke-width: 5%;
    }
    
#### Results
# math-shift
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `math-shift` property indicates whether superscripts inside MathML formulas should be raised by a normal or compact shift.
## Syntax
    
    /* Keyword values */
    math-shift: normal;
    math-shift: compact;
    
    /* Global values */
    math-shift: inherit;
    math-shift: initial;
    math-shift: revert;
    math-shift: revert-layer;
    math-shift: unset;
    
### Values
`normal`
    
The initial value, indicates normal rendering. Superscripts in MathML formulas use the superscriptShiftUp parameter from the OpenType MATH table.
`compact`
    
Indicates compact rendering. Superscripts in MathML formulas use the superscriptShiftUpCramped parameter from the OpenType MATH table, which is generally smaller.
## Examples
>
### CSS
    
    math {
      math-shift: compact;
      font-size: 64pt;
    }
    
    .normal-shift {
      math-shift: normal;
    }
    .compact-shift {
      math-shift: compact;
    }
    
### MathML
The following MathML displays two versions of "x squared" using a font with an OpenType MATH table. Browser implementing the `math-shift` property should raise the superscripts using slightly different shifts.
    
    <math>
      <msup class="normal-shift">
        <mi>x</mi>
        <mn>2</mn>
      </msup>
      <msup class="compact-shift">
        <mi>x</mi>
        <mn>2</mn>
      </msup>
    </math>
    
# :state()
The `:state()` CSS pseudo-class matches custom elements that have the specified custom state.
## Syntax
    
    :state(<custom identifier>) {
      /* ... */
    }
    
### Parameters
The `:state()` pseudo-class takes as its argument a custom identifier that represents the state of the custom element to match.
## Description
Elements can transition between states due to user interaction and other factors. For instance, an element can be in the "hover" state when a user hovers over the element, or a link can be in the "visited" state after a user clicks on it. Elements provided by browsers can be styled based on these states using CSS pseudo-classes such as `:hover` and `:visited`. Similarly, autonomous custom elements (custom elements that are not derived from built-in elements) can expose their states, allowing pages that use the elements to style them using the CSS `:state()` pseudo-class.
The states of a custom element are represented by string values. These values are added to or removed from a `CustomStateSet` object associated with the element. The CSS `:state()` pseudo-class matches an element when the identifier, passed as an argument, is present in the `CustomStateSet` of the element.
The `:state()` pseudo-class can also be used to match custom states within the implementation of a custom element. This is achieved by using `:state()` within the `:host()` pseudo-class function, which matches a state only within the shadow DOM of the current custom element.
Additionally, the `::part()` pseudo-element followed by the `:state()` pseudo-class allows matching on the shadow parts of a custom element that are in a particular state. (Shadow parts are parts of a custom element's shadow tree that are explicitly exposed to a containing page for styling purposes.)
## Examples
>
### Matching a custom state
This CSS shows how to change the border of the autonomous custom element `<labeled-checkbox>` to `red` when it is in the "checked" state.
    
    labeled-checkbox {
      border: dashed red;
    }
    labeled-checkbox:state(checked) {
      border: solid;
    }
    
For a live example of this code in action, see the Matching the custom state of a custom checkbox element example on the `CustomStateSet` page.
### Matching a custom state in a custom element's shadow DOM
This example shows how the `:state()` pseudo-class can be used within the `:host()` pseudo-class function to match custom states within the implementation of a custom element.
The following CSS injects a grey `[x]` before the element when it is in the "checked" state.
    
    :host(:state(checked))::before {
      content: "[x]";
    }
    
For a live example of this code in action, see the Matching the custom state of a custom checkbox element example on the `CustomStateSet` page.
### Matching a custom state in a shadow part
This example shows how the `:state()` pseudo-class can be used to target the shadow parts of a custom element.
Shadow parts are defined and named using the `part` attribute. For example, consider a custom element named `<question-box>` that uses a `<labeled-checkbox>` custom element as a shadow part named `checkbox`:
    
    shadowRoot.innerHTML = `<labeled-checkbox part='checkbox'>Yes</labeled-checkbox>`;
    
The CSS below shows how the `::part()` pseudo-element can be used to match against the `'checkbox'` shadow part. It then shows how the `::part()` pseudo-element followed by the `:state()` pseudo-class can be used to match against the same part when it is in the `checked` state.
    
    question-box::part(checkbox) {
      color: red;
    }
    
    question-box::part(checkbox):state(checked) {
      color: green;
      outline: dashed 1px green;
    }
    
For a live example of this code in action, see the Matching a custom state in a shadow part of a custom element example on the `CustomStateSet` page.
# scroll-margin
The `scroll-margin` shorthand property sets all of the scroll margins of an element at once, assigning values much like the `margin` property does for margins of an element.
## Try it
    
    scroll-margin: 0;
    
    
    scroll-margin: 20px;
    
    
    scroll-margin: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-margin-bottom`
  * `scroll-margin-left`
  * `scroll-margin-right`
  * `scroll-margin-top`


## Syntax
    
    /* <length> values */
    scroll-margin: 10px;
    scroll-margin: 1em 0.5em 1em 1em;
    
    /* Global values */
    scroll-margin: inherit;
    scroll-margin: initial;
    scroll-margin: revert;
    scroll-margin: revert-layer;
    scroll-margin: unset;
    
### Values
`<length>`
    
An outset from the corresponding edge of the scroll container.
## Description
You can see the effect of `scroll-margin` by scrolling to a point partway between two of the "pages" of the example's content. The value specified for `scroll-margin` determines how much of the page that's primarily outside the snapport should remain visible.
Thus, the `scroll-margin` values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Examples
>
### Basic demonstration
This example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
The aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block.
#### HTML
The HTML includes a scroller with four children:
    
    <div class="scroller">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
    </div>
    
#### CSS
Let's walk through the CSS. The outer container is styled like this:
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
The main parts relevant to the scroll snapping are `overflow-x: scroll`, which makes sure the contents will scroll and not be hidden, and `scroll-snap-type: x mandatory`, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
The child elements are styled as follows:
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(2n) {
      background-color: white;
      color: rebeccapurple;
    }
    
The most relevant part here is `scroll-snap-align: start`, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points.
Last of all we specify the scroll margin-values, a different one for the second and third child elements:
    
    .scroller > div:nth-child(2) {
      scroll-margin: 1rem;
    }
    
    .scroller > div:nth-child(3) {
      scroll-margin: 2rem;
    }
    
This means that when scrolling past the middle child elements, the scrolling will snap to `1rem` outside the left edge of the second `<div>`, and `2rems` outside the left edge of the third `<div>`.
Note: Here we are setting `scroll-margin` on all sides at once, but only the start edge is really relevant. It would work just as well here to only set a scroll margin on that one edge, for example with `scroll-margin-inline-start: 1rem`, or `scroll-margin: 0 0 0 1rem`.
#### Result
Try it for yourself:
# counters()
The `counters()` CSS function enables combining markers when nesting counters. The function returns a string that concatenates the current values of the named and nested counters, if any are present, with the string provided. The third, optional parameter enables defining the list style.
The `counters()` function is generally used within pseudo-element through the `content` property, but theoretically, it can be used wherever a `<string>` value is supported.
The `counters()` function has two forms: `counters(<name>, <string>)` and `counters(<name>, <string>, <style>)`. The generated text is the value of all counters with the given `<name>`, arranged from the outermost to the innermost, and separated by the specified `<string>`. The counters are rendered in the `<style>` indicated, defaulting to `decimal` if no `<style>` is specified.
## Try it
    
    ol {
      counter-reset: index;
      list-style-type: none;
    }
    
    li::before {
      counter-increment: index;
      content: counters(index, ".", decimal) " ";
    }
    
    
    <ol>
      <li>Mars</li>
      <li>
        Saturn
        <ol>
          <li>Mimas</li>
          <li>Enceladus</li>
          <li>
            <ol>
              <li>Voyager</li>
              <li>Cassini</li>
            </ol>
          </li>
          <li>Tethys</li>
        </ol>
      </li>
      <li>
        Uranus
        <ol>
          <li>Titania</li>
        </ol>
      </li>
    </ol>
    
## Syntax
    
    /* Basic usage  - style defaults to decimal */
    counters(counter-name, '.');
    
    /* changing the counter display */
    counters(counter-name, '-', upper-roman)
    
A counter has no visible effect by itself. The `counters()` function (and `counter()` function) is what makes it useful by returning developer-defined content.
### Values
The `counters()` function accepts two or three parameters. The first parameter is the `<counter-name>`. The second parameter is the concatenator `<string>`. The optional third parameter is the `<counter-style>`.
`<counter-name>`
    
A `<custom-ident>` identifying the counters, which is the same case-sensitive name used for the `counter-reset` and `counter-increment` properties. The name cannot start with two dashes and can't be `none`, `unset`, `initial`, or `inherit`. Alternatively, for inline, single-use counters, the `symbols()` function can be used instead of a named counter in browsers that support `symbols()`.
`<string>`
    
Any number of text characters. Non-Latin characters must be encoded using their Unicode escape sequences: for example, `\000A9` represents the copyright symbol.
`<counter-style>`
    
A counter style name or a `symbols()` function. The counter style name can be a predefined style such as numeric, alphabetic, or symbolic, a complex longhand predefined style such as East Asian or Ethiopic, or another predefined counter style. If omitted, the counter-style defaults to decimal.
The return value is a string containing all the values of all the counters in the element's CSS counters set named `<counter-name>` in the counter style defined by `<counter-style>` (or decimal, if omitted). The return string is sorted in outermost-first to innermost-last order, joined by the `<string>` specified.
Note: For information about non-concatenated counters, see the `counter()` function, which omits the `<string>` as a parameter.
## Examples
>
### Comparing default counter value to uppercase roman numerals
This example includes two `counters()` functions: one with `<counter-style>` set and the other defaulting to `decimal`.
#### HTML
    
    <ol>
      <li>
        <ol>
          <li></li>
          <li></li>
          <li></li>
        </ol>
      </li>
      <li></li>
      <li></li>
      <li>
        <ol>
          <li></li>
          <li>
            <ol>
              <li></li>
              <li></li>
              <li></li>
            </ol>
          </li>
        </ol>
      </li>
    </ol>
    
#### CSS
    
    ol {
      counter-reset: listCounter;
    }
    li {
      counter-increment: listCounter;
    }
    li::marker {
      content:
        counters(listCounter, ".", upper-roman) ") ";
    }
    li::before {
      content:
        counters(listCounter, ".") " == "
        counters(listCounter, ".", lower-roman);
    }
    
#### Result
### Comparing decimal-leading-zero counter value to lowercase letters
This example includes three `counters()` functions, each with different `<string>` and `<counter-style>` values.
#### HTML
    
    <ol>
      <li>
        <ol>
          <li></li>
          <li></li>
          <li></li>
        </ol>
      </li>
      <li></li>
      <li></li>
      <li>
        <ol>
          <li></li>
          <li>
            <ol>
              <li></li>
              <li></li>
              <li></li>
            </ol>
          </li>
        </ol>
      </li>
    </ol>
    
#### CSS
    
    ol {
      counter-reset: count;
    }
    li {
      counter-increment: count;
    }
    li::marker {
      content:
        counters(count, "-", decimal-leading-zero) ") ";
    }
    li::before {
      content:
        counters(count, "~", upper-alpha) " == "
        counters(count,  "*", lower-alpha);
    }
    
#### Result
# ::cue
The `::cue` CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks.
## Try it
    
    video {
      width: 100%;
    }
    
    video::cue {
      font-size: 1rem;
      color: yellow;
    }
    
    ::cue(u) {
      color: red;
    }
    
    
    <video controls src="/shared-assets/videos/friday.mp4">
      <track
        default
        kind="captions"
        srclang="en"
        src="/shared-assets/misc/friday.vtt" />
      Sorry, your browser doesn't support embedded videos.
    </video>
    
The properties are applied to the entire set of cues as if they were a single unit. The only exception is that `background` and its longhand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media.
In the example above, the `::cue(u)` selector selects all the `<u>` elements inside the cue text.
## Syntax
    
    ::cue | ::cue(<selector>) {
      /* ... */
    }
    
## Permitted properties
Rules whose selectors include this element may only use the following CSS properties:
  * `background`
  * `background-attachment`
  * `background-clip`
  * `background-color`
  * `background-image`
  * `background-origin`
  * `background-position`
  * `background-repeat`
  * `background-size`
  * `color`
  * `font`
  * `font-family`
  * `font-size`
  * `font-stretch`
  * `font-style`
  * `font-variant`
  * `font-weight`
  * `line-height`
  * `opacity`
  * `outline`
  * `outline-color`
  * `outline-style`
  * `outline-width`
  * `ruby-position`
  * `text-combine-upright`
  * `text-decoration`
  * `text-decoration-color`
  * `text-decoration-line`
  * `text-decoration-style`
  * `text-decoration-thickness`
  * `text-shadow`
  * `visibility`
  * `white-space`


## Examples
>
### Styling WebVTT cues as white-on-black
The following CSS sets the cue style so that the text is white and the background is a translucent black box.
    
    ::cue {
      color: white;
      background-color: rgb(0 0 0 / 60%);
    }
    
### Styling WebVTT internal node objects
Cue text can include internal node objects as the tags (similar to HTML elements) `<c>`, `<i>`, `<b>`, `<u>`, `<ruby>`, `<rt>`, `<v>`, and `<lang>`. The `::cue()` selector can be used to apply styles to content inside these tags to customize how the WebVTT track is displayed. Consider the following cue text that uses the `<u>` tag to underline some text:
    
    00:00:01.500 --> 00:00:02.999 line:80%
    Tell me, is the <u>lord of the universe</u> in?
    
The following CSS rule customizes the text inside the `<u>` tag with a color and a text-decoration:
    
    ::cue(u) {
      color: red;
      text-decoration: wavy overline lime;
    }
    
# outline-width
The CSS `outline-width` property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the `border`.
## Try it
    
    outline-width: 12px;
    
    
    outline-width: thin;
    
    
    outline-width: medium;
    
    
    outline-width: thick;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with an outline around it.
      </div>
    </section>
    
    
    #example-element {
      outline: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
It is often more convenient to use the shorthand property `outline` when defining the appearance of an outline.
## Syntax
    
    /* Keyword values */
    outline-width: thin;
    outline-width: medium;
    outline-width: thick;
    
    /* <length> values */
    outline-width: 1px;
    outline-width: 0.1em;
    
    /* Global values */
    outline-width: inherit;
    outline-width: initial;
    outline-width: revert;
    outline-width: revert-layer;
    outline-width: unset;
    
The `outline-width` property is specified as any one of the values listed below.
### Values
`<length>`
    
The width of the outline specified as a `<length>`.
`thin`
    
Depends on the user agent. Typically equivalent to `1px` in desktop browsers (including Firefox).
`medium`
    
Depends on the user agent. Typically equivalent to `3px` in desktop browsers (including Firefox).
`thick`
    
Depends on the user agent. Typically equivalent to `5px` in desktop browsers (including Firefox).
## Examples
>
### Setting an element's outline width
#### HTML
    
    <span id="thin">thin</span>
    <span id="medium">medium</span>
    <span id="thick">thick</span>
    <span id="twopixels">2px</span>
    <span id="oneex">1ex</span>
    <span id="em">1.2em</span>
    
#### CSS
    
    span {
      outline-style: solid;
      display: inline-block;
      margin: 20px;
    }
    
    #thin {
      outline-width: thin;
    }
    
    #medium {
      outline-width: medium;
    }
    
    #thick {
      outline-width: thick;
    }
    
    #twopixels {
      outline-width: 2px;
    }
    
    #oneex {
      outline-width: 1ex;
    }
    
    #em {
      outline-width: 1.2em;
    }
    
#### Result
# anchor-size()
The `anchor-size()` CSS function enables setting anchor-positioned element's size, position, and margins relative to the dimensions of anchor elements. It returns the `<length>` of a specified side of the target anchor element. `anchor-size()` is only valid when used within the value of anchor-positioned elements' sizing, inset, and margin properties.
For detailed information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
## Syntax
    
    /* sizing relative to anchor side */
    width: anchor-size(width);
    block-size: anchor-size(block);
    height: calc(anchor-size(self-inline) + 2em);
    
    /* sizing relative to named anchor's side */
    width: anchor-size(--my-anchor width);
    block-size: anchor-size(--my-anchor block);
    
    /* sizing relative to named anchor's side with fallback */
    width: anchor-size(--my-anchor width, 50%);
    block-size: anchor-size(--my-anchor block, 200px);
    
    /* positioning relative to anchor side */
    left: anchor-size(width);
    inset-inline-end: anchor-size(--my-anchor height, 100px);
    
    /* setting margin relative to anchor side */
    margin-left: calc(anchor-size(width) / 4);
    margin-block-start: anchor-size(--my-anchor self-block, 20px);
    
### Parameters
The `anchor-size()` function's syntax is as follows:
    
    anchor-size(<anchor-name> <anchor-size>, <length-percentage>)
    
The parameters are:
`<anchor-name>` Optional
    
The `anchor-name` property value of an anchor element you want to set the element's size, position, or margins relative to. This is a `<dashed-ident>` value. If omitted, the element's default anchor is used.
Note: Specifying an `<anchor-name>` inside an `anchor-size()` function neither associates nor tethers an element to an anchor; it only defines which anchor the element's property values should be set relative to.
`<anchor-size>` Optional
    
Specifies the dimension of the anchor element that the positioned element's property values will be set relative to. Valid values include:
`width`
    
The width of the anchor element.
`height`
    
The height of the anchor element.
`block`
    
The length of the anchor element's containing block in the block direction.
`inline`
    
The length of the anchor element's containing block in the inline direction.
`self-block`
    
The length of the anchor element in the block direction.
`self-inline`
    
The length of the anchor element in the inline direction.
Note: If this parameter is omitted, the dimension defaults to the `<anchor-size>` keyterm that matches the axis of the property in which the function is included. For example, `width: anchor-size();` is equivalent to `width: anchor-size(width);`.
`<length-percentage>` Optional
    
Specifies the size to use as a fallback value if the element is not absolutely or fixed positioned, or the anchor element doesn't exist. If this parameter is omitted in a case when the fallback would otherwise be used, the declaration is invalid.
Note: The anchor dimension you set the positioned element's property values relative to does not have to be along the same axis as the sizing value being set. For example, `width: anchor-size(height)` is valid.
### Return value
Returns a `<length>` value.
## Description
The `anchor-size()` function enables a positioned element's sizing, position, and margin values to be expressed in terms of an anchor element's dimensions; it returns a `<length>` value representing the dimension of a specific anchor element the positioned element's property values are set relative to. It is a valid value for sizing, inset, and margin properties set on anchor-positioned elements.
The length returned is the vertical or horizontal size of an anchor element or its containing block. The dimension used is defined by the `<anchor-size>` parameter. If that parameter is omitted, the dimension used will match the axis of the sizing, position, or margin property is it set on. So for example:
  * `width: anchor-size()` is equivalent to `width: anchor-size(width)`.
  * `top: anchor-size()` is equivalent to `top: anchor-size(height)`.
  * `margin-inline-end: anchor-size()` is equivalent to `margin-inline-end: anchor-size(self-inline)`. `margin-inline-end: anchor-size()` is also equivalent to `margin-inline-end: anchor-size(width)` in horizontal writing modes, or `margin-inline-end: anchor-size(height)` in vertical writing modes.


The anchor element used as the basis for the dimension length is the element with the `anchor-name` specified in the `<anchor-name>` parameter. If more than one element has the same anchor name, the last element with that anchor name in the DOM order is used.
If no `<anchor-name>` parameter is included in the function call, the element's default anchor, referenced in its `position-anchor` property, or associated with the element via the `anchor` HTML attribute, is used.
If an `<anchor-name>` parameter is included and there are no elements matching that anchor name, the fallback value is used. If no fallback was included, the declaration is ignored. For example, if `width: anchor-size(--foo width, 50px); height: anchor-size(--foo width);` were specified on the positioned element but no anchor named `--foo` exists in the DOM, the `width` would be `50px` and the `height` declaration would have no effect.
If an element has sizing, position, or margin properties with `anchor-size()` values set on them, but it is not an anchor-positioned element (it does not have its `position` property set to `absolute` or `fixed` or does not have an anchor associated with it via its `position-anchor` property), the fallback value will be used if one is available. If no fallback is available, the declaration is ignored.
For example, if `width: anchor-size(width, 50px);` were specified on the positioned element but no anchor was associated with it, the fallback value would be used, so `width` would get a computed value of `50px`.
For detailed information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
### Properties that accept `anchor-size()` function values
The properties that accept an `anchor-size()` function as a value include:
  * Sizing properties: 
    * `width`
    * `height`
    * `min-width`
    * `min-height`
    * `max-width`
    * `max-height`
    * `block-size`
    * `inline-size`
    * `min-block-size`
    * `min-inline-size`
    * `max-block-size`
    * `max-inline-size`
  * Inset properties: 
    * `bottom`
    * `left`
    * `right`
    * `top`
    * `inset` shorthand
    * `inset-block` shorthand
    * `inset-block-end`
    * `inset-block-start`
    * `inset-inline` shorthand
    * `inset-inline-end`
    * `inset-inline-start`
  * Margin properties: 
    * `margin` shorthand
    * `margin-bottom`
    * `margin-left`
    * `margin-right`
    * `margin-top`
    * `margin-block` shorthand
    * `margin-block-end`
    * `margin-block-start`
    * `margin-inline` shorthand
    * `margin-inline-end`
    * `margin-inline-start`


### Using `anchor-size()` inside `calc()`
The most common `anchor-size()` functions you'll use will just refer to a dimension of the default anchor. Alternative, include the `anchor-size()` function inside a `calc()` function to modify the size applied to the positioned element.
For example, this rule sizes the positioned element's width equal to the default anchor element's width:
    
    .positionedElem {
      width: anchor-size(width);
    }
    
This rule sizes the positioned element's inline size to 4 times the anchor element's inline size, with the multiplication being done inside a `calc()` function:
    
    .positionedElem {
      inline-size: calc(anchor-size(self-inline) * 4);
    }
    
## Examples
>
### Basic `anchor-size()` usage
This example shows two elements positioned relative to an anchor and sized using `anchor-size()` functions.
#### HTML
We specify three `<div>` elements, one `anchor` element and the two `infobox` elements we'll position relative to the anchor. We also include filler text to make the `<body>` tall enough to require scrolling, but this has been hidden for the sake of brevity.
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox" id="infobox1">
      <p>This is the first infobox.</p>
    </div>
    
    <div class="infobox" id="infobox2">
      <p>This is the second infobox.</p>
    </div>
    
#### CSS
We declare the `anchor` `<div>` as an anchor element by giving it an `anchor-name`. The positioned elements, with their `position` properties set to `fixed`, are associated with the anchor element via their `position-anchor` properties. We also set absolute `height` and `width` dimensions on the anchor to provide a reference point when checking the positioned element dimensions, for example, with browser developer tools:
    
    .anchor {
      anchor-name: --my-anchor;
      width: 100px;
      height: 100px;
    }
    
    .infobox {
      position-anchor: --my-anchor;
      position: fixed;
    }
    
We set some distinct property values on the positioned elements:
  * The positioned elements are tethered to the anchor with different `position-area` values that position the elements in different places around the anchor element.
  * The `height` of the first infobox is set to the same height as the anchor element: `anchor-size(height)` returns the anchor element's height. The element's `width` is set to double the anchor element's width using the `anchor-size()` function within a `calc()` function: `anchor-size(width)` retrieves the anchor element's width, which is then multiplied by two.
  * The `height` of the second infobox is set to two-thirds of the anchor element's height, using a similar technique.
  * Margin values are included to provide some separation from the anchor element.


    
    #infobox1 {
      position-area: right;
      height: anchor-size(height);
      width: calc(anchor-size(width) * 2);
      margin-left: 5px;
    }
    
    #infobox2 {
      position-area: top span-right;
      height: calc(anchor-size(height) / 1.5);
      margin-bottom: 5px;
    }
    
#### Result
Use your browser tools to inspect the anchor-positioned elements. The first infobox will be `100px` tall and `200px` wide, while the second infobox will have a height of approximately `66.7px`, with the `width` defaulting to `max-content`.
### Position and margin example
See `anchor-size()` position and margin example.
# animation-range-end
The `animation-range-end` CSS property is used to set the end of an animation's attachment range along its timeline, i.e., where along the timeline an animation will end.
The `animation-range-end` and `animation-range-start` properties can also be set using the `animation-range` shorthand property.
Note: `animation-range-end` is included in the `animation` shorthand as a reset-only value. This means that including `animation` resets a previously-declared `animation-range-end` value to `normal`, but a specific value cannot be set via `animation`. When creating CSS scroll-driven animations, you need to declare `animation-range-end` after declaring any `animation` shorthand for it to take effect.
## Syntax
    
    /* Keyword or length percentage value */
    animation-range-end: normal;
    animation-range-end: 80%;
    animation-range-end: 700px;
    
    /* Named timeline range value */
    animation-range-end: cover;
    animation-range-end: contain;
    animation-range-end: cover 80%;
    animation-range-end: contain 700px;
    
### Values
Allowed values for `animation-range-end` are `normal`, a `<length-percentage>`, a `<timeline-range-name>`, or a `<timeline-range-name>` with a `<length-percentage>` following it. See `animation-range` for a detailed description of the available values.
Also check out the View Timeline Ranges Visualizer, which shows exactly what the different values mean in an easy visual format.
## Examples
>
### Creating a named view progress timeline with range end
A view progress timeline named `--subject-reveal` is defined using the `view-timeline` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
An `animation-range-end` declaration is also set to make the animation end earlier than expected.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed. We also give it an `animation-range-end` declaration to make the animation end earlier than expected.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline: --subject-reveal block;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-range-end: contain 50%;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# min-block-size
The `min-block-size` CSS property defines the minimum horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`.
If the writing mode is vertically oriented, the value of `min-block-size` relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. A related property is `min-inline-size`, which defines the other dimension of the element.
## Try it
    
    min-block-size: 150px;
    writing-mode: horizontal-tb;
    
    
    min-block-size: 150px;
    writing-mode: vertical-rl;
    
    
    min-block-size: 20px;
    writing-mode: horizontal-tb;
    
    
    min-block-size: 15em;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the minimum block size. <br />If there is
        more content than the minimum the box will grow in the block dimension as
        needed by the content.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    min-block-size: 100px;
    min-block-size: 5em;
    min-block-size: anchor-size(self-inline);
    
    /* <percentage> values */
    min-block-size: 10%;
    
    /* Keyword values */
    min-block-size: max-content;
    min-block-size: min-content;
    min-block-size: fit-content;
    min-block-size: fit-content(20em);
    
    /* Global values */
    min-block-size: inherit;
    min-block-size: initial;
    min-block-size: revert;
    min-block-size: revert-layer;
    min-block-size: unset;
    
### Values
The `min-block-size` property takes the same values as the `min-width` and `min-height` properties.
## Examples
>
### Setting minimum block size for vertical text
#### HTML
    
    <p class="exampleText">Example text</p>
    
#### CSS
    
    .exampleText {
      writing-mode: vertical-rl;
      background-color: yellow;
      min-block-size: 200px;
    }
    
#### Result
# object-position
The `object-position` CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background.
You can adjust how the replaced element's object's intrinsic size (that is, its natural size) is adjusted to fit within the element's box using the `object-fit` property.
## Try it
    
    object-position: 50% 50%;
    
    
    object-position: right top;
    
    
    object-position: left bottom;
    
    
    object-position: 250px 125px;
    
    
    <section id="default-example">
      <img
        class="transition-all"
        id="example-element"
        src="/shared-assets/images/examples/moon.jpg" />
    </section>
    
    
    #example-element {
      height: 250px;
      width: 250px;
      object-fit: none;
      border: 1px solid red;
    }
    
## Syntax
    
    /* Keyword values */
    object-position: top;
    object-position: bottom;
    object-position: left;
    object-position: right;
    object-position: center;
    
    /* <percentage> values */
    object-position: 25% 75%;
    
    /* <length> values */
    object-position: 0 0;
    object-position: 1cm 2cm;
    object-position: 10ch 8em;
    
    /* Edge offsets values */
    object-position: bottom 10px right 20px;
    object-position: right 3em bottom 10px;
    object-position: top 0 right 10px;
    
    /* Global values */
    object-position: inherit;
    object-position: initial;
    object-position: revert;
    object-position: revert-layer;
    object-position: unset;
    
### Values
`<position>`
    
From one to four values that define the 2D position of the element. Relative or absolute offsets can be used.
Note: The position can be set so that the replaced element is drawn outside its box.
## Examples
>
### Positioning image content
#### HTML
Here we see HTML that includes two `<img>` elements, each displaying the MDN logo.
    
    <img id="object-position-1" src="mdn.svg" alt="MDN Logo" />
    <img id="object-position-2" src="mdn.svg" alt="MDN Logo" />
    
#### CSS
The CSS includes default styling for the `<img>` element itself, as well as separate styles for each of the two images.
    
    img {
      width: 300px;
      height: 250px;
      border: 1px solid black;
      background-color: silver;
      margin-right: 1em;
      object-fit: none;
    }
    
    #object-position-1 {
      object-position: 10px;
    }
    
    #object-position-2 {
      object-position: 100% 10%;
    }
    
The first image is positioned with its left edge inset 10 pixels from the left edge of the element's box. The second image is positioned with its right edge flush against the right edge of the element's box and is located 10% of the way down the height of the element's box.
#### Result
# vector-effect
The `vector-effect` CSS property suppresses specific transformation effects in SVG, thus permitting effects like a road on a map staying the same width no matter how the map is zoomed, or allowing a diagram key to retain its position and size regardless of other transforms. It can only be used with SVG elements that accept the `vector-effect` attribute. When used, the CSS value overrides any values of the element's `vector-effect` attribute.
## Syntax
    
    /* Keywords */
    vector-effect: none;
    vector-effect: non-scaling-stroke;
    
    /* Global values */
    vector-effect: inherit;
    vector-effect: initial;
    vector-effect: revert;
    vector-effect: revert-layer;
    vector-effect: unset;
    
### Values
`none`
    
No vector effects are applied to the element, meaning it will be fully affected by transforms as normal.
`non-scaling-stroke`
    
The element's drawn stroke width will be physically equal in size to its defined stroke width, even if the element has been scaled up or down in size due to transforms of either itself or its coordinate system. This is the case whether the element is scaled with transforms or by physical resizing of the entire image.
Note: The spec defines three other values, `non-scaling-size`, `non-rotation`, and `fixed-position`, but these have no implementations and are considered at-risk.
## Examples
>
### Preventing SVG stroke scaling with CSS
Here, we start with a 200x100 SVG image that contains two rectangles inside a group. The group is scaled up and rotated. The second of the two rectangles has a class of `thinned`.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
      <g
        transform="scale(2.3) rotate(23)"
        transform-origin="100 50"
        stroke-width="3"
        stroke="orange"
        fill="#ddeeff88">
        <rect x=" 60" y="20" width="30" height="60" />
        <rect x="110" y="20" width="30" height="60" class="thinned" />
      </g>
    </svg>
    
To this SVG image, we apply `width: 500px` to make it larger than its intrinsic size, and set the classed `<rect>` to have non-scaled strokes.
    
    svg {
      width: 500px;
    }
    svg rect.thinned {
      vector-effect: non-scaling-stroke;
    }
    
The result is that the first of the two rectangles has an apparent (visual) stroke width of approximately 17, whereas the second rectangle still has an apparent stroke width of 3 despite having been scaled up in the same way the first rectangle has.
### Overriding SVG stroke scaling values with CSS
In this case, we start with a similar SVG image to the one used in the previous example. Here, the `<g>` element is rotated as before, but no scaling is applied to it. The `<rect>` elements are given a common origin for their transforms, and have their `vector-effect` SVG attributes set to a value of `none`.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
      <g
        transform="rotate(23)"
        transform-origin="100 50"
        stroke-width="3"
        stroke="orange"
        fill="#ddeeff88">
        <rect
          x=" 60"
          y="20"
          width="30"
          height="60"
          transform-origin="100 50"
          vector-effect="none" />
        <rect
          x="110"
          y="20"
          width="30"
          height="60"
          transform-origin="100 50"
          vector-effect="none"
          class="thinned" />
      </g>
    </svg>
    
As before, the SVG is made larger than its intrinsic size using CSS. This time, scaling is applied to the `<rect>` elements directly, and the second rectangle is set to have its strokes non-scaled.
    
    svg {
      width: 500px;
    }
    svg rect {
      transform: scale(2.3);
    }
    svg rect.thinned {
      vector-effect: non-scaling-stroke;
    }
    
The result is visually identical to that of the previous example. What we can see is that the attribute value of `none` is overridden by the CSS value `non-scaling-stroke`, and that the vector effects are honored even though the scaling was done directly on the `<rect>` rather than on its parent `<g>` element.
# @font-face
The `@font-face` CSS at-rule specifies a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user's own computer.
## Syntax
    
    @font-face {
      font-family: "Trickster";
      src:
        local("Trickster"),
        url("trickster-COLRv1.otf") format("opentype") tech(color-COLRv1),
        url("trickster-outline.otf") format("opentype"),
        url("trickster-outline.woff") format("woff");
    }
    
### Descriptors
`ascent-override`
    
Defines the ascent metric for the font.
`descent-override`
    
Defines the descent metric for the font.
`font-display`
    
Determines how a font face is displayed based on whether and when it is downloaded and ready to use.
`font-family`
    
Specifies a name that will be used as the font face value for font properties. A `font-family` name is required for the `@font-face` rule to be valid.
`font-stretch`
    
A `font-stretch` value. Accepts two values to specify a range that is supported by a font face, for example `font-stretch: 50% 200%;`
`font-style`
    
A `font-style` value. Accepts two values to specify a range that is supported by a font face, for example `font-style: oblique 20deg 50deg;`
`font-weight`
    
A `font-weight` value. Accepts two values to specify a range that is supported by a font face, for example `font-weight: 100 400;`
`font-feature-settings`
    
Allows control over advanced typographic features in OpenType fonts.
`font-variation-settings`
    
Allows low-level control over OpenType or TrueType font variations, by specifying the four-letter axis names of the features to vary, along with their variation values.
`line-gap-override`
    
Defines the line gap metric for the font.
`size-adjust`
    
Defines a multiplier for glyph outlines and metrics associated with this font. This makes it easier to harmonize the designs of various fonts when rendered at the same font size.
`src`
    
Specifies references to font resources including hints about the font format and technology. A `src` is required for the `@font-face` rule to be valid.
`unicode-range`
    
The range of Unicode code points to be used from the font.
## Description
It's common to use both `url()` and `local()` together, so that the user's installed copy of the font is used if available, falling back to downloading a copy of the font if it's not found on the user's device.
If the `local()` function is provided, specifying a font name to look for on the user's device, and if the user agent finds a match, that local font is used. Otherwise, the font resource specified using the `url()` function is downloaded and used.
Browsers attempt to load resources in their list declaration order, so usually `local()` should be written before `url()`. Both functions are optional, so a rule block containing only one or more `local()` without `url()` is possible. If more specific fonts with `format()` or `tech()` values are desired, these should be listed before versions that don't have these values, as the less specific variant would otherwise be tried and used first.
By allowing authors to provide their own fonts, `@font-face` makes it possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts that are so common that they're considered to be universally available). The ability to specify the name of a locally-installed font to look for and use makes it possible to customize the font beyond the basics while making it possible to do so without relying on an internet connection.
Note: Fallback strategies for loading fonts on older browsers are described in the `src` descriptor page.
The `@font-face` at-rule may be used not only at the top level of a CSS, but also inside any CSS conditional-group at-rule.
### Font MIME Types
Format MIME type  
TrueType `font/ttf`  
OpenType `font/otf`  
Web Open Font Format `font/woff`  
Web Open Font Format 2 `font/woff2`  
### Notes
  * Web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction.
  * `@font-face` cannot be declared within a CSS selector. For example, the following will not work:
        .className {
          @font-face {
            font-family: "MyHelvetica";
            src:
              local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"),
              url("MgOpenModernaBold.ttf");
            font-weight: bold;
          }
        }
        


## Examples
>
### Specifying a downloadable font
This example specifies a downloadable font to use, applying it to the entire body of the document:
    
    <body>
      This is Bitstream Vera Serif Bold.
    </body>
    
    
    @font-face {
      font-family: "Bitstream Vera Serif Bold";
      src: url("https://mdn.github.io/shared-assets/fonts/VeraSeBd.ttf");
    }
    
    body {
      font-family: "Bitstream Vera Serif Bold", serif;
    }
    
### Specifying local font alternatives
In this example, the user's local copy of "Helvetica Neue Bold" is used; if the user does not have that font installed (both the full font name and the Postscript name are tried), then the downloadable font named "MgOpenModernaBold.ttf" is used instead:
    
    @font-face {
      font-family: "MyHelvetica";
      src:
        local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"),
        url("MgOpenModernaBold.ttf");
      font-weight: bold;
    }
    
# cx
The `cx` CSS property defines the x-axis center point of an SVG `<circle>` or `<ellipse>` element. If present, it overrides the element's `cx` attribute.
Note: While SVG the `cx` attribute is relevant to the SVG `<radialGradient>` element, the `cx` property only applies to `<circle>` and `<ellipse>` elements nested in an `<svg>`. It doesn't apply to `<radialGradient>` or other SVG elements nor to HTML elements or pseudo-elements.
## Syntax
    
    /* length and percentage values */
    cx: 20px;
    cx: 20%;
    
    /* Global values */
    cx: inherit;
    cx: initial;
    cx: revert;
    cx: revert-layer;
    cx: unset;
    
### Values
The `<length>` and `<percentage>` values denote the horizontal center of the circle or ellipse.
`<length>`
    
As an absolute or relative length, it can be expressed in any unit allowed by the CSS `<length>` data type. Negative values are invalid.
`<percentage>`
    
Percentages refer to the width of the current SVG viewport.
## Examples
>
### Defining the x-axis coordinate of a circle and ellipse
This example demonstrates the basic use case of `cx`, and how the CSS `cx` property takes precedence over the `cx` attribute.
#### HTML
We include two identical `<circle>` and two identical `<ellipse>` elements in an SVG; their `cx` attribute values are `50` and `150`, respectively.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="30" />
      <circle cx="50" cy="50" r="30" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
    </svg>
    
#### CSS
With CSS, we style only the first circle and first ellipse, allowing their twin shapes to use default styles (with (`fill` defaulting to black). We use the `cx` property to override the value of the SVG `cx` attribute and also give it a `fill` and `stroke` to differentiate the first shapes in each pair from their twin. The browser renders SVG images as `300px` wide and `150px` tall by default.
    
    svg {
      border: 1px solid;
    }
    
    circle:first-of-type {
      cx: 30px;
      fill: lightgreen;
      stroke: black;
    }
    ellipse:first-of-type {
      cx: 180px;
      fill: pink;
      stroke: black;
    }
    
#### Results
The style circle's center is `30px` from the left edge of the SVG viewport and the styled ellipse is `180px` from that edge, as defined in the CSS `cx` property values. The unstyled shapes centers are `50px` and `150px` from the left edge of the SVG viewport, as defined in their SVG `cx` attribute values.
### x-axis coordinates as percentage values
This example demonstrates using percentage values for `cx`.
#### HTML
We use the same markup as the previous example.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="30" />
      <circle cx="50" cy="50" r="30" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
    </svg>
    
#### CSS
We use CSS which is similar to the previous example. The only difference is the CSS `cx` property value; in this case, we use percentage values of `30%` for the `<circle>` and `80%` for the `<ellipse>`.
    
    svg {
      border: 1px solid;
    }
    
    circle:first-of-type {
      cx: 30%;
      fill: lightgreen;
      stroke: black;
    }
    ellipse:first-of-type {
      cx: 80%;
      fill: pink;
      stroke: black;
    }
    
#### Results
When using percentage values for `cx`, the values are relative to the width of the SVG viewport. Here, the x-axis coordinates of the center of the style circle and ellipse are `30%` and `80%`, respectively, of the width of the current SVG viewport. As the width defaulted to `300px`, the `cx` values are `90px` and `240px` from the SVG viewport's left edge.
# :seeking
The `:seeking` CSS pseudo-class selector represents an element that is playable, such as `<audio>` or `<video>`, when the playable element is seeking a playback position in the media resource. A resource is considered to be seeking if the user has requested playback of a specific position in the media resource, but the media element has not yet reached that position.
Seeking is different from `:buffering` in that the media element is not currently loading data, but is instead skipping to a new position in the media resource. For more information, see the Media buffering, seeking, and time ranges guide.
## Syntax
    
    :seeking {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :seeking {
      outline: 5px solid red;
    }
    
    video:seeking {
      outline: 5px solid blue;
    }
    
# paint-order
The `paint-order` CSS property lets you control the order in which the fill and stroke (and painting markers) of text content and shapes are drawn.
## Syntax
    
    /* Normal */
    paint-order: normal;
    
    /* Single values */
    paint-order: stroke; /* draw the stroke first, then fill and markers */
    paint-order: markers; /* draw the markers first, then fill and stroke */
    
    /* Multiple values */
    paint-order: stroke fill; /* draw the stroke first, then the fill, then the markers */
    paint-order: markers stroke fill; /* draw markers, then stroke, then fill */
    
    /* Global values */
    paint-order: inherit;
    paint-order: initial;
    paint-order: revert;
    paint-order: revert-layer;
    paint-order: unset;
    
If no value is specified, the default paint order is `fill`, `stroke`, `markers`.
When one value is specified, that one is painted first, followed by the other two in their default order relative to one another. When two values are specified, they will be painted in the order they are specified in, followed by the unspecified one.
Note: In the case of this property, markers are only appropriate when drawing SVG shapes involving the use of the `marker-*` properties (e.g., `marker-start`) and `<marker>` element. They do not apply to HTML text, so in that case, you can only determine the order of `stroke` and `fill`.
### Values
`normal`
    
Paint the different items in normal paint order.
`stroke`, `fill`, `markers`
    
Specify some or all of these values in the order you want them to be painted in.
## Examples
>
### Reversing the paint order of stroke and fill
#### SVG
    
    <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200">
      <text x="10" y="75">stroke in front</text>
      <text x="10" y="150" class="stroke-behind">stroke behind</text>
    </svg>
    
#### CSS
    
    text {
      font-family: sans-serif;
      font-size: 50px;
      font-weight: bold;
      fill: black;
      stroke: red;
      stroke-width: 4px;
    }
    
    .stroke-behind {
      paint-order: stroke fill;
    }
    
#### Result
### Reversing the paint order of stroke and fill using HTML
To control the fill and stroke order in HTML, you can use the `-webkit-text-stroke-color` and `-webkit-text-stroke-width` CSS properties.
#### HTML
    
    <div>stroke in front</div>
    <div class="stroke-behind">stroke behind</div>
    
#### CSS
    
    div {
      font-family: sans-serif;
      font-size: 50px;
      font-weight: bold;
      fill: black;
      padding-top: 10px;
      padding-bottom: 10px;
      -webkit-text-stroke-color: red;
      -webkit-text-stroke-width: 4px;
    }
    
    .stroke-behind {
      paint-order: stroke fill;
    }
    
#### Result
# fit-content
The `fit-content` sizing keyword represents an element size that adapts to its content while staying within the limits of its container. The keyword ensures that the element is never smaller than its minimum intrinsic size (`min-content`) or larger than its maximum intrinsic size (`max-content`).
Note: This keyword is different from the `fit-content()` function. The function is used for grid track sizing (for example in `grid-template-columns` and `grid-auto-rows`) and for laid-out box sizing for properties such as `width`, `height`, `min-width`, and `max-height`.
## Syntax
    
    /* Used in sizing properties */
    width: fit-content;
    height: fit-content;
    inline-size: fit-content;
    block-size: fit-content;
    
## Description
This keyword is used with sizing properties such as `width`, `height`, `block-size`, `inline-size`, `min-width`, and `max-width`. When used on these properties, the calculated size refers to the element's content box.
When `fit-content` is set, the element grows or shrinks to fit its content, but stops expanding after the relevant dimension reaches the size limit of its container.
The `fit-content` size is calculated using the following formula:
    
    min(max-content, max(min-content, stretch))
    
where, `stretch` matches the element's margin box to the width of its containing block. The keyword is essentially equivalent to `fit-content(stretch)`.
You can enable animations to and from `fit-content` using the `interpolate-size` property and the `calc-size()` function.
## Examples
>
### Sizing boxes with fit-content
#### HTML
    
    <div class="container">
      <div class="item">Item</div>
      <div class="item">Item with more text in it.</div>
      <div class="item">
        Item with more text in it, hopefully we have added enough text so the text
        will start to wrap.
      </div>
    </div>
    
#### CSS
    
    .container {
      border: 2px solid #cccccc;
      padding: 10px;
      width: 20em;
    }
    
    .item {
      width: fit-content;
      background-color: #8ca0ff;
      padding: 5px;
      margin-bottom: 1em;
    }
    
#### Result
# border-inline-style
The `border-inline-style` CSS property defines the style of the logical inline borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-inline-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-inline-style: groove;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border style in the other dimension can be set with `border-block-style`, which sets `border-block-start-style`, and `border-block-end-style`.
## Syntax
    
    /* <'border-style'> values */
    border-inline-style: dashed;
    border-inline-style: dotted;
    border-inline-style: groove;
    
    /* Global values */
    border-inline-style: inherit;
    border-inline-style: initial;
    border-inline-style: revert;
    border-inline-style: revert-layer;
    border-inline-style: unset;
    
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### Setting border-inline-style
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-inline-style: dashed;
    }
    
# mix-blend-mode
The `mix-blend-mode` CSS property sets how an element's content should blend with the content of the element's parent and the element's background.
## Try it
    
    mix-blend-mode: normal;
    
    
    mix-blend-mode: multiply;
    
    
    mix-blend-mode: hard-light;
    
    
    mix-blend-mode: difference;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <img
          id="example-element"
          src="/shared-assets/images/examples/firefox-logo.svg"
          width="200" />
      </div>
    </section>
    
    
    .example-container {
      background-color: sandybrown;
    }
    
## Syntax
    
    /* Keyword values */
    mix-blend-mode: normal;
    mix-blend-mode: multiply;
    mix-blend-mode: screen;
    mix-blend-mode: overlay;
    mix-blend-mode: darken;
    mix-blend-mode: lighten;
    mix-blend-mode: color-dodge;
    mix-blend-mode: color-burn;
    mix-blend-mode: hard-light;
    mix-blend-mode: soft-light;
    mix-blend-mode: difference;
    mix-blend-mode: exclusion;
    mix-blend-mode: hue;
    mix-blend-mode: saturation;
    mix-blend-mode: color;
    mix-blend-mode: luminosity;
    mix-blend-mode: plus-darker;
    mix-blend-mode: plus-lighter;
    
    /* Global values */
    mix-blend-mode: inherit;
    mix-blend-mode: initial;
    mix-blend-mode: revert;
    mix-blend-mode: revert-layer;
    mix-blend-mode: unset;
    
### Values
`<blend-mode>`
    
The blending mode that should be applied.
`plus-darker`
    
Blending using the plus-darker compositing operator.
`plus-lighter`
    
Blending using the plus-lighter compositing operator. Useful for cross-fade effects (prevents unwanted blinking when two overlaying elements animate their opacity in opposite directions).
## Examples
>
### Effect of different mix-blend-mode values
### Using mix-blend-mode with HTML
#### HTML
    
    <div class="isolate">
      <div class="circle circle-1"></div>
      <div class="circle circle-2"></div>
      <div class="circle circle-3"></div>
    </div>
    
#### CSS
    
    .circle {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      mix-blend-mode: screen;
      position: absolute;
    }
    
    .circle-1 {
      background: red;
    }
    
    .circle-2 {
      background: lightgreen;
      left: 40px;
    }
    
    .circle-3 {
      background: blue;
      left: 20px;
      top: 40px;
    }
    
    .isolate {
      isolation: isolate; /* Without isolation, the background color will be taken into account */
      position: relative;
    }
    
#### Result
### Using mix-blend-mode with SVG
#### SVG
    
    <svg>
      <g class="isolate">
        <circle cx="40" cy="40" r="40" fill="red" />
        <circle cx="80" cy="40" r="40" fill="lightgreen" />
        <circle cx="60" cy="80" r="40" fill="blue" />
      </g>
    </svg>
    
#### CSS
    
    circle {
      mix-blend-mode: screen;
    }
    .isolate {
      isolation: isolate;
    } /* Without isolation, the background color will be taken into account */
    
#### Result
### Using mix-blend-mode with text
This example uses `mix-blend-mode` to blend text color with the background color of its parent element.
#### HTML
    
    <div class="container">
      <p>Mostly Harmless</p>
      <p class="multiply">Mostly Harmless</p>
      <p class="screen">Mostly Harmless</p>
      <p class="hard-light">Mostly Harmless</p>
    </div>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Rubik+Moonrocks&display=swap";
    
    .container {
      background-color: blue;
    }
    
    p {
      font:
        4rem "Rubik Moonrocks",
        cursive;
      font-weight: bold;
      color: orange;
      padding: 0.5rem;
      margin: 0;
    }
    
    .multiply {
      mix-blend-mode: multiply;
    }
    
    .screen {
      mix-blend-mode: screen;
    }
    
    .hard-light {
      mix-blend-mode: hard-light;
    }
    
#### Result
# Attribute selectors
The CSS attribute selector matches elements based on the element having a given attribute explicitly set, with options for defining an attribute value or substring value match.
## Syntax
    
    /* <a> elements with a title attribute */
    a[title] {
      color: purple;
    }
    
    /* <a> elements with an href matching "https://example.org" */
    a[href="https://example.org"]
    {
      color: green;
    }
    
    /* <a> elements with an href containing "example" */
    a[href*="example"] {
      font-size: 2em;
    }
    
    /* <a> elements with an href ending ".org", case-insensitive */
    a[href$=".org" i] {
      font-style: italic;
    }
    
    /* <a> elements whose class attribute contains the word "logo" */
    a[class~="logo"] {
      padding: 2px;
    }
    
`[attr]`
    
Represents elements with an attribute name of attr.
`[attr=value]`
    
Represents elements with an attribute name of attr whose value is exactly value.
`[attr~=value]`
    
Represents elements with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value.
`[attr|=value]`
    
Represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, `-` (U+002D). It is often used for language subcode matches.
`[attr^=value]`
    
Represents elements with an attribute name of attr whose value is prefixed (preceded) by value.
`[attr$=value]`
    
Represents elements with an attribute name of attr whose value is suffixed (followed) by value.
`[attr*=value]`
    
Represents elements with an attribute name of attr whose value contains at least one occurrence of value within the string.
`[attr operator value i]`
    
Adding an `i` (or `I`) before the closing bracket causes the value to be compared case-insensitively (for characters within the ASCII range).
`[attr operator value s]`
    
Adding an `s` (or `S`) before the closing bracket causes the value to be compared case-sensitively (for characters within the ASCII range).
### Values
`<attr>`
    
An `<ident>`, that is, the unquoted name of the attribute. This can be any valid language-specific attribute (SVG, HTML, XML, etc), a `data-*` attribute, or an author-created attribute.
`<value>`
    
An `<ident>` or `<string>`, representing the attribute value. The value must be quoted if it contains spaces or special characters.
`s` or `i`
    
Case sensitivity or insensitivity flag. If included before the closing bracket (`]`), makes the value case sensitive or insensitive, irrespective of the markup language.
## Description
The case sensitivity of attribute names and values depends on the document language. In HTML, attribute names are case-insensitive, as are spec-defined enumerated values. The case-insensitive HTML attribute values are listed in the HTML spec. For these attributes, the attribute value in the selector is case-insensitive, regardless of whether the value is invalid or the attribute for the element on which it is set is invalid.
If the attribute value is case-sensitive, like `class`, `id`, and `data-*` attributes, the attribute selector value match is case-sensitive. Attributes defined outside of the HTML specification, like `role` and `aria-*` attributes, are also case-sensitive. Case-sensitive attribute selectors can be made case-insensitive with the inclusion of the case-insensitive modifier (`i`).
## Examples
>
### Links
#### CSS
    
    a {
      color: blue;
    }
    
    /* Internal links, beginning with "#" */
    a[href^="#"] {
      background-color: gold;
    }
    
    /* Links with "example" anywhere in the URL */
    a[href*="example"] {
      background-color: silver;
    }
    
    /* Links with "insensitive" anywhere in the URL,
       regardless of capitalization */
    a[href*="insensitive" i] {
      color: cyan;
    }
    
    /* Links with "cAsE" anywhere in the URL,
    with matching capitalization */
    a[href*="cAsE" s] {
      color: pink;
    }
    
    /* Links that end in ".org" */
    a[href$=".org"] {
      color: red;
    }
    
    /* Links that start with "https://" and end in ".org" */
    a[href^="https://"][href$=".org"]
    {
      color: green;
    }
    
#### HTML
    
    <ul>
      <li><a href="#internal">Internal link</a></li>
      <li><a href="http://example.com">Example link</a></li>
      <li><a href="#InSensitive">Insensitive internal link</a></li>
      <li><a href="http://example.org">Example org link</a></li>
      <li><a href="https://example.org">Example https org link</a></li>
    </ul>
    
#### Result
### Languages
#### CSS
    
    /* All divs with a `lang` attribute are bold. */
    div[lang] {
      font-weight: bold;
    }
    
    /* All divs without a `lang` attribute are italicized. */
    div:not([lang]) {
      font-style: italic;
    }
    
    /* All divs in US English are blue. */
    div[lang~="en-us"] {
      color: blue;
    }
    
    /* All divs in Portuguese are green. */
    div[lang="pt"] {
      color: green;
    }
    
    /* All divs in Chinese are red, whether
       simplified (zh-Hans-CN) or traditional (zh-Hant-TW). */
    div[lang|="zh"] {
      color: red;
    }
    
    /* All divs with a Traditional Chinese
       `data-lang` are purple. */
    /* Note: You could also use hyphenated attributes
       without double quotes */
    div[data-lang="zh-Hant-TW"] {
      color: purple;
    }
    
#### HTML
    
    <div lang="en-us en-gb en-au en-nz">Hello World!</div>
    <div lang="pt">Olá Mundo!</div>
    <div lang="zh-Hans-CN">世界您好！</div>
    <div lang="zh-Hant-TW">世界您好！</div>
    <div data-lang="zh-Hant-TW">世界您好！</div>
    
#### Result
### HTML ordered lists
The HTML specification requires the `type` attribute to be matched case-insensitively because it is primarily used in the `<input>` element. Note that if a modifier is not supported by the user agent, then the selector will not match.
#### CSS
    
    /* Case-sensitivity depends on document language */
    ol[type="a"]:first-child {
      list-style-type: lower-alpha;
      background: red;
    }
    
    ol[type="i" s] {
      list-style-type: lower-alpha;
      background: lime;
    }
    
    ol[type="I" s] {
      list-style-type: upper-alpha;
      background: grey;
    }
    
    ol[type="a" i] {
      list-style-type: upper-alpha;
      background: green;
    }
    
#### HTML
    
    <ol type="A">
      <li>
        Red background for case-insensitive matching (default for the type selector)
      </li>
    </ol>
    <ol type="i">
      <li>Lime background if `s` modifier is supported (case-sensitive match)</li>
    </ol>
    <ol type="I">
      <li>Grey background if `s` modifier is supported (case-sensitive match)</li>
    </ol>
    <ol type="A">
      <li>
        Green background if `i` modifier is supported (case-insensitive match)
      </li>
    </ol>
    
#### Result
# font-kerning
The `font-kerning` CSS property sets the use of the kerning information stored in a font.
## Try it
    
    font-kerning: auto;
    
    
    font-kerning: normal;
    
    
    font-kerning: none;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        “We took Tracy to see ‘THE WATERFALL’ in W. Virginia.”
      </div>
    </section>
    
    
    section {
      font-family: serif;
    }
    
Kerning affects how letters are spaced. In well-kerned fonts, this feature makes character spacing more uniform and pleasant to read by reducing white space between certain character combinations.
In the image below, for instance, the examples on the left do not use kerning, while the ones on the right do:
## Syntax
    
    font-kerning: auto;
    font-kerning: normal;
    font-kerning: none;
    
    /* Global values */
    font-kerning: inherit;
    font-kerning: initial;
    font-kerning: revert;
    font-kerning: revert-layer;
    font-kerning: unset;
    
### Values
`auto`
    
The browser determines whether font kerning should be used or not. For example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text.
`normal`
    
Font kerning information stored in the font must be applied.
`none`
    
Font kerning information stored in the font is disabled.
## Examples
>
### Enabling and disabling kerning
#### HTML
    
    <div id="kern"></div>
    <div id="no-kern"></div>
    <textarea id="input">AV T. ij</textarea>
    
#### CSS
    
    div {
      font-size: 2rem;
      font-family: serif;
    }
    
    #no-kern {
      font-kerning: none;
    }
    
    #kern {
      font-kerning: normal;
    }
    
#### JavaScript
    
    const input = document.getElementById("input");
    const kern = document.getElementById("kern");
    const noKern = document.getElementById("no-kern");
    
    input.addEventListener("keyup", () => {
      kern.textContent = input.value; /* Update content */
      noKern.textContent = input.value;
    });
    
    kern.textContent = input.value; /* Initialize content */
    noKern.textContent = input.value;
    
# font-size
The `font-size` CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative `<length>` units, such as `em`, `ex`, and so forth.
## Try it
    
    font-size: 1.2rem;
    
    
    font-size: x-small;
    
    
    font-size: smaller;
    
    
    font-size: 12px;
    
    
    font-size: 80%;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
## Syntax
    
    /* <absolute-size> values */
    font-size: xx-small;
    font-size: x-small;
    font-size: small;
    font-size: medium;
    font-size: large;
    font-size: x-large;
    font-size: xx-large;
    font-size: xxx-large;
    
    /* <relative-size> values */
    font-size: smaller;
    font-size: larger;
    
    /* <length> values */
    font-size: 12px;
    font-size: 0.8em;
    
    /* <percentage> values */
    font-size: 80%;
    
    /* math value */
    font-size: math;
    
    /* Global values */
    font-size: inherit;
    font-size: initial;
    font-size: revert;
    font-size: revert-layer;
    font-size: unset;
    
### Values
`xx-small`, `x-small`, `small`, `medium`, `large`, `x-large`, `xx-large`, `xxx-large`
    
Absolute-size keywords, based on the user's default font size (which is `medium`).
`larger`, `smaller`
    
Relative-size keywords. The font will be larger or smaller relative to the parent element's font size, roughly by the ratio used to separate the absolute-size keywords above.
`<length>`
    
A positive `<length>` value. For most font-relative units (such as `em` and `ex`), the font size is relative to the parent element's font size.
For font-relative units that are root-based (such as `rem`), the font size is relative to the size of the font used by the `<html>` (root) element.
`<percentage>`
    
A positive `<percentage>` value, relative to the parent element's font size.
Note: To maximize accessibility, it is generally best to use values that are relative to the user's default font size.
`math`
    
Scaling rules are applied when determining the computed value of the `font-size` property for math elements relative to the `font-size` of the containing parent. See the math-depth property for more information.
## Description
There are several ways to specify the font size, including keywords or numerical values for pixels or ems. Choose the appropriate method based on the needs of the particular web page.
### Keywords
Keywords are a good way to set the size of fonts on the web. By setting a keyword font size on the `<body>` element, you can set relative font-sizing everywhere else on the page, giving you the ability to easily scale the font up or down on the entire page accordingly.
### Pixels
Setting the font size in pixel values (`px`) is a good choice when you need pixel accuracy. A px value is static. This is an OS-independent and cross-browser way of literally telling the browsers to render the letters at exactly the number of pixels in height that you specified. The results may vary slightly across browsers, as they may use different algorithms to achieve a similar effect.
Font sizing settings can also be used in combination. For example, if a parent element is set to `16px` and its child element is set to `larger`, the child element displays larger than the parent element on the page.
Note: Defining font sizes in `px` is not accessible, because the user cannot change the font size in some browsers. For example, users with limited vision may wish to set the font size much larger than the size chosen by a web designer. Avoid using them for font sizes if you wish to create an inclusive design.
### Ems
Using an `em` value creates a dynamic or computed font size (historically the `em` unit was derived from the width of a capital "M" in a given typeface.). The numeric value acts as a multiplier of the `font-size` property of the element on which it is used. Consider this example:
    
    p {
      font-size: 2em;
    }
    
In this case, the font size of `<p>` elements will be double the computed `font-size` inherited by `<p>` elements. By extension, a `font-size` of `1em` equals the computed `font-size` of the element on which it is used.
If a `font-size` has not been set on any of the `<p>`'s ancestors, then `1em` will equal the default browser `font-size`, which is usually `16px`. So, by default `1em` is equivalent to `16px`, and `2em` is equivalent to `32px`. If you were to set a `font-size` of 20px on the `<body>` element say, then `1em` on the `<p>` elements would instead be equivalent to `20px`, and `2em` would be equivalent to `40px`.
In order to calculate the `em` equivalent for any pixel value required, you can use this formula:
    
    em = desired element pixel value / parent element font-size in pixels
    
For example, suppose the `font-size` of the `<body>` of the page is set to `16px`. If the font-size you want is `12px`, then you should specify `0.75em` (because 12/16 = 0.75). Similarly, if you want a font size of `10px`, then specify `0.625em` (10/16 = 0.625); for `22px`, specify `1.375em` (22/16).
The `em` is a very useful unit in CSS since it automatically adapts its length relative to the font that the reader chooses to use.
One important fact to keep in mind: em values compound. Take the following HTML and CSS:
    
    html {
      font-size: 100%;
    }
    span {
      font-size: 1.6em;
    }
    
    
    <div>
      <span>Outer <span>inner</span> outer</span>
    </div>
    
The result is:
Assuming that the browser's default `font-size` is 16px, the words "outer" would be rendered at 25.6px, but the word "inner" would be rendered at 40.96px. This is because the inner `<span>`'s `font-size` is 1.6em which is relative to its parent's `font-size`, which is in turn relative to its parent's `font-size`. This is often called compounding.
### Rems
`rem` values were invented in order to sidestep the compounding problem. `rem` values are relative to the root `html` element, not the parent element. In other words, it lets you specify a font size in a relative fashion without being affected by the size of the parent, thereby eliminating compounding.
The CSS below is nearly identical to the previous example. The only exception is that the unit has been changed to `rem`.
    
    html {
      font-size: 100%;
    }
    span {
      font-size: 1.6rem;
    }
    
Then we apply this CSS to the same HTML, which looks like this:
    
    <span>Outer <span>inner</span> outer</span>
    
In this example, the words "outer inner outer" are all displayed at 25.6px (assuming that the browser's `font-size` has been left at the default value of 16px).
### Ex
Like the `em` unit, an element's `font-size` set using the `ex` unit is computed or dynamic. It behaves in exactly the same way, except that when setting the `font-size` property using `ex` units, the `font-size` equals the x-height of the first available font used on the page. The number value multiplies the element's inherited `font-size` and the `font-size` compounds relatively.
See the W3C Editor's Draft for a more detailed description of font-relative length units such as `ex`.
## Examples
>
### Setting font sizes
#### CSS
    
    .small {
      font-size: xx-small;
    }
    .larger {
      font-size: larger;
    }
    .point {
      font-size: 24pt;
    }
    .percent {
      font-size: 200%;
    }
    
#### HTML
    
    <h1 class="small">Small H1</h1>
    <h1 class="larger">Larger H1</h1>
    <h1 class="point">24 point H1</h1>
    <h1 class="percent">200% H1</h1>
    
#### Result
# mask-type
The `mask-type` CSS property applies to the SVG `<mask>` element. It defines whether to use the luminance (brightness) or alpha (transparency) content of the mask. This property may be overridden by the `mask-mode` property. The `mask-type` property has no effect on image or gradient masks.
## Syntax
    
    /* Keyword values */
    mask-type: luminance;
    mask-type: alpha;
    
    /* Global values */
    mask-type: inherit;
    mask-type: initial;
    mask-type: revert;
    mask-type: revert-layer;
    mask-type: unset;
    
### Values
`alpha`
    
Indicates that the alpha (transparency) values of the `<mask>` should be used.
`luminance`
    
Indicates that the luminance (brightness) values of the `<mask>` should be used.
## Description
The `mask-type` property is only relevant for the SVG `<mask>` element. If you set `mask-type: luminance`, the mask will use how bright each part of the mask is; if you set `mask-type: alpha`, it will use how transparent or opaque each part of the mask is.
### Default behavior
By default, the SVG `<mask>` element uses `mask-type: luminance`. This means both the color and the transparency of the mask content affect masking. Whether the mask is opaque partially depends on the lightness of the color of the opaque areas:
  * Fully opaque white areas (100% luminance) will be masked and visible.
  * Black (0% luminance) or fully transparent areas will be clipped and invisible.
  * Areas with intermediate luminance values will be partially masked, reflecting both the luminance, or lightness of the mask color, and the alpha transparency of each area of the mask.


### Understanding luminance
The opacity of a `luminance` mask is determined by the `R`, `G`, `B`, and `A` values of an `rgb()` color using the following formula:
`((0.2125 * R) + (0.7154 * G) + (0.0721 * B)) * A`
For example, the color `green` (`#008000` or `rgb(0% 50% 0% / 1)`) has a luminance value of `35.77%`. Any area masked by a solid `green` luminance mask will be `35.77%` visible. If the `mask-type` is set to `alpha`, the same fully opaque `green` color will make the masked area `100%` visible.
If the SVG `<mask>` element has `fill="rgb(0 0 0 / 0.5)"`, which is a 50% transparent black, the corresponding shape on the masked element will display at 50% opacity when `mask-type` is set to `alpha` because the alpha values is `0.5` (50% opacity). But if the `mask-type` defaults to or is set as `luminance` the masked area will be fully clipped and invisible because its luminance is `0`.
### Effect of `mask-mode` on `mask-type`
While the `mask-type` property is set on the SVG `<mask>` element, the `mask-mode` property is set on the element being masked (the element you're applying the mask to). If the mask image source is not an SVG `<mask>`, this property has no effect.
The default value of `mask-mode` is `match-source`, which means the browser uses the `mask-type` value from the `<mask>` element to determine how to interpret it. If `mask-mode` is set to a value other than `match-source`, that value takes precedence and overrides the `mask-type` value of the applied mask.
If the `<mask>` is defined as the mask image's source, and the `mask-mode` is set as or defaults to `match-source`, the `mask-mode` will resolve to the `<mask>` element's `mask-type` value: `luminance` or `alpha`. If not explicitly set, the value defaults to `luminance`.
## Examples
>
### Using the `mask-type` property
This example demonstrates how to use the `mask-type` property and the effect of its different values.
#### HTML
We've included two images that will be masked. Other than their class names, the two images are identical. We've also included an SVG with two `<mask>` elements. Other than their `id` values, the two masks are also identical: each has a green and white heart shape and a semi-transparent white-and-black-filled circle.
    
    <img
      class="alphaMaskType"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <img
      class="luminanceMaskType"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    
    <svg height="0" width="0">
      <mask id="alphaMask">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green"
          stroke="white"
          stroke-width="20" />
        <circle
          cx="170"
          cy="170"
          r="40"
          fill="rgb(0 0 0 / 0.5)"
          stroke="rgb(255 255 255 / 0.5)"
          stroke-width="20" />
      </mask>
      <mask id="luminanceMask">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green"
          stroke="white"
          stroke-width="20" />
        <circle
          cx="170"
          cy="170"
          r="40"
          fill="rgb(0 0 0 / 0.5)"
          stroke="rgb(255 255 255 / 0.5)"
          stroke-width="20" />
      </mask>
    </svg>
    
#### CSS
We apply the `mask-type` property to the `<mask>` elements, and then apply the `<mask>` elements and the mask source to the images.
    
    mask#alphaMask {
      mask-type: alpha;
    }
    
    mask#luminanceMask {
      mask-type: luminance;
    }
    
    img.alphaMaskType {
      mask-image: url("#alphaMask");
    }
    
    img.luminanceMaskType {
      mask-image: url("#luminanceMask");
    }
    
#### Result
As the default value for the `mask-mode` property is `match-source`, the first mask uses the alpha channels only to define the mask: the white and green are fully opaque, and the 50% white and black colors are 50% opaque because only the alpha value of the colors matters. The second example uses the luminance of the colors to determine the opacity of the mask, with white being brighter than green, and semi-transparent white being brighter than semi-transparent black.
# scroll-margin-block-start
The `scroll-margin-block-start` property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-block-start: 0;
    
    
    scroll-margin-block-start: 20px;
    
    
    scroll-margin-block-start: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-block-start: 10px;
    scroll-margin-block-start: 1em;
    
    /* Global values */
    scroll-margin-block-start: inherit;
    scroll-margin-block-start: initial;
    scroll-margin-block-start: revert;
    scroll-margin-block-start: revert-layer;
    scroll-margin-block-start: unset;
    
### Values
`<length>`
    
An outset from the block start edge of the scroll container.
# attr()
Note: The `attr()` function can be used with any CSS property, but support for properties other than `content` is experimental.
The `attr()` CSS function is used to retrieve the value of an attribute of the selected element and use it in a property value, similar to how the `var()` function substitutes a custom property value. It can also be used with pseudo-elements, in which case the attribute's value on the pseudo-element's originating element is returned.
## Try it
    
    blockquote {
      margin: 1em 0;
    }
    
    blockquote::after {
      display: block;
      content: " (source: " attr(cite) ") ";
      color: hotpink;
    }
    
    
    <blockquote cite="https://mozilla.org/en-US/about/">
      Mozilla makes browsers, apps, code and tools that put people before profit.
    </blockquote>
    
    <blockquote cite="https://web.dev/about/">
      Google believes in an open, accessible, private, and secure web.
    </blockquote>
    
## Syntax
    
    /* Basic usage */
    attr(data-count)
    attr(href)
    
    /* With type */
    attr(data-width px)
    attr(data-size rem)
    attr(data-name raw-string)
    attr(id type(<custom-ident>))
    attr(data-count type(<number>))
    attr(data-size type(<length> | <percentage>))
    
    /* With fallback */
    attr(data-count type(<number>), 0)
    attr(data-width px, inherit)
    attr(data-something, "default")
    
### Parameters
The `attr()` function's syntax is as follows:
    
    attr(<attr-name> <attr-type>? , <fallback-value>?)
    
The parameters are:
`<attr-name>`
    
The attribute name whose value should be retrieved from the selected HTML element(s).
`<attr-type>`
    
Specifies how the attribute value is parsed into a CSS value. This can be the `raw-string` keyword, a `type()` function, or a CSS dimension unit (specified using an `<attr-unit>` identifier). When omitted, it defaults to `raw-string`.
`raw-string`
    
The `raw-string` keyword causes the attribute's literal value to be treated as the value of a CSS string, with no CSS parsing performed (including CSS escapes, whitespace removal, comments, etc). The `<fallback-value>` is only used if the attribute is omitted; specifying an empty value doesn't trigger the fallback.
    
    attr(data-name raw-string, "stranger")
    
Note: This keyword was originally named and supported in Chromium browsers as `string`. Both keywords will be supported briefly, for backwards compatibility purposes.
`type()`
    
The `type()` function takes a `<syntax>` as its argument that specifies what data type to parse the value into. The `<syntax>` can be `<angle>`, `<color>`, `<custom-ident>`, `<image>`, `<integer>`, `<length>`, `<length-percentage>`, `<number>`, `<percentage>`, `<resolution>`, `<string>`, `<time>`, `<transform-function>`, or a combination thereof.
    
    attr(id type(<custom-ident>), none)
    attr(data-count type(<number>), 0)
    
To accept multiple types, list all allowed `<syntax>`es in the `type()` function, separated by a `|`.
    
    attr(data-size type(<length> | <percentage>), 0px)
    
Note: For security reasons `<url>` is not allowed as a `<syntax>`.
To accept any data type, use `*` as the type. This still triggers CSS parsing but with no requirements placed on it beyond that it parses validly and substitutes the result of that parsing directly as tokens, rather than as a `<string>` value.
    
    attr(data-content type(*))
    
`<attr-unit>`
    
The `<attr-unit>` identifier specifies the unit a numeric value should have (if any). It can be the `%` character (percentage) or a CSS distance unit such as `px`, `rem`, `deg`, `s`, etc.
    
    attr(data-size rem)
    attr(data-width px, inherit)
    attr(data-rotation deg)
    
`<fallback-value>`
    
The value to be used if the specified attribute is missing or contains an invalid value.
### Return value
The return value of `attr()` is the value of the HTML attribute whose name is `<attr-name>` parsed as the given `<attr-type>` or parsed as a CSS string.
When an `<attr-type>` is set, `attr()` will try to parse the attribute into that specified `<attr-type>` and return it. If the attribute cannot be parsed into the given `<attr-type>`, the `<fallback-value>` will be returned instead. When no `<attr-type>` is set, the attribute will be parsed into a CSS string.
If no `<fallback-value>` is set, the return value will default to an empty string when no `<attr-type>` is set or the guaranteed-invalid value when an `<attr-type>` is set.
## Description
>
### Limitations and security
The `attr()` function can reference attributes that were never intended by the page author to be used for styling and might contain sensitive information (for example, a security token used by scripts on the page). In general, this is fine, but it can become a security threat when used in URLs. Therefore, you can't use `attr()` to dynamically construct URLs.
    
    <!-- This won't work! -->
    <span data-icon="https://example.org/icons/question-mark.svg">help</span>
    
    
    span[data-icon] {
      background-image: url(attr(data-icon));
    }
    
Values that use `attr()` get marked as `attr()`-tainted. Using an `attr()`-tainted value as or in a `<url>` makes a declaration become "invalid at computed value time" or IACVT for short.
### Backwards compatibility
Generally speaking, the modern `attr()` syntax is backward-compatible because the old way of using it — without specifying an `<attr-type>` — behaves the same as before. Having `attr(data-attr)` in your code is the same as writing `attr(data-attr type(<string>))` or the simpler `attr(data-attr string))`.
However, there are two edge cases where the modern `attr()` syntax behaves differently from the old syntax.
In the following snippet, browsers that don't support the modern `attr()` syntax will discard the second declaration because they cannot parse it. The result in those browsers is `"Hello World"`.
    
    <div text="Hello"></div>
    
    
    div::before {
      content: attr(text) " World";
    }
    div::before {
      content: attr(text) 1px;
    }
    
In browsers with support for the modern syntax, the output will be … nothing. Those browsers will successfully parse the second declaration, but because it is invalid content for the `content` property, the declaration becomes "invalid at computed value time" or IACVT for short.
To prevent this kind of situation, feature detection is recommended.
A second edge case is the following:
    
    <div id="parent"><div id="child" data-attr="foo"></div></div>
    
    
    #parent {
      --x: attr(data-attr);
    }
    #child::before {
      content: var(--x);
    }
    
Browsers without support for modern syntax display the text `"foo"`. In browsers with modern `attr()` support there is no output.
This is because `attr()` — similar to custom properties that use the `var()` function — get substituted at computed value time. With the modern behavior, `--x` first tries to read the `data-attr` attribute from the `#parent` element, which results in an empty string because there is no such attribute on `#parent`. That empty string then gets inherited by the `#child` element, resulting in a `content: ;` declaration being set.
To prevent this sort of situation, don't pass inherited `attr()` values onto children unless you explicitly want to.
### Feature detection
You can feature detect support for modern `attr()` syntax using the `@supports` at-rule. In the test, try to assign advanced `attr()` to a (non-custom) CSS property.
For example:
    
    @supports (x: attr(x type(*))) {
      /* Browser has modern attr() support */
    }
    
    @supports not (x: attr(x type(*))) {
      /* Browser does not have modern attr() support */
    }
    
We can perform the same check in JavaScript with `CSS.supports()`:
    
    if (CSS.supports("x: attr(x type(*))")) {
      /* Browser has modern attr() support */
    }
    
    if (!CSS.supports("x: attr(x type(*))")) {
      /* Browser does not have modern attr() support */
    }
    
## Examples
>
### content property
In this example, we prepend the value of the `data-foo` `data-*` global attribute to the contents of the `<p>` element.
#### HTML
    
    <p data-foo="hello">world</p>
    
#### CSS
    
    [data-foo]::before {
      content: attr(data-foo) " ";
    }
    
#### Result
### Using a fallback value
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
In this example, we append the value of `data-browser` `data-*` global attribute to the `<p>` element. If the `data-browser` attribute is missing from the `<p>` element, we append the fallback value of "Unknown".
#### HTML
    
    <p data-browser="Firefox">My favorite browser is:</p>
    <p>Your favorite browser is:</p>
    
#### CSS
    
    p::after {
      content: " " attr(data-browser, "Unknown");
      color: tomato;
    }
    
#### Result
### color value
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
In this example, we set the CSS value of `background-color` to the value of the `data-background` `data-*` global attribute assigned to the `<div>` element.
#### HTML
    
    <div class="background" data-background="lime">
      background expected to be red if your browser does not support advanced usage
      of attr()
    </div>
    
#### CSS
    
    .background {
      background-color: red;
    }
    
    .background[data-background] {
      background-color: attr(data-background type(<color>), red);
    }
    
#### Result
### Using dimension units
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
In this example the `data-rotation` attribute is parsed into a `deg` unit, which specifies the element's rotation.
#### HTML
    
    <div data-rotation="-3">I am rotated by -3 degrees</div>
    <div data-rotation="2">And I by 2 degrees</div>
    <div>And so am I, using the fallback value of 1.5deg</div>
    
#### CSS
    
    div {
      width: fit-content;
      transform-origin: 50% 50%;
      rotate: attr(data-rotation deg, 1.5deg);
    }
    
#### Result
### Parsing `attr()` values as `<custom-ident>`s
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
In this example, the values for the `view-transition-name` property are derived from the `id` attribute of the element. The attribute gets parsed into a `<custom-ident>`, which is what `view-transition-name` accepts as a value.
The resulting values for `view-transition-name` are `card-1`, `card-2`, `card-3`, etc.
#### HTML
The HTML contains four cards with different `id` attributes and a "Shuffle cards" `<button>`, which shuffles the cards.
    
    <div class="cards">
      <div class="card" id="card-1">1</div>
      <div class="card" id="card-2">2</div>
      <div class="card" id="card-3">3</div>
      <div class="card" id="card-4">4</div>
    </div>
    <button>Shuffle cards</button>
    
#### CSS
The cards are laid out in a flex container:
    
    .cards {
      display: flex;
      flex-direction: row;
      gap: 1em;
      padding: 1em;
    }
    
On each card, the `attr()` function gets the `id` attribute and parses it into a `<custom-ident>`, which is used as the value for the `view-transition-name` property. When there is no `id` set on a card, the fallback value `none` is used instead.
    
    .card {
      view-transition-name: attr(id type(<custom-ident>), none);
      view-transition-class: card;
    }
    
#### JavaScript
When the `<button>` is pressed the cards are shuffled. This is done by randomizing the order of an array containing references to all the cards and then updating the `order` property of each card to its new array index position.
To animate each card to its new position, View Transitions are used. This is done by wrapping the `order` update in a call to `document.startViewTransition`.
    
    const shuffle = (array) => {
      for (let i = array.length - 1; i >= 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [array[i], array[j]] = [array[j], array[i]];
      }
    };
    
    document.querySelector("button").addEventListener("click", (e) => {
      const $cards = Array.from(document.querySelectorAll(".card"));
      shuffle($cards);
      document.startViewTransition(() => {
        $cards.forEach(($card, i) => {
          $card.style.setProperty("order", i);
        });
      });
    });
    
#### Result
# outline-color
The `outline-color` CSS property sets the color of an element's outline.
## Try it
    
    outline-color: red;
    
    
    outline-color: #32a1ce;
    
    
    outline-color: rgb(170 50 220 / 0.6);
    
    
    outline-color: hsl(60 90% 50% / 0.8);
    
    
    outline-color: currentColor;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with an outline around it.
      </div>
    </section>
    
    
    #example-element {
      outline: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <color> values */
    outline-color: #f92525;
    outline-color: rgb(30 222 121);
    outline-color: blue;
    
    /* Global values */
    outline-color: inherit;
    outline-color: initial;
    outline-color: revert;
    outline-color: revert-layer;
    outline-color: unset;
    
The `outline-color` property is specified as any one of the values listed below.
### Values
`<color>`
    
The color of the outline, specified as a `<color>`.
The specification also lists an additional value, `auto`, which is not currently supported in any browsers. When implemented, `auto` will compute to `currentColor` unless `outline-style` is set to `auto` then it will compute to the accent color.
## Description
An outline is a line that is drawn around an element, outside the `border`. Unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. The border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap).
It is often more convenient to use the shorthand property `outline` when defining the appearance of an outline.
## Accessibility
Custom focus styles commonly involve making adjustments to the `outline` property. If the color of the outline is adjusted, it is important to ensure that the contrast ratio between it and the background the outline is placed over is high enough that people experiencing low vision conditions will be able to perceive it.
Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


## Examples
>
### Setting a solid blue outline
#### HTML
    
    <p>My outline is blue, as you can see.</p>
    
#### CSS
    
    p {
      outline: 2px solid; /* Set the outline width and style */
      outline-color: blue; /* Set the outline color */
      margin: 5px;
    }
    
#### Result
# text-emphasis-style
The `text-emphasis-style` CSS property sets the appearance of emphasis marks. It can also be set, and reset, using the `text-emphasis` shorthand.
## Try it
    
    text-emphasis-style: none;
    
    
    text-emphasis-style: triangle;
    
    
    text-emphasis-style: "x";
    
    
    text-emphasis-style: filled double-circle;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
## Syntax
    
    /* Initial value */
    text-emphasis-style: none; /* No emphasis marks */
    
    /* <string> values */
    text-emphasis-style: "x";
    text-emphasis-style: "\25B2";
    text-emphasis-style: "*";
    
    /* Keyword values */
    text-emphasis-style: filled;
    text-emphasis-style: open;
    text-emphasis-style: dot;
    text-emphasis-style: circle;
    text-emphasis-style: double-circle;
    text-emphasis-style: triangle;
    text-emphasis-style: filled sesame;
    text-emphasis-style: open sesame;
    
    /* Global values */
    text-emphasis-style: inherit;
    text-emphasis-style: initial;
    text-emphasis-style: revert;
    text-emphasis-style: revert-layer;
    text-emphasis-style: unset;
    
### Values
`none`
    
No emphasis marks.
`filled`
    
The shape is filled with solid color. If neither `filled` nor `open` is present, this is the default.
`open`
    
The shape is hollow.
`dot`
    
Display small circles as marks. The filled dot is `'•'` (`U+2022`), and the open dot is `'◦'` (`U+25E6`).
`circle`
    
Display large circles as marks. The filled circle is `'●'` (`U+25CF`), and the open circle is `'○'` (`U+25CB`).
`double-circle`
    
Display double circles as marks. The filled double-circle is `'◉'` (`U+25C9`), and the open double-circle is `'◎'` (`U+25CE`).
`triangle`
    
Display triangles as marks. The filled triangle is `'▲'` (`U+25B2`), and the open triangle is `'△'` (`U+25B3`).
`sesame`
    
Display sesames as marks. The filled sesame is `'﹅'` (`U+FE45`), and the open sesame is `'﹆'` (`U+FE46`).
`<string>`
    
Display the given string as marks. Authors should not specify more than one character in `<string>`. The UA may truncate or ignore strings consisting of more than one grapheme cluster.
## Examples
>
### Basic example
    
    h2 {
      -webkit-text-emphasis-style: sesame;
      text-emphasis-style: sesame;
    }
    
# isolation
The `isolation` CSS property determines whether an element must create a new stacking context.
## Try it
    
    isolation: auto;
    
    
    isolation: isolate;
    
    
    <section class="default-example" id="default-example">
      <div class="background-container">
        <div id="example-element">
          <img src="/shared-assets/images/examples/firefox-logo.svg" />
          <p><code>mix-blend-mode: multiply;</code></p>
        </div>
      </div>
    </section>
    
    
    .background-container {
      background-color: #f4f460;
      width: 250px;
    }
    
    #example-element {
      border: 1px solid black;
      margin: 2em;
    }
    
    #example-element * {
      mix-blend-mode: multiply;
      color: #8245a3;
    }
    
This property is especially helpful when used in conjunction with `mix-blend-mode` and `z-index`.
## Syntax
    
    /* Keyword values */
    isolation: auto;
    isolation: isolate;
    
    /* Global values */
    isolation: inherit;
    isolation: initial;
    isolation: revert;
    isolation: revert-layer;
    isolation: unset;
    
The `isolation` property is specified as one of the keyword values listed below.
### Values
`auto`
    
A new stacking context is created only if one of the properties applied to the element requires it.
`isolate`
    
A new stacking context must be created.
## Examples
>
### Forcing a new stacking context for an element
#### HTML
    
    <div class="big-square">
      <div class="isolation-auto">
        <div class="small-square">auto</div>
      </div>
      <div class="isolation-isolate">
        <div class="small-square">isolate</div>
      </div>
    </div>
    
#### CSS
    
    .isolation-auto {
      isolation: auto;
    }
    
    .isolation-isolate {
      isolation: isolate;
    }
    
    .big-square {
      background-color: lime;
      width: 200px;
      height: 210px;
    }
    
    .small-square {
      background-color: lime;
      width: 100px;
      height: 100px;
      border: 1px solid black;
      padding: 2px;
      mix-blend-mode: difference;
    }
    
#### Result
# <gradient>
The `<gradient>` CSS data type is a special type of `<image>` that consists of a progressive transition between two or more colors.
## Try it
    
    background: linear-gradient(#f69d3c, #3f87a6);
    
    
    background: radial-gradient(#f69d3c, #3f87a6);
    
    
    background: repeating-linear-gradient(#f69d3c, #3f87a6 50px);
    
    
    background: repeating-radial-gradient(#f69d3c, #3f87a6 50px);
    
    
    background: conic-gradient(#f69d3c, #3f87a6);
    
    
    <section class="display-block" id="default-example">
      <div id="example-element"></div>
    </section>
    
    
    #example-element {
      min-height: 100%;
    }
    
A CSS gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio. Its concrete size will match the size of the element to which it applies.
## Syntax
The `<gradient>` data type is defined with one of the function types listed below.
### Linear gradient
Linear gradients transition colors progressively along an imaginary line. They are generated with the `linear-gradient()` function.
### Radial gradient
Radial gradients transition colors progressively from a center point (origin). They are generated with the `radial-gradient()` function.
### Conic gradient
Conic gradients transition colors progressively around a circle. They are generated with the `conic-gradient()` function.
### Repeating gradient
Repeating gradients duplicate a gradient as much as necessary to fill a given area. They are generated with the `repeating-linear-gradient()`, `repeating-radial-gradient()`, and `repeating-conic-gradient()` functions.
## Interpolation
As with any interpolation involving colors, gradients are calculated in the alpha-premultiplied color space. This prevents unexpected shades of gray from appearing when both the color and the opacity are changing. (Be aware that older browsers may not use this behavior when using the transparent keyword.)
## Examples
>
### Linear gradient example
A linear gradient.
    
    .linear-gradient {
      background: linear-gradient(
        to right,
        red,
        orange,
        yellow,
        green,
        blue,
        indigo,
        violet
      );
    }
    
### Radial gradient example
A radial gradient.
    
    .radial-gradient {
      background: radial-gradient(red, yellow, dodgerblue);
    }
    
### Conic gradient example
A conic gradient example.
    
    .conic-gradient {
      background: conic-gradient(pink, coral, lime);
    }
    
### Repeating gradient examples
Repeating linear and radial gradient examples.
    
    .linear-repeat {
      background: repeating-linear-gradient(
        to top left,
        pink,
        pink 5px,
        white 5px,
        white 10px
      );
    }
    
    .radial-repeat {
      background: repeating-radial-gradient(
        lime,
        lime 15px,
        white 15px,
        white 30px
      );
    }
    
    .conic-repeat {
      background: repeating-conic-gradient(lime, pink 30deg);
    }
    
# CSS containment
The CSS containment module defines containment and container queries.
Containment enables the isolation of page subtrees from the rest of the DOM. The browser can then improve performance by optimizing the rendering of these independent parts.
Container queries are similar to dimension media queries, except that the queries are based on the dimensions of a specific container element defined as a containment context, rather than on the dimensions of the viewport. Container queries enable querying a container's size, properties, and property values to conditionally apply CSS styles. When applying these conditional styles, you can use container query length units, which specify lengths relative to the dimensions of the query container. Additional properties are defined to enable establishing a specific element as a query container and giving it a specific name.
## Reference
>
### Properties
  * `contain`
  * `content-visibility`


### Events
  * `contentvisibilityautostatechange`


### Interfaces
  * `ContentVisibilityAutoStateChangeEvent`
    * `skipped` property
  * `CSSContainerRule`
    * `CSSContainerRule.containerName`
    * `CSSContainerRule.containerQuery`


## Guides
CSS container queries
    
A guide to using container queries with `@container`, including naming containment contexts.
Using CSS containment
    
Describes the basic aims of CSS containment and how to leverage `contain` and `content-visibility` for a better user experience.
Using container size and style queries
    
A guide to writing container size and style queries with `@container`, including style queries for custom properties, query syntax and names, and nesting container queries.
## Related concepts
  * Layout and the containing block
  * Block formatting context
  * CSS conditional rules module
    * `@container` at-rule
    * `container` property
    * `container-name` property
    * `container-type` property
  * CSS media queries module
    * `@media` at-rule
    * CSS logical operators (`not`, `or`, and `and`)
  * CSS transitions module
    * `@starting-style` at-rule
    * `transition-behavior` property
  * CSS box sizing module
    * `aspect-ratio` property
    * `contain-intrinsic-size` shorthand property
    * `contain-intrinsic-inline-size` property
    * `contain-intrinsic-block-size` property
    * `contain-intrinsic-width` property
    * `contain-intrinsic-height` property
  * CSS counter styles module
    * Using CSS counters guide
  * CSS nesting module
    * CSS nesting at-rules guide


# text-wrap-style
The `text-wrap-style` CSS property controls how text inside an element is wrapped. The different values provide alternate ways of wrapping the content of a block element. It can also be set, and reset, using the `text-wrap` shorthand.
## Try it
    
    text-wrap-style: auto;
    
    
    text-wrap-style: balance;
    
    
    text-wrap-style: pretty;
    
    
    text-wrap-style: stable;
    
    
    <section class="default-example" id="default-example">
      <div class="whole-content-wrapper">
        <p>Edit the text in the box:</p>
        <div class="transition-all" id="example-element">
          <p contenteditable="">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut
            cum eum id quos est.
          </p>
        </div>
      </div>
    </section>
    
    
    .whole-content-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
    }
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 250px;
    }
    
## Syntax
    
    /* Keyword values */
    text-wrap-style: auto;
    text-wrap-style: balance;
    text-wrap-style: pretty;
    text-wrap-style: stable;
    
    /* Global values */
    text-wrap-style: inherit;
    text-wrap-style: initial;
    text-wrap-style: revert;
    text-wrap-style: revert-layer;
    text-wrap-style: unset;
    
When wrapping is allowed (see `text-wrap-mode`), the `text-wrap-style` property is specified as a single keyword chosen from the list of values below.
### Values
`auto`
    
Text is wrapped in the most performant way for the browser and does not take into account the number of characters.
`balance`
    
Text is wrapped in a way that best balances the number of characters on each line, enhancing layout quality and legibility. Because counting characters and balancing them across multiple lines is computationally expensive, this value is only supported for blocks of text spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).
`pretty`
    
Text is wrapped using a slower algorithm that favors better layout over speed. This is intended for body copy where good typography is favored over performance (for example, when the number of orphans should be kept to a minimum).
`stable`
    
Text is wrapped such that when the user is editing the content, the lines that come before the lines they are editing remain static rather than the whole block of text re-wrapping.
Note: The CSS text module defines an `avoid-orphans` value for the `text-wrap-style` property to avoid excessively short last lines and expect the user agent to consider more than one line when making break decisions. This value is not yet supported in any browser.
## Description
When the content is allowed to wrap, which it does by default, then there are a number of choices that can effect the way the content is wrapped.
The value you choose, for `text-wrap-style`, depends on how many lines of text you anticipate styling, whether the text is `contenteditable`, and whether you need to prioritize appearance or performance.
When the styled content will be limited to a short number of lines, such as headings, captions, and blockquotes, `text-wrap-style: balance` can be added to balance the number of characters on each line, enhancing layout quality and legibility. As browsers limit the number of lines impacted by this property, this value's impact on performance is negligible.
For longer sections of text, `text-wrap-style: pretty` can be used. Note that `pretty` has a negative effect on performance, so it should be only used for longer blocks of text when the layout is more important than speed.
The `stable` value improves user experience when used on content that is `contenteditable`. This value ensures that, as the user is editing text, the previous lines in the area being edited remain stable.
## Examples
>
### Balanced text
This example has two paragraphs, the first is the default `auto` and the second is `balance`.
#### HTML
    
    <h2>Unbalanced</h2>
    <p>
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit, ad. Impedit
      adipisci rerum modi praesentium atque aperiam vitae nesciunt consectetur
      assumenda deleniti repudiandae perferendis sed odio doloremque, aliquid natus
      laboriosam?
    </p>
    <h2>Balanced</h2>
    <p class="balanced">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit, ad. Impedit
      adipisci rerum modi praesentium atque aperiam vitae nesciunt consectetur
      assumenda deleniti repudiandae perferendis sed odio doloremque, aliquid natus
      laboriosam?
    </p>
    
#### CSS
    
    p {
      max-width: 60ch;
    }
    .balanced {
      text-wrap-style: balance;
    }
    
#### Result
# repeat()
The `repeat()` CSS function represents a repeated fragment of the track list, allowing a large number of columns or rows that exhibit a recurring pattern to be written in a more compact form.
## Try it
    
    grid-template-columns: repeat(2, 60px);
    
    
    grid-template-columns: 1fr repeat(2, 60px);
    
    
    grid-template-columns: repeat(2, 20px 1fr);
    
    
    grid-template-columns: repeat(auto-fill, 40px);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
This function can be used in the CSS grid properties `grid-template-columns` and `grid-template-rows`.
## Syntax
    
    /* <track-repeat> values */
    repeat(4, 1fr)
    repeat(4, [col-start] 250px [col-end])
    repeat(4, [col-start] 60% [col-end])
    repeat(4, [col-start] 1fr [col-end])
    repeat(4, [col-start] min-content [col-end])
    repeat(4, [col-start] max-content [col-end])
    repeat(4, [col-start] auto [col-end])
    repeat(4, [col-start] minmax(100px, 1fr) [col-end])
    repeat(4, [col-start] fit-content(200px) [col-end])
    repeat(4, 10px [col-start] 30% [col-middle] auto [col-end])
    repeat(4, [col-start] min-content [col-middle] max-content [col-end])
    
    /* <auto-repeat> values */
    repeat(auto-fill, 250px)
    repeat(auto-fit, 250px)
    repeat(auto-fill, [col-start] 250px [col-end])
    repeat(auto-fit, [col-start] 250px [col-end])
    repeat(auto-fill, [col-start] minmax(100px, 1fr) [col-end])
    repeat(auto-fill, 10px [col-start] 30% [col-middle] 400px [col-end])
    
    /* <fixed-repeat> values */
    repeat(4, 250px)
    repeat(4, [col-start] 250px [col-end])
    repeat(4, [col-start] 60% [col-end])
    repeat(4, [col-start] minmax(100px, 1fr) [col-end])
    repeat(4, [col-start] fit-content(200px) [col-end])
    repeat(4, 10px [col-start] 30% [col-middle] 400px [col-end])
    
The `repeat()` function takes two arguments:
  * repeat count: the first argument specifies the number of times that the track list should be repeated. It is specified with an integer value of 1 or more, or with the keyword values `auto-fill` or `auto-fit`. These keyword values repeat the set of tracks as many times as is needed to fill the grid container.
  * tracks: the second argument specifies the set of tracks that will be repeated. Fundamentally this consists of one or more values, where each value represents the size of that track. Each size is specified using either a `<track-size>` value or a `<fixed-size>` value. You can also specify one or more line names before or after each track, by providing `<line-names>` values before and/or after the track size.


If you use `auto-fill` or `auto-fit` to set the repeat count, you may only specify track sizes using the `<fixed-size>` type, not the `<track-size>` type. This give us three main syntax forms for `repeat()`:
  * `<track-repeat>`, which uses: 
    * an integer to set the repeat count
    * `<track-size>` values to set track sizes.
  * `<auto-repeat>`, which uses 
    * `auto-fill` or `auto-fit` to set the repeat count
    * `<fixed-size>` to set track sizes.
  * `<fixed-repeat>`, which uses: 
    * an integer to set the repeat count
    * `<fixed-size>` values to set track sizes.


Then if a property declaration uses `<auto-repeat>`, it is only allowed to use `<fixed-repeat>` for any additional `repeat()` calls. For example, this is invalid, because it combines the `<auto-repeat>` form with the `<track-repeat>` form:
    
    .wrapper {
      grid-template-columns:
        repeat(auto-fill, 10px)
        repeat(2, minmax(min-content, max-content));
    }
    
There is a fourth form, `<name-repeat>`, which is used to add line names to subgrids. It only used with the `subgrid` keyword and only specifies line names, not track sizes.
### Values
`<fixed-size>`
    
One of the following forms:
  * a `<length-percentage>` value
  * a `minmax()` function with: 
    * `min` given as a `<length-percentage>` value
    * `max` given as one of a `<length-percentage>` value, a `<flex>` value, or one of the following keywords: `min-content`, `max-content`, or `auto`
  * a `minmax()` function with: 
    * `min` given as a `<length-percentage>` value or one of the following keywords: `min-content`, `max-content`, or `auto`
    * `max` given as a `<length-percentage>` value.


`<flex>`
    
A non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor.
`<length>`
    
A positive integer length.
`<line-names>`
    
Zero or more `<custom-ident>` values, space-separated and enclosed in square brackets, like this: `[first header-start]`.
`<percentage>`
    
A non-negative percentage relative to the inline size of the grid container in column grid tracks, and the block size of the grid container in row grid tracks. If the size of the grid container depends on the size of its tracks, then the `<percentage>` must be treated as `auto`. The user-agent may adjust the intrinsic size contributions of the track to the size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage.
`<track-size>`
    
One of the following forms:
  * a `<length-percentage>` value, a `<flex>` value, or one of the following keywords: `min-content`, `max-content`, or `auto`
  * a `minmax()` function with: 
    * `min` given as a `<length-percentage>` value, or one of the following keywords: `min-content`, `max-content`, or `auto`
    * `max` given as a `<length-percentage>` value, a `<flex>` value, or one of the following keywords: `min-content`, `max-content`, or `auto`
  * a `fit-content()` function, passed a `<length-percentage>` value.


`auto`
    
As a maximum, identical to `max-content`. As a minimum it represents the largest minimum size (as specified by `min-width`/`min-height`) of the grid items occupying the grid track.
`auto-fill`
    
If the grid container has a definite or maximal size in the relevant axis, then the number of repetitions is the largest possible positive integer that does not cause the grid to overflow its grid container. Treating each track as its maximal track sizing function (each independent value used to define `grid-template-rows` or `grid-template-columns`), if that is definite. Otherwise, as its minimum track sizing function, and taking grid-gap into account. If any number of repetitions would overflow, then the repetition is `1`. Otherwise, if the grid container has a definite minimal size in the relevant axis, the number of repetitions is the smallest possible positive integer that fulfills that minimum requirement. Otherwise, the specified track list repeats only once.
`auto-fit`
    
Behaves the same as `auto-fill`, except that after placing the grid items any empty repeated tracks are collapsed. An empty track is one with no in-flow grid items placed into or spanning across it. (This can result in all tracks being collapsed, if they're all empty.)
A collapsed track is treated as having a single fixed track sizing function of `0px`, and the gutters on either side of it collapse.
For the purpose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., `1px`), to avoid division by zero.
`max-content`
    
Represents the largest max-content contribution of the grid items occupying the grid track.
`min-content`
    
Represents the largest min-content contribution of the grid items occupying the grid track.
## Examples
>
### Specifying grid columns using repeat()
#### HTML
    
    <div id="container">
      <div>This item is 50 pixels wide.</div>
      <div>Item with flexible width.</div>
      <div>This item is 50 pixels wide.</div>
      <div>Item with flexible width.</div>
      <div>Inflexible item of 100 pixels width.</div>
    </div>
    
#### CSS
    
    #container {
      display: grid;
      grid-template-columns: repeat(2, 50px 1fr) 100px;
      grid-gap: 5px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background-color: #8cffa0;
      padding: 10px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      padding: 5px;
    }
    
#### Result
# var()
The `var()` CSS function can be used to insert the value of a custom property (sometimes called a "CSS variable") instead of any part of a value of another property.
## Try it
    
    border-color: var(--color-a);
    
    
    border-color: var(--color-b);
    
    
    border-color: var(--color-c);
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">
        Three color options have been set on the :root use these to change the
        border color.
      </div>
    </section>
    
    
    :root {
      --color-a: pink;
      --color-b: green;
      --color-c: rebeccapurple;
    }
    
    #example-element {
      border: 10px solid black;
      padding: 10px;
    }
    
The `var()` function cannot be used in property names, selectors or anything else besides property values. (Doing so usually produces invalid syntax, or else a value whose meaning has no connection to the variable.)
## Syntax
    
    /* Basic usage */
    var(--custom-prop);
    
    /* With fallback */
    var(--custom-prop,);  /* empty value as fallback */
    var(--custom-prop, initial); /* initial value of the property as fallback */
    var(--custom-prop, red);
    var(--custom-prop, var(--default-value));
    var(--custom-prop, var(--default-value, red));
    
The first argument to the function is the name of the custom property to be substituted. An optional second argument to the function serves as a fallback value. If the custom property referenced by the first argument is not defined or equals a CSS-wide keyword, the function uses the second value.
The syntax of the fallback, like that of custom properties, allows commas. For example, `var(--foo, red, blue)` defines a fallback of `red, blue`; that is, anything between the first comma and the end of the function is considered a fallback value.
### Values
`<custom-property-name>`
    
A custom property's name represented by an identifier that starts with two dashes. Custom properties are solely for use by authors and users; CSS will never give them a meaning beyond what is presented here.
`<declaration-value>`
    
The custom property's fallback value, which is used in case the custom property is not defined or equals a CSS-wide keyword. This value may contain any character except some characters with special meaning like newlines, unmatched closing brackets, i.e., `)`, `]`, or `}`, top-level semicolons, or exclamation marks. The fallback value can itself be a custom property using the `var()` syntax. If the fallback value is omitted, and the custom property is not defined, the `var()` function resolves to an invalid value.
Note: `var(--a,)` is valid, specifying that if the `--a` custom property is not defined or equals a CSS-wide keyword, the `var()` should be replaced with nothing.
## Examples
>
### Using a custom property set on :root
#### CSS
    
    :root {
      --main-bg-color: pink;
    }
    
    body {
      background-color: var(--main-bg-color);
    }
    
#### Result
Here, the value of the `background-color` property has been set via the custom property `--main-bg-color`. So the background color of the HTML body will be pink.
### Using a custom property before it is set
#### CSS
    
    body {
      background-color: var(--main-bg-color);
    }
    
    :root {
      --main-bg-color: pink;
    }
    
#### Result
In this example, the background color of the HTML body will be pink even though the custom property is set later.
### Using a custom property set in another file
#### HTML
    
    <!doctype html>
    <html lang="en-US">
      <head>
        <meta charset="utf-8" />
        <link rel="stylesheet" href="1.css" />
        <link rel="stylesheet" href="2.css" />
      </head>
      <body></body>
    </html>
    
#### CSS
    
    /* 1.css */
    body {
      background-color: var(--main-bg-color);
    }
    
    
    /* 2.css */
    :root {
      --main-bg-color: pink;
    }
    
#### Result
The background color of the HTML body will be pink in this case even though the custom property is declared in another file.
### Custom properties with fallbacks for use when the property has not been set
#### HTML
    
    <div class="component">
      <h1 class="header">Header</h1>
      <p class="text">Text</p>
    </div>
    
#### CSS
    
    /* In the component's style: */
    .component .header {
      /* header-color isn't set, and so remains blue, the fallback value */
      color: var(--header-color, blue);
    }
    
    .component .text {
      color: var(--text-color, black);
    }
    
    /* In the larger application's style: */
    .component {
      --text-color: #008800;
    }
    
#### Result
Since `--header-color` isn't set, the text "Header" will be blue, the fallback value.
### Using a custom property as a fallback
#### CSS
    
    :root {
      --backup-bg-color: teal;
    }
    
    body {
      background-color: var(--main-bg-color, var(--backup-bg-color, white));
    }
    
#### Result
Since `--main-bg-color` isn't set, the body's `background-color` will fall back to `--backup-bg-color`, which is teal.
### Invalid values
`var()` functions can resolve to invalid values if:
  * The custom property is not defined and no fallback value is provided.
  * The custom property is defined but its value is an invalid value for the property it is used in.


When this happens, the property is treated as if it has value `unset`. This is because variables can't "fail early" like other syntax errors can, so by the time the user agent realizes a property value is invalid, it has already thrown away the other cascaded values.
For example:
#### HTML
    
    <p class="p1">Undefined variable</p>
    <p class="p2">Invalid variable</p>
    <p class="p3">Invalid literal color</p>
    
#### CSS
    
    p {
      color: red;
    }
    
    .p1 {
      color: var(--invalid-color);
    }
    
    .p2 {
      --invalid-color: 20px;
      color: var(--invalid-color);
    }
    
    .p3 {
      color: 20px;
    }
    
#### Result
Note how the paragraphs using `var()` are reset to the default black, but the paragraph with an invalid literal color is still red, because the `color: 20px` declaration is simply ignored.
# :heading()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:heading()` CSS pseudo-class function represents all heading elements that match a value calculated using the `An+B` notation. This allows you to style elements at specific heading levels at once, rather than matching and styling them individually.
Note: The `:heading()` functional pseudo-class has the same specificity as a class selector, that is, `0-1-0`. So `:heading()` would have a specificity of `0-1-0`, and `section:heading()` would have a specificity of `0-1-1`.
## Syntax
    
    :heading([ <An+B> [, <An+B>]* | even | odd ]) {
      /* ... */
    }
    
### Parameters
The `:heading()` pseudo-class function takes a comma-separated list of `An+B` expressions or keyword values that describe a pattern for matching heading elements.
#### Keyword values
`odd`
    
Represents the heading elements whose numeric position is odd: `<h1>`, `<h3>`, and `<h5>`.
`even`
    
Represents the heading elements whose numeric position is even: `<h2>`, `<h4>`, and `<h6>`.
#### Functional notation
`<An+B>`
    
Represents the heading elements whose numeric position matches the pattern `An+B`, for every positive integer or zero value of `n`, where:
  * `A` is an integer step size,
  * `B` is an integer offset,
  * `n` is all nonnegative integers, starting from 0.


It can be read as the `An+B`-th element of a list. The `A` and `B` must both have `<integer>` values.
## Usage notes
The `:heading()` functional pseudo-class matches only elements that are semantically recognized as headings. It does not match elements with a `role="heading"` attribute, nor does it respect the 'aria-level' ARIA attribute.
## Examples
>
### Using keyword parameters
In this example, the `odd` keyword matches headings with odd-numbered levels, which are `<h1>` and `<h3>`. The `even` keyword is used to target even-numbered heading levels, `<h2>` and `<h4>`.
    
    <h1>Heading 1</h1>
    <h2>Heading 2</h2>
    <h3>Heading 3</h3>
    <h4>Heading 4</h4>
    
    
    :heading(odd) {
      color: tomato;
    }
    :heading(even) {
      color: slateblue;
    }
    
### Using the `An+B` notation
    
    <h1>Science</h1>
    <h2>Physics</h2>
    <h3>Atomic, molecular, and optical physics</h3>
    <h4>Optical physics</h4>
    <h5>X-Rays</h5>
    <h6>Discovery</h6>
    
    
    /* Targets headings <h3> and <h4> */
    :heading(3, 4) {
      font-weight: 100;
    }
    /* Targets headings in reverse starting from <h3> */
    :heading(-n + 3) {
      color: tomato;
    }
    /* Targets every third heading starting from <h1> */
    :heading(3n + 1) {
      font-style: italic;
    }
    /* Targets headings after level 5 */
    :heading(n + 5) {
      color: slateblue;
    }
    
In this example:
  * `:heading(3, 4)` matches the `<h3>` and `<h4>` elements
  * `:heading(-n + 3)` matches heading elements in reverse, so `<h3>`, `<h2>`, and `<h1>`
  * `:heading(3n + 1)` matches every third (`3n`) heading element starting from `<h1>`, so this would include `<h1>` and `<h4>`
  * `:heading(n + 5)` matches heading elements starting from `<h5>` and will include `<h6>`


# gap
The `gap` CSS shorthand property sets the gaps (also called gutters) between rows and columns. This property applies to multi-column, flex, and grid containers.
## Try it
    
    gap: 0;
    
    
    gap: 10%;
    
    
    gap: 1em;
    
    
    gap: 10px 20px;
    
    
    gap: calc(20px + 10%);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 200px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `column-gap`
  * `row-gap`


## Syntax
    
    /* One <length> value */
    gap: 20px;
    gap: 1em;
    gap: 3vmin;
    gap: 0.5cm;
    
    /* One <percentage> value */
    gap: 16%;
    gap: 100%;
    
    /* Two <length> values */
    gap: 20px 10px;
    gap: 1em 0.5em;
    gap: 3vmin 2vmax;
    gap: 0.5cm 2mm;
    
    /* One or two <percentage> values */
    gap: 16% 100%;
    gap: 21px 82%;
    
    /* calc() values */
    gap: calc(10% + 20px);
    gap: calc(20px + 10%) calc(10% - 5px);
    
    /* Global values */
    gap: inherit;
    gap: initial;
    gap: revert;
    gap: revert-layer;
    gap: unset;
    
### Values
This property is specified as a value for `<'row-gap'>`, followed optionally by a value for `<'column-gap'>`. If `<'column-gap'>` is omitted, it is set to the same value as `<'row-gap'>`. Both `<'row-gap'>` and `<'column-gap'>` can each be specified as a `<length>` or a `<percentage>`.
`<length>`
    
Specifies the width of the gutter separating columns, flex items, flex lines, and grid lines.
`<percentage>`
    
Specifies the width of the gutter separating columns, flex items, flex lines, and grid lines relative to the dimension of the element.
## Description
This property defines gaps between columns in CSS multi-column layout, between flex items and flex lines in CSS flexible box layout, and between rows and columns in CSS grid layout.
The generated gaps create empty spaces that have the width or height of the gap's specified size, much like an empty item or track. The visible space between elements may differ from the provided `gap` value because margins, padding, and distributed alignment may increase the separation between elements beyond what is determined by `gap`.
In grid layout, the first value defines the gutter between rows, and the second defines the gutter between columns. In both grid and flex layouts, if only one value is included, that value is used for both dimensions.
With flex containers, whether the first value is the gap between flex items or between flex lines depends on the direction. Flex items are laid out in either rows or columns depending on the value of the `flex-direction` property. For rows (`row` (the default) or `row-reverse`), the first value defines the gap between flex lines, and the second value defines the gap between items within each line. For columns (`column` or `column-reverse`), the first value defines the gap between flex items within a flex line, and the second value defines the gaps between each flex line.
In multi-column containers, the first value defines the gap between columns. A dividing line can be added to the otherwise "empty space" by using the `column-rule-style` property or `column-rule` shorthand.
Percentage gap values are always calculated against the content box size of the container element. The behavior is well-defined and consistent across layout modes when the container size is definite. As these three layout modes (multi-column, flex, and grid) treat cyclic percentage sizes differently, `gap` also does so. In grid layout, cyclic percentage sizes resolve against zero for determining intrinsic size contributions but resolve against the element's content box when laying out the contents. Two examples below demonstrate percentage gap values with explicit container size and implicit container size in the examples section.
Early versions of the specification called this property `grid-gap`, and to maintain compatibility with legacy websites, browsers still accept `grid-gap` as an alias for `gap`.
## Examples
>
### Flex layout
#### HTML
    
    <div id="flexbox">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #flexbox {
      display: flex;
      flex-wrap: wrap;
      width: 300px;
      gap: 20px 5px;
    }
    
    #flexbox > div {
      border: 1px solid green;
      background-color: lime;
      flex: 1 1 auto;
      width: 100px;
      height: 50px;
    }
    
#### Result
### Grid layout
#### HTML
    
    <div id="grid">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 200px;
      grid-template: repeat(3, 1fr) / repeat(3, 1fr);
      gap: 20px 5px;
    }
    
    #grid > div {
      border: 1px solid green;
      background-color: lime;
    }
    
#### Result
### Multi-column layout
#### HTML
    
    <p class="content-box">
      This is some multi-column text with a 40px column gap created with the CSS
      <code>gap</code> property. Don't you think that's fun and exciting? I sure do!
    </p>
    
#### CSS
    
    .content-box {
      column-count: 3;
      gap: 40px;
    }
    
#### Result
### Percentage gap value and explicit container size
If the container has a fixed size set, then gap percentage value calculations are based on the size of the container. Thus, gap behavior is consistent across all layouts. In the following example, there are two containers, one with a grid layout and the other with a flex layout. The containers have five red 20x20px children. Both containers are explicitly set to 200px high using `height: 200px` and the gap is set with `gap: 12.5% 0`.
    
    <span>Grid</span>
    <div id="grid">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    <span>Flex</span>
    <div id="flex">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    
    #grid {
      display: inline-grid;
      height: 200px;
      gap: 12.5% 0;
    }
    
    #flex {
      display: inline-flex;
      height: 200px;
      gap: 12.5% 0;
    }
    
    #grid > div,
    #flex > div {
      background-color: coral;
      width: 20px;
      height: 20px;
    }
    
Now inspect the grid and flex elements using Inspector tab in Web Developer Tools. In order to see the actual gaps hover mouse over `<div id="grid">` and `<div id="flex">` tags in the inspector. You will notice that the gap is the same in both cases which is 25px.
### Percentage gap value and implicit container size
If size is not explicitly set on the container, then the percentage gap behaves differently in case of grid and flex layouts. In the following example the containers don't have height explicitly set.
In case of the grid layout, percentage gap doesn't contribute to the actual height of the grid. The container's height is calculated using `0px` gap, so the actual height turns out to be 100px (20px x 5). Then the actual percentage gap is calculated using the content box's height, the gap turns out to be `12.5px` (100px x 12.5%). The gap is applied just before rendering. Thus the grid remains 100px high but it overflows due to the percentage gap added later just before rendering.
In case of the flex layout, the percentage gap always results in zero value.
# overscroll-behavior-inline
The `overscroll-behavior-inline` CSS property sets the browser's behavior when the inline direction boundary of a scrolling area is reached.
See `overscroll-behavior` for a full explanation.
## Syntax
    
    /* Keyword values */
    overscroll-behavior-inline: auto; /* default */
    overscroll-behavior-inline: contain;
    overscroll-behavior-inline: none;
    
    /* Global values */
    overscroll-behavior-inline: inherit;
    overscroll-behavior-inline: initial;
    overscroll-behavior-inline: revert;
    overscroll-behavior-inline: revert-layer;
    overscroll-behavior-inline: unset;
    
The `overscroll-behavior-inline` property is specified as a keyword chosen from the list of values below.
### Values
`auto`
    
The default scroll overflow behavior occurs as normal.
`contain`
    
Default scroll overflow behavior (e.g., "bounce" effects) is observed inside the element where this value is set. However, no scroll chaining occurs on neighboring scrolling areas; the underlying elements will not scroll. The `contain` value disables native browser navigation, including the vertical pull-to-refresh gesture and horizontal swipe navigation.
`none`
    
No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
## Examples
>
### Preventing inline overscrolling
In this demo we have two block-level boxes, one inside the other. The outer box has a large `width` set on it so the page will scroll horizontally. The inner box has a small width (and `height`) set on it so it sits comfortably inside the viewport, but its content is given a large width so it will also scroll horizontally.
By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. To avoid this happening in the inline direction, we've set `overscroll-behavior-inline: contain` on the inner box.
#### HTML
    
    <main>
      <div>
        <div>
          <p>
            <code>overscroll-behavior-inline</code> has been used to make it so that
            when the scroll boundaries of the yellow inner box are reached, the
            whole page does not begin to scroll.
          </p>
        </div>
      </div>
    </main>
    
#### CSS
    
    main {
      height: 400px;
      width: 3000px;
      background-color: white;
      background-image: repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 19px,
        rgb(0 0 0 / 50%) 20px
      );
    }
    
    main > div {
      height: 300px;
      width: 400px;
      overflow: auto;
      position: relative;
      top: 50px;
      left: 50px;
      overscroll-behavior-inline: contain;
    }
    
    div > div {
      height: 100%;
      width: 1500px;
      background-color: yellow;
      background-image: repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 19px,
        rgb(0 0 0 / 50%) 20px
      );
    }
    
    p {
      padding: 10px;
      background-color: rgb(255 0 0 / 50%);
      margin: 0;
      width: 360px;
      position: relative;
      top: 10px;
      left: 10px;
    }
    
#### Result
# :picture-in-picture
The `:picture-in-picture` CSS pseudo-class matches the element which is currently in picture-in-picture mode.
## Syntax
    
    :picture-in-picture {
      /* ... */
    }
    
## Usage notes
The `:picture-in-picture` pseudo-class lets you configure your stylesheets to automatically adjust the size, style, or layout of content when a video switches back and forth between picture-in-picture and traditional presentation modes.
## Examples
In this example, a video has a box shadow when it is displayed in the floating window.
### HTML
The page's HTML looks like this:
    
    <h1>MDN Web Docs Demo: :picture-in-picture pseudo-class</h1>
    
    <p>
      This demo uses the <code>:picture-in-picture</code> pseudo-class to
      automatically change the style of a video entirely using CSS.
    </p>
    
    <video id="pip-video"></video>
    
The `<video>` with the ID `"pip-video"` will change between having a red box shadow or not, depending on whether or not it is displayed in the picture-in-picture floating window.
### CSS
The magic happens in the CSS.
    
    :picture-in-picture {
      box-shadow: 0 0 0 5px red;
    }
    
# CSS namespaces
The CSS namespaces module defines the syntax for using namespaces in CSS.
CSS isn't just for styling HTML. A stylesheet may be used to style SVG, MathML, XML, or HTML, each of which has a different namespace or a document containing multiple namespaces.
The `@namespace` at-rule defined in this module enables distinguishing between same-named elements in different namespaces. Element tag names are not unique to a single language. For example, the `<a>` element isn't limited to HTML. You may want to style the `<a>`s within your SVGs differently from the links in your HTML. You also will likely want to ensure that `querySelectorAll("a")` selects the right kind of element. Namespacing can help.
The `@namespace` rule is used for declaring a default namespace and for binding namespaces to namespace prefixes. The namespaces module also defines the syntax for using these prefixes to represent namespace-qualified names. That's it. What a name means or if the name is even valid depends on the context and host language.
## Reference
>
### At-rules
  * `@namespace`


## Guides
Namespaces crash course
    
Deep dive into what a namespace is and how they are used in XML and XML-based markup languages.
## Related concepts
  * CSS namespace separator (`|`) combinator
  * CSS type selectors
  * CSS universal selector
  * `CSSNamespaceRule` interface 
    * `CSSNamespaceRule.namespaceURI` property
    * `CSSNamespaceRule.prefix` property
  * `Document.createAttributeNS()` method
  * `Document.createElementNS()` method
  * `Document.getElementsByTagNameNS()` method
  * `Element.getAttributeNodeNS()` method
  * `Element.getAttributeNS()` method
  * `Element.getElementsByTagNameNS()` method
  * `Element.hasAttributeNS()` method
  * `Element.namespaceURI` property
  * `Element.removeAttributeNS()` method
  * `Element.setAttributeNS()` method
  * `Element.setAttributeNodeNS()` method
  * `NamedNodeMap.getNamedItemNS()` method
  * `NamedNodeMap.removeNamedItemNS()` method
  * `NamedNodeMap.setNamedItemNS()` method
  * Namespace glossary term


# CSS table
The CSS table module helps you define how to lay out table data.
This CSS module defines styles applicable to the HTML `<table>` element, which is used to render tabular data. By default, tables are rendered as a two-dimensional grid with cells lined up in a series of consecutive rows and columns. This layout is generated from the table structure and sized according to the content of the cells. This module also enables defining the position of the table's `<caption>`, if present.
The properties introduced in this module aren't limited to the `<table>` elements; they can be applied to any element with a table-related CSS `display` value.
## Reference
>
### Properties
  * `border-collapse`
  * `border-spacing`
  * `caption-side`
  * `empty-cells`
  * `table-layout`


## Guides
Learn: Styling tables
    
A guide to improving the appearance of HTML tables, covering table styling techniques.
Learn: HTML table basics
    
An introduction to HTML tables, including the HTML for creating rows and cells, headings, and making cells span multiple columns and rows.
Learn: HTML table accessibility
    
A look at advanced HTML table features, including captions and grouping table rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
## Related concepts
  * `display` property
  * `vertical-align` property
  * `text-align` property
  * CSS box sizing module
    * `box-sizing`
    * `height`
    * `max-width`
    * `min-height`
    * `min-width`
    * `width`
    * `min-content` keyword
  * CSS backgrounds and borders module
    * `border` shorthand
    * `border-width`
    * `border-style`
    * `border-color`
  * HTML table-related elements:
    * `<table>`
    * `<caption>`
    * `<colgroup>`
    * `<col>`
    * `<thead>`
    * `<tbody>`
    * `<tfoot>`
    * `<tr>`
    * `<th>`
    * `<td>`


Note: The CSS 2.2 specification defines stable standards for web styling, including detailed specifications for table formatting. The CSS Table Module Level 3 specification seeks to expand these capabilities with advanced features for table layout and rendering. However, the table module specification is still being developed and is not yet ready for implementation.
# @color-profile
The `@color-profile` CSS at-rule defines and names a color profile which can later be used in the `color()` function to specify a color.
## Syntax
    
    @color-profile --swop5c {
      src: url("https://example.org/SWOP2006_Coated5v2.icc");
    }
    
### Parameters
profile name
    
Either a `<dashed-ident>` or the identifier `device-cmyk`.
### Descriptors
`src`
    
Specifies the URL to retrieve the color-profile information from.
`rendering-intent`
    
If the color profile contains more than one rendering intent, this descriptor allows one to be selected as the one to use to define how to map the color to smaller gamuts than this profile is defined over.
If used, it must be one of the following keywords:
`relative-colorimetric`
    
Media-relative colorimetric is required to leave source colors that fall inside the destination medium gamut unchanged relative to the respective media white points. Source colors that are out of the destination medium gamut are mapped to colors on the gamut boundary using a variety of different methods.
`absolute-colorimetric`
    
ICC-absolute colorimetric is required to leave source colors that fall inside the destination medium gamut unchanged relative to the adopted white (a perfect reflecting diffuser). Source colors that are out of the destination medium gamut are mapped to colors on the gamut boundary using a variety of different methods.
`perceptual`
    
This method is often the preferred choice for images, especially when there are substantial differences between the source and destination (such as a screen display image reproduced on a reflection print). It takes the colors of the source image and re-optimizes the appearance for the destination medium using proprietary methods.
`saturation`
    
This option was created to preserve the relative saturation (chroma) of the original, and to keep solid colors pure. However, it experienced interoperability problems like the perceptual intent.
## Examples
This example demonstrates using offset printing to ISO 12647-2:2004 using the CGATS/SWOP TR005 2007 characterization data on grade 5 paper with an ink limit of 300% Total Area Coverage, and medium gray component replacement (GCR). This example is from the specification.
The `src` descriptor specifies the URL to retrieve the color-profile information from.
    
    @color-profile --swop5c {
      src: url("https://example.org/SWOP2006_Coated5v2.icc");
    }
    .header {
      background-color: color(--swop5c 0% 70% 20% 0%);
    }
    
Currently, no browsers support this feature.
# white-space-collapse
The `white-space-collapse` CSS property controls how white space inside an element is collapsed.
Note: The `white-space-collapse` and `text-wrap-mode` properties can be declared together using the `white-space` shorthand property.
## Syntax
    
    /* Keyword values */
    white-space-collapse: collapse;
    white-space-collapse: preserve;
    white-space-collapse: preserve-breaks;
    white-space-collapse: preserve-spaces;
    white-space-collapse: break-spaces;
    
    /* Global values */
    white-space-collapse: inherit;
    white-space-collapse: initial;
    white-space-collapse: revert;
    white-space-collapse: revert-layer;
    white-space-collapse: unset;
    
The `white-space-collapse` property is specified as a single keyword chosen from the list of values below.
### Values
`collapse`
    
White space sequences are collapsed.
`preserve`
    
White space sequences and segment break characters are preserved.
`preserve-breaks`
    
White space sequences are collapsed, while segment break characters are preserved.
`preserve-spaces`
    
White space sequences are preserved, while tabs and segment break characters are converted to spaces.
`break-spaces`
    
The behavior is identical to `preserve`, except that:
  * Any sequence of preserved white space always takes up space, including at the end of the line.
  * A line-breaking opportunity exists after every preserved white space character, including between white space characters.
  * Preserved spaces take up space and do not hang, thus affecting the box's intrinsic sizes (`min-content` size and `max-content` size).


Note: Segment break characters are characters such as line feeds that cause text to break onto new lines.
Note: The CSS text module defines a `discard` value for the `white-space-collapse` property to discard all white space in the element, however, this is not supported in any browsers.
## Examples
>
### HTML
    
    <h2 class="collapse">Default behavior;
      all   whitespace   is   collapsed
      in    the          heading       .</h2>
    
    <h2 class="preserve">In this case
      all   whitespace   is   preserved
      in    the          heading       .</h2>
    
    <h2 class="preserve-breaks">In this case only
      the   line breaks  are  preserved
      in    the          heading       .</h2>
    
    <h2 class="preserve-spaces">In this case only
      the   spaces       are  preserved
      in    the          heading       .</h2>
    
### CSS
    
    .collapse {
      white-space-collapse: collapse;
    }
    
    .preserve {
      white-space-collapse: preserve;
    }
    
    .preserve-breaks {
      white-space-collapse: preserve-breaks;
    }
    
    .preserve-spaces {
      white-space-collapse: preserve-spaces;
    }
    
    h2 {
      font-size: 1.6rem;
      font-family: monospace;
      border-bottom: 1px dotted #cccccc;
    }
    
### Result
# scroll-margin-right
The `scroll-margin-right` property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-right: 0;
    
    
    scroll-margin-right: 20px;
    
    
    scroll-margin-right: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-right: 10px;
    scroll-margin-right: 1em;
    
    /* Global values */
    scroll-margin-right: inherit;
    scroll-margin-right: initial;
    scroll-margin-right: revert;
    scroll-margin-right: revert-layer;
    scroll-margin-right: unset;
    
### Values
`<length>`
    
An outset from the right edge of the scroll container.
# line-clamp
The `line-clamp` CSS property allows limiting of the contents of a block to the specified number of lines.
Note: For legacy support, the vendor-prefixed `-webkit-line-clamp` property only works in combination with the `display` property set to `-webkit-box` or `-webkit-inline-box` and the `-webkit-box-orient` property set to `vertical`. Despite these prefixed properties being deprecated, the co-dependency of these three properties is a fully specified behavior and will continue to be supported.
In most cases you will also want to set `overflow` to `hidden`, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines.
When applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end.
## Syntax
    
    /* Keyword value */
    line-clamp: none;
    
    /* <integer> values */
    line-clamp: 3;
    line-clamp: 10;
    
    /* Global values */
    line-clamp: inherit;
    line-clamp: initial;
    line-clamp: revert;
    line-clamp: revert-layer;
    line-clamp: unset;
    
### Values
`none`
    
This value specifies that the content won't be clamped.
`<integer>`
    
This value specifies the number of lines after which the content will be clamped. It must be greater than 0.
## Examples
>
### Truncating a paragraph
#### HTML
    
    <p>
      In this example the <code>-webkit-line-clamp</code> property is set to
      <code>3</code>, which means the text is clamped after three lines. An ellipsis
      will be shown at the point where the text is clamped.
    </p>
    
#### CSS
    
    p {
      width: 300px;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      overflow: hidden;
    }
    
#### Result
# scroll-padding-inline
The `scroll-padding-inline` shorthand property sets the scroll padding of an element in the inline dimension.
## Try it
    
    scroll-padding-inline: 0;
    
    
    scroll-padding-inline: 20px;
    
    
    scroll-padding-inline: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-padding-inline-end`
  * `scroll-padding-inline-start`


## Syntax
    
    /* Keyword values */
    scroll-padding-inline: auto;
    
    /* <length> values */
    scroll-padding-inline: 10px;
    scroll-padding-inline: 1em 0.5em;
    scroll-padding-inline: 10%;
    
    /* Global values */
    scroll-padding-inline: inherit;
    scroll-padding-inline: initial;
    scroll-padding-inline: revert;
    scroll-padding-inline: revert-layer;
    scroll-padding-inline: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# corner-end-end-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-end-end-shape` CSS property specifies the shape of a box's block-end and inline-end corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-end-end-shape: scoop;
    corner-end-end-shape: notch;
    
    /* superellipse() function values */
    corner-end-end-shape: superellipse(4);
    corner-end-end-shape: superellipse(-0.5);
    
    /* Global values */
    corner-end-end-shape: inherit;
    corner-end-end-shape: initial;
    corner-end-end-shape: revert;
    corner-end-end-shape: revert-layer;
    corner-end-end-shape: unset;
    
### Values
The `corner-end-end-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-end-end-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of 60 pixels, and a `corner-end-end-shape` of `squircle`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px;
      corner-end-end-shape: squircle;
    }
    
#### Result
The rendered result looks like this:
# CSS images
The CSS images module defines the types of images that can be used (the `<image>` type, containing URLs, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models.
## Reference
>
### Properties
  * `image-orientation`
  * `image-rendering`
  * `object-fit`
  * `object-position`


The CSS images module also defines the `image-resolution` property. Currently, no browsers support this feature.
### Functions
  * `linear-gradient()`
  * `radial-gradient()`
  * `repeating-linear-gradient()`
  * `repeating-radial-gradient()`
  * `conic-gradient()`
  * `repeating-conic-gradient()`
  * `cross-fade()`
  * `element()`
  * `image-set()`


The CSS images module also defines the `image()` function. Currently, no browsers support this feature.
### Data types
  * `<gradient>`
  * `<image>`


## Guides
Using CSS gradients
    
Presents a specific type of CSS images, gradients, and how to create and use these.
Implementing image sprites in CSS
    
Describes the common technique grouping several images in one single document to save download requests and speed up the availability of a page.
Styling replaced elements
    
Introduces the properties that only apply to replaced elements.
Understanding aspect ratios
    
Learn about the `aspect-ratio` property, discuss aspect ratios for replaced and non-replaced elements, and examine some common aspect ratio use cases.
## Related concepts
  * `<url>`
  * `url()`


# text-decoration-skip-ink
The `text-decoration-skip-ink` CSS property specifies how overlines and underlines are drawn when they pass over glyph ascenders and descenders.
## Try it
    
    text-decoration-skip-ink: auto;
    
    
    text-decoration-skip-ink: none;
    
    
    <section id="default-example">
      <p>
        <span class="transition-all" id="example-element">parapsychologists</span>
      </p>
    </section>
    
    
    p {
      font:
        1.9em Georgia,
        serif;
      text-decoration: underline;
    }
    
`text-decoration-skip-ink` is not part of the `text-decoration` shorthand.
## Syntax
    
    /* Single keyword */
    text-decoration-skip-ink: none;
    text-decoration-skip-ink: auto;
    text-decoration-skip-ink: all;
    
    /* Global keywords */
    text-decoration-skip-ink: inherit;
    text-decoration-skip-ink: initial;
    text-decoration-skip-ink: revert;
    text-decoration-skip-ink: revert-layer;
    text-decoration-skip-ink: unset;
    
### Values
`none`
    
Underlines and overlines are drawn across the full length of the text content, including parts that cross over glyph descenders and ascenders.
`auto`
    
The default — the browser may interrupt underlines and overlines so that they do not touch or closely approach a glyph. That is, they are interrupted where they would otherwise cross over a glyph.
`all`
    
The browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph. This can be helpful with certain Chinese, Japanese, or Korean (CJK) fonts, where the `auto` behavior might not create interruptions.
## Examples
>
### HTML
    
    <p>You should go on a quest for a cup of coffee.</p>
    <p class="no-skip-ink">Or maybe you'd prefer some tea?</p>
    <p>この文は、 text-decoration-skip-ink: auto の使用例を示しています。</p>
    <p class="skip-ink-all">
      この文は、 text-decoration-skip-ink: all の使用例を示しています。
    </p>
    
### CSS
    
    p {
      font-size: 1.5em;
      text-decoration: underline blue;
      text-decoration-skip-ink: auto; /* this is the default anyway */
    }
    
    .no-skip-ink {
      text-decoration-skip-ink: none;
    }
    
    .skip-ink-all {
      text-decoration-skip-ink: all;
    }
    
### Result
# :root
The `:root` CSS pseudo-class matches the root element of a tree representing the document. In HTML, `:root` represents the `<html>` element and is identical to the selector `html`, except that its specificity is higher.
    
    /* Selects the root element of the document:
       <html> in the case of HTML */
    :root {
      background: yellow;
    }
    
## Syntax
    
    :root {
      /* ... */
    }
    
## Examples
>
### Declaring global CSS variables
`:root` can be useful for declaring global CSS variables:
    
    :root {
      --main-color: hotpink;
      --pane-padding: 5px 42px;
    }
    
# grid-row-start
The `grid-row-start` CSS property specifies a grid item's start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area.
## Try it
    
    grid-row-start: auto;
    
    
    grid-row-start: 3;
    
    
    grid-row-start: -1;
    
    
    grid-row-start: span 2;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Syntax
    
    /* Keyword value */
    grid-row-start: auto;
    
    /* <custom-ident> values */
    grid-row-start: some-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-row-start: 2;
    grid-row-start: some-grid-area 4;
    
    /* span + <integer> + <custom-ident> values */
    grid-row-start: span 3;
    grid-row-start: span some-grid-area;
    grid-row-start: 5 some-grid-area span;
    
    /* Global values */
    grid-row-start: inherit;
    grid-row-start: initial;
    grid-row-start: revert;
    grid-row-start: revert-layer;
    grid-row-start: unset;
    
This property is specified as a single `<grid-line>` value. A `<grid-line>` value can be specified as:
  * either the `auto` keyword
  * or a `<custom-ident>` value
  * or an `<integer>` value
  * or both `<custom-ident>` and `<integer>`, separated by a space
  * or the keyword `span` together with either a `<custom-ident>` or an `<integer>` or both.


### Values
`auto`
    
Is a keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name '<custom-ident>-start', it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-row-start: foo;` will choose the start edge of that named grid area (unless another line named `foo-start` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement; such that the row start edge of the grid item's grid area is n lines from the end edge.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span.
If the <integer> is omitted, it defaults to `1`. Negative integers or 0 are invalid.
The `<custom-ident>` cannot take the `span` and `auto` values.
## Examples
>
### Setting row start for a grid item
#### HTML
    
    <div class="wrapper">
      <div class="box1">One</div>
      <div class="box2">Two</div>
      <div class="box3">Three</div>
      <div class="box4">Four</div>
      <div class="box5">Five</div>
    </div>
    
#### CSS
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-rows: 100px;
    }
    
    .box1 {
      grid-column-start: 1;
      grid-column-end: 4;
      grid-row-start: 1;
      grid-row-end: 3;
    }
    
    .box2 {
      grid-column-start: 1;
      grid-row-start: 3;
      grid-row-end: 5;
    }
    
#### Result
# animation-range-start
The `animation-range-start` CSS property is used to set the start of an animation's attachment range along its timeline, i.e., where along the timeline an animation will start.
The `animation-range-start` and `animation-range-end` properties can also be set using the `animation-range` shorthand property.
Note: `animation-range-start` is included in the `animation` shorthand as a reset-only value. This means that including `animation` resets a previously-declared `animation-range-start` value to `normal`, but a specific value cannot be set via `animation`. When creating CSS scroll-driven animations, you need to declare `animation-range-start` after declaring any `animation` shorthand for it to take effect.
## Syntax
    
    /* Keyword or length percentage value */
    animation-range-start: normal;
    animation-range-start: 20%;
    animation-range-start: 100px;
    
    /* Named timeline range value */
    animation-range-start: cover;
    animation-range-start: contain;
    animation-range-start: cover 20%;
    animation-range-start: contain 100px;
    
### Values
Allowed values for `animation-range-start` are `normal`, a `<length-percentage>`, a `<timeline-range-name>`, or a `<timeline-range-name>` with a `<length-percentage>` following it. See `animation-range` for a detailed description of the available values.
Also check out the View Timeline Ranges Visualizer, which shows exactly what the different values mean in an easy visual format.
## Examples
>
### Creating a named view progress timeline with range start
A view progress timeline named `--subject-reveal` is defined using the `view-timeline` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
An `animation-range-start` declaration is also set to make the animation begin later than expected.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed. We also give it an `animation-range-start` declaration to make the animation begin later than expected.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline: --subject-reveal block;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-range-start: entry 25%;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# border-right-color
The `border-right-color` CSS property sets the color of an element's right border. It can also be set with the shorthand CSS properties `border-color` or `border-right`.
## Try it
    
    border-right-color: red;
    
    
    border-right-color: #32a1ce;
    
    
    border-right-color: rgb(170 50 220 / 0.6);
    
    
    border-right-color: hsl(60 90% 50% / 0.8);
    
    
    border-right-color: transparent;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <color> values */
    border-right-color: red;
    border-right-color: #ffbb00;
    border-right-color: rgb(255 0 0);
    border-right-color: hsl(100deg 50% 25% / 75%);
    border-right-color: currentColor;
    border-right-color: transparent;
    
    /* Global values */
    border-right-color: inherit;
    border-right-color: initial;
    border-right-color: revert;
    border-right-color: revert-layer;
    border-right-color: unset;
    
The `border-right-color` property is specified as a single value.
### Values
`<color>`
    
The color of the right border.
## Examples
>
### A div with a border
#### HTML
    
    <div class="my-box">
      <p>
        This is a box with a border around it. Note which side of the box is
        <span class="red-text">red</span>.
      </p>
    </div>
    
#### CSS
    
    .my-box {
      border: solid 0.3em gold;
      border-right-color: red;
      width: auto;
    }
    
    .red-text {
      color: red;
    }
    
#### Result
# text-autospace
The `text-autospace` CSS property allows you to specify the space applied between Chinese/Japanese/Korean (CJK) and non-CJK characters.
## Syntax
    
    text-autospace: normal;
    text-autospace: no-autospace;
    text-autospace: ideograph-alpha;
    text-autospace: ideograph-numeric;
    text-autospace: punctuation;
    text-autospace: insert;
    text-autospace: replace;
    text-autospace: ideograph-alpha ideograph-numeric punctuation;
    text-autospace: ideograph-alpha ideograph-numeric;
    text-autospace: ideograph-alpha ideograph-numeric insert;
    text-autospace: auto;
    
    /* Global values */
    text-autospace: inherit;
    text-autospace: initial;
    text-autospace: revert;
    text-autospace: revert-layer;
    text-autospace: unset;
    
### Values
`normal`
    
Creates the default behavior to automatically apply spacing between CJK and non-CJK characters and around punctuation. This value has the same effect as applying both `ideograph-alpha` and `ideograph-numeric`.
`<autospace>`
    
Provides more control over spacing behaviors. It accepts:
  * the keyword `no-autospace`, or
  * a combination of one or more of `ideograph-alpha`, `ideograph-numeric`, and `punctuation`, optionally followed by `insert` or `replace`.
  * `no-autospace`
    * : Disables automatic spacing between CJK and non-CJK characters.
  * `ideograph-alpha`
    * : Adds spacing only between ideographic characters (such as Katakana and Han) and non-ideographic letters (such as Latin). It does not add spacing between ideographic characters and non-ideographic numbers.
  * `ideograph-numeric`
    * : Adds spacing only between ideographic characters (such as Katakana and Han) and non-ideographic numbers (such as Latin). It does not add spacing between ideographic characters and non-ideographic letters.
  * `punctuation`
    * : Adds non-breaking spacing around punctuation as required by language-specific typographic conventions.
  * `insert`
    * : Adds the specified spacing only if there are no existing spaces between the ideographic and non-ideographic scripts.
  * `replace`
    * : Replaces existing spacing (such as U+0020) between ideographic and non-ideographic characters with the specified spacing.


`auto`
    
Lets the browser choose typographically appropriate spacing. The spacing may vary across browsers and platforms.
Note: If neither `insert` nor `replace` are specified, the behavior is the same as `insert`.
Note: This property is additive with the `word-spacing` and `letter-spacing` properties. The amount of spacing contributed by the `letter-spacing` setting is added to the spacing created by `text-autospace`. The same applies to `word-spacing`.
## Examples
This example shows the difference between various values of `text-autospace`. Try selecting a value from the drop-down box to see how it affects the spacing in the text.
    
    <main>
      <figure class="no-autospace">
        <figcaption>
          <code>
            text-autospace: <span id="autospace-value">no-autospace</span>;
          </code>
        </figcaption>
        <div>
          <p>HTML超文本标记语言</p>
          <p>42四十二</p>
        </div>
      </figure>
    </main>
    
    
    .no-autospace {
      text-autospace: no-autospace;
    }
    .auto {
      text-autospace: auto;
    }
    .normal {
      text-autospace: normal;
    }
    .ideograph-alpha {
      text-autospace: ideograph-alpha;
    }
    .ideograph-numeric {
      text-autospace: ideograph-numeric;
    }
    
# grid-column-end
The `grid-column-end` CSS property specifies a grid item's end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area.
## Try it
    
    grid-column-end: auto;
    
    
    grid-column-end: 3;
    
    
    grid-column-end: -1;
    
    
    grid-column-end: span 3;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Syntax
    
    /* Keyword value */
    grid-column-end: auto;
    
    /* <custom-ident> values */
    grid-column-end: some-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-column-end: 2;
    grid-column-end: some-grid-area 4;
    
    /* span + <integer> + <custom-ident> values */
    grid-column-end: span 3;
    grid-column-end: span some-grid-area;
    grid-column-end: 5 some-grid-area span;
    
    /* Global values */
    grid-column-end: inherit;
    grid-column-end: initial;
    grid-column-end: revert;
    grid-column-end: revert-layer;
    grid-column-end: unset;
    
### Values
`auto`
    
Contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`. This is the default value.
`<custom-ident>`
    
Contributes the first line to the grid item's placement if there is a named line with the name `<custom-ident>-end`.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-column-end: foo;` will choose the end edge of that named grid area (unless another line named `foo-end` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement such that the column end edge of the grid item's grid area is n lines from the start edge.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the <integer> is omitted, it defaults to `1`. Negative integers or 0 are invalid.
The `<custom-ident>` cannot take the `span` and `auto` values.
## Examples
>
### Setting column end for a grid item
#### HTML
    
    <div class="wrapper">
      <div class="box1">One</div>
      <div class="box2">Two</div>
      <div class="box3">Three</div>
      <div class="box4">Four</div>
      <div class="box5">Five</div>
    </div>
    
#### CSS
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-rows: 100px;
    }
    
    .box1 {
      grid-column-start: 1;
      grid-column-end: 4;
      grid-row-start: 1;
      grid-row-end: 3;
    }
    
    .box2 {
      grid-column-start: 1;
      grid-row-start: 3;
      grid-row-end: 5;
    }
    
#### Result
# visibility
The `visibility` CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a `<table>`.
## Try it
    
    visibility: visible;
    
    
    visibility: hidden;
    
    
    visibility: collapse;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">Hide me</div>
        <div>Item 2</div>
        <div>Item 3</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      padding: 0.75em;
      width: 80%;
      max-height: 300px;
      display: flex;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex: 1;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
To both hide an element and remove it from the document layout, set the `display` property to `none` instead of using `visibility`.
## Syntax
    
    /* Keyword values */
    visibility: visible;
    visibility: hidden;
    visibility: collapse;
    
    /* Global values */
    visibility: inherit;
    visibility: initial;
    visibility: revert;
    visibility: revert-layer;
    visibility: unset;
    
The `visibility` property is specified as one of the keyword values listed below.
### Values
`visible`
    
The element box is visible.
`hidden`
    
The element box is invisible (not drawn), but still affects layout as normal. Descendants of the element will be visible if they have `visibility` set to `visible`. The element cannot receive focus (such as when navigating through tab indexes).
`collapse`
    
The `collapse` keyword has different effects for different elements:
  * For `<table>` rows, columns, column groups, and row groups, the row(s) or column(s) are hidden and the space they would have occupied is removed (as if ``display`: none` were applied to the column/row of the table). However, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. This value allows for the fast removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table.
  * Collapsed flex items and ruby annotations are hidden, and the space they would have occupied is removed.
  * For other elements, `collapse` is treated the same as `hidden`.


## Accessibility
Using a `visibility` value of `hidden` on an element will remove it from the accessibility tree. This will cause the element and all its descendant elements to no longer be announced by screen reading technology.
## Interpolation
When animated, visibility values are interpolated between visible and not-visible. One of the start or ending values must therefore be `visible` or no interpolation can happen. The value is interpolated as a discrete step, where values of the easing function between `0` and `1` map to `visible` and other values of the easing function (which occur only at the start/end of the transition or as a result of `cubic-bezier()` functions with y values outside of [0, 1]) map to the closer endpoint.
## Notes
  * Support for `visibility: collapse` is missing or partially incorrect in some modern browsers. It may not be correctly treated like `visibility: hidden` on elements other than table rows and columns.
  * When applied to table rows, if the table contains cells (`<td>` and `<th>` elements) that span both visible and collapsed rows, the cell may render in unexpected ways. If the spanning cell is defined in a collapsed row, browsers do not render the table cell, as if the cells in subsequent rows were present with `visibility: collapse` applied. When the cell is defined in a visible row and spans a collapsed row, the cell contents are not reflowed, but the presentation of the cell itself varies by browser. Most browsers reduce the block size of the cell by the block size of the hidden row. This means the contents may be larger than the cell in the block-size direction. Depending on the browser, the overflowing contents are either cropped, as if `overflow: hidden` were set, while the content bleeds into the subsequent row in other browsers as if `overflow: visible` were set. In other browsers, the cell is rendered as if the row were not collapsed, with all the other cells in the row hidden as if `visibility: collapse` were set on individual cells rather than the row itself.
  * `visibility: collapse` may change the layout of a table if the table has nested tables within the cells that are collapsed, unless `visibility: visible` is specified explicitly on nested tables.


## Examples
>
### Basic example
#### HTML
    
    <p class="visible">The first paragraph is visible.</p>
    <p class="not-visible">The second paragraph is NOT visible.</p>
    <p class="visible">
      The third paragraph is visible. Notice the second paragraph is still occupying
      space.
    </p>
    
#### CSS
    
    .visible {
      visibility: visible;
    }
    
    .not-visible {
      visibility: hidden;
    }
    
### Table example
#### HTML
    
    <table>
      <tr>
        <td>1.1</td>
        <td class="collapse">1.2</td>
        <td>1.3</td>
      </tr>
      <tr class="collapse">
        <td>2.1</td>
        <td>2.2</td>
        <td>2.3</td>
      </tr>
      <tr>
        <td>3.1</td>
        <td>3.2</td>
        <td>3.3</td>
      </tr>
    </table>
    
#### CSS
    
    .collapse {
      visibility: collapse;
    }
    
    table {
      border: 1px solid red;
    }
    
    td {
      border: 1px solid gray;
    }
    
# align-self
The `align-self` CSS property overrides a grid or flex item's `align-items` value. In grid, it aligns the item inside the grid area. In flexbox, it aligns the item on the cross axis.
## Try it
    
    align-self: stretch;
    
    
    align-self: center;
    
    
    align-self: start;
    
    
    align-self: end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      width: 200px;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 80px;
      grid-gap: 10px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
The property doesn't apply to block-level boxes, or to table cells. If a flexbox item's cross-axis margin is `auto`, then `align-self` is ignored.
## Syntax
    
    /* Keyword values */
    align-self: auto;
    align-self: normal;
    
    /* Positional alignment */
    /* align-self does not take left and right values */
    align-self: center; /* Put the item around the center */
    align-self: start; /* Put the item at the start */
    align-self: end; /* Put the item at the end */
    align-self: self-start; /* Align the item flush at the start */
    align-self: self-end; /* Align the item flush at the end */
    align-self: flex-start; /* Put the flex item at the start */
    align-self: flex-end; /* Put the flex item at the end */
    align-self: anchor-center;
    
    /* Baseline alignment */
    align-self: baseline;
    align-self: first baseline;
    align-self: last baseline;
    align-self: stretch; /* Stretch 'auto'-sized items to fit the container */
    
    /* Overflow alignment */
    align-self: safe center;
    align-self: unsafe center;
    
    /* Global values */
    align-self: inherit;
    align-self: initial;
    align-self: revert;
    align-self: revert-layer;
    align-self: unset;
    
### Values
`auto`
    
Computes to the parent's `align-items` value.
`normal`
    
The effect of this keyword is dependent of the layout mode we are in:
  * In absolutely-positioned layouts, the keyword behaves like `start` on replaced absolutely-positioned boxes, and as `stretch` on all other absolutely-positioned boxes.
  * In static position of absolutely-positioned layouts, the keyword behaves as `stretch`.
  * For flex items, the keyword behaves as `stretch`.
  * For grid items, this keyword leads to a behavior similar to the one of `stretch`, except for boxes with an aspect ratio or an intrinsic size where it behaves like `start`.
  * The property doesn't apply to block-level boxes, and to table cells.


`self-start`
    
Aligns the items to be flush with the edge of the alignment container corresponding to the item's start side in the cross axis.
`self-end`
    
Aligns the items to be flush with the edge of the alignment container corresponding to the item's end side in the cross axis.
`flex-start`
    
The cross-start margin edge of the flex item is flushed with the cross-start edge of the line.
`flex-end`
    
The cross-end margin edge of the flex item is flushed with the cross-end edge of the line.
`center`
    
The flex item's margin box is centered within the line on the cross-axis. If the cross-size of the item is larger than the flex container, it will overflow equally in both directions.
`baseline`, `first baseline`, `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group. The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`stretch`
    
If the item's cross-size is `auto`, the used size is set to the length necessary to be as close to filling the container as possible, respecting the item's width and height limits. If the item is not auto-sized, this value falls back to `flex-start`, and to `self-start` or `self-end` if the container's `align-content` is `first baseline` (or `baseline`) or `last baseline`.
`anchor-center`
    
In the case of anchor-positioned elements, aligns the item to the center of the associated anchor element in the block direction. See Centering on the anchor using `anchor-center`.
`safe`
    
If the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Regardless of the relative sizes of the item and alignment container, the given alignment value is honored.
## Examples
>
### HTML
    
    <section>
      <div>Item #1</div>
      <div>Item #2</div>
      <div>Item #3</div>
    </section>
    
### CSS
    
    section {
      display: flex;
      align-items: center;
      height: 120px;
      background: beige;
    }
    
    div {
      height: 60px;
      background: cyan;
      margin: 5px;
    }
    
    div:nth-child(3) {
      align-self: flex-end;
      background: pink;
    }
    
### Result
# sqrt()
The `sqrt()` CSS function is an exponential function that returns the square root of a number.
The function `pow(x, 0.5)` is equivalent to `sqrt(x)`.
## Syntax
    
    /* A <number> value */
    width: calc(100px * sqrt(9)); /*  300px */
    width: calc(100px * sqrt(25)); /*  500px */
    width: calc(100px * sqrt(100)); /* 1000px */
    
### Parameters
The `sqrt(x)` function accepts only one value as its parameter.
`x`
    
A calculation which resolves to a `<number>` greater than or equal to 0.
### Return value
Returns a `<number>` which is the square root of `x`.
  * if `x` is `+∞`, the result is `+∞`.
  * If `x` is `0⁻`, the result is `0⁻`.
  * If `x` is less than `0`, the result is `NaN`.


## Examples
>
### Scale sizes based on square root
This example shows how you can use the `sqrt()` function to calculate sizes.
#### HTML
    
    <div class="boxes">
      <div class="box">50px</div>
      <div class="box one">100px</div>
      <div class="box two">150px</div>
      <div class="box three">200px</div>
    </div>
    
#### CSS
Here we are using CSS custom properties to define the sizes to be used. First, we declare the first size (`--size-0`), which is then used to calculate the other sizes.
  * `--size-1` is calculated by multiplying the value of `--size-0` (50px) by the square root of 4 (2), which results in 100px.
  * `--size-2` is calculated by multiplying the value of `--size-0` (50px) by the square root of 9 (3), which results in 150px.
  * `--size-3` is calculated by multiplying the value of `--size-0` (50px) by the square root of 16 (4), which results in 200px.


    
    :root {
      --size-0: 50px;
      --size-1: calc(var(--size-0) * sqrt(4)); /*  100px */
      --size-2: calc(var(--size-0) * sqrt(9)); /*  150px */
      --size-3: calc(var(--size-0) * sqrt(16)); /*  200px */
    }
    
The sizes are then applied as the `width` and `height` values of the selectors.
    
    .one {
      width: var(--size-1);
      height: var(--size-1);
    }
    .two {
      width: var(--size-2);
      height: var(--size-2);
    }
    .three {
      width: var(--size-3);
      height: var(--size-3);
    }
    
#### Result
# CSS transforms
The CSS transforms module defines how elements styled with CSS can be transformed in two-dimensional or three-dimensional space.
## CSS transforms in action
Use the sliders in the example below to modify the translation, rotation, scale, and skew CSS transform properties of the cube in 3D space. As you move the cube through 3D space, notice the way it interacts with the element labelled `z:0px`, which is located at the 3D position `(0, 0, 0)`.
You can also use the `perspective` slider to modify the `perspective` property of the cube's container, which determines the distance between you and the `z=0` plane.
The `perspective-origin` sliders determine where you, the viewer, are looking into the 3D space for purposes of determining the view's vanishing point. This vanishing point is indicated by a small red dot. You can imagine modifying these sliders as physically moving your head up, down, left, and right to see different parts of the cube without moving the cube itself.
The `backface-visibility` checkbox determines whether the cube's back faces are set to `visible` or `hidden`.
The cube in the above example is comprised of six `<div>` elements, all of which are styled with CSS to create the cube's faces. The cube is not drawn using a 2D or 3D canvas context, so you can inspect the faces of the cube with your browser's developer tools as you would inspect any other DOM element. Try using your browser's developer tools element picker to inspect different faces of the cube as you transform its position and rotation.
Note: The order in which transformations, including 3D rotations, are applied affects the resultant transformation. In the above example, transforms are translated, scaled, rotated, then skewed. The rotations are applied in the order X → Y → Z.
## Reference
>
### Properties
  * `backface-visibility`
  * `perspective`
  * `perspective-origin`
  * `rotate`
  * `scale`
  * `transform`
  * `transform-box`
  * `transform-origin`
  * `transform-style`
  * `translate`


### Functions
  * `matrix()`
  * `matrix3d()`
  * `perspective()`
  * `rotate()`
  * `rotate3d()`
  * `rotateX()`
  * `rotateY()`
  * `rotateZ()`
  * `scale()`
  * `scale3d()`
  * `scaleX()`
  * `scaleY()`
  * `scaleZ()`
  * `skew()`
  * `skewX()`
  * `skewY()`
  * `translate()`
  * `translate3d()`
  * `translateX()`
  * `translateY()`
  * `translateZ()`


### Data types
  * `<transform-function>`


## Guides
Using CSS transforms
    
Step-by-step tutorial about how to transform elements styled with CSS.
Coordinate systems
    
Describes the way pixel locations are defined in the CSS object model.
Performance fundamentals: Use CSS transforms
    
An overview of web performance fundamentals, including how CSS transforms can improve performance.
Matrix math for the web
    
Describes how object transformations can be represented by mathematical matrices.
## Related concepts
  * CSS Properties: 
    * `animation`
    * `background-position`
    * `clip`
    * `clip-path`
    * `contain`
    * `content-visibility`
    * `isolation`
    * `mask`
    * `mask-border-source`
    * `mask-image`
    * `mix-blend-mode`
    * `opacity`
    * `overflow`
    * `transition`
    * `visibility`
  * Data types: 
    * `<angle>`
    * `<length-percentage>`
    * `<length>`
    * `<number>`
    * `<percentage>`
    * `<position>`
  * Glossary terms: 
    * Interpolation
    * Stacking context
  * SVG concepts: 
    * `<animate>` element
    * `<animateTransform>` element
    * `<set>` element
    * `transform` element


# d
The `d` CSS property defines a path to be drawn by the SVG `<path>` element. If present, it overrides the element's `d` attribute.
Note: The `d` property only applies to `<path>` elements nested in an `<svg>`. It doesn't apply to other SVG elements nor to HTML elements or pseudo-elements.
## Syntax
    
    /* Default */
    d: none;
    
    /* Basic usage */
    d: path("m 5,5 h 35 L 20,30 z");
    d: path("M 0,25 l 50,150 l 200,50 z");
    d: path("M 10,5 l 90,0 -80,80 0,-60 80,80 -90,0 z");
    
    /* Global values */
    d: inherit;
    d: initial;
    d: revert;
    d: revert-layer;
    d: unset;
    
### Values
The value is either a `path()` function with a single `<string>` parameter or the keyword `none`.
`none`
    
No path is drawn.
`path(<string>)`
    
A `path()` function with a quoted data string parameter. The data string defines an SVG path. The SVG path data string contains path commands that implicitly use pixel units. An empty path is considered invalid.
## Examples
>
### Specifying path data
This example demonstrates the basic use case of `d`, and how the CSS `d` property takes precedence over the `d` attribute.
#### HTML
We include two identical `<path>` elements in an SVG; their `d` attribute values are `"m 5,5 h 90 v 90 h -90 v -90 z"`, which creates a `90px` square.
    
    <svg>
      <path d="m 5,5 h 90 v 90 h -90 v -90 z" />
      <path d="m 5,5 h 90 v 90 h -90 v -90 z" />
    </svg>
    
#### CSS
With CSS, we style both paths, providing a black `stroke` and semi-opaque red `fill`. We then use the `d` property to override the value of the SVG `d` attribute for the last path only. The browser renders SVG images as `300px` wide and `150px` tall by default.
    
    svg {
      border: 1px solid;
    }
    
    path {
      fill: #ff333388;
      stroke: black;
    }
    
    path:last-of-type {
      d: path(
        "M10,30 A20,20 0,0,1 50,30 A20,20 0,0,1 90,30 Q90,60 50,90 Q10,60 10,30 z"
      );
    }
    
#### Results
The second `<path>` is a heart, as defined in the CSS `d` property's `path()` function value. The unstyled `<path>`'s path remained a square, as defined in its SVG `d` attribute value.
### Animating data paths
This example demonstrates animating the `d` attribute value.
#### HTML
We create a `<svg>` containing a single `<path>` element.
    
    <svg>
      <path />
    </svg>
    
#### CSS
We use the `d` attribute to define a heart with a line through it. We use CSS to define the `fill`, `stroke`, and `stroke-width` of that path, and add a two-second `transition`. We add a `:hover` style that contains a slightly different `path()` function; the path has the same number of data points as the default state, making the path animatable.
    
    svg {
      border: 1px solid;
    }
    
    path {
      d: path(
        "M10,30 A20,20 0,0,1 50,30 A20,20 0,0,1 90,30 Q90,60 50,90 Q10,60 10,30 z M90,5 L5,90"
      );
      transition: all 2s;
      fill: none;
      stroke: red;
      stroke-width: 3px;
    }
    
    svg:hover path {
      d: path(
        "M10,30 A20,20 0,0,1 50,30 A20,20 0,0,1 90,30 Q90,60 50,90 Q10,60 10,30 z M5,5 L90,90"
      );
      stroke: black;
    }
    
#### Results
To view the animation, hover over the SVG.
# offset
The `offset` CSS shorthand property sets all the properties required for animating an element along a defined path. The offset properties together help to define an offset transform, a transform that aligns a point in an element (offset-anchor) to an offset position (offset-position) on a path (offset-path) at various points along the path (offset-distance) and optionally rotates the element (offset-rotate) to follow the direction of the path.
Note: Early versions of the spec called this property `motion`.
## Try it
    
    offset: path("M 20 60 L 120 60 L 70 10 L 20 60") 0% auto 90deg;
    
    
    offset: path(
        "M 20 210 L 74 210 L 118 140 \
     L 62 140 L 20 210"
      )
      20% auto;
    
    
    <section class="default-example" id="default-example">
      <div class="wrapper">
        <div id="example-element"></div>
      </div>
      <button id="playback" type="button">Play</button>
    </section>
    
    
    #example-element {
      width: 24px;
      height: 24px;
      background: #2bc4a2;
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
      animation: distance 3000ms infinite normal ease-in-out;
      animation-play-state: paused;
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    .wrapper {
      height: 220px;
      width: 200px;
      background:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 140" width="200" height="140"><path d="M 0 60 L 100 60 L 50 10 L 0 60" fill="none" stroke="lightgrey" stroke-width="2" stroke-dasharray="4.5"/></svg>')
          no-repeat,
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -140 150 230" width="200" height="230"><path d="M 0 70 L 56 70 L 98 0 L 42 0 L 0 70" fill="none" stroke="lightgrey" stroke-width="2" stroke-dasharray="4.5"/></svg>');
    }
    
    @keyframes distance {
      to {
        offset-distance: 100%;
      }
    }
    
    #playback {
      position: absolute;
      top: 0;
      left: 0;
      font-size: 1em;
    }
    
    
    const example = document.getElementById("example-element");
    const button = document.getElementById("playback");
    
    button.addEventListener("click", () => {
      if (example.classList.contains("running")) {
        example.classList.remove("running");
        button.textContent = "Play";
      } else {
        example.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `offset-anchor`
  * `offset-distance`
  * `offset-path`
  * `offset-position`
  * `offset-rotate`


## Syntax
    
    /* Offset position */
    offset: auto;
    offset: 10px 30px;
    offset: none;
    
    /* Offset path */
    offset: ray(45deg closest-side);
    offset: path("M 100 100 L 300 100 L 200 300 z");
    offset: url("arc.svg");
    
    /* Offset path with distance and/or rotation */
    offset: url("circle.svg") 100px;
    offset: url("circle.svg") 40%;
    offset: url("circle.svg") 30deg;
    offset: url("circle.svg") 50px 20deg;
    
    /* Including offset anchor */
    offset: ray(45deg closest-side) / 40px 20px;
    offset: url("arc.svg") 2cm / 0.5cm 3cm;
    offset: url("arc.svg") 30deg / 50px 100px;
    
    /* Global values */
    offset: inherit;
    offset: initial;
    offset: revert;
    offset: revert-layer;
    offset: unset;
    
## Examples
>
### Animating an element along a path
#### HTML
    
    <div id="offsetElement"></div>
    
#### CSS
    
    @keyframes move {
      from {
        offset-distance: 0%;
      }
    
      to {
        offset-distance: 100%;
      }
    }
    
    #offsetElement {
      width: 50px;
      height: 50px;
      background-color: blue;
      offset: path("M 100 100 L 300 100 L 200 300 z") auto;
      animation: move 3s linear infinite;
    }
    
#### Result
# scroll-timeline-name
The `scroll-timeline-name` CSS property is used to define the name of a named scroll progress timeline, which is progressed through by scrolling a scrollable element (scroller) between top and bottom (or left and right). `scroll-timeline-name` is set on the scroller that will provide the timeline.
The name is then referenced in an `animation-timeline` declaration to indicate the container's element that is used to drive the progress of the animation through the scrolling action.
Note: If the element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no timeline will be created.
The `scroll-timeline-axis` and `scroll-timeline-name` properties can also be set using the `scroll-timeline` shorthand property.
## Syntax
    
    scroll-timeline-name: none;
    scroll-timeline-name: --custom_name_for_timeline;
    
### Values
Allowed values for `scroll-timeline-name` are:
`none`
    
The timeline has no name.
`<dashed-ident>`
    
An arbitrary custom identifier defining a name for a scroll progress timeline, which can then be referenced in an `animation-timeline` property.
Note: `<dashed-ident>` values must start with `--`, which helps avoid name clashes with standard CSS keywords.
## Examples
>
### Creating a named scroll progress timeline animation
In this example, a scroll timeline named `--square-timeline` is defined using the `scroll-timeline-name` property on the element with the ID `container`. This is then applied to the animation on the `#square` element using `animation-timeline: --square-timeline`.
#### HTML
The HTML for the example is shown below.
    
    <div id="container">
      <div id="square"></div>
      <div id="stretcher"></div>
    </div>
    
#### CSS
The CSS for the container sets it as the source of a scroll timeline named `--square-timeline` using the `scroll-timeline-name` property. No scrollbar axis is defined here because the vertical axis will be used by default.
The height of the container is set to `300px`, and the container is also set to create a vertical scrollbar if it overflows (the CSS `height` rule on the `stretcher` element below does make the content overflow its container).
    
    #container {
      height: 300px;
      overflow-y: scroll;
      scroll-timeline-name: --square-timeline;
      position: relative;
    }
    
The CSS below defines a square that rotates according to the timeline provided by the `animation-timeline` property, which is set to the `--square-timeline` timeline named above.
    
    #square {
      background-color: deeppink;
      width: 100px;
      height: 100px;
      margin-top: 100px;
      animation-name: rotateAnimation;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
      animation-timeline: --square-timeline;
      position: absolute;
      bottom: 0;
    }
    
    #stretcher {
      height: 600px;
      background: #dedede;
    }
    
    @keyframes rotateAnimation {
      from {
        transform: rotate(0deg);
      }
    
      to {
        transform: rotate(360deg);
      }
    }
    
The `stretcher` CSS rule sets the block height to `600px`, which creates content that overflows the container element, thereby creating scroll bars. Without this element, the content would not overflow the container, there would be no scrollbar, and hence no scroll timeline to associate with the animation timeline.
#### Result
Scroll the vertical bar to see the square animate as you scroll.
# border-right-width
The `border-right-width` CSS property sets the width of the right border of an element.
## Try it
    
    border-right-width: thick;
    
    
    border-right-width: 2em;
    
    
    border-right-width: 4px;
    
    
    border-right-width: 2ex;
    
    
    border-right-width: 0;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* Keyword values */
    border-right-width: thin;
    border-right-width: medium;
    border-right-width: thick;
    
    /* <length> values */
    border-right-width: 10em;
    border-right-width: 3vmax;
    border-right-width: 6px;
    
    /* Global keywords */
    border-right-width: inherit;
    border-right-width: initial;
    border-right-width: revert;
    border-right-width: revert-layer;
    border-right-width: unset;
    
### Values
`<line-width>`
    
Defines the width of the border, either as an explicit nonnegative `<length>` or a keyword. If it's a keyword, it must be one of the following values:
  * `thin`
  * `medium`
  * `thick`


Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern `thin ≤ medium ≤ thick`, and the values are constant within a single document.
## Examples
>
### Comparing border widths
#### HTML
    
    <div>Element 1</div>
    <div>Element 2</div>
    
#### CSS
    
    div {
      border: 1px solid red;
      margin: 1em 0;
    }
    
    div:nth-child(1) {
      border-right-width: thick;
    }
    div:nth-child(2) {
      border-right-width: 2em;
    }
    
#### Result
# flex-shrink
The `flex-shrink` CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, the flex items can shrink to fit according to their `flex-shrink` value. Each flex line's negative free space is distributed between the line's flex items that have a `flex-shrink` value greater than `0`.
Note: It is recommended to use the `flex` shorthand with a keyword value like `auto` or `initial` instead of setting `flex-basis` on its own. The keyword values expand to reliable combinations of `flex-grow`, `flex-shrink`, and `flex-basis`, which help to achieve the commonly desired flex behaviors.
## Try it
    
    flex-shrink: 0;
    
    
    flex-shrink: 1;
    
    
    flex-shrink: 2;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">I shrink</div>
      <div>Item Two</div>
      <div>Item Three</div>
    </section>
    
    
    .default-example {
      border: 1px solid #c5c5c5;
      width: auto;
      max-height: 300px;
      display: flex;
    }
    
    .default-example > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex-grow: 1;
      flex-shrink: 1;
      flex-basis: 300px;
    }
    
## Syntax
    
    /* <number> values */
    flex-shrink: 2;
    flex-shrink: 0.6;
    
    /* Global values */
    flex-shrink: inherit;
    flex-shrink: initial;
    flex-shrink: revert;
    flex-shrink: revert-layer;
    flex-shrink: unset;
    
## Description
The `flex-shrink` property specifies the flex shrink factor, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when negative free space is distributed.
This property deals with situations where the browser calculates the flex-basis values of the flex items, and finds that they are too large to fit into the flex container. As long as flex-shrink has a positive value the items will shrink in order that they do not overflow the container.
The `flex-grow` property deals with distributing available positive free space proportional to each item's flex grow factor, with the value of the `flex-grow` property as the only consideration. The `flex-shrink` property manages removing negative free space to make boxes fit into their container without overflowing. Removing space is a bit more complicated than adding space. The flex shrink factor is multiplied by the flex base size; this distributes negative space in proportion to how much the item can shrink. This prevents smaller items from shrinking to `0px` before a larger item is noticeably reduced.
Generally, `flex-shrink` is used alongside the `flex-grow` and `flex-basis` properties. Within the `flex` shorthand, the shrink factor is always the second `<number>`. If the shorthand only includes one number value, that value is assumed to be the `flex-grow` value.
## Values
The `flex-shrink` property is specified as a single `<number>`.
`<number>`
    
See `<number>`. Negative values are invalid. Defaults to 1.
## Examples
>
### Setting flex item shrink factor
This example demonstrates how negative free space is distributed based on the item's shrink factor. It includes five flex items with a `flex-shrink` value greater than 0, which have a combined width greater than their parent flex container's width.
#### HTML
    
    <div id="content">
      <div class="box1">A</div>
      <div class="box2">B</div>
      <div class="box3">C</div>
      <div class="box4">D</div>
      <div class="box5">E</div>
    </div>
    
#### CSS
We give each flex item a `width` of `200px`. As the `flex-basis` property defaults to `auto`, each item's flex-basis is `200px`. This gives the flex items a total width of `1000px`, twice the size of the container. We set all flex items to be shrinkable, with `flex-shrink` values greater than `0`. The last two items have greater `flex-shrink` values set so they will shrink more.
    
    #content {
      display: flex;
      width: 500px;
    }
    
    #content div {
      width: 200px;
    }
    
    .box1,
    .box2,
    .box3 {
      flex-shrink: 1;
    }
    
    .box4 {
      flex-shrink: 1.5;
    }
    
    .box5 {
      flex-shrink: 2;
    }
    
#### Result
The flex items don't overflow their container because they are able to shrink: the `500px` of negative free space is distributed among the five items based on their `flex-shrink` values. The first three items have `flex-shrink: 1` set. D has `flex-shrink: 1.5` and E has `flex-shrink: 2` set. The final width of D and E is less than the others, with E smaller than D.
# text-underline-offset
The `text-underline-offset` CSS property sets the offset distance of an underline text decoration line (applied using `text-decoration`) from its original position.
## Try it
    
    text-underline-offset: auto;
    
    
    text-underline-offset: 8px;
    
    
    text-underline-offset: -0.5rem;
    
    
    <section id="default-example">
      <p id="example-element">And after all we are only ordinary</p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
      text-decoration-line: underline;
      text-decoration-color: red;
    }
    
`text-underline-offset` is not part of the `text-decoration` shorthand. While an element can have multiple `text-decoration` lines, `text-underline-offset` only impacts underlining, and not other possible line decoration options such as `overline` or `line-through`.
## Syntax
    
    /* Single keyword */
    text-underline-offset: auto;
    
    /* length */
    text-underline-offset: 0.1em;
    text-underline-offset: 3px;
    
    /* percentage */
    text-underline-offset: 20%;
    
    /* Global values */
    text-underline-offset: inherit;
    text-underline-offset: initial;
    text-underline-offset: revert;
    text-underline-offset: revert-layer;
    text-underline-offset: unset;
    
The `text-underline-offset` property is specified as a single value from the list below.
### Values
`auto`
    
The browser chooses the appropriate offset for underlines.
`<length>`
    
Specifies the offset of underlines as a `<length>`, overriding the font file suggestion and the browser default. It is recommended to use `em` units so the offset scales with the font size.
`<percentage>`
    
Specifies the offset of underlines as a `<percentage>` of 1 em in the element's font. A percentage inherits as a relative value, and so therefore scales with changes in the font. For a given application of this property, the offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or vertical alignment.
## Examples
>
### Demonstration of text-underline-offset
    
    <p class="one-line">Here's some text with an offset wavy red underline!</p>
    <br />
    <p class="two-lines">
      This text has lines both above and below it. Only the bottom one is offset.
    </p>
    
    
    p {
      text-decoration: underline wavy red;
      text-underline-offset: 1em;
    }
    
    .two-lines {
      text-decoration-color: purple;
      text-decoration-line: underline overline;
    }
    
# sign()
The `sign()` CSS function contains one calculation, and returns `-1` if the numeric value of the argument is negative, `+1` if the numeric value of the argument is positive, `0⁺` if the numeric value of the argument is 0⁺, and `0⁻` if the numeric value of the argument is 0⁻.
Note: While `abs()` returns the absolute value of the argument, `sign()` returns the sign of the argument.
## Syntax
    
    /* property: sign( expression ) */
    top: sign(20vh - 100px);
    
### Parameters
The `sign(x)` function accepts only one value as its parameter.
`x`
    
A calculation which resolves to a number.
### Return value
A number representing the sign of `A`:
  * If `x` is positive, returns `1`.
  * If `x` is negative, returns `-1`.
  * If `x` is positive zero, returns `0`.
  * If `x` is negative zero, returns `-0`.
  * Otherwise, returns `NaN`.


## Examples
>
### Background image position
For example, in `background-position` positive percentages resolve to a negative length, and vice versa, if the background image is larger than the background area. Thus `sign(10%)` might return `1` or `-1`, depending on how the percentage is resolved! (Or even `0`, if it's resolved against a zero length.)
    
    div {
      background-position: sign(10%);
    }
    
### Position direction
Another use case is to control the `position` of the element. Either a positive or a negative value.
    
    div {
      position: absolute;
      top: calc(100px * sign(var(--value)));
    }
    
# :visited
The `:visited` CSS pseudo-class applies once the link has been visited by the user. For privacy reasons, the styles that can be modified using this selector are very limited. The `:visited` pseudo-class applies only to `<a>` and `<area>` elements that have an `href` attribute.
## Try it
    
    p {
      font-weight: bold;
    }
    
    a:visited {
      color: forestgreen;
      text-decoration-color: hotpink;
    }
    
    
    <p>Pages that you might have visited:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org">MDN Web Docs</a>
      </li>
      <li>
        <a href="https://www.youtube.com/">YouTube</a>
      </li>
    </ul>
    <p>Pages unlikely to be in your history:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org/missing-1">Random MDN page</a>
      </li>
      <li>
        <a href="https://example.com/missing-1">Random Example page</a>
      </li>
    </ul>
    
Styles defined by the `:visited` and unvisited `:link` pseudo-classes can be overridden by any subsequent user-action pseudo-classes (`:hover` or `:active`) that have at least equal specificity. To style links appropriately, put the `:visited` rule after the `:link` rule but before the `:hover` and `:active` rules, as defined by the LVHA-order: `:link` — `:visited` — `:hover` — `:active`. The `:visited` pseudo-class and `:link` pseudo-class are mutually exclusive.
## Privacy restrictions
For privacy reasons, browsers strictly limit which styles you can apply using this pseudo-class, and how they can be used:
  * Allowable CSS properties are `color`, `background-color`, `border-color`, `border-bottom-color`, `border-left-color`, `border-right-color`, `border-top-color`, `column-rule-color`, `outline-color`, `text-decoration-color`, and `text-emphasis-color`.
  * Allowable SVG attributes are `fill` and `stroke`.
  * The alpha component of the allowed styles will be ignored. The alpha component of the element's non-`:visited` state will be used instead. In Firefox when the alpha component is `0`, the style set in `:visited` will be ignored entirely.
  * Although these styles can change the appearance of colors to the end user, the `window.getComputedStyle` method will lie and always return the value of the non-`:visited` color.
  * The `<link>` element is never matched by `:visited`.
  * DOM methods that match elements via CSS selectors — such as `querySelector()` and `querySelectorAll()` — will always return an "empty" result even if there are visited links in a document. For the aforementioned methods, this will be `null` or an empty `NodeList`, respectively.


Note: For more information on these limitations and the reasons behind them, see Privacy and the :visited selector.
## Syntax
    
    :visited {
      /* ... */
    }
    
## Examples
Properties that would otherwise have no color or be transparent cannot be modified with `:visited`. Of the properties that can be set with this pseudo-class, your browser probably has a default value for `color` and `column-rule-color` only. Thus, if you want to modify the other properties, you'll need to give them a base value outside the `:visited` selector.
### HTML
    
    <a href="#test-visited-link">Have you visited this link yet?</a><br />
    <a href="">You've already visited this link.</a>
    
### CSS
    
    a {
      /* Specify non-transparent defaults to certain properties,
         allowing them to be styled with the :visited state */
      background-color: white;
      border: 1px solid white;
    }
    
    a:visited {
      background-color: yellow;
      border-color: hotpink;
      color: hotpink;
    }
    
### Result
# CSS anchor positioning
The CSS anchor positioning module defines features that allow you to tether elements together. Certain elements are defined as anchor elements; anchor-positioned elements can then have their size and position set based on the size and location of the anchor elements to which they are bound.
In addition, the specification provides CSS-only mechanisms to:
  * Specify a set of alternative positions for an anchored element; when the default rendering position causes it to overflow its containing block and/or be rendered offscreen, the browser will try rendering the anchored element in the alternative positions instead.
  * Declare conditions under which anchor-positioned elements should be hidden, in situations where it is not appropriate to tether them to anchor elements.


## Reference
>
### Properties
  * `anchor-name`
  * `position-anchor`
  * `position-area`
  * `position-try-fallbacks`
  * `position-try-order`
  * `position-try` shorthand
  * `position-visibility`


The CSS anchor positioning module also introduces the `anchor-scope` property. Currently, no browsers support this feature.
### At-rules and descriptors
  * `@position-try`


### Functions
  * `anchor()`
  * `anchor-size()`


### Data types and values
  * `anchor-center`
  * `<anchor-side>`
  * `<anchor-size>`
  * `<position-area>`
  * `<try-size>`
  * `<try-tactic>`


### HTML attributes
  * `anchor` Non-standard


### Interfaces
  * `CSSPositionTryDescriptors`
  * `CSSPositionTryRule`
  * `HTMLElement.anchorElement` Non-standard


## Guides
Using CSS anchor positioning
    
An introductory guide to fundamental anchor positioning concepts, including associating, positioning, and sizing elements relative to their anchor.
Fallback options and conditional hiding for overflow
    
A guide to the mechanisms CSS anchor positioning provides to prevent anchor-positioned elements from overflowing their containing elements or the viewport, including position try fallback options and conditionally hiding elements.
## Related concepts
  * CSS logical properties and values module: 
    * `inset-block-start`
    * `inset-block-end`
    * `inset-inline-start`
    * `inset-inline-end`
    * `inset-block`
    * `inset-inline`
    * `inset` shorthand
    * `inline-size`
    * `min-block-size`
    * `min-inline-size`
    * `block-size`
    * `max-block-size`
    * `max-inline-size`
    * `margin-block`
    * `margin-block-end`
    * `margin-block-start`
    * `margin-inline`
    * `margin-inline-end`
    * `margin-inline-start`
    * Inset properties glossary term
  * CSS positioned layout module: 
    * `top`
    * `left`
    * `bottom`
    * `right`
  * CSS box model module: 
    * `width`
    * `height`
    * `min-width`
    * `min-height`
    * `max-width`
    * `max-height`
    * `margin`
    * `margin-bottom`
    * `margin-left`
    * `margin-right`
    * `margin-top`
  * CSS box alignment module: 
    * `align-items`
    * `align-self`
    * `justify-items`
    * `justify-self`
    * `place-items`
    * `place-self`


# scroll-padding-block-start
The `scroll-padding-block-start` property defines offsets for the start edge in the block dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-block-start: 0;
    
    
    scroll-padding-block-start: 20px;
    
    
    scroll-padding-block-start: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-block-start: auto;
    
    /* <length> values */
    scroll-padding-block-start: 10px;
    scroll-padding-block-start: 1em;
    scroll-padding-block-start: 10%;
    
    /* Global values */
    scroll-padding-block-start: inherit;
    scroll-padding-block-start: initial;
    scroll-padding-block-start: revert;
    scroll-padding-block-start: revert-layer;
    scroll-padding-block-start: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the block start edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# :modal
The `:modal` CSS pseudo-class matches an element that is in a state in which it excludes all interaction with elements outside it until the interaction has been dismissed. Multiple elements can be selected by the `:modal` pseudo-class at the same time, but only one of them will be active and able to receive input.
## Try it
    
    button {
      display: block;
      margin: auto;
      width: 10rem;
      height: 2rem;
    }
    
    :modal {
      background-color: beige;
      border: 2px solid burlywood;
      border-radius: 5px;
    }
    
    p {
      color: black;
    }
    
    
    <p>Would you like to see a new random number?</p>
    <button id="showNumber">Show me</button>
    
    <dialog id="favDialog">
      <form method="dialog">
        <p>Lucky number is: <strong id="number"></strong></p>
        <button>Close dialog</button>
      </form>
    </dialog>
    
    
    const showNumber = document.getElementById("showNumber");
    const favDialog = document.getElementById("favDialog");
    const number = document.getElementById("number");
    
    showNumber.addEventListener("click", () => {
      number.innerText = Math.floor(Math.random() * 1000);
      favDialog.showModal();
    });
    
## Syntax
    
    :modal {
      /* ... */
    }
    
## Usage notes
Examples of elements that will prevent user interaction with the rest of the page and will be selected by the `:modal` pseudo-class include:
  * The `dialog` element opened with the `showModal()` API.
  * The element selected by the `:fullscreen` pseudo-class when opened with the `requestFullscreen()` API.


## Examples
>
### Styling a modal dialog
This example styles a modal dialog that opens when the "Update details" button is activated. This example has been built on top of the `<dialog>` element example.
#### CSS
    
    :modal {
      border: 5px solid red;
      background-color: yellow;
      box-shadow: 3px 3px 10px rgb(0 0 0 / 50%);
    }
    
### Result
# @property
The `@property` CSS at-rule is part of the CSS Houdini set of APIs. It allows developers to explicitly define CSS custom properties, allowing for property type checking and constraining, setting default values, and defining whether a custom property can inherit values or not.
The `@property` rule represents a custom property registration directly in a stylesheet without having to run any JavaScript. Valid `@property` rules result in a registered custom property, which is similar to calling `registerProperty()` with equivalent parameters.
## Syntax
    
    @property --rotation {
      syntax: "<angle>";
      inherits: false;
      initial-value: 45deg;
    }
    
The custom property name is a `<dashed-ident>` that starts with `--` and is followed by a valid, user-defined identifier. It is case-sensitive.
### Descriptors
`syntax`
    
A string that describes the allowed value types for the registered custom property. May be a data type name (such as `<color>`, `<length>`, or `<number>`, etc.), with multipliers (`+`, `#`) and combinators (`|`), or a custom ident. See the syntax descriptor page for more details.
`inherits`
    
A boolean value that controls whether the custom property registration specified by `@property` inherits by default.
`initial-value`
    
A value that sets the starting value for the property.
## Description
The following conditions must be met for the `@property` rule to be valid:
  * The `@property` rule must include both the `syntax` and `inherits` descriptors. If either is missing, the entire `@property` rule is invalid and ignored.
  * The `initial-value` descriptor is optional if the value of the `syntax` descriptor is the universal syntax definition (that is, `syntax: "*"`). If the `initial-value` descriptor is required but omitted, the entire `@property` rule is invalid and ignored.
  * If the value of the `syntax` descriptor is not the universal syntax definition, the `initial-value` descriptor has to be a computationally independent value. This means the value can be converted into a computed value without depending on other values, except for "global" definitions independent of CSS. For example, `10px` is computationally independent—it doesn't change when converted to a computed value. `2in` is also valid, because `1in` is always equivalent to `96px`. However, `3em` is not valid, because the value of an `em` is dependent on the parent's `font-size`.
  * Unknown descriptors are invalid and ignored, but do not invalidate the `@property` rule.


## Examples
>
### Using `@property` to register and use a custom property
In this example, we define two custom properties, `--item-size` and `--item-color`, that we'll use to define the size (width and height) and background color of the three following items.
    
    <div class="container">
      <div class="item one">Item one</div>
      <div class="item two">Item two</div>
      <div class="item three">Item three</div>
    </div>
    
The following code uses the CSS `@property` at-rule to define a custom property named `--item-size`. The property sets the initial value to `40%`, limiting valid values to `<percentage>` values only. This means, when used as the value for an item's size, its size will always be relative to its parent's size. The property is inheritable.
    
    @property --item-size {
      syntax: "<percentage>";
      inherits: true;
      initial-value: 40%;
    }
    
We define a second custom property, `--item-color`, using JavaScript instead of CSS. The JavaScript `registerProperty()` method is equivalent to `@property` at-rule. The property is defined to have an initial value of `aqua`, to accept only `<color>` values, and is not inherited.
    
    window.CSS.registerProperty({
      name: "--item-color",
      syntax: "<color>",
      inherits: false,
      initialValue: "aqua",
    });
    
We use the two custom properties to style the items:
    
    .container {
      display: flex;
      height: 200px;
      border: 1px dashed black;
    
      /* set custom property values on parent */
      --item-size: 20%;
      --item-color: orange;
    }
    
    /* use custom properties to set item size and background color */
    .item {
      width: var(--item-size);
      height: var(--item-size);
      background-color: var(--item-color);
    }
    
    /* set custom property values on element itself */
    .two {
      --item-size: initial;
      --item-color: inherit;
    }
    
    .three {
      /* invalid values */
      --item-size: 1000px;
      --item-color: xyz;
    }
    
The two custom properties, `--item-size: 20%` and `--item-color: orange;` are set on the `container` parent, overriding the `40%` and `aqua` default values set when these custom properties were defined. The size is set to be inheritable; the color is not.
For item one, none of these custom properties have been set. The `--item-size` is inheritable, so the value `20%` set on its parent `container` is used. On the other hand, the property `--item-color` is not inheritable, so the value `orange` set on the parent is not considered. Instead the default initial value `aqua` is used.
For item two, CSS global keywords are set for both custom properties which are valid values for all value types and therefore valid no matter the `syntax` descriptor value. The `--item-size` is set to `initial` and uses the `initial-value: 40%;` set in the `@property` declaration. The `initial` value means the `initialValue` value for the property is used. The `--item-color` is set to `inherit`, explicitly inheriting the `orange` value from its parent even though the custom property is set to otherwise not be inherited. This is why item two is orange.
For item three, the `--item-size` value gets set to `1000px`. While `1000px` is a `<length>` value, the `@property` declaration requires the value be a `<percentage>`, so the declaration is not valid and is ignored, meaning the inheritable `20%` set on the parent is used. The `xyz` value is also invalid. As `registerProperty()` set `--item-color` to not be inherited, the default initial value of `aqua` is used and not the parent's `orange` value.
### Animating a custom property value
In this example, we define a custom property called `--progress` using `@property`: this accepts `<percentage>` values and has an initial value of `25%`. We use `--progress` to define the position value of the color stops in a `linear-gradient()`, specifying where a green color stops, and black starts. We then animate the value of `--progress` to `100%` over 2.5 seconds, giving the effect of animating a progress bar.
    
    <div class="bar"></div>
    
    
    @property --progress {
      syntax: "<percentage>";
      inherits: false;
      initial-value: 25%;
    }
    
    .bar {
      display: inline-block;
      --progress: 25%;
      width: 100%;
      height: 5px;
      background: linear-gradient(
        to right,
        #00d230 var(--progress),
        black var(--progress)
      );
      animation: progressAnimation 2.5s ease infinite;
    }
    
    @keyframes progressAnimation {
      to {
        --progress: 100%;
      }
    }
    
# font-synthesis-small-caps
The `font-synthesis-small-caps` CSS property lets you specify whether or not the browser may synthesize small-caps typeface when it is missing in a font family. Small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters.
It is often convenient to use the shorthand property `font-synthesis` to control all typeface synthesis values.
## Syntax
    
    /* Keyword values */
    font-synthesis-small-caps: auto;
    font-synthesis-small-caps: none;
    
    /* Global values */
    font-synthesis-small-caps: inherit;
    font-synthesis-small-caps: initial;
    font-synthesis-small-caps: revert;
    font-synthesis-small-caps: revert-layer;
    font-synthesis-small-caps: unset;
    
### Values
`auto`
    
Indicates that the missing small-caps typeface may be synthesized by the browser if needed.
`none`
    
Indicates that the synthesis of the missing small-caps typeface by the browser is not allowed.
## Examples
>
### Disabling synthesis of small-caps typeface
This example shows turning off synthesis of the small-caps typeface by the browser in the `Montserrat` font.
#### HTML
    
    <p class="english">
      These are the default <span class="small-caps">small-caps</span>,
      <strong>bold</strong>, and <em>oblique</em> typefaces.
    </p>
    
    <p class="english no-syn">
      The <span class="small-caps">small-caps</span> typeface is turned off here but
      not the <strong>bold</strong> and <em>oblique</em> typefaces.
    </p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
    
    .english {
      font-family: "Montserrat", sans-serif;
    }
    .small-caps {
      font-variant: small-caps;
    }
    .no-syn {
      font-synthesis-small-caps: none;
    }
    
#### Result
# overscroll-behavior-y
The `overscroll-behavior-y` CSS property sets the browser's behavior when the vertical boundary of a scrolling area is reached.
See `overscroll-behavior` for a full explanation.
## Syntax
    
    /* Keyword values */
    overscroll-behavior-y: auto; /* default */
    overscroll-behavior-y: contain;
    overscroll-behavior-y: none;
    
    /* Global values */
    overscroll-behavior-y: inherit;
    overscroll-behavior-y: initial;
    overscroll-behavior-y: revert;
    overscroll-behavior-y: revert-layer;
    overscroll-behavior-y: unset;
    
The `overscroll-behavior-y` property is specified as a keyword chosen from the list of values below.
### Values
`auto`
    
The default scroll overflow behavior occurs as normal.
`contain`
    
Default scroll overflow behavior (e.g., "bounce" effects) is observed inside the element where this value is set. However, no scroll chaining occurs on neighboring scrolling areas; the underlying elements will not scroll. The `contain` value disables native browser navigation, including the vertical pull-to-refresh gesture and horizontal swipe navigation.
`none`
    
No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
## Examples
>
### Preventing an underlying element from scrolling vertically
    
    .messages {
      height: 220px;
      overflow: auto;
      overscroll-behavior-y: contain;
    }
    
See `overscroll-behavior` for a full example and explanation.
# user-select
The `user-select` CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes.
## Try it
    
    user-select: none;
    
    
    user-select: text;
    
    
    user-select: all;
    
    
    <section id="default-example">
      <p id="example-element">Try to select this text</p>
    </section>
    
    
    #example-element {
      font-size: 1.5rem;
    }
    
## Syntax
    
    /* Keyword values */
    user-select: none;
    user-select: auto;
    user-select: text;
    user-select: all;
    
    /* Global values */
    user-select: inherit;
    user-select: initial;
    user-select: revert;
    user-select: revert-layer;
    user-select: unset;
    
Note: `user-select` is not an inherited property, though the initial `auto` value makes it behave like it is inherited most of the time. WebKit/Chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. Until now, Chromium has chosen to fix the issues to make the final behavior meet the specifications.
### Values
`none`
    
The text of the element and its sub-elements is not selectable. Note that the `Selection` object can contain these elements.
`auto`
    
The used value of `auto` is determined as follows:
  * On the `::before` and `::after` pseudo elements, the used value is `none`
  * If the used value of `user-select` on the parent of this element is `none`, the used value is `none`
  * Otherwise, if the used value of `user-select` on the parent of this element is `all`, the used value is `all`
  * Otherwise, the used value is `text`


`text`
    
The text can be selected by the user.
`all`
    
The content of the element shall be selected atomically: If a selection would contain part of the element, then the selection must contain the entire element including all its descendants. If a double-click or context-click occurred in sub-elements, the highest ancestor with this value will be selected.
Note: The CSS basic user interface module defines a `contain` value for the `user-select` property to enable selection to start within the element to be contained by the bounds of that element, however, this is not supported in any browsers.
## Examples
>
### HTML
    
    <p>You should be able to select this text.</p>
    <p class="unselectable">Hey, you can't select this text!</p>
    <p class="all">Clicking once will select all of this text.</p>
    
### CSS
    
    .unselectable {
      -webkit-user-select: none; /* Safari */
      user-select: none;
    }
    
    .all {
      -webkit-user-select: all;
      user-select: all;
    }
    
### Result
# :read-only
The `:read-only` CSS pseudo-class selects elements (such as certain `<input>` types and `<textarea>`) that are not editable by the user. Elements on which the HTML attribute `readonly` doesn't have an effect (such as `<input type="radio">`, `<input type="checkbox">`, and all other non-form elements) are also selected by the `:read-only` pseudo-class. In fact, `:read-only` matches anything that `:read-write` doesn't match, making it equivalent to `:not(:read-write)`.
## Try it
    
    label,
    input[type="submit"] {
      display: block;
      margin-top: 1em;
    }
    
    *:read-only {
      font-weight: bold;
      color: indigo;
    }
    
    
    <p>Please fill your details:</p>
    
    <form>
      <label for="email">Email Address:</label>
      <input id="email" name="email" type="email" value="test@example.com" />
    
      <label for="note">Short note about yourself:</label>
      <textarea id="note" name="note">Don't be shy</textarea>
    
      <label for="pic">Your picture:</label>
      <input id="pic" name="pic" type="file" />
    
      <input type="submit" value="Submit form" />
    </form>
    
## Syntax
    
    :read-only {
      /* ... */
    }
    
## Examples
>
### Confirming form information using read-only or read-write controls
One use of read-only form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form. We do just this in the example below.
The `:read-only` pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs. The `:read-write` pseudo-class on the other hand is used to provide some nicer styling to the editable `<textarea>`.
    
    input:read-only,
    textarea:read-only {
      border: 0;
      box-shadow: none;
      background-color: #dddddd;
    }
    
    textarea:read-write {
      outline: 1px dashed red;
      outline-offset: 2px;
      border-radius: 5px;
    }
    
### Styling read-only non-form controls
This selector doesn't just select `<input>`/`<textarea>` elements — it will select any element that cannot be edited by the user.
    
    <p contenteditable>This paragraph is editable; it is read-write.</p>
    
    <p>This paragraph is not editable; it is read-only.</p>
    
    
    p {
      font-size: 150%;
      padding: 5px;
      border-radius: 5px;
    }
    
    p:read-only {
      background-color: red;
      color: white;
    }
    
    p:read-write {
      background-color: lime;
    }
    
# CSS properties and values API
The CSS properties and values API module defines a method for registering new CSS properties, defining the property's data type, inheritance behavior, and, optionally, an initial value. This API expands on CSS custom properties for cascading variables module, which allows authors to define custom properties in CSS using two dash syntax (`--`). The CSS properties and values API is part of the CSS Houdini umbrella of APIs.
Custom properties let you reuse values across a project to simplify complex or repetitive stylesheets. Basic custom properties are defined in the CSS custom properties for cascading variables module. The CSS properties and values API expands on that module, enabling adding metadata to custom properties using CSS with the `@property` at-rule or, alternatively, using JavaScript's `CSS.registerProperty` method.
Whether registered with CSS or JavaScript, setting metadata on custom properties provides for an expected data type that the browser can use depending on the context, defines an initial value, and lets you control inheritance.
CSS properties and values API custom property registration is more robust than the more basic CSS cascading variable custom property declaration, especially when it comes to transitioning and animating values as browsers can interpolate between custom values of this type, whereas properties that use two dash syntax (`--`) behave more like a string substitution.
## Properties and values API in action
To see how custom properties and values can be used via API, hover over the box below.
The box has a background consisting of a linear gradient from `--stop-color` (the custom property) to `lavenderblush`. The value of `--stop-color` is set to `cornflowerblue` at first, but when you hover over the box, `--stop-color` transitions to `aquamarine` over two seconds (`linear-gradient(to right, aquamarine, lavenderblush)`).
## Reference
>
### At-rules
  * `@property`
    * syntax descriptor 
      * `+` and `#` multipliers
      * `|` combinator
    * inherits descriptor
    * initial-value descriptor


### Interfaces and APIs
  * `CSSPropertyRule`
  * `CSS.registerProperty()`


## Guides
Using the CSS properties and values API
    
Explains how to register custom properties in CSS and JavaScript, with hints on handling undefined and invalid values, fallbacks, and inheritance.
CSS Houdini
    
Reference guide to Houdini resources including the CSS modules, API guides, and external resources.
Houdini APIs
    
Explains what CSS Houdini is and its advantages, along with a list of available APIs and their statuses.
## Related concepts
  * `var()`
  * CSSRule
  * CSSStyleValue
  * CSS scoping
  * Using shadow DOM
  * CSS Typed Object Model API
  * CSS Painting API
  * Worklet


# :not()
The `:not()` CSS pseudo-class represents elements that do not match a list of selectors. Since it prevents specific items from being selected, it is known as the negation pseudo-class.
## Try it
    
    p:not(.irrelevant) {
      font-weight: bold;
    }
    
    p > strong,
    p > b.important {
      color: crimson;
    }
    
    p > :not(strong, b.important) {
      color: darkmagenta;
    }
    
    
    <p>
      <b>Mars</b> is one of the most Earth-like planets. <b>Mars</b> day is almost
      the same as an Earth day, only <strong>37 minutes</strong> longer.
    </p>
    
    <p class="irrelevant">
      <b class="important">NASA</b>'s Jet <del>Momentum</del> Propulsion Laboratory
      is designing mission concepts to survive the <b>Venus</b> extreme temperatures
      and atmospheric pressure.
    </p>
    
The `:not()` pseudo-class has a number of quirks, tricks, and unexpected results that you should be aware of before using it.
## Syntax
    
    :not(<complex-selector-list>) {
      /* ... */
    }
    
### Parameters
The `:not()` pseudo-class requires a selector list, a comma-separated list of one or more selectors, as its argument. The list must not contain a pseudo-element, but any other simple, compound, and complex selectors are allowed.
## Description
There are several unusual effects and outcomes when using `:not()` that you should keep in mind when using it:
  * Useless selectors can be written using this pseudo-class. For example, `:not(*)` matches any element which is not an element, which is obviously nonsense, so the accompanying rule will never be applied.
  * This pseudo-class can increase the specificity of a rule. For example, `#foo:not(#bar)` will match the same element as the simpler `#foo`, but has the higher specificity of two `id` selectors.
  * The specificity of the `:not()` pseudo-class is replaced by the specificity of the most specific selector in its comma-separated argument of selectors; providing the same specificity as if it had been written `:not(:is(argument))`.
  * `:not(.foo)` will match anything that isn't `.foo`, including `<html>` and `<body>`. 
  * This selector will match everything that is "not an X". This may be surprising when used with descendant combinators, since there are multiple paths to select a target element. For instance, `body :not(table) a` will still apply to links inside a `<table>`, since `<tr>`, `<tbody>`, `<th>`, `<td>`, `<caption>`, etc. can all match the `:not(table)` part of the selector. To avoid this, you can use `body a:not(table a)` instead, which will only apply to links that are not descendants of a table.
  * You can negate several selectors at the same time. Example: `:not(.foo, .bar)` is equivalent to `:not(.foo):not(.bar)`.
  * If any selector passed to the `:not()` pseudo-class is invalid or not supported by the browser, the whole rule will be invalidated. The effective way to overcome this behavior is to use `:is()` pseudo-class, which accepts a forgiving selector list. For example `:not(.foo, :invalid-pseudo-class)` will invalidate a whole rule, but `:not(:is(.foo, :invalid-pseudo-class))` will match any (including `<html>` and `<body>`) element that isn't `.foo`.


## Examples
>
### Using :not() with valid selectors
This example shows some a few examples of using `:not()`.
#### HTML
    
    <p>I am a paragraph.</p>
    <p class="fancy">I am so very fancy!</p>
    <div>I am NOT a paragraph.</div>
    <h2>
      <span class="foo">foo inside h2</span>
      <span class="bar">bar inside h2</span>
    </h2>
    
#### CSS
    
    .fancy {
      text-shadow: 2px 2px 3px gold;
    }
    
    /* <p> elements that don't have a class `.fancy` */
    p:not(.fancy) {
      color: green;
    }
    
    /* Elements that are not <p> elements */
    body :not(p) {
      text-decoration: underline;
    }
    
    /* Elements that are not <div>s or `.fancy` */
    body :not(div):not(.fancy) {
      font-weight: bold;
    }
    
    /* Elements that are not <div>s or `.fancy` */
    body :not(div, .fancy) {
      text-decoration: overline underline;
    }
    
    /* Elements inside an <h2> that aren't a <span> with a class of `.foo` */
    h2 :not(span.foo) {
      color: red;
    }
    
#### Result
### Using :not() with invalid selectors
This example shows the use of `:not()` with invalid selectors and how to prevent invalidation.
#### HTML
    
    <p class="foo">I am a paragraph with .foo</p>
    <p class="bar">I am a paragraph with .bar</p>
    <div>I am a div without a class</div>
    <div class="foo">I am a div with .foo</div>
    <div class="bar">I am a div with .bar</div>
    <div class="foo bar">I am a div with .foo and .bar</div>
    
#### CSS
    
    /* Invalid rule, does nothing */
    p:not(.foo, :invalid-pseudo-class) {
      color: red;
      font-style: italic;
    }
    
    /* Select all <p> elements without the `foo` class */
    p:not(:is(.foo, :invalid-pseudo-class)) {
      color: green;
      border-top: dotted thin currentColor;
    }
    
    /* Select all <div> elements without the `foo` or the `bar` class */
    div:not(.foo, .bar) {
      color: red;
      font-style: italic;
    }
    
    /* Select all <div> elements without the `foo` or the `bar` class */
    div:not(:is(.foo, .bar)) {
      border-bottom: dotted thin currentColor;
    }
    
#### Result
The `p:not(.foo, :invalid-pseudo-class)` rule is invalid because it contains an invalid selector. The `:is()` pseudo-class accepts a forgiving selector list, so the `:is(.foo, :invalid-pseudo-class)` rule is valid and equivalent to `:is(.foo)`. Thus, the `p:not(:is(.foo, :invalid-pseudo-class))` rule is valid and equivalent to `p:not(.foo)`.
If `:invalid-pseudo-class` was a valid selector, the first two rules above would still be equivalent (the last two rules showcase that). The use of `:is()` makes the rule more robust.
# :future
The `:future` CSS pseudo-class selector is a time-dimensional pseudo-class that will match for any element which appears entirely after an element that matches `:current`. For example in a video with captions which are being displayed by WebVTT.
    
    :future(p, span) {
      display: none;
    }
    
## Syntax
    
    :future {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :future(p, span) {
      display: none;
    }
    
### HTML
    
    <video controls preload="metadata">
      <source src="video.mp4" type="video/mp4" />
      <source src="video.webm" type="video/webm" />
      <track
        label="English"
        kind="subtitles"
        srclang="en"
        src="subtitles.vtt"
        default />
    </video>
    
### WebVTT
    
    WEBVTT FILE
    
    1
    00:00:03.500 --> 00:00:05.000
    This is the first caption
    
    2
    00:00:06.000 --> 00:00:09.000
    This is the second caption
    
    3
    00:00:11.000 --> 00:00:19.000
    This is the third caption
    
# element()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `element()` CSS function defines an `<image>` value generated from an arbitrary HTML element. This image is live, meaning that if the HTML element is changed, the CSS properties using the resulting value are automatically updated.
A particularly useful scenario for using this would be to render an image in an HTML `<canvas>` element, then use that as a background.
On Gecko browsers, you can use the non-standard `document.mozSetImageElement()` method to change the element being used as the background for a given CSS background element.
## Syntax
    
    element(id)
    
where:
id
    
The ID of an element to use as the background, specified using the HTML attribute #id on the element.
## Examples
These examples work in builds of Firefox that support `-moz-element()`.
### A somewhat realistic example
This example uses a hidden `<div>` as a background. The background element uses a gradient, but also includes text that is rendered as part of the background.
    
    <div id="target-box">
      <p>This box uses the element with the #my-background ID as its background!</p>
    </div>
    
    <div id="background-container">
      <div id="my-background">
        <p>This text is part of the background. Cool, huh?</p>
      </div>
    </div>
    
    
    #target-box {
      width: 400px;
      height: 400px;
      background: -moz-element(#my-background) no-repeat;
    }
    
    #background-container {
      overflow: hidden;
      height: 0;
    }
    
    #my-background {
      width: 1024px;
      height: 1024px;
      background-image: linear-gradient(to right, red, orange, yellow, white);
    }
    
    #my-background p {
      transform-origin: 0 0;
      rotate: 45deg;
      color: white;
    }
    
The `<div>` element with the ID "my-background" is used as the background for the content including the paragraph "This box uses the element with the #my-background ID as its background!".
### Page Preview
This  example based on Vincent De Oliveira's creates a preview of the `<div id="css-source">` inside `<div id="css-result">`.
#### HTML
    
    <div id="css-source">
      <h1>Page Preview</h1>
    </div>
    <div id="css-result"></div>
    
#### CSS
    
    #css-result {
      background: -moz-element(#css-source) no-repeat;
      width: 256px;
      height: 32px;
      background-size: 80%;
      border: dashed;
    }
    
#### Result
# <hue>
The `<hue>` CSS data type represents the hue angle of a color. It is used in the color functions that accept hue expressed as a single value, specifically `hsl()`, `hwb()`, `lch()`, and `oklch()` functional notations.
## Syntax
A `<hue>` can be either an `<angle>` or a `<number>`.
### Values
`<angle>`
    
An angle expressed in degrees, gradians, radians, or turns using the `deg`, `grad`, `rad`, or `turn`, respectively.
`<number>`
    
A real number, representing degrees of the hue angle.
As an `<angle>` is periodic, `<hue>` is normalized to the range `[0deg, 360deg)`. It implicitly wraps around such that `480deg` is the same as `120deg`, `-120deg` is the same as `240deg`, `-1turn` is the same as `1turn`, and so on.
## Description
The color wheel above shows hues at all angles in the sRGB color space. In particular, red is at `0deg`, yellow is at `60deg`, lime is at `120deg`, cyan is at `180deg`, blue is at `240deg`, and magenta is at `300deg`.
The angles corresponding to particular hues differ depending on the color space. For example, the hue angle of sRGB green is `120deg` in the sRGB color space, but `134.39deg` in the CIELAB color space.
The following table lists typical colors at various angles in the sRGB (used by `hsl()` and `hwb()`), CIELAB (used by `lch()`), and Oklab (used by `oklch()`) color spaces:
0° 60° 120° 180° 240° 300°  
sRGB  
CIELAB  
Oklab  
## Interpolation of `<hue>` values
`<hue>` values are interpolated as `<angle>` values, and the default interpolation algorithm is `shorter`. In some color-related CSS functions, this can be overridden by the `<hue-interpolation-method>` component.
## Examples
>
### Changing the hue of a color using a slider
The following example shows the effect of changing the `hue` value of the `hsl()` functional notation on a color.
#### HTML
    
    <input type="range" min="0" max="360" value="0" id="hue-slider" />
    <p>Hue: <span id="hue-value">0deg</span></p>
    <div id="box"></div>
    
#### CSS
    
    #box {
      background-color: hsl(0 100% 50%);
    }
    
#### JavaScript
    
    const hue = document.querySelector("#hue-slider");
    const box = document.querySelector("#box");
    hue.addEventListener("input", () => {
      box.style.backgroundColor = `hsl(${hue.value} 100% 50%)`;
      document.querySelector("#hue-value").textContent = `${hue.value}deg`;
    });
    
#### Result
### Approximating red hues in different color spaces
The following example shows a similar red color in different color spaces. The values in the `lch()` and `oklch()` functions are rounded for readability.
#### HTML
    
    <div data-color="hsl-red">hsl()</div>
    <div data-color="hwb-red">hwb()</div>
    <div data-color="lch-red">lch()</div>
    <div data-color="oklch-red">oklch()</div>
    
#### CSS
    
    [data-color="hsl-red"] {
      /* hsl(<hue> <saturation> <lightness>) */
      background-color: hsl(0 100% 50%);
    }
    [data-color="hwb-red"] {
      /* hwb(<hue> <whiteness> <blackness>) */
      background-color: hwb(0 0% 0%);
    }
    [data-color="lch-red"] {
      /* lch(<lightness> <chroma> <hue>) */
      background-color: lch(50 150 40);
    }
    [data-color="oklch-red"] {
      /* oklch(<lightness> <chroma> <hue>) */
      background-color: oklch(0.6 0.4 20);
    }
    
#### Result
>
### css.types.color.hsl
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`hue` 1 12 1 9.5 3.1 18 4 10.1 2 1.0 4.4 2  
`alpha_parameter` 65 79 52 52 12.1 65 52 47 12.2 9.0 65 12.2  
`mixed_type_parameters` 121 121 122 107 18 121 122 81 18 25.0 121 18  
`relative_syntax` 125119–125`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 125119–125`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 128 111105–111`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `s` and `l`). 125119–125`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 128 8379–83`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `s` and `l`). 27.025.0–27.0`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 125119–125`s` and `l` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `s` and `l` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `s` and `l`).  
`space_separated_parameters` 65 79 52 52 12.1 65 52 47 12.2 9.0 65 12.2  
### css.types.color.hwb
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`hue` 101 101 96 87 15 101 96 70 15 19.0 101 15  
`mixed_type_parameters` 121 121 122 107 18 121 122 81 18 25.0 121 18  
`relative_syntax` 125119–125`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 125119–125`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 128 111105–111`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `w` and `b`). 125119–125`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 128 8379–83`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `w` and `b`). 27.025.0–27.0`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 125119–125`w` and `b` channel values incorrectly resolve to numbers between 0-1 rather than 0-100. As a result, channel value calculations require `w` and `b` values to be specified as decimal percentage equivalents (e.g. 0.2 for 20%). See bug 330096624. 1816.4–18Implementation based on older spec version. As a result, calculations with channel values do not work correctly, requiring values to be specified with units (`deg` for `h`, `%` for `w` and `b`).  
### css.types.color.lch
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`hue` 111 111 113 97 15 111 113 75 15 22.0 111 15  
`mixed_type_parameters` 116 116 113 102 16.2 116 113 78 16.2 24.0 116 16.2  
`relative_syntax` 119 119 128 105 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`). 119 128 79 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`). 25.0 119 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`).  
### css.types.color.oklch
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`hue` 111 111 113 97 15.4 111 113 75 15.4 22.0 111 15.4  
`mixed_type_parameters` 116 116 113 102 16.2 116 113 78 16.2 24.0 116 16.2  
`relative_syntax` 122119–122`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 122119–122`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 128 108105–108`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`). 122119–122`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 128 8179–81`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`). 26.025.0–26.0`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 122119–122`l` channel values incorrectly resolve to numbers between 0-100 rather than 0-1. As a result, channel value calculations require `l` values to be specified as percentage numbers without units (e.g. 20 for 0.2). See bug 40940488. 1816.4–18Implementation based on older spec version. As a result, calculations with `h` channel values do not work correctly, requiring values to be specified with units (`deg`).  
# mask
The `mask` CSS shorthand property hides an element (partially or fully) by masking or clipping a specified area of the image. It is a shorthand for all the `mask-*` properties. The property accepts one or more comma-separated values, where each value corresponds to a `<mask-layer>`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `mask-clip`
  * `mask-composite`
  * `mask-image`
  * `mask-mode`
  * `mask-origin`
  * `mask-position`
  * `mask-repeat`
  * `mask-size`


## Syntax
    
    /* Keyword values */
    mask: none;
    
    /* Image values */
    mask: url("mask.png"); /* Raster image used as mask */
    mask: url("masks.svg#star"); /* SVG used as mask */
    
    /* Combined values */
    mask: url("masks.svg#star") luminance; /* Luminance mask */
    mask: url("masks.svg#star") 40px 20px; /* Mask positioned 40px from the top and 20px from the left */
    mask: url("masks.svg#star") 0 0/50px 50px; /* Mask with a width and height of 50px */
    mask: url("masks.svg#star") repeat-x; /* Horizontally-repeated mask */
    mask: url("masks.svg#star") stroke-box; /* Mask extends to the inside edge of the stroke box */
    mask: url("masks.svg#star") exclude; /* Mask combined with background using non-overlapping parts */
    
    /* Multiple masks */
    mask:
      url("masks.svg#star") left / 16px repeat-y,
      /* 16px-wide mask on the left side */ url("masks.svg#circle") right / 16px
        repeat-y; /* 16px-wide mask against right side */
    
    /* Global values */
    mask: inherit;
    mask: initial;
    mask: revert;
    mask: revert-layer;
    mask: unset;
    
### Values
`<mask-layer>`
    
One or more comma-separated mask layers, consisting of the following components:
`<mask-reference>`
    
Sets the mask image source. See `mask-image`.
`<masking-mode>`
    
Sets the masking mode of the mask image. See `mask-mode`.
`<position>`
    
Sets the position of the mask image. See `mask-position`.
`<bg-size>`
    
Sets the size of the mask image. See `mask-size`.
`<repeat-style>`
    
Sets the repetition of the mask image. See `mask-repeat`.
`<geometry-box>`
    
If only one `<geometry-box>` value is given, it sets both the `mask-origin` and `mask-clip` property values. If two `<geometry-box>` values are present, the first defines the `mask-origin` and the second defines the `mask-clip`.
`<geometry-box> | no-clip`
    
Sets the area affected by the mask image. See `mask-clip`.
`<compositing-operator>`
    
Sets the compositing operation used on the current mask layer. See `mask-composite`.
## Description
The `mask` shorthand property hides part or all of the element it is applied to. The parts of the element that are hidden, visible, or partially shown depend on either the opacity (alpha channel of the mask) or the brightness (luminance) of the mask. In alpha masking, opaque areas of the mask reveal the element, and transparent areas hide it. In luminance masking, light opaque areas of the mask reveal the element, and dark or transparent areas hide it.
While not all constituent mask properties need to be declared, any values that are omitted default to their initial values, which are:
    
    mask-image: none;
    mask-mode: match-source;
    mask-position: 0% 0%;
    mask-size: auto;
    mask-repeat: repeat;
    mask-origin: border-box;
    mask-clip: border-box;
    mask-composite: add;
    
Within each `<mask-layer>`, the `mask-size` component must go after the `mask-position` value, with a forward slash (`/`) separating the two.
If there are two `<geometry-box>` values present, the first is the `mask-origin` value, while the second is the `mask-clip` value. If one `<geometry-box>` value and the `no-clip` keyword are present, the `<geometry-box>` is the value of the `mask-origin` property, as the `no-clip` is only valid for the `mask-clip` property. In this case, the order of the two values doesn't matter. If only one `<geometry-box>` value is present (with no `no-clip` keyterm specified), this value is used for both the `mask-origin` and `mask-clip` properties.
As the `mask` shorthand resets all the `mask-border-*` properties to their `initial` value, you should declare these properties — or the `mask-border` shorthand — after any `mask` declarations. When setting `mask` in your declaration block, you also implicitly set the following:
    
    mask-border-source: none;
    mask-border-mode: alpha;
    mask-border-outset: 0;
    mask-border-repeat: stretch;
    mask-border-slice: 0;
    mask-border-width: auto;
    
For this reason, the specification recommends using the `mask` shorthand rather than the individual component properties to override any masks set earlier in the cascade. This ensures that `mask-border` has also been reset.
## Examples
>
### Masking an image
In this example, an image is masked using a CSS-generated repeating conic gradient as a mask source. We'll also show the gradient as a background image for comparison.
#### HTML
We include an `<img>` and an empty `<div>` element.
    
    <img
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <div></div>
    
#### CSS
We set the same `border`, `padding`, and sizing on both the `<img>` and `<div>`.
    
    img,
    div {
      border: 20px dashed rebeccapurple;
      box-sizing: content-box;
      padding: 20px;
      height: 220px;
      width: 220px;
    }
    
We then apply a mask to the `<img>`. The `mask-image` is generated using a `repeating-conic-gradient()` function. We define it to be a `100px` by `100px` gradient, which repeats starting at the top and left corner of the image's `content-box`. We include two `<geometry-box>` values; the first sets the `mask-origin` and the second defines the `mask-clip` property value. The gradient goes from transparent to solid `lightgreen`. We used `lightgreen` to demonstrate that it isn't the color of the mask that is important, but rather its transparency.
    
    img {
      mask: repeating-radial-gradient(
          circle,
          transparent 0 5px,
          lightgreen 15px 20px
        )
        content-box border-box 0% 0% / 100px 100px repeat;
    }
    
Finally, we use the same value for the `<div>`'s `background` shorthand property as we used for the `mask`.
    
    div {
      background: repeating-radial-gradient(
          circle,
          transparent 0 5px,
          lightgreen 15px 20px
        )
        content-box border-box 0% 0% / 100px 100px repeat;
    }
    
#### Results
# padding-block-start
The `padding-block-start` CSS property defines the logical block start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-block-start: 20px;
    writing-mode: horizontal-tb;
    
    
    padding-block-start: 20px;
    writing-mode: vertical-rl;
    
    
    padding-block-start: 5em;
    writing-mode: horizontal-tb;
    
    
    padding-block-start: 5em;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    padding-block-start: 10px; /* An absolute length */
    padding-block-start: 1em; /* A length relative to the text size */
    
    /* <percentage> value */
    padding-block-start: 5%; /* A padding relative to the block container's width */
    
    /* Global values */
    padding-block-start: inherit;
    padding-block-start: initial;
    padding-block-start: revert;
    padding-block-start: revert-layer;
    padding-block-start: unset;
    
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline-size (width in a horizontal language) of the containing block. Must be nonnegative.
## Description
The `padding-block-start` property takes the same values as physical padding properties such as `padding-top`. However, it can be equivalent to `padding-top`, `padding-bottom`, `padding-left`, or `padding-right` depending on the values set for `writing-mode`, `direction`, and `text-orientation`.
It relates to `padding-block-end`, `padding-inline-start`, and `padding-inline-end`, which define the other padding values of the element.
## Examples
>
### Setting block start padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      padding-block-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# scroll-padding-inline-end
The `scroll-padding-inline-end` property defines offsets for the end edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-inline-end: 0;
    
    
    scroll-padding-inline-end: 20px;
    
    
    scroll-padding-inline-end: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-inline-end: auto;
    
    /* <length> values */
    scroll-padding-inline-end: 10px;
    scroll-padding-inline-end: 1em;
    scroll-padding-inline-end: 10%;
    
    /* Global values */
    scroll-padding-inline-end: inherit;
    scroll-padding-inline-end: initial;
    scroll-padding-inline-end: revert;
    scroll-padding-inline-end: revert-layer;
    scroll-padding-inline-end: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the inline end edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# page-break-before
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This property has been replaced by the `break-before` property.
The `page-break-before` CSS property adjusts page breaks before the current element.
This property applies to block elements that generate a box. It won't apply on an empty `<div>` that won't generate a box.
## Try it
    
    page-break-before: auto;
    
    
    page-break-before: always;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'page-break-before'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Keyword values */
    page-break-before: auto;
    page-break-before: always;
    page-break-before: avoid;
    page-break-before: left;
    page-break-before: right;
    page-break-before: recto;
    page-break-before: verso;
    
    /* Global values */
    page-break-before: inherit;
    page-break-before: initial;
    page-break-before: revert;
    page-break-before: revert-layer;
    page-break-before: unset;
    
### Values
`auto`
    
Initial value. Automatic page breaks (neither forced nor forbidden).
`always`
    
Always force page breaks before the element.
`avoid`
    
Avoid page breaks before the element.
`left`
    
Force page breaks before the element so that the next page is formatted as a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing.
`right`
    
Force page breaks before the element so that the next page is formatted as a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing.
`recto`
    
If pages progress left-to-right, then this acts like `right`. If pages progress right-to-left, then this acts like `left`.
`verso`
    
If pages progress left-to-right, then this acts like `left`. If pages progress right-to-left, then this acts like `right`.
## Page break aliases
The `page-break-before` property is now a legacy property, replaced by `break-before`.
For compatibility reasons, `page-break-before` should be treated by browsers as an alias of `break-before`. This ensures that sites using `page-break-before` continue to work as designed. A subset of values should be aliased as follows:
page-break-before break-before  
`auto` `auto`  
`left` `left`  
`right` `right`  
`avoid` `avoid`  
`always` `page`  
## Examples
>
### Avoid a page break before an element
    
    /* Avoid page break before div elements of class note */
    div.note {
      page-break-before: avoid;
    }
    
# ::view-transition
The `::view-transition` CSS pseudo-element represents the root of the view transitions overlay, which contains all view transition snapshot groups and sits over the top of all other page content.
During a view transition, `::view-transition` is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree. It is the top-level node of this tree, and has one or more `::view-transition-group()`s as children.
`::view-transition` is given the following default styling in the UA stylesheet:
    
    :root::view-transition {
      position: fixed;
      inset: 0;
    }
    
All `::view-transition-group()` pseudo-elements are positioned relative to the view transition root.
## Syntax
    
    ::view-transition {
      /* ... */
    }
    
## Examples
    
    ::view-transition {
      background-color: rgb(0 0 0 / 25%);
    }
    
# justify-self
The CSS `justify-self` property sets the way a box is justified inside its alignment container along the appropriate axis.
## Try it
    
    justify-self: stretch;
    
    
    justify-self: center;
    
    
    justify-self: start;
    
    
    justify-self: end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      width: 220px;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 40px;
      grid-gap: 10px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
The effect of this property is dependent of the layout mode we are in:
  * In block-level layouts, it aligns an item inside its containing block on the inline axis.
  * For absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
  * In table cell layouts, this property is ignored. Read more about alignment in block, absolute positioned and table layout.
  * In flexbox layouts, this property is ignored. Read more about alignment in flexbox.
  * In grid layouts, it aligns an item inside its grid area on the inline axis. Read more about alignment in grid layouts.


## Syntax
    
    /* Basic keywords */
    justify-self: auto;
    justify-self: normal;
    justify-self: stretch;
    
    /* Positional alignment */
    justify-self: center; /* Pack item around the center */
    justify-self: start; /* Pack item from the start */
    justify-self: end; /* Pack item from the end */
    justify-self: flex-start; /* Equivalent to 'start'. Note that justify-self is ignored in flexbox layouts. */
    justify-self: flex-end; /* Equivalent to 'end'. Note that justify-self is ignored in flexbox layouts. */
    justify-self: self-start;
    justify-self: self-end;
    justify-self: left; /* Pack item from the left */
    justify-self: right; /* Pack item from the right */
    justify-self: anchor-center;
    
    /* Baseline alignment */
    justify-self: baseline;
    justify-self: first baseline;
    justify-self: last baseline;
    
    /* Overflow alignment (for positional alignment only) */
    justify-self: safe center;
    justify-self: unsafe center;
    
    /* Global values */
    justify-self: inherit;
    justify-self: initial;
    justify-self: revert;
    justify-self: revert-layer;
    justify-self: unset;
    
This property can take one of three different forms:
  * Basic keywords: one of the keyword values `normal`, `auto`, or `stretch`.
  * Baseline alignment: the `baseline` keyword, plus optionally one of `first` or `last`.
  * Positional alignment: 
    * one of: `center`, `start`, `end`, `flex-start`, `flex-end`, `self-start`, `self-end`, `left`, or `right`.
    * Plus optionally `safe` or `unsafe`.


### Values
`auto`
    
The value used is the value of the `justify-items` property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, `auto` represents `normal`.
`normal`
    
The effect of this keyword is dependent of the layout mode we are in:
  * In block-level layouts, the keyword is a synonym of `start`.
  * In absolutely-positioned layouts, the keyword behaves like `start` on replaced absolutely-positioned boxes, and as `stretch` on all other absolutely-positioned boxes.
  * In table cell layouts, this keyword has no meaning as this property is ignored.
  * In flexbox layouts, this keyword has no meaning as this property is ignored. 
  * In grid layouts, this keyword leads to a behavior similar to the one of `stretch`, except for boxes with an aspect ratio or an intrinsic size where it behaves like `start`.


`start`
    
The item is packed flush to each other toward the start edge of the alignment container in the appropriate axis.
`end`
    
The item is packed flush to each other toward the end edge of the alignment container in the appropriate axis.
`flex-start`
    
For items that are not children of a flex container, this value is treated like `start`.
`flex-end`
    
For items that are not children of a flex container, this value is treated like `end`.
`self-start`
    
The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.
`self-end`
    
The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis.
`center`
    
The items are packed flush to each other toward the center of the alignment container.
`left`
    
The items are packed flush to each other toward the left edge of the alignment container. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`right`
    
The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`baseline`, `first baseline`, `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group. The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`stretch`
    
If the combined size of the items is less than the size of the alignment container, any `auto`-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size exactly fills the alignment container.
`anchor-center`
    
In the case of anchor-positioned elements, aligns the item to the center of the associated anchor element in the inline direction. See Centering on the anchor using `anchor-center`.
`safe`
    
If the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Regardless of the relative sizes of the item and alignment container, the given alignment value is honored.
## Examples
>
### Basic demonstration
In the following example we have a 2 x 2 grid layout. Initially the grid container is given a `justify-items` value of `stretch` — the default — which causes the grid items to stretch across the entire width of their cells.
The second, third, and fourth grid items are then given different values of `justify-self`, to show how these override the `justify-items` value. These values cause the grid items to span only as wide as their content width, and align in different positions across their cells.
#### HTML
    
    <article class="container">
      <span>First child</span>
      <span>Second child</span>
      <span>Third child</span>
      <span>Fourth child</span>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
      letter-spacing: 1px;
    }
    
    article {
      background-color: red;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      margin: 20px;
      width: 300px;
      justify-items: stretch;
    }
    
    span:nth-child(2) {
      justify-self: start;
    }
    
    span:nth-child(3) {
      justify-self: center;
    }
    
    span:nth-child(4) {
      justify-self: end;
    }
    
    article span {
      background-color: black;
      color: white;
      margin: 1px;
      text-align: center;
    }
    
    article,
    span {
      padding: 10px;
      border-radius: 7px;
    }
    
#### Result
# scroll-margin-left
The `scroll-margin-left` property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Try it
    
    scroll-margin-left: 0;
    
    
    scroll-margin-left: 20px;
    
    
    scroll-margin-left: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* <length> values */
    scroll-margin-left: 10px;
    scroll-margin-left: 1em;
    
    /* Global values */
    scroll-margin-left: inherit;
    scroll-margin-left: initial;
    scroll-margin-left: revert;
    scroll-margin-left: revert-layer;
    scroll-margin-left: unset;
    
### Values
`<length>`
    
An outset from the left edge of the scroll container.
# corner-right-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-right-shape` CSS property specifies the shape of both the corners on a box's right-hand edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-right-shape` property is a shorthand for the following physical properties:
  * `corner-top-right-shape`
  * `corner-bottom-right-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-right-shape: bevel;
    corner-right-shape: notch;
    
    /* Single superellipse() value set for both corners */
    corner-right-shape: superellipse(4);
    corner-right-shape: superellipse(-0.9);
    
    /* Top corner, bottom corner */
    corner-right-shape: bevel notch;
    corner-right-shape: notch superellipse(-0.9);
    
    /* Global values */
    corner-right-shape: inherit;
    corner-right-shape: initial;
    corner-right-shape: revert;
    corner-right-shape: revert-layer;
    corner-right-shape: unset;
    
### Values
The `corner-right-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both right-hand corners.
  * If two values are used, the first one specifies the shape of the top-right corner, and the second one specifies the shape of the bottom-right corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-right-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `20% 30% / 50% 40%`, and a `corner-right-shape` of `square scoop`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 20% 30% / 50% 40%;
      corner-right-shape: square scoop;
    }
    
#### Result
The rendered result looks like this:
# text-emphasis
The `text-emphasis` CSS property applies emphasis marks to text (except spaces and control characters). It is a shorthand for `text-emphasis-style` and `text-emphasis-color`.
## Try it
    
    text-emphasis: none;
    
    
    text-emphasis: filled red;
    
    
    text-emphasis: "x";
    
    
    text-emphasis: filled double-circle #ffb703;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
The `text-emphasis` property is quite different from `text-decoration`. The `text-decoration` property does not inherit, and the decoration specified is applied across the whole element. However, text-emphasis does inherit, which means it is possible to change emphasis marks for descendants.
The size of the emphasis symbol, like ruby symbols, is about 50% of the size of the font, and `text-emphasis` may affect line height when the current leading is not enough for the marks.
Note: `text-emphasis` doesn't reset the value of `text-emphasis-position`. This is because if the style and the color of emphasis marks may vary in a text, it is extremely unlikely that their position will. In the very rare cases when this is needed, use the property `text-emphasis-position`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `text-emphasis-color`
  * `text-emphasis-style`


## Syntax
    
    /* Initial value */
    text-emphasis: none; /* No emphasis marks */
    
    /* <string> value */
    text-emphasis: "x";
    text-emphasis: "点";
    text-emphasis: "\25B2";
    text-emphasis: "*" #555555;
    text-emphasis: "foo"; /* Should NOT use. It may be computed to or rendered as 'f' only */
    
    /* Keywords value */
    text-emphasis: filled;
    text-emphasis: open;
    text-emphasis: filled sesame;
    text-emphasis: open sesame;
    
    /* Keywords value combined with a color */
    text-emphasis: filled sesame #555555;
    
    /* Global values */
    text-emphasis: inherit;
    text-emphasis: initial;
    text-emphasis: revert;
    text-emphasis: revert-layer;
    text-emphasis: unset;
    
### Values
`none`
    
No emphasis marks.
`filled`
    
The shape is filled with solid color. If neither `filled` nor `open` is present, this is the default.
`open`
    
The shape is hollow.
`dot`
    
Display small circles as marks. The filled dot is `'•'` (`U+2022`), and the open dot is `'◦'` (`U+25E6`).
`circle`
    
Display large circles as marks. The filled circle is `'●'` (`U+25CF`), and the open circle is `'○'` (`U+25CB`). This is the default shape in horizontal writing modes when no other shape is given.
`double-circle`
    
Display double circles as marks. The filled double-circle is `'◉'` (`U+25C9`), and the open double-circle is `'◎'` (`U+25CE`).
`triangle`
    
Display triangles as marks. The filled triangle is `'▲'` (`U+25B2`), and the open triangle is `'△'` (`U+25B3`).
`sesame`
    
Display sesames as marks. The filled sesame is `'﹅'` (`U+FE45`), and the open sesame is `'﹆'` (`U+FE46`). This is the default shape in vertical writing modes when no other shape is given.
`<string>`
    
Display the given string as marks. Authors should not specify more than one character in `<string>`. The UA may truncate or ignore strings consisting of more than one grapheme cluster.
`<color>`
    
Defines the color of the mark. If no color is present, it defaults to `currentColor`.
## Examples
>
### A heading with emphasis shape and color
This example draws a heading with triangles used to emphasize each character.
#### CSS
    
    h2 {
      text-emphasis: triangle #dd5555;
    }
    
#### HTML
    
    <h2>This is important!</h2>
    
#### Result
# Child combinator
The child combinator (`>`) is placed between two CSS selectors. It matches only those elements matched by the second selector that are the direct children of elements matched by the first.
    
    /* List items that are children of the "my-things" list */
    ul.my-things > li {
      margin: 2em;
    }
    
Elements matched by the second selector must be the immediate children of the elements matched by the first selector. This is stricter than the descendant combinator, which matches all elements matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of "hops" up the DOM.
## Syntax
    
    /* The white space around the > combinator is optional but recommended. */
    selector1 > selector2 { /* style properties */ }
    
## Examples
>
### CSS
    
    span {
      background-color: aqua;
    }
    
    div > span {
      background-color: yellow;
    }
    
### HTML
    
    <div>
      <span>
        Span #1, in the div.
        <span>Span #2, in the span that's in the div.</span>
      </span>
    </div>
    <span>Span #3, not in the div at all.</span>
    
### Result
# @starting-style
The `@starting-style` CSS at-rule is used to define starting values for properties set on an element that you want to transition from when the element receives its first style update, i.e., when an element is first displayed on a previously loaded page.
## Syntax
The `@starting-style` at rule can be used in two ways:
  1. As a standalone block, in which case it contains one or more rulesets defining starting style declarations and selecting the elements they apply to:
         @starting-style {
           /* rulesets */
         }
         
  2. Nested within an existing ruleset, in which case it contains one or more declarations defining starting property values for the elements already selected by that ruleset:
         selector {
           /* existing ruleset */
           /* ... */
         
           @starting-style {
             /* declarations */
           }
         }
         


## Description
To avoid unexpected behavior, CSS transitions are by default not triggered on an element's initial style update, or when its `display` type changes from `none` to another value. To enable first-style transitions, `@starting-style` rules are needed. They provide starting styles for elements that do not have a previous state, defining the property values to transition from.
`@starting-style` is especially useful when creating entry and exit transitions for elements displayed in the top layer (such as popovers and modal `<dialog>`s), elements that are changing to and from `display: none`, and elements when first added to or removed from the DOM.
Note: `@starting-style` is only relevant to CSS transitions. When using CSS animations to implement such effects, `@starting-style` is not needed. See Using CSS animations for an example.
There are two ways to use `@starting-style`: as a standalone rule or nested within a ruleset.
Let's consider a scenario where we want to animate a popover when shown (that is, when added to the top layer). The "original rule" specifying the styles for the open popover could look something like this (see the popover example below):
    
    [popover]:popover-open {
      opacity: 1;
      transform: scaleX(1);
    }
    
To specify the starting values of the popover's properties that will be animated using the first method, you include a standalone `@starting-style` block in your CSS:
    
    @starting-style {
      [popover]:popover-open {
        opacity: 0;
        transform: scaleX(0);
      }
    }
    
Note: The `@starting-style` at-rule and the "original rule" have the same specificity. To ensure that starting styles get applied, include the `@starting-style` at-rule after the "original rule". If you specify the `@starting-style` at-rule before the "original rule", the original styles will override the starting styles.
To specify the starting style for the popover using the nested method, you can nest the `@starting-style` block inside the "original rule":
    
    [popover]:popover-open {
      opacity: 1;
      transform: scaleX(1);
    
      @starting-style {
        opacity: 0;
        transform: scaleX(0);
      }
    }
    
### When exactly are starting styles used?
It is important to understand that an element will transition from its `@starting-style` styles when it is first rendered in the DOM, or when it transitions from `display: none` to a visible value. When it transitions back from its initial visible state, it will no longer use the `@starting-style` styles as it is now visible in the DOM. Instead, it will transition back to whatever styles exist for that element's default state.
In effect, there are three style states to manage in these situations — starting-style state, transitioned state, and default state. It is possible for the "to" and "from" transitions to be different in such cases. You can see a proof of this in our Demonstration of when starting styles are used example, below.
## Examples
>
### Basic @starting-style usage
Transition an element's `background-color` from transparent to green when it is initially rendered:
    
    #target {
      transition: background-color 1.5s;
      background-color: green;
    }
    
    @starting-style {
      #target {
        background-color: transparent;
      }
    }
    
Transition the `opacity` of an element when it changes its `display` value to or from `none`:
    
    #target {
      transition-property: opacity, display;
      transition-duration: 0.5s;
      display: block;
      opacity: 1;
      @starting-style {
        opacity: 0;
      }
    }
    
    #target.hidden {
      display: none;
      opacity: 0;
    }
    
### Demonstration of when starting styles are used
In this example, a button is pressed to create a `<div>` element, give it a `class` of `showing`, and add it to the DOM.
`showing` is given a `@starting-style` of `background-color: red` and a style of `background-color: blue` to transition to. The default `div` ruleset contains `background-color: yellow`, and is also where the `transition` is set.
When the `<div>` is first added to the DOM, you'll see the background transition from red to blue. After a timeout, we remove the `showing` class from the `<div>` via JavaScript. At that point it transitions from blue back to yellow, not red. This proves that the starting styles are only used when the element is first rendered in the DOM. Once it has appeared, the element transitions back to the default style set on it.
After another timeout, we then remove the `<div>` from the DOM altogether, resetting the initial state of the example so it can be run again.
#### HTML
    
    <button>Display <code>&lt;div&gt;</code></button>
    
#### CSS
    
    div {
      background-color: yellow;
      transition: background-color 3s;
    }
    
    div.showing {
      background-color: skyblue;
    }
    
    @starting-style {
      div.showing {
        background-color: red;
      }
    }
    
#### JavaScript
    
    const btn = document.querySelector("button");
    
    btn.addEventListener("click", () => {
      btn.disabled = true;
      const divElem = document.createElement("div");
      divElem.classList.add("showing");
      document.body.append(divElem);
    
      setTimeout(() => {
        divElem.classList.remove("showing");
    
        setTimeout(() => {
          divElem.remove();
          btn.disabled = false;
        }, 3000);
      }, 3000);
    });
    
#### Result
The code renders as follows:
### Animating a popover
In this example, a popover is animated using CSS transitions. Basic entry and exit animations are provided using the `transition` property.
#### HTML
The HTML contains a `<div>` element declared as a popover using the popover attribute and a `<button>` element designated as the popover's display control using its popovertarget attribute.
    
    <button popovertarget="mypopover">Show the popover</button>
    <div popover="auto" id="mypopover">I'm a Popover! I should animate.</div>
    
#### CSS
In this example, we want to animate two properties, `opacity` and `transform` (specifically, a horizontally scaling transform), to make the popover fade in and out as well as grow and shrink horizontally.
    
    html {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    [popover]:popover-open {
      opacity: 1;
      transform: scaleX(1);
    }
    
    [popover] {
      font-size: 1.2rem;
      padding: 10px;
    
      /* Final state of the exit animation */
      opacity: 0;
      transform: scaleX(0);
    
      transition:
        opacity 0.7s,
        transform 0.7s,
        overlay 0.7s allow-discrete,
        display 0.7s allow-discrete;
      /* Equivalent to
      transition: all 0.7s allow-discrete; */
    }
    
    /* Include after the [popover]:popover-open rule */
    @starting-style {
      [popover]:popover-open {
        opacity: 0;
        transform: scaleX(0);
      }
    }
    
    /* Transition for the popover's backdrop */
    [popover]::backdrop {
      background-color: transparent;
      transition:
        display 0.7s allow-discrete,
        overlay 0.7s allow-discrete,
        background-color 0.7s;
      /* Equivalent to
      transition: all 0.7s allow-discrete; */
    }
    
    [popover]:popover-open::backdrop {
      background-color: rgb(0 0 0 / 25%);
    }
    
    /* Nesting (&) is not supported for pseudo-elements
    so specify a standalone starting-style block. */
    @starting-style {
      [popover]:popover-open::backdrop {
        background-color: transparent;
      }
    }
    
To achieve this, we have set a starting state for these properties on the default hidden state of the popover element (selected via `[popover]`), and an ending state on the open state of the popover (selected via the `:popover-open` pseudo-class).
We then set a `transition` property to animate between the two states. A starting state for the animation is included inside a `@starting-style` at-rule to enable the entry animation.
Because the animated element is being promoted to the top layer when shown and removed from the top layer when hidden (with `display: none`), some extra steps are required to ensure the animation works in both directions:
  * `display` is added to the list of transitioned elements to ensure the animated element is visible (set to `display: block` or another visible `display` value) throughout both the entry and exit animations. Without this, the exit animation would not be visible; in effect, the popover would just disappear. Note that the `transition-behavior: allow-discrete` value is also set in the shorthand to activate the animation.
  * `overlay` is added to the list of transitioned elements to ensure that the removal of the element from the top layer is deferred until the animation ends. This doesn't make a huge difference for animations such as this one, but in more complex cases, not doing this can result in the element being removed from the overlay too quickly, meaning the animation is not smooth or effective. Again, `transition-behavior: allow-discrete` is required in this case for the animation to occur.


Note: We've also included a transition on the `::backdrop` that appears behind the popover when it opens, to provide a nice darkening animation. `[popover]:popover-open::backdrop` is used to select the backdrop when the popover is open.
#### Result
The code renders as follows:
Note: Because popovers change from `display: none` to `display: block` each time they are shown, the popover transitions from its `@starting-style` styles to its `[popover]:popover-open` styles every time the entry transition occurs. When the popover closes, it transitions from its `[popover]:popover-open` state to the default `[popover]` state.
Note: You can find an example that demonstrates transitioning a `<dialog>` element and its backdrop as it is shown and hidden on the `<dialog>` reference page — see Transitioning dialog elements.
### Transitioning elements on DOM addition and removal
This example contains a button which, when pressed, appends new elements to a `<section>` container. Each element, in turn, contains a nested button, which when pressed, removes the element. This example demonstrates how to use transitions to animate elements when they are added to or removed from the DOM.
#### HTML
    
    <button>Create new column</button>
    <section></section>
    
#### JavaScript
JavaScript enables the addition and removal of elements:
    
    const btn = document.querySelector("button");
    const sectionElem = document.querySelector("section");
    
    btn.addEventListener("click", createColumn);
    
    function randomBackground() {
      function randomNum() {
        return Math.floor(Math.random() * 255);
      }
      const baseColor = `${randomNum()} ${randomNum()} ${randomNum()}`;
    
      return `linear-gradient(to right, rgb(${baseColor} / 0), rgb(${baseColor} / 0.5))`;
    }
    
    function createColumn() {
      const divElem = document.createElement("div");
      divElem.style.background = randomBackground();
    
      const closeBtn = document.createElement("button");
      closeBtn.textContent = "✖";
      closeBtn.setAttribute("aria-label", "close");
      divElem.append(closeBtn);
      sectionElem.append(divElem);
    
      closeBtn.addEventListener("click", () => {
        divElem.classList.add("fade-out");
    
        setTimeout(() => {
          divElem.remove();
        }, 1000);
      });
    }
    
When the "Create new column" button is clicked, the `createColumn()` function is called. This creates a `<div>` element with a randomly generated background color and a `<button>` element to close the `<div>`. It then appends the `<button>` to the `<div>` and the `<div>` to the `<section>` container.
We then add an event listener to the close button via `addEventListener()`. Clicking the close button does two things:
  * Adds the `fade-out` class to the `<div>`. Adding the class triggers the exit animation set on that class.
  * Removes the `<div>` after a 1000ms delay. The `setTimeout()` delays removal of the `<div>` from the DOM (via `Element.remove()`) until after the animation ends.


#### CSS
We include a `transition` that animates the `opacity` and `scale` of each column as they are added and removed:
    
    div {
      flex: 1;
      border: 1px solid gray;
      position: relative;
      opacity: 1;
      scale: 1 1;
    
      transition:
        opacity 0.7s,
        scale 0.7s,
        display 0.7s allow-discrete,
        all 0.7s allow-discrete;
      /* Equivalent to
      transition: all 0.7s allow-discrete; */
    }
    
    /* Include after the `div` rule */
    @starting-style {
      div {
        opacity: 0;
        scale: 1 0;
      }
    }
    
    .fade-out {
      opacity: 0;
      display: none;
      scale: 1 0;
    }
    
    div > button {
      font-size: 1.6rem;
      background: none;
      border: 0;
      text-shadow: 2px 1px 1px white;
      border-radius: 15px;
      position: absolute;
      top: 1px;
      right: 1px;
      cursor: pointer;
    }
    
To animate the `opacity` and `scale` of each `<div>` as it is added to the DOM and then reverse the animation as it is removed from the DOM, we:
  * Specify the ending state of the properties we want to transition on the `div { ... }` rule.
  * Specify the starting state from which to transition the properties inside a `@starting-style` block.
  * Specify the exit animation inside the `.fade-out` rule — this is the class that the JavaScript assigns to the `<div>` elements when their close buttons are pressed. Besides setting the `opacity` and `scale` ending states, we also set `display: none` on the `<div>`s — we want them to become immediately unavailable when removed from the UI.
  * Specify the `transition` list inside the `div { ... }` rule to animate `opacity`, `scale`, and `display`. Note that for `display`, the `transition-behavior: allow-discrete` value is also set in the shorthand so that it will animate.


#### Result
The final result looks like this:
# :playing
The `:playing` CSS pseudo-class selector represents the playback state of an element that is playable, such as `<audio>` or `<video>`, when that element is "playing". An element is considered to be playing if it is currently playing the media resource, or if it has temporarily stopped for reasons other than user intent (such as `:buffering` or `:stalled`).
## Syntax
    
    :playing {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :playing {
      border: 5px solid green;
    }
    
# border-top-style
The `border-top-style` CSS property sets the line style of an element's top `border`.
## Try it
    
    border-top-style: none;
    
    
    border-top-style: dotted;
    
    
    border-top-style: dashed;
    
    
    border-top-style: solid;
    
    
    border-top-style: groove;
    
    
    border-top-style: inset;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
    body {
      background-color: white;
    }
    
Note: The specification doesn't define how borders of different styles connect in the corners.
## Syntax
    
    /* Keyword values */
    border-top-style: none;
    border-top-style: hidden;
    border-top-style: dotted;
    border-top-style: dashed;
    border-top-style: solid;
    border-top-style: double;
    border-top-style: groove;
    border-top-style: ridge;
    border-top-style: inset;
    border-top-style: outset;
    
    /* Global values */
    border-top-style: inherit;
    border-top-style: initial;
    border-top-style: revert;
    border-top-style: revert-layer;
    border-top-style: unset;
    
The `border-top-style` property is specified as a single `<line-style>` keyword value.
## Examples
>
### Setting border-top-style
#### HTML
    
    <table>
      <tr>
        <td class="b1">none</td>
        <td class="b2">hidden</td>
        <td class="b3">dotted</td>
        <td class="b4">dashed</td>
      </tr>
      <tr>
        <td class="b5">solid</td>
        <td class="b6">double</td>
        <td class="b7">groove</td>
        <td class="b8">ridge</td>
      </tr>
      <tr>
        <td class="b9">inset</td>
        <td class="b10">outset</td>
      </tr>
    </table>
    
#### CSS
    
    /* Define look of the table */
    table {
      border-width: 2px;
      background-color: #52e385;
    }
    tr,
    td {
      padding: 3px;
    }
    
    /* border-top-style example classes */
    .b1 {
      border-top-style: none;
    }
    .b2 {
      border-top-style: hidden;
    }
    .b3 {
      border-top-style: dotted;
    }
    .b4 {
      border-top-style: dashed;
    }
    .b5 {
      border-top-style: solid;
    }
    .b6 {
      border-top-style: double;
    }
    .b7 {
      border-top-style: groove;
    }
    .b8 {
      border-top-style: ridge;
    }
    .b9 {
      border-top-style: inset;
    }
    .b10 {
      border-top-style: outset;
    }
    
#### Result
# CSS scoping
The CSS scoping module defines the CSS scoping and encapsulation mechanisms, focusing on the Shadow DOM scoping mechanism.
CSS styles are either global in scope or scoped to a shadow tree. Globally scoped styles apply to all the elements in the node tree that match the selector, including custom elements in that tree, but not to the shadow trees composing each custom element. Selectors and their associated style definitions don't bleed between scopes.
Within the CSS of a shadow tree, selectors don't select elements outside the tree, either in the global scope or in other shadow trees. Each custom element has its own shadow tree, which contains all the components that make up the custom element (but not the custom element, or "host", itself).
Sometimes it's useful to be able to style a host from inside the shadow tree context. The CSS scoping module makes this possible by defining selectors that:
  * Enable a shadow tree to style its host.
  * Enable external CSS to style elements within a shadow DOM (but only if the associated custom element is set up to accept external styles).


## Reference
>
### Selectors
  * `:host`
  * `:host()`
  * `:host-context()`
  * `::slotted`


## Guides
Web components
    
An introduction to the different technologies used to create reusable web components — custom elements whose functionality is encapsulated away from the rest of your code.
Using shadow DOM
    
Shadow DOM fundamentals, including attaching a shadow DOM to an element, adding to the shadow DOM tree, and styling.
Using templates and slots
    
Defining reusable HTML structure using `<template>` and `<slot>` elements, and using that structure inside web components.
Using custom elements
    
Introduction to the Custom Elements API, the JavaScript API used to create custom elements that encapsulate functionality.
## Related concepts
  * CSS `:defined` pseudo-class
  * CSS `::part` pseudo-element
  * HTML `<template>` element
  * HTML `<slot>` element
  * HTML `slot` attribute
  * Shadow tree glossary term
  * DOM glossary term
  * Compound selector term
  * Selector list term
  * Web components interfaces, properties, and methods
    * `CustomElementRegistry` interface
    * `Element` API 
      * `Element.slot` property
      * `Element.assignedSlot` property
      * `Element.attachShadow()` method
    * `HTMLSlotElement` interface
    * `HTMLTemplateElement` interface
    * `ShadowRoot` interface


Note: Despite the name, the `:scope` pseudo-class, which represents elements that are a reference point (or scope) for selectors to match against, is defined in the Selectors module. It is otherwise unrelated to the CSS scoping module, which is focused on scoping as it pertains to the Shadow DOM scoping mechanism.
# grid
The `grid` CSS property is a shorthand property that sets all of the explicit and implicit grid properties in a single declaration.
Using `grid` you specify one axis using `grid-template-rows` or `grid-template-columns`, you then specify how content should auto-repeat in the other axis using the implicit grid properties: `grid-auto-rows`, `grid-auto-columns`, and `grid-auto-flow`.
## Try it
    
    grid: auto-flow / 1fr 1fr 1fr;
    
    
    grid: auto-flow dense / 40px 40px 1fr;
    
    
    grid: repeat(3, 80px) / auto-flow;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-gap: 10px;
      width: 200px;
    }
    
    #example-element :nth-child(1) {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element :nth-child(2) {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
      grid-column: auto / span 3;
      grid-row: auto / span 2;
    }
    
    #example-element :nth-child(3) {
      background-color: rgb(94 255 0 / 0.2);
      border: 3px solid green;
      grid-column: auto / span 2;
    }
    
Note: The sub-properties you don't specify are set to their initial value, as normal for shorthands. Also, the gutter properties are NOT reset by this shorthand.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `grid-auto-columns`
  * `grid-auto-flow`
  * `grid-auto-rows`
  * `grid-template-areas`
  * `grid-template-columns`
  * `grid-template-rows`


## Syntax
    
    /* <'grid-template'> values */
    grid: none;
    grid: "a" 100px "b" 1fr;
    grid: [line-name1] "a" 100px [line-name2];
    grid: "a" 200px "b" min-content;
    grid: "a" minmax(100px, max-content) "b" 20%;
    grid: 100px / 200px;
    grid: minmax(400px, min-content) / repeat(auto-fill, 50px);
    
    /* <'grid-template-rows'> /
       [ auto-flow && dense? ] <'grid-auto-columns'>? values */
    grid: 200px / auto-flow;
    grid: 30% / auto-flow dense;
    grid: repeat(3, [line1 line2 line3] 200px) / auto-flow 300px;
    grid: [line1] minmax(20em, max-content) / auto-flow dense 40%;
    
    /* [ auto-flow && dense? ] <'grid-auto-rows'>? /
       <'grid-template-columns'> values */
    grid: auto-flow / 200px;
    grid: auto-flow dense / 30%;
    grid: auto-flow 300px / repeat(3, [line1 line2 line3] 200px);
    grid: auto-flow dense 40% / [line1] minmax(20em, max-content);
    
    /* Global values */
    grid: inherit;
    grid: initial;
    grid: revert;
    grid: revert-layer;
    grid: unset;
    
### Values
`<'grid-template'>`
    
Defines the `grid-template` including `grid-template-columns`, `grid-template-rows` and `grid-template-areas`.
`<'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>?`
    
Sets up an auto-flow by setting the row tracks explicitly via the `grid-template-rows` property (and the `grid-template-columns` property to `none`) and specifying how to auto-repeat the column tracks via `grid-auto-columns` (and setting `grid-auto-rows` to `auto`). `grid-auto-flow` is also set to `column` accordingly, with `dense` if it's specified.
All other `grid` sub-properties are reset to their initial values.
`[ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>`
    
Sets up an auto-flow by setting the column tracks explicitly via the `grid-template-columns` property (and the `grid-template-rows` property to `none`) and specifying how to auto-repeat the row tracks via `grid-auto-rows` (and setting `grid-auto-columns` to `auto`). `grid-auto-flow` is also set to `row` accordingly, with `dense` if it's specified.
All other `grid` sub-properties are reset to their initial values.
## Examples
>
### Creating a grid layout
#### HTML
    
    <div id="container">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #container {
      display: grid;
      grid: repeat(2, 60px) / auto-flow 80px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      width: 50px;
      height: 50px;
    }
    
#### Result
# <ident>
The `<ident>` CSS data type denotes an arbitrary string used as an identifier.
## Syntax
A CSS identifier consists of one or more characters, which can be any of the following:
  * any ASCII character in the ranges `A-Z` and `a-z`
  * any decimal digit (`0` to `9`)
  * a hyphen (`-`)
  * an underscore (`_`)
  * any other Unicode character `U+00A0` and higher (that is, any other non-ASCII Unicode character)
  * an escaped character


Additionally, an identifier must not start with an unescaped digit, and must not start with an unescaped hyphen followed by an unescaped digit.
Note that `id1`, `Id1`, `iD1` and `ID1` are all different identifiers because they are case-sensitive. On the other hand, since there are several ways to escape a character, `toto\?` and `toto\3F` are the same identifiers.
### Escaping characters
Escaping a character means representing it in a way that changes how it is interpreted by a software system. In CSS, you can escape a character by adding a backslash (`\`) in front of the character. Any character, except the hexadecimal digits `0-9`, `a-f`, and `A-F`, can be escaped in this way. For example, `&` can be escaped as `\&`.
You can also escape any character with a backslash followed by the character's Unicode code point represented by one to six hexadecimal digits. For example, `&` can be escaped as `\26`. In this usage, if the escaped character is followed by a hexadecimal digit, do one of the following:
  * Place a space or other whitespace character after the Unicode code point.
  * Provide the full six-digit Unicode code point of the character being escaped.


For example, the string `&123` can be escaped as `\26 123` (with a whitespace) or `\000026123` (with the six-digit Unicode code point for `&`) to ensure that `123` is not considered as part of the escape pattern.
## Examples
>
### Valid identifiers
    
    nono79        /* A mix of alphanumeric characters and numbers */
    ground-level  /* A mix of alphanumeric characters and a dash */
    -test         /* A hyphen followed by alphanumeric characters */
    --toto        /* A custom-property like identifier */
    _internal     /* An underscore followed by alphanumeric characters */
    \22 toto      /* An escaped character followed by alphanumeric characters */
    \000022toto   /* Same as the previous example */
    scooby\.doo   /* A correctly escaped period */
    🔥123         /* A non-ASCII character followed by numbers */
    
### Invalid identifiers
    
    34rem     /* Must not start with a decimal digit */
    -12rad    /* Must not start with a dash followed by a decimal digit */
    scooby.doo  /* ASCII characters apart from alphanumerics must be escaped */
    'scoobyDoo' /* Treated as a string */
    "scoobyDoo" /* Treated as a string */
    
As this type is not a real type but a convenience type used to simplify the definition of other CSS syntax, there is no browser compatibility information as such.
# text-align
The `text-align` CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box. This means it works like `vertical-align` but in the horizontal direction.
## Try it
    
    text-align: start;
    
    
    text-align: end;
    
    
    text-align: center;
    
    
    text-align: justify;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
          cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
          est laborum.
        </p>
      </div>
    </section>
    
    
    section {
      font-size: 1.5em;
    }
    
    #default-example > div {
      width: 250px;
    }
    
## Syntax
    
    /* Keyword values */
    text-align: start;
    text-align: end;
    text-align: left;
    text-align: right;
    text-align: center;
    text-align: justify;
    text-align: match-parent;
    
    /* Block alignment values (Non-standard syntax) */
    text-align: -moz-center;
    text-align: -webkit-center;
    
    /* Global values */
    text-align: inherit;
    text-align: initial;
    text-align: revert;
    text-align: revert-layer;
    text-align: unset;
    
The `text-align` property is specified as a single keyword from the list below.
### Values
`start`
    
The same as `left` if direction is left-to-right and `right` if direction is right-to-left.
`end`
    
The same as `right` if direction is left-to-right and `left` if direction is right-to-left.
`left`
    
The inline contents are aligned to the left edge of the line box.
`right`
    
The inline contents are aligned to the right edge of the line box.
`center`
    
The inline contents are centered within the line box.
`justify`
    
The inline contents are justified. Spaces out the content to line up its left and right edges to the left and right edges of the line box, except for the last line.
`match-parent`
    
Similar to `inherit`, but the values `start` and `end` are calculated according to the parent's `direction` and are replaced by the appropriate `left` or `right` value.
## Accessibility
The inconsistent spacing between words created by justified text can be problematic for people with cognitive concerns such as Dyslexia.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.8 | Understanding WCAG 2.0


## Examples
>
### Start alignment
#### HTML
    
    <p class="example">
      Integer elementum massa at nulla placerat varius. Suspendisse in libero risus,
      in interdum massa. Vestibulum ac leo vitae metus faucibus gravida ac in neque.
      Nullam est eros, suscipit sed dictum quis, accumsan a ligula.
    </p>
    
#### CSS
    
    .example {
      text-align: start;
      border: solid;
    }
    
#### Result
### Centered text
#### HTML
    
    <p class="example">
      Integer elementum massa at nulla placerat varius. Suspendisse in libero risus,
      in interdum massa. Vestibulum ac leo vitae metus faucibus gravida ac in neque.
      Nullam est eros, suscipit sed dictum quis, accumsan a ligula.
    </p>
    
#### CSS
    
    .example {
      text-align: center;
      border: solid;
    }
    
#### Result
### Example using "justify"
#### HTML
    
    <p class="example">
      Integer elementum massa at nulla placerat varius. Suspendisse in libero risus,
      in interdum massa. Vestibulum ac leo vitae metus faucibus gravida ac in neque.
      Nullam est eros, suscipit sed dictum quis, accumsan a ligula.
    </p>
    
#### CSS
    
    .example {
      text-align: justify;
      border: solid;
    }
    
#### Result
### Table alignment
This example demonstrates the use of `text-align` on `<table>` elements:
  * The `<caption>` is set to right-aligned.
  * The first two `<th>` elements inherit the left alignment from the `text-align: left` set on the `<thead>`, while the third is set to right-aligned.
  * Inside the `<tbody>` element, the first row is set to right-aligned, the second is set to center-aligned, and the third uses the default (left) alignment.
  * Within each row, some cells (c12, c31) are set to override the alignment of the row.


#### HTML
    
    <table>
      <caption>
        Example table
      </caption>
      <thead>
        <tr>
          <th>Col 1</th>
          <th>Col 2</th>
          <th class="right">Col 3</th>
        </tr>
      </thead>
      <tbody>
        <tr class="right">
          <td>11</td>
          <td class="center">12</td>
          <td>13</td>
        </tr>
        <tr class="center">
          <td>21</td>
          <td>22</td>
          <td>23</td>
        </tr>
        <tr id="r3">
          <td class="right">31</td>
          <td>32</td>
          <td>33</td>
        </tr>
      </tbody>
    </table>
    
#### CSS
    
    table {
      border-collapse: collapse;
      border: solid black 1px;
      width: 250px;
      height: 150px;
    }
    
    thead {
      text-align: left;
    }
    
    td,
    th {
      border: solid 1px black;
    }
    
    .center {
      text-align: center;
    }
    
    .right,
    caption {
      text-align: right;
    }
    
#### Result
# corner-top-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-top-shape` CSS property specifies the shape of both the corners on a box's top edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-top-shape` property is a shorthand for the following physical properties:
  * `corner-top-left-shape`
  * `corner-top-right-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-top-shape: notch;
    corner-top-shape: squircle;
    
    /* Single superellipse() value set for both corners */
    corner-top-shape: superellipse(3);
    corner-top-shape: superellipse(-1.5);
    
    /* Left-hand corner, right-hand corner */
    corner-top-shape: notch squircle;
    corner-top-shape: notch superellipse(-1.5);
    
    /* Global values */
    corner-top-shape: inherit;
    corner-top-shape: initial;
    corner-top-shape: revert;
    corner-top-shape: revert-layer;
    corner-top-shape: unset;
    
### Values
The `corner-top-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both top corners.
  * If two values are used, the first one specifies the shape of the top-left corner, and the second one specifies the shape of the top-right corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-top-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of 60 pixels, and a `corner-top-shape` of `scoop notch`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px;
      corner-top-shape: scoop notch;
    }
    
#### Result
The rendered result looks like this:
# border-block-start
The `border-block-start` CSS property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet.
## Try it
    
    border-block-start: solid;
    writing-mode: horizontal-tb;
    
    
    border-block-start: dashed red;
    writing-mode: vertical-rl;
    
    
    border-block-start: 1rem solid;
    writing-mode: horizontal-tb;
    
    
    border-block-start: thick double #32a1ce;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-block-start-color`
  * `border-block-start-style`
  * `border-block-start-width`


## Syntax
    
    border-block-start: 1px;
    border-block-start: 2px dotted;
    border-block-start: medium dashed blue;
    
    /* Global values */
    border-block-start: inherit;
    border-block-start: initial;
    border-block-start: revert;
    border-block-start: revert-layer;
    border-block-start: unset;
    
`border-block-start` can be used to set the values for one or more of `border-block-start-width`, `border-block-start-style`, and `border-block-start-color`. The physical border to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top`, `border-right`, `border-bottom`, or `border-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
Related properties are `border-block-end`, `border-inline-start`, and `border-inline-end`, which define the other borders of the element.
### Values
The `border-block-start` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### Border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-block-start: 5px dashed blue;
    }
    
# position-anchor
The `position-anchor` CSS property specifies the anchor name of the anchor element (i.e., an element that has an anchor name set on it via the `anchor-name` property) a positioned element is associated with.
## Syntax
    
    /* Single values */
    position-anchor: auto;
    position-anchor: --anchor-name;
    
    /* Global values */
    position-anchor: inherit;
    position-anchor: initial;
    position-anchor: revert;
    position-anchor: revert-layer;
    position-anchor: unset;
    
### Values
`auto`
    
Associates a positioned element with its implicit anchor element, if it has one — for example as set by the non-standard HTML `anchor` attribute.
`<dashed-ident>`
    
The name of the anchor element to associate the positioned element with, as listed in the anchor element's `anchor-name` property. This is known as the default anchor specifier.
## Description
This property is only relevant to "positioned" elements — elements and pseudo elements that have a `position` of `absolute` or `fixed` set.
To position an element relative to an anchor element, the positioned element requires three features: an association, a position, and a location. The `position-anchor` and `anchor-name` properties provide an explicit association.
The anchor element accepts one or more `<dashed-ident>` anchor names set on it via the `anchor-name` property. When one of those names is then set as the value of the positioned element's `position-anchor` property, the two elements are associated.
If there are multiple anchor elements with the anchor name listed in the `position-anchor` property, the positioned element will be associated with the last anchor element in the source order with that anchor name.
To tether a positioned element to its anchor, it must be placed relative to an anchor element using an anchor positioning feature, such as the `anchor()` function (set as a value on inset properties) or the `position-area` property.
If the associated anchor is hidden, for example with `display: none` or `visibility: hidden`, or if it is part of the skipped contents of another element due to it having `content-visibility: hidden` set on it, the anchor positioned element will not be displayed.
The `position-anchor` property is supported on all elements that are positioned, including pseudo-elements like `::before` and `::after`. Pseudo elements are implicitly anchored to the same element as the pseudo-element's originating element, unless otherwise specified.
For more information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
## Examples
See the `anchor-name` documentation for basic usage and additional `position-anchor` examples.
### Using a slider thumb as an anchor
In this example, an `<output>` is positioned relative to an anchor that is the thumb of a range slider.
#### HTML
We include an `<input type="range">` element and an `<output>` element to display the value of the range. The value displayed in the `<output>` element is updated via JavaScript as the slider value changes.
    
    <label for="slider">Change the value:</label>
    <input type="range" min="0" max="100" value="25" id="slider" />
    <output>25</output>
    
#### CSS
We give the thumb, represented by the `::-webkit-slider-thumb` pseudo-element, an anchor name of `--thumb`. We then set that name as the value of the `<output>` element's `position-anchor` property, and give it a `position` value of `fixed`. These steps associated the `<output>` with the thumb.
Finally, we use `left` and `top` properties with `anchor()` values to position the `<output>` relative to the thumb.
    
    input::-webkit-slider-thumb {
      anchor-name: --thumb;
    }
    
    output {
      position-anchor: --thumb;
      position: absolute;
      left: anchor(right);
      bottom: anchor(top);
    }
    
#### JavaScript
We include an event listener that updates the content of the `<output>` element when the value of the `<input>` changes:
    
    const input = document.querySelector("input");
    const output = document.querySelector("output");
    
    input.addEventListener("input", (event) => {
      output.innerText = `${input.value}`;
    });
    
#### Results
The output is anchored to the thumb. Change the value. If anchor positioning is supported in your browser, the value will be above and to the right of the thumb, no matter where it is along the slider.
### Multiple positioned elements and anchors
In this example, you can move multiple positioned elements around, associating them with different anchors. This example demonstrates how an anchor can be associated with multiple positioned elements, but an anchor-positioned element can only be associated with a single anchor at a time, the anchor defined by the `anchor-position` property.
#### HTML
We have four anchors and two positioned elements, distinguished with different `id` values. The positioned elements contain `<select>` boxes that allow you to choose which anchor you want to associate them with.
    
    <div id="anchor-container">
      <div class="anchor" id="anchor1">⚓︎</div>
      <div class="anchor" id="anchor2">⚓︎</div>
      <div class="anchor" id="anchor3">⚓︎</div>
      <div class="anchor" id="anchor4">⚓︎</div>
    </div>
    
    <div class="infobox" id="infobox1">
      <form>
        <label for="anchor1-anchor-select">Place infobox on:</label>
        <select id="anchor1-anchor-select">
          <option value="1">Anchor 1</option>
          <option value="2">Anchor 2</option>
          <option value="3">Anchor 3</option>
          <option value="4">Anchor 4</option>
        </select>
      </form>
    </div>
    
    <div class="infobox" id="infobox2">
      <form>
        <label for="anchor2-anchor-select">Place infobox on:</label>
        <select id="anchor2-anchor-select">
          <option value="1">Anchor 1</option>
          <option value="2">Anchor 2</option>
          <option value="3">Anchor 3</option>
          <option value="4">Anchor 4</option>
        </select>
      </form>
    </div>
    
#### CSS
We declare the first `anchor` `<div>` as an anchor using the `anchor-name` property, which is given two comma-separated anchor names, one for each positioned element. This is the initial state of the demo — both positioned elements will be tethered to the first anchor.
    
    #anchor1 {
      anchor-name: --my-anchor1, --my-anchor2;
    }
    
Each of the positioned elements is given a `position-anchor` property with a value matching one of the two anchor names. The positioned elements are then given anchor-relative positioning information using a combination of inset, alignment, and margin properties.
    
    #infobox1 {
      position-anchor: --my-anchor1;
      position: fixed;
      left: anchor(right);
      align-self: anchor-center;
      margin-left: 10px;
    }
    
    #infobox2 {
      position-anchor: --my-anchor2;
      position: fixed;
      bottom: anchor(top);
      justify-self: anchor-center;
      margin-bottom: 15px;
    }
    
#### JavaScript
We dynamically change which anchor elements the `anchor-name` values are set on in response to different anchors being selected in the positioned elements' `<select>` menus. The key functionality here is the `change` event handler, `updateAnchorNames()`. It sets both anchor names on one anchor, if the anchors chosen in the two `<select>` menus are the same. Otherwise, it sets a single anchor name on two separate anchors as appropriate.
    
    // Get references to the two select menus
    const select1 = document.querySelector("#anchor1-anchor-select");
    const select2 = document.querySelector("#anchor2-anchor-select");
    // Store references to all the anchors in a NodeList (array-like)
    const anchors = document.querySelectorAll("#anchor-container > div");
    
    // Set the same change event handler on both select menus
    select1.addEventListener("change", updateAnchorNames);
    select2.addEventListener("change", updateAnchorNames);
    
    function updateAnchorNames() {
      // Remove all anchor names from all anchors
      for (const anchor of anchors) {
        anchor.style.anchorName = "none";
      }
    
      // convert the select menu values to numbers, and remove one to
      // make them match the selected anchors' index positions in the NodeList
      const value1 = Number(select1.value) - 1;
      const value2 = Number(select2.value) - 1;
    
      if (value1 === value2) {
        // If the chosen anchors are both the same, set both anchor
        // names on the same anchor
        anchors[value1].style.anchorName = "--my-anchor1, --my-anchor2";
      } else {
        // If they are not the same, set the anchor names separately
        // on each selected anchor
        anchors[value1].style.anchorName = "--my-anchor1";
        anchors[value2].style.anchorName = "--my-anchor2";
      }
    }
    
#### Result
Select different values from the drop-down menus to change the anchors that the elements are positioned relative to.
# calc()
The `calc()` CSS function lets you perform calculations when specifying CSS property values. It can be used with `<length>`, `<frequency>`, `<angle>`, `<time>`, `<percentage>`, `<number>`, `<integer>`, and `<color-function>` values.
## Try it
    
    width: calc(10px + 100px);
    
    
    width: calc(100% - 30px);
    
    
    width: calc(2em * 5);
    
    
    width: calc(var(--variable-width) + 20px);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Change my width.</div>
    </section>
    
    
    :root {
      --variable-width: 100px;
    }
    
    #example-element {
      border: 10px solid black;
      padding: 10px;
    }
    
## Syntax
    
    /* calc(expression) */
    calc(100% - 80px)
    
    /* Expression with a CSS function */
    calc(100px * sin(pi / 2))
    
    /* Expression containing a variable */
    calc(var(--hue) + 180)
    
    /* Expression with color channels in relative colors */
    lch(from aquamarine l c calc(h + 180))
    
The `calc()` function takes a single expression as its parameter, and the expression's result is used as the value for a CSS property. In this expression, the operands can be combined using the operators listed below. When the expression contains multiple operands, `calc()` uses the standard operator precedence rules:
`+`
    
Adds the specified operands.
`-`
    
Subtracts the second operand from the first operand.
`*`
    
Multiplies the specified operands.
`/`
    
Divides the left-side operand (dividend) by the right-side operand (divisor).
All operands, except those of type `<number>`, must be suffixed with an appropriate unit string, such as `px`, `em`, or `%`. You can use a different unit with each operand in your expression. You may also use parentheses to establish computation order when needed.
## Description
There are a few points to note about `calc()`, which are detailed in the sections below.
### Resulting values
The `calc()` function must stand in place of a full CSS value of one of the following types:
  * `<length>`
  * `<frequency>`
  * `<angle>`
  * `<time>`
  * `<flex>`
  * `<resolution>`
  * `<percentage>`
  * `<number>`
  * `<integer>`
  * One of the mixed types like `<length-percentage>`


`calc()` cannot only replace the numeric part of percentage values, length values, etc., without also replacing the unit after it. For example, `calc(100 / 4)%` is invalid, while `calc(100% / 4)` is valid.
The resulting value of `calc()` must be compatible with the context in which it is used. For example, `margin: calc(1px + 2px)` is valid, but `margin: calc(1 + 2)` is not: it is equivalent to specifying `margin: 3`, which results in the property being ignored.
When an `<integer>` is expected, the `calc()` expression can also evaluate to a `<number>`, which gets rounded to the nearest integer. So, `calc(1.4)` will result in a value of `1`. If the fractional part of the value is exactly `0.5`, the value is rounded towards positive infinity. For example, `calc(1.5)` will result in a value of `2`, while `calc(-1.5)` will round to `-1`.
`calc()` performs floating point math following the IEEE-754 standard, which results in some considerations concerning the `infinity` and `NaN` values. For more details on how constants are serialized, see the `calc-keyword` page.
### Input considerations
  * `calc()` cannot perform calculations on intrinsic size values such as `auto` and `fit-content`. Use the `calc-size()` function instead.
  * The `*` and `/` operators do not require whitespace, but adding it for consistency is recommended.
  * It is permitted to nest `calc()` functions, in which case, the inner ones are treated as simple parentheses.
  * Current implementations require that, when using the `*` and `/` operators, one of the operands must be unitless. For `/`, the right operand must be unitless. For example `font-size: calc(1.25rem / 1.25)` is valid but `font-size: calc(1.25rem / 125%)` is invalid.
  * Math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if `auto` is specified.
  * See `<calc-sum>` for more information on the syntax of `+` and `-` expressions.


### Support for computing color channels in relative colors
The `calc()` function can be used to manipulate color channels directly within the context of relative colors. This allows for dynamic adjustments of color channels in color models such as `rgb()`, `hsl()`, and `lch()`.
The relative color syntax defines several color-channel keywords, each of which represents the value of the color channel as a `<number>` (see Channel values resolve to `<number>` values for more information). The `calc()` function can use these color-channel keywords to perform dynamic adjustments on the color channels, for example, `calc(r + 10)`.
## Accessibility
When `calc()` is used for controlling text size, be sure that one of the values includes a relative length unit, for example:
    
    h1 {
      font-size: calc(1.5rem + 3vw);
    }
    
This ensures that text size will scale if the page is zoomed.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Positioning an object on screen with a margin
`calc()` makes it easy to position an object with a set margin. In this example, the CSS creates a banner that stretches across the window, with a 40-pixel gap between both sides of the banner and the edges of the window:
    
    .banner {
      position: absolute;
      left: 40px;
      width: calc(100% - 80px);
      border: solid black 1px;
      box-shadow: 1px 2px;
      background-color: yellow;
      padding: 6px;
      text-align: center;
      box-sizing: border-box;
    }
    
    
    <div class="banner">This is a banner!</div>
    
### Automatically sizing form fields to fit their container
Another use case for `calc()` is to help ensure that form fields fit in the available space, without extruding past the edge of their container while maintaining an appropriate margin.
Let's look at some CSS:
    
    input {
      padding: 2px;
      display: block;
      width: calc(100% - 1em);
    }
    
    #form-box {
      width: calc(100% / 6);
      border: 1px solid black;
      padding: 4px;
    }
    
Here, the form itself is established to use 1/6 of the available window width. Then, to ensure that input fields retain an appropriate size, we use `calc()` again to establish that they should be the width of their container minus 1em. Then, the following HTML makes use of this CSS:
    
    <form>
      <div id="form-box">
        <label for="misc">Type something:</label>
        <input type="text" id="misc" name="misc" />
      </div>
    </form>
    
### Nesting with CSS variables
You can use `calc()` with CSS variables. Consider the following code:
    
    .foo {
      --width-a: 100px;
      --width-b: calc(var(--width-a) / 2);
      --width-c: calc(var(--width-b) / 2);
      width: var(--width-c);
    }
    
After all variables are expanded, `--width-c`'s value will be `calc(calc(100px / 2) / 2)`. When it's assigned to `.foo`'s width property, all inner `calc()` functions (no matter how deeply nested) will be flattened to just parentheses. Therefore, the `width` property's value will eventually be `calc((100px / 2) / 2)`, which equals `25px`. In short, a `calc()` inside of a `calc()` is identical to using parentheses.
### Adjusting color channels in relative colors
The `calc()` function can be used to adjust individual color channels in relative colors without the need for storing color channel values as variables.
In the example below, the first paragraph uses a `<named-color>`. In the paragraphs that follow, `calc()` is used with the `rgb()` and `hsl()` functions to adjust the values of each color channel relative to the original named color.
    
    <p class="original">Original text color in rebeccapurple</p>
    <p class="increase-hue">Hue increased by 80</p>
    <p class="increase-lightness">Lightness increased by 20</p>
    <p class="decrease-lightness">Lightness decreased by 10</p>
    
    
    .original {
      color: rebeccapurple;
    }
    
    .increase-hue {
      color: lch(from rebeccapurple l c calc(h + 80));
    }
    
    .increase-lightness {
      color: lch(from rebeccapurple calc(l + 20) c h);
    }
    
    .decrease-lightness {
      color: lch(from rebeccapurple calc(l - 10) c h);
    }
    
For another example of using the `calc()` function to derive relative colors, see the Using math functions section on the Using relative colors page.
# inset-inline
The `inset-inline` CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    inset-inline: 5% 10%;
    writing-mode: horizontal-tb;
    
    
    inset-inline: 10px 40px;
    writing-mode: vertical-rl;
    
    
    inset-inline: 5% 10%;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid #ad1457;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #07136c;
      border: 6px solid #ffa000;
      color: white;
      position: absolute;
      inset: 0;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `inset-inline-end`
  * `inset-inline-start`


## Syntax
    
    /* <length> values */
    inset-inline: 3px 10px;
    inset-inline: 2.4em 3em;
    inset-inline: 10px; /* value applied to start and end */
    inset-inline: auto calc(anchor(self-start) + 20px);
    inset-inline: 400px anchor-size(--my-anchor height, 100px);
    
    /* <percentage>s of the width or height of the containing block */
    inset-inline: 10% 5%;
    
    /* Keyword value */
    inset-inline: auto;
    
    /* Global values */
    inset-inline: inherit;
    inset-inline: initial;
    inset-inline: revert;
    inset-inline: revert-layer;
    inset-inline: unset;
    
### Values
The `inset-inline` property takes the same values as the `left` property.
## Examples
>
### Setting inline start and end offsets
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      position: relative;
      inset-inline: 20px 50px;
      background-color: #c8c800;
    }
    
#### Result
# text-align-last
The `text-align-last` CSS property sets how the last line of a block or a line, right before a forced line break, is aligned.
## Try it
    
    text-align-last: right;
    
    
    text-align-last: center;
    
    
    text-align-last: left;
    
    
    <section id="default-example">
      <div>
        <p id="example-element">
          Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
          aliquip ex ea commodo consequat.
        </p>
      </div>
    </section>
    
    
    section {
      font-size: 1.5em;
    }
    
    #default-example > div {
      width: 250px;
    }
    
    #example-element {
      text-align: justify;
    }
    
## Syntax
    
    /* Keyword values */
    text-align-last: auto;
    text-align-last: start;
    text-align-last: end;
    text-align-last: left;
    text-align-last: right;
    text-align-last: center;
    text-align-last: justify;
    
    /* Global values */
    text-align-last: inherit;
    text-align-last: initial;
    text-align-last: revert;
    text-align-last: revert-layer;
    text-align-last: unset;
    
### Values
`auto`
    
The affected line is aligned per the value of `text-align`, unless `text-align` is `justify`, in which case the effect is the same as setting `text-align-last` to `start`.
`start`
    
The same as `left` if direction is left-to-right and `right` if direction is right-to-left.
`end`
    
The same as `right` if direction is left-to-right and `left` if direction is right-to-left.
`left`
    
The inline contents are aligned to the left edge of the line box.
`right`
    
The inline contents are aligned to the right edge of the line box.
`center`
    
The inline contents are centered within the line box.
`justify`
    
The text is justified. Text should line up their left and right edges to the left and right content edges of the paragraph.
## Examples
>
### Justifying the last line
#### CSS
    
    p {
      font-size: 1.4em;
      text-align: justify;
      text-align-last: center;
    }
    
#### Results
# <length>
The `<length>` CSS data type represents a distance value. Lengths can be used in numerous CSS properties, such as `width`, `height`, `margin`, `padding`, `border-width`, `font-size`, and `text-shadow`.
Note: Although `<percentage>` values are usable in some of the same properties that accept `<length>` values, they are not themselves `<length>` values. See `<length-percentage>`.
## Syntax
The `<length>` data type consists of a `<number>` followed by one of the units listed below. As with all CSS dimensions, there is no space between the number and the unit literal. Specifying the length unit is optional if the number is `0`.
Note: Some properties allow negative `<length>` values, while others do not.
The specified value of a length (specified length) is represented by its quantity and unit. The computed value of a length (computed length) is the specified length resolved to an absolute length, and its unit is not distinguished.
The `<length>` units can be relative or absolute. Relative lengths represent a measurement in terms of some other distance. Depending on the unit, this distance can be the size of a specific character, the line height, or the size of the viewport. Style sheets that use relative length units can more easily scale from one output environment to another.
Note: Child elements do not inherit the relative values as specified for their parent; they inherit the computed values.
## Relative length units
CSS relative length units are based on font, container, or viewport sizes.
### Relative length units based on font
Font lengths define the `<length>` value in terms of the size of a particular character or font attribute in the font currently in effect in an element or its parent.
Note: These units, especially `em` and the root relative `rem`, are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size.
`cap`
    
Represents the "cap height" (nominal height of capital letters) of the element's `font`.
`ch`
    
Represents the width or, more precisely, the advance measure of the glyph `0` (zero, the Unicode character U+0030) in the element's `font`. In cases where determining the measure of the `0` glyph is impossible or impractical, it must be assumed to be `0.5em` wide by `1em` tall.
`em`
    
Represents the calculated `font-size` of the element. If used on the `font-size` property itself, it represents the inherited font-size of the element.
`ex`
    
Represents the x-height of the element's `font`. In fonts with the `x` letter, this is generally the height of lowercase letters in the font; `1ex ≈ 0.5em` in many fonts.
`ic`
    
Equal to the used advance measure of the "水" glyph (CJK water ideograph, U+6C34), found in the font used to render it.
`lh`
    
Equal to the computed value of the `line-height` property of the element on which it is used, converted to an absolute length. This unit enables length calculations based on the theoretical size of an ideal empty line. However, the size of actual line boxes may differ based on their content.
### Relative length units based on root element's font
Root element font relative length units define the `<length>` value in terms of the size of a particular character or font attribute of the root element:
`rcap`
    
Equal to the "cap height" (nominal height of capital letters) of the root element's `font`.
`rch`
    
Equal to the width or the advance measure of the glyph `0` (zero, the Unicode character U+0030) in the root element's `font`.
`rem`
    
Represents the `font-size` of the root element (typically `<html>`). When used within the root element `font-size`, it represents its initial value. A common browser default is `16px`, but user-defined preferences may modify this.
`rex`
    
Represents the x-height of the root element's `font`.
`ric`
    
Equal to the value of `ic` unit on the root element's font.
`rlh`
    
Equal to the value of `lh` unit on the root element's font. This unit enables length calculations based on the theoretical size of an ideal empty line. However, the size of actual line boxes may differ based on their content.
### Relative length units based on viewport
The viewport-percentage length units are based on four different viewport sizes: small, large, dynamic, and default. The allowance for the different viewport sizes is in response to browser interfaces expanding and retracting dynamically and hiding and showing the content underneath.
Small viewport units
    
When you want the smallest possible viewport in response to browser interfaces expanding dynamically, you should use the small viewport size. The small viewport size allows the content you design to fill the entire viewport when browser interfaces are expanded. Choosing this size might also possibly leave empty spaces when browser interfaces retract.
For example, an element that is sized using viewport-percentage units based on the small viewport size, the element will fill the screen perfectly without any of its content being obscured when all the dynamic browser interfaces are shown. When those browser interfaces are hidden, however, there might be extra space visible around the element. Therefore, the small viewport-percentage units are "safer" to use in general, but might not produce the most attractive layout after a user starts interacting with the page.
The small viewport size is represented by the `sv` prefix and results in the `sv*` viewport-percentage length units. The sizes of the small viewport-percentage units are fixed, and therefore stable, unless the viewport itself is resized.
Large viewport units
    
When you want the largest possible viewport in response to browser interfaces retracting dynamically, you should use the large viewport size. The large viewport size allows the content you design to fill the entire viewport when browser interfaces are retracting. You need to be aware that the content might get hidden when browser interfaces expand.
For example, on mobile phones where screen real-estate is at a premium, browsers often hide part or all of the title and address bar after a user starts scrolling the page. When an element is sized using a viewport-percentage unit based on the large viewport size, the content of the element will fill the entire visible page when these browser interfaces are hidden. However, when these retractable browser interfaces are shown, they can hide the content that is sized or positioned using the large viewport-percentage units.
The large viewport unit is represented by the `lv` prefix and results in the `lv*` viewport-percentage units. The sizes of the large viewport-percentage units are fixed and therefore stable, unless the viewport itself is resized.
Dynamic viewport units
    
When you want the viewport to be automatically sized in response to browser interfaces dynamically expanding or retracting, you can use the dynamic viewport size. The dynamic viewport size allows the content you design to fit exactly within the viewport, irrespective of the presence of dynamic browser interfaces.
The dynamic viewport unit is represented by the `dv` prefix and results in the `dv*` viewport-percentage units. The sizes of the dynamic viewport-percentage units are not stable, even when the viewport itself is unchanged.
Note: While the dynamic viewport size can give you more control and flexibility, using viewport-percentage units based on the dynamic viewport size can cause the content to resize while a user is scrolling a page. This can lead to degradation of the user interface and cause a performance hit.
Default viewport units
    
The default viewport size is defined by the browser. The behavior of the resulting viewport-percentage unit could be equivalent to the viewport-percentage unit based on the small viewport size, the large viewport size, an intermediate size between the two, or the dynamic viewport size.
Note: For example, a browser might implement the default viewport-percentage unit for height (`vh`) that is equivalent to the large viewport-percentage height unit (`lvh`). If so, this could obscure content on a full-page display while the browser interface is expanded. Currently, all default viewport units (`vh`, `vw`, etc.) are equivalent to their large viewport counterparts (`lvh`, `lvw`, etc.).
Viewport-percentage lengths define `<length>` values in percentage relative to the size of the initial containing block, which in turn is based on either the size of the viewport or the page area, i.e., the visible portion of the document. When the height or width of the initial containing block is changed, the elements that are sized based on them are scaled accordingly. There is a viewport-percentage length unit variant corresponding to each of the viewport sizes, as described below.
Note: Viewport lengths are invalid in `@page` declaration blocks.
`vh`
    
Represents a percentage of the height of the viewport's initial containing block. `1vh` is 1% of the viewport height. For example, if the viewport height is `300px`, then a value of `70vh` on a property will be `210px`.
The respective viewport-percentage units for small, large, and dynamic viewport sizes are `svh`, `lvh`, and `dvh`. `vh` is equivalent to `lvh`, representing the viewport-percentage length unit based on the large viewport size.
`vw`
    
Represents a percentage of the width of the viewport's initial containing block. `1vw` is 1% of the viewport width. For example, if the viewport width is `800px`, then a value of `50vw` on a property will be `400px`.
For small, large, and dynamic viewport sizes, the respective viewport-percentage units are `svw`, `lvw`, and `dvw`. `vw` is equivalent to `lvw`, representing the viewport-percentage length unit based on the large viewport size.
`vmax`
    
Represents in percentage the largest of `vw` and `vh`.
For small, large, and dynamic viewport sizes, the respective viewport-percentage units are `svmax`, `lvmax`, and `dvmax`. `vmax` is equivalent to `lvmax`, representing the viewport-percentage length unit based on the large viewport size.
`vmin`
    
Represents in percentage the smallest of `vw` and `vh`.
For small, large, and dynamic viewport sizes, the respective viewport-percentage units are `svmin`, `lvmin`, and `dvmin`. `vmin` is equivalent to `lvmin`, representing the viewport-percentage length unit based on the large viewport size.
`vb`
    
Represents the percentage of the size of the initial containing block, in the direction of the root element's block axis.
For small, large, and dynamic viewport sizes, the respective viewport-percentage units are `svb`, `lvb`, and `dvb`, respectively. `vb` is equivalent to `lvb`, representing the viewport-percentage length unit based on the large viewport size.
`vi`
    
Represents a percentage of the size of the initial containing block, in the direction of the root element's inline axis.
For small, large, and dynamic viewport sizes, the respective viewport-percentage units are `svi`, `lvi`, and `dvi`. `vi` is equivalent to `lvi`, representing the viewport-percentage length unit based on the large viewport size.
### Container query length units
When applying styles to a container using container queries, you can use container query length units. These units specify a length relative to the dimensions of a query container. Components that use units of length relative to their container are more flexible to use in different containers without having to recalculate concrete length values.
If no eligible container is available for the query, the container query length unit defaults to the small viewport unit for that axis (`sv*`).
For more information, see Container queries.
`cqw`
    
Represents a percentage of the width of the query container. `1cqw` is 1% of the query container's width. For example, if the query container's width is `800px`, then a value of `50cqw` on a property will be `400px`.
`cqh`
    
Represents a percentage of the height of the query container. `1cqh` is 1% of the query container's height. For example, if the query container's height is `300px`, then a value of `10cqh` on a property will be `30px`.
`cqi`
    
Represents a percentage of the inline size of the query container. `1cqi` is 1% of the query container's inline size. For example, if the query container's inline size is `800px`, then a value of `50cqi` on a property will be `400px`.
`cqb`
    
Represents a percentage of the block size of the query container. `1cqb` is 1% of the query container's block size. For example, if the query container's block size is `300px`, then a value of `10cqb` on a property will be `30px`.
`cqmin`
    
Represents a percentage of the smaller value of either the query container's inline size or block size. `1cqmin` is 1% of the smaller value of either the query container's inline size or block size. For example, if the query container's inline size is `800px` and its block size is `300px`, then a value of `50cqmin` on a property will be `150px`.
`cqmax`
    
Represents a percentage of the larger value of either the query container's inline size or block size. `1cqmax` is 1% of the larger value of either the query container's inline size or block size. For example, if the query container's inline size is `800px` and its block size is `300px`, then a value of `50cqmax` on a property will be `400px`.
## Absolute length units
Absolute length units represent a physical measurement when the physical properties of the output medium are known, such as for print layout. This is done by anchoring one of the units to a physical unit or the visual angle unit and then defining the others relative to it. Physical units include `cm`, `in`, `mm`, `pc`, `pt`, `px`, and `Q`.The anchoring is done differently for low-resolution devices, such as screens, versus high-resolution devices, such as printers.
For low-dpi devices, the unit `px` represents the physical reference pixel; other units are defined relative to it. Thus, `1in` is defined as `96px`, which equals `72pt`. The consequence of this definition is that on such devices, dimensions described in inches (`in`), centimeters (`cm`), or millimeters (`mm`) don't necessarily match the size of the physical unit with the same name.
For high-dpi devices, inches (`in`), centimeters (`cm`), and millimeters (`mm`) are the same as their physical counterparts. Therefore, the `px` unit is defined relative to them (1/96 of `1in`).
Note: Many users increase their user agent's default font size to make text more legible. Absolute lengths can cause accessibility problems because they are fixed and do not scale according to user settings. For this reason, prefer relative lengths (such as `em` or `rem`) when setting `font-size`.
`px`
    
One pixel. For screen displays, it traditionally represents one device pixel (dot). However, for printers and high-resolution screens, one CSS pixel implies multiple device pixels. `1px` = `1in / 96`.
`cm`
    
One centimeter. `1cm` = `96px / 2.54`.
`mm`
    
One millimeter. `1mm` = `1cm / 10`.
`Q`
    
One quarter of a millimeter. `1Q` = `1cm / 40`.
`in`
    
One inch. `1in` = `2.54cm` = `96px`.
`pc`
    
One pica. `1pc` = `12pt` = `1in / 6`.
`pt`
    
One point. `1pt` = `1in / 72`.
## Interpolation
When animated, values of the `<length>` data type are interpolated as real, floating-point numbers. The interpolation happens on the calculated value. The speed of the interpolation is determined by the easing function associated with the animation.
## Examples
>
### Comparing different length units
The following example provides you with an input field in which you can enter a `<length>` value (e.g., `300px`, `50%`, `30vw`) to set the width of a result bar that will appear below it once you've pressed the `Enter` or the `Return` key.
This allows you to compare and contrast the effects of different length units.
#### HTML
    
    <div class="outer">
      <div class="input-container">
        <label for="length">Enter width:</label>
        <input type="text" id="length" />
      </div>
      <div class="inner"></div>
    </div>
    <div class="results"></div>
    
#### CSS
    
    html {
      font-family: sans-serif;
      font-weight: bold;
      box-sizing: border-box;
    }
    
    .outer {
      width: 100%;
      height: 50px;
      background-color: #eeeeee;
      position: relative;
    }
    
    .inner {
      height: 50px;
      background-color: #999999;
      box-shadow:
        inset 3px 3px 5px rgb(255 255 255 / 50%),
        inset -3px -3px 5px rgb(0 0 0 / 50%);
    }
    
    .result {
      height: 20px;
      box-shadow:
        inset 3px 3px 5px rgb(255 255 255 / 50%),
        inset -3px -3px 5px rgb(0 0 0 / 50%);
      background-color: orange;
      display: flex;
      align-items: center;
      margin-top: 10px;
    }
    
    .result code {
      position: absolute;
      margin-left: 20px;
    }
    
    .results {
      margin-top: 10px;
    }
    
    .input-container {
      position: absolute;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      height: 50px;
    }
    
    label {
      margin: 0 10px 0 20px;
    }
    
#### JavaScript
    
    const inputDiv = document.querySelector(".inner");
    const inputElem = document.querySelector("input");
    const resultsDiv = document.querySelector(".results");
    
    inputElem.addEventListener("change", () => {
      inputDiv.style.width = inputElem.value;
    
      const result = document.createElement("div");
      result.className = "result";
      result.style.width = inputElem.value;
      const code = document.createElement("code");
      code.textContent = `width: ${inputElem.value}`;
      result.appendChild(code);
      resultsDiv.appendChild(result);
    
      inputElem.value = "";
      inputElem.focus();
    });
    
#### Result
# border-style
The `border-style` shorthand CSS property sets the line style for all four sides of an element's border.
## Try it
    
    border-style: none;
    
    
    border-style: dotted;
    
    
    border-style: inset;
    
    
    border-style: dashed solid;
    
    
    border-style: dashed double none;
    
    
    border-style: dashed groove none dotted;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
    body {
      background-color: white;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-bottom-style`
  * `border-left-style`
  * `border-right-style`
  * `border-top-style`


## Syntax
    
    /* Keyword values */
    border-style: none;
    border-style: hidden;
    border-style: dotted;
    border-style: dashed;
    border-style: solid;
    border-style: double;
    border-style: groove;
    border-style: ridge;
    border-style: inset;
    border-style: outset;
    
    /* top and bottom | left and right */
    border-style: dotted solid;
    
    /* top | left and right | bottom */
    border-style: hidden double dashed;
    
    /* top | right | bottom | left */
    border-style: none solid dotted dashed;
    
    /* Global values */
    border-style: inherit;
    border-style: initial;
    border-style: revert;
    border-style: revert-layer;
    border-style: unset;
    
The `border-style` property may be specified using one, two, three, or four values.
  * When one value is specified, it applies the same style to all four sides.
  * When two values are specified, the first style applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first style applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the styles apply to the top, right, bottom, and left in that order (clockwise).


Each value is a keyword chosen from the list below.
### Values
`<line-style>`
    
Describes the style of the border. It can have the following values:
`none`
    
Like the `hidden` keyword, displays no border. Unless a `background-image` is set, the computed value of the same side's `border-width` will be `0`, even if the specified value is something else. In the case of table cell and border collapsing, the `none` value has the lowest priority: if any other conflicting border is set, it will be displayed.
`hidden`
    
Like the `none` keyword, displays no border. Unless a `background-image` is set, the computed value of the same side's `border-width` will be `0`, even if the specified value is something else. In the case of table cell and border collapsing, the `hidden` value has the highest priority: if any other conflicting border is set, it won't be displayed.
`dotted`
    
Displays a series of rounded dots. The spacing of the dots is not defined by the specification and is implementation-specific. The radius of the dots is half the computed value of the same side's `border-width`.
`dashed`
    
Displays a series of short square-ended dashes or line segments. The exact size and length of the segments are not defined by the specification and are implementation-specific.
`solid`
    
Displays a single, straight, solid line.
`double`
    
Displays two straight lines that add up to the pixel size defined by `border-width`.
`groove`
    
Displays a border with a carved appearance. It is the opposite of `ridge`.
`ridge`
    
Displays a border with an extruded appearance. It is the opposite of `groove`.
`inset`
    
Displays a border that makes the element appear embedded. It is the opposite of `outset`. When applied to a table cell with `border-collapse` set to `collapsed`, this value behaves like `ridge`.
`outset`
    
Displays a border that makes the element appear embossed. It is the opposite of `inset`. When applied to a table cell with `border-collapse` set to `collapsed`, this value behaves like `groove`.
## Examples
>
### All property values
Here is an example of all the property values.
#### HTML
    
    <pre class="b1">none</pre>
    <pre class="b2">hidden</pre>
    <pre class="b3">dotted</pre>
    <pre class="b4">dashed</pre>
    <pre class="b5">solid</pre>
    <pre class="b6">double</pre>
    <pre class="b7">groove</pre>
    <pre class="b8">ridge</pre>
    <pre class="b9">inset</pre>
    <pre class="b10">outset</pre>
    
#### CSS
    
    pre {
      height: 80px;
      width: 120px;
      margin: 20px;
      padding: 20px;
      display: inline-block;
      background-color: palegreen;
      border-width: 5px;
      box-sizing: border-box;
    }
    
    /* border-style example classes */
    .b1 {
      border-style: none;
    }
    
    .b2 {
      border-style: hidden;
    }
    
    .b3 {
      border-style: dotted;
    }
    
    .b4 {
      border-style: dashed;
    }
    
    .b5 {
      border-style: solid;
    }
    
    .b6 {
      border-style: double;
    }
    
    .b7 {
      border-style: groove;
    }
    
    .b8 {
      border-style: ridge;
    }
    
    .b9 {
      border-style: inset;
    }
    
    .b10 {
      border-style: outset;
    }
    
#### Result
# :first
The `:first` CSS pseudo-class, used with the `@page` at-rule, represents the first page of a printed document. (See `:first-child` for general first element of a node.)
    
    /* Selects the first page when printing */
    @page :first {
      margin-left: 50%;
      margin-top: 50%;
    }
    
Note: You can't change all CSS properties with this pseudo-class. You can only change the margins, `orphans`, `widows`, and page breaks of the document. Furthermore, you may only use absolute-length units when defining the margins. All other properties will be ignored.
## Syntax
    
    :first {
      /* ... */
    }
    
## Examples
>
### Using `:first` for page print styles
Press the "Print!" button to print the example. The words on the first page should be somewhere around the center, while other pages will have their contents at the default position:
    
    <p>First Page.</p>
    <p>Second Page.</p>
    <button>Print!</button>
    
    
    @page :first {
      size: 8.5in 11in;
      margin-left: 3in;
      margin-top: 5in;
    }
    
    p {
      page-break-after: always;
      font: 1.2em sans-serif;
    }
    
    
    document.querySelector("button").addEventListener("click", () => {
      window.print();
    });
    
# break-inside
The `break-inside` CSS property sets how page, column, or region breaks should behave inside a generated box. If there is no generated box, the property is ignored.
## Try it
    
    break-inside: auto;
    
    
    break-inside: avoid;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'break-before'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    @media print {
      #example-element {
        height: 25cm;
      }
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Keyword values */
    break-inside: auto;
    break-inside: avoid;
    break-inside: avoid-page;
    break-inside: avoid-column;
    break-inside: avoid-region;
    
    /* Global values */
    break-inside: inherit;
    break-inside: initial;
    break-inside: revert;
    break-inside: revert-layer;
    break-inside: unset;
    
Each possible break point (in other words, each element boundary) is affected by three properties: the `break-after` value of the previous element, the `break-before` value of the next element, and the `break-inside` value of the containing element.
To determine if a break must be done, the following rules are applied:
  1. If any of the three concerned values is a forced break value (`always`, `left`, `right`, `page`, `column`, or `region`), it has precedence. If more than one of them are such a break, the value of the element that appears the latest in the flow is used. Thus, the `break-before` value has precedence over the `break-after` value, which in turn has precedence over the `break-inside` value.
  2. If any of the three concerned values is an avoid break value (`avoid`, `avoid-page`, `avoid-region`, or `avoid-column`), no such break will be applied at that point.


Once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding `avoid` value.
### Values
`auto`
    
Allows, but does not force, any break (page, column, or region) to be inserted within the principal box.
`avoid`
    
Avoids any break (page, column, or region) from being inserted within the principal box.
`avoid-page`
    
Avoids any page break within the principal box.
`avoid-column`
    
Avoids any column break within the principal box.
`avoid-region`
    
Avoids any region break within the principal box.
## Page break aliases
For compatibility reasons, the legacy `page-break-inside` property should be treated by browsers as an alias of `break-inside`. This ensures that sites using `page-break-inside` continue to work as designed. A subset of values should be aliased as follows:
page-break-inside break-inside  
`auto` `auto`  
`avoid` `avoid`  
## Examples
>
### Avoiding breaking inside a figure
In the following example we have a container that contains an `<h1>` spanning all columns (achieved using `column-span: all`) and a series of paragraphs laid out in multiple columns using `column-width: 200px`. We also have a `<figure>` containing an image and a caption.
By default, it is possible for you to get a break between the image and its caption, which is not what we want. To avoid this, we have set `break-inside: avoid` on the `<figure>`, which causes them to always stay together.
#### HTML
    
    <article>
      <h1>Main heading</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae
        fringilla mauris. Quisque commodo eget nisi sed pretium. Mauris luctus nec
        lacus in ultricies. Mauris vitae hendrerit arcu, ac scelerisque lacus.
        Aliquam lobortis in lacus sit amet posuere. Fusce iaculis urna id neque
        dapibus, eu lacinia lectus dictum.
      </p>
    
      <figure>
        <img
          src="https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png" />
        <figcaption>The Firefox logo — fox wrapped around the world</figcaption>
      </figure>
    
      <p>
        Praesent condimentum dui dui, sit amet rutrum diam tincidunt eu. Cras
        suscipit porta leo sit amet rutrum. Sed vehicula ornare tincidunt. Curabitur
        a ipsum ac diam mattis volutpat ac ut elit. Nullam luctus justo non
        vestibulum gravida. Morbi metus libero, pharetra non porttitor a, molestie
        nec nisi.
      </p>
    
      <p>
        In finibus viverra enim vel suscipit. Quisque consequat velit eu orci
        malesuada, ut interdum tortor molestie. Proin sed pellentesque augue. Nam
        risus justo, faucibus non porta a, congue vel massa. Cras luctus lacus nisl,
        sed tincidunt velit pharetra ac. Duis suscipit faucibus dui sed ultricies.
      </p>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
    }
    
    body {
      width: 80%;
      margin: 0 auto;
    }
    
    h1 {
      font-size: 3rem;
      letter-spacing: 2px;
      column-span: all;
    }
    
    h1 + p {
      margin-top: 0;
    }
    
    p {
      line-height: 1.5;
      break-after: column;
    }
    
    figure {
      break-inside: avoid;
    }
    
    img {
      max-width: 70%;
      display: block;
      margin: 0 auto;
    }
    
    figcaption {
      font-style: italic;
      font-size: 0.8rem;
      width: 70%;
    }
    
    article {
      column-width: 200px;
      gap: 20px;
    }
    
### Result
# corner-top-right-shape
The `corner-top-right-shape` CSS property specifies the shape of a box's top-right corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-top-right-shape: scoop;
    corner-top-right-shape: square;
    
    /* superellipse() function values */
    corner-top-right-shape: superellipse(2.2);
    corner-top-right-shape: superellipse(-2.5);
    
    /* Global values */
    corner-top-right-shape: inherit;
    corner-top-right-shape: initial;
    corner-top-right-shape: revert;
    corner-top-right-shape: revert-layer;
    corner-top-right-shape: unset;
    
### Values
The `corner-top-right-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-top-right-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of 60 pixels, and a `corner-top-right-shape` of `bevel`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px;
      corner-top-right-shape: bevel;
    }
    
#### Result
The rendered result looks like this:
# top
The `top` CSS property sets the vertical position of a positioned element. This inset property has no effect on non-positioned elements.
## Try it
    
    top: 0;
    
    
    top: 4em;
    
    
    top: 10%;
    
    
    top: 20px;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #264653;
      border: 4px solid #ffb500;
      color: white;
      position: absolute;
      width: 140px;
      height: 60px;
    }
    
The effect of `top` depends on how the element is positioned (i.e., the value of the `position` property):
  * When `position` is set to `absolute` or `fixed`, the `top` property specifies the distance between the element's outer margin of the top edge and the inner border of the top edge of its containing block, or, in the case of anchor positioned elements when the `anchor()` function is used within the value, relative to the specified `<anchor-side>` edge. The `top` property is compatible with the `top`, `bottom`, `start`, `end`, `self-start`, `self-end`, `center`, and `<percentage>` values.
  * When `position` is set to `relative`, the `top` property specifies the distance the element's top edge is moved below its normal position.
  * When `position` is set to `sticky`, the `top` property is used to compute the sticky-constraint rectangle.
  * When `position` is set to `static`, the `top` property has no effect.


When both `top` and `bottom` values are specified, there are three different cases:
  * If `position` is set to `absolute` or `fixed` and `height` is unspecified (either `auto` or `100%`), both the `top` and `bottom` values are respected.
  * If `position` is set to `relative` or `height` is constrained, the `top` property takes precedence and the `bottom` property is ignored.
  * If `position` is set to `sticky`, both `top` and `bottom` values are considered. This means that a sticky element can potentially move up and down within its containing block based on the values of these two properties as long as the element's position box remains contained within its containing block.


## Syntax
    
    /* <length> values */
    top: 3px;
    top: 2.4em;
    top: anchor(bottom);
    top: anchor-size(--my-anchor self-block, 10%);
    
    /* <percentage>s of the height of the containing block */
    top: 10%;
    
    /* Keyword value */
    top: auto;
    
    /* Global values */
    top: inherit;
    top: initial;
    top: revert;
    top: revert-layer;
    top: unset;
    
### Values
`<length>`
    
A negative, null, or positive `<length>`:
  * for absolutely positioned elements, it represents the distance to the top edge of the containing block.
  * for anchor-positioned elements, the `anchor()` function resolves to a `<length>` value relative to the position of the associated anchor element's top or bottom edge (see Using inset properties with `anchor()` function values), and the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element position based on anchor size).
  * for relatively positioned elements, it represents the distance that the element is moved below its normal position.


`<percentage>`
    
A `<percentage>` of the containing block's height.
`auto`
    
Specifies that:
  * for absolutely positioned elements, the position of the element is based on the `bottom` property, while `height: auto` is treated as a height based on the content; or if `bottom` is also `auto`, the element is positioned where it should vertically be positioned if it were a static element.
  * for relatively positioned elements, the distance of the element from its normal position is based on the `bottom` property; or if `bottom` is also `auto`, the element is not moved vertically at all.


## Examples
>
### A positioned element set 10% from the top
    
    body {
      background: beige;
    }
    
    div {
      position: absolute;
      top: 10%;
      right: 40%;
      bottom: 20%;
      left: 15%;
      background: gold;
      border: 1px solid blue;
    }
    
    
    <div>The size of this content is determined by the position of its edges.</div>
    
# line-break
The `line-break` CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols.
## Try it
    
    line-break: auto;
    
    
    line-break: anywhere;
    
    
    line-break: normal;
    
    
    line-break: loose;
    
    
    <section id="default-example">
      <p id="example-element">
        この喫茶店は、いつでもコーヒーの香りを漂わせています。<br />彼女はこの喫茶店で働いて、着々と実力をつけていきました。<br />今では知る人ぞ知る、名人です。
      </p>
    </section>
    
    
    #example-element {
      font-family: "Yu Gothic", YuGothic, Meiryo, "ＭＳ ゴシック", sans-serif;
      border: 2px dashed #999999;
      text-align: left;
      width: 240px;
      font-size: 16px;
    }
    
## Syntax
    
    /* Keyword values */
    line-break: auto;
    line-break: loose;
    line-break: normal;
    line-break: strict;
    line-break: anywhere;
    
    /* Global values */
    line-break: inherit;
    line-break: initial;
    line-break: revert;
    line-break: revert-layer;
    line-break: unset;
    
### Values
`auto`
    
Break text using the default line break rule.
`loose`
    
Break text using the least restrictive line break rule. Typically used for short lines, such as in newspapers.
`normal`
    
Break text using the most common line break rule.
`strict`
    
Break text using the most stringent line break rule.
`anywhere`
    
There is a soft wrap opportunity around every typographic character unit, including around any punctuation character or preserved white spaces, or in the middle of words, disregarding any prohibition against line breaks, even those introduced by characters with the GL, WJ, or ZWJ character class or mandated by the `word-break` property. The different wrapping opportunities must not be prioritized. Hyphenation is not applied.
## Examples
>
### Setting text wrapping
See whether the text is wrapped before "々", "ぁ" and "。".
#### HTML
    
    <div lang="ja">
      <p class="wrap-box auto">
        auto:<br />そこは湖のほとりで木々が輝いていた。<br />その景色に、美しいなぁと思わずつぶやいた。
      </p>
      <p class="wrap-box loose">
        loose:<br />そこは湖のほとりで木々が輝いていた。<br />その景色に、美しいなぁと思わずつぶやいた。
      </p>
      <p class="wrap-box normal">
        normal:<br />そこは湖のほとりで木々が輝いていた。<br />その景色に、美しいなぁと思わずつぶやいた。
      </p>
      <p class="wrap-box strict">
        strict:<br />そこは湖のほとりで木々が輝いていた。<br />その景色に、美しいなぁと思わずつぶやいた。
      </p>
      <p class="wrap-box anywhere">
        anywhere:<br />そこは湖のほとりで木々が輝いていた。<br />その景色に、美しいなぁと思わずつぶやいた。
      </p>
    </div>
    
#### CSS
    
    .wrap-box {
      width: 10em;
      margin: 0.5em;
      white-space: normal;
      vertical-align: top;
      display: inline-block;
    }
    .auto {
      line-break: auto;
    }
    .loose {
      line-break: loose;
    }
    .normal {
      line-break: normal;
    }
    .strict {
      line-break: strict;
    }
    .anywhere {
      line-break: anywhere;
    }
    
#### Result
# CSS lists and counters
The CSS lists and counters module enables styling and positioning of list item bullets and manipulating their values with a combination of strings, counters, and other features.
A list item's marker, whether a bullet symbol or ordinal counter, is its defining feature. List items are not limited to `<li>` elements nested within `<ol>` or `<ul>` elements. Rather, list items are any element with `display: list-item` set.
This module defines CSS features to set and reset a list's counters, set which counter-styles or symbols to use as its markers, and position those markers. It also provides developers with the ability to create customized markers.
## Reference
>
### Properties
  * `counter-increment`
  * `counter-reset`
  * `counter-set`
  * `list-style-image`
  * `list-style-type`
  * `list-style-position`
  * `list-style` shorthand


There is also a `marker-side` property, which is yet to be fully defined or implemented.
### Pseudo-elements
  * `::marker`


### Functions
  * `counter()`
  * `counters()`


### Data types
  * `<counter>`
  * `<counter-name>`
  * `<counter-style>`


## Guides
Consistent list indentation
    
Explains how to achieve consistent list indentation across different browsers.
Using CSS Counters
    
Explains how to use the CSS counter properties to control list counters.
## Related concepts
  * CSS counter styles
    * `@counter-style` at-rule
    * `<counter-style-name>` data type
    * `<symbol>` data type
    * `symbols()` function
  * `<ol>` `start`, `reversed`, and `type` attributes
  * `<ul>` `type` attribute
  * `<li>` `type` and `value` attributes


# background-clip
The `background-clip` CSS property sets whether an element's background extends underneath its border box, padding box, or content box.
## Try it
    
    background-clip: border-box;
    
    
    background-clip: padding-box;
    
    
    background-clip: content-box;
    
    
    background-clip: text;
    color: transparent;
    text-shadow: none;
    
    
    <section id="default-example">
      <div id="example-element">This is the content of the element.</div>
    </section>
    
    
    #example-element {
      background-image: url("/shared-assets/images/examples/leopard.jpg");
      color: white;
      text-shadow: 2px 2px black;
      padding: 20px;
      border: 10px dashed #333333;
      font-size: 2em;
      font-weight: bold;
    }
    
The background is always drawn behind the border, so `background-clip: border-box` has a visual effect only when the border is partially opaque or has transparent or partially opaque regions. Also, the `background-clip: text` property has little to no visual effect if the text is fully or partially opaque.
Note: Because the root element has a different background painting area, the `background-clip` property has no effect when specified on it. See "The backgrounds of special elements."
Note: For documents whose root element is an HTML element: if the computed value of `background-image` on the root element is `none` and its `background-color` is `transparent`, user agents must instead propagate the computed values of the `background` properties from that element's first HTML `<body>` child element. The used values of that `<body>` element's `background` properties are their initial values, and the propagated values are treated as if they were specified on the root element. It is recommended that authors of HTML documents specify the canvas background for the `<body>` element rather than the HTML element.
## Syntax
    
    /* Keyword values */
    background-clip: border-box;
    background-clip: padding-box;
    background-clip: content-box;
    background-clip: text;
    background-clip: border-area;
    
    /* Global values */
    background-clip: inherit;
    background-clip: initial;
    background-clip: revert;
    background-clip: revert-layer;
    background-clip: unset;
    
### Values
`border-box`
    
The background extends to the outside edge of the border (but underneath the border in z-ordering).
`padding-box`
    
The background extends to the outside edge of the padding. No background is drawn beneath the border.
`content-box`
    
The background is painted within (clipped to) the content box.
`text`
    
The background is painted within (clipped to) the foreground text.
`border-area`
    
The background is painted within (clipped to) the area painted by the border, taking `border-width` and `border-style` into account but ignoring any transparency introduced by `border-color`.
## Accessibility
When using `background-clip: text`, check that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page.
If the background image does not load, this could also lead to the text becoming unreadable. Add a fallback `background-color` to prevent this from happening, and test without the image.
Consider using feature queries with `@supports` to test for support of `background-clip: text` and provide an accessible alternative where it is not supported.
## Examples
>
### HTML
    
    <p class="border-box">The background extends behind the border.</p>
    <p class="padding-box">
      The background extends to the inside edge of the border.
    </p>
    <p class="content-box">
      The background extends only to the edge of the content box.
    </p>
    <p class="text">The background is clipped to the foreground text.</p>
    <p class="border-area">
      The background is clipped to the area painted by the border.
    </p>
    
### CSS
    
    p {
      border: 0.8em darkviolet;
      border-style: dotted double;
      margin: 1em 0;
      padding: 1.4em;
      background: linear-gradient(60deg, red, yellow, red, yellow, red);
      font: 900 1.2em sans-serif;
      text-decoration: underline;
    }
    
    .border-box {
      background-clip: border-box;
    }
    .padding-box {
      background-clip: padding-box;
    }
    .content-box {
      background-clip: content-box;
    }
    
    .text {
      background-clip: text;
      color: rgb(0 0 0 / 20%);
    }
    
    .border-area {
      background-clip: border-area;
      border-color: transparent;
    }
    
#### Result
# background-origin
The `background-origin` CSS property sets the background's origin: from the border start, inside the border, or inside the padding.
## Try it
    
    background-origin: border-box;
    background-repeat: no-repeat;
    
    
    background-origin: padding-box;
    background-repeat: no-repeat;
    
    
    background-origin: content-box;
    background-repeat: no-repeat;
    
    
    <section id="default-example">
      <div id="example-element">This is the content of the element.</div>
    </section>
    
    
    #example-element {
      background-image: url("/shared-assets/images/examples/leopard.jpg");
      color: #d73611;
      text-shadow: 2px 2px black;
      padding: 20px;
      border: 10px dashed #333333;
      font-size: 2em;
      font-weight: bold;
    }
    
Note that `background-origin` is ignored when `background-attachment` is `fixed`.
## Syntax
    
    /* Keyword values */
    background-origin: border-box;
    background-origin: padding-box;
    background-origin: content-box;
    
    /* Global values */
    background-origin: inherit;
    background-origin: initial;
    background-origin: revert;
    background-origin: revert-layer;
    background-origin: unset;
    
The `background-origin` property is specified as one of the keyword values listed below.
### Values
`border-box`
    
The background is positioned relative to the border box.
`padding-box`
    
The background is positioned relative to the padding box. Default value.
`content-box`
    
The background is positioned relative to the content box.
## Examples
>
### Setting background origins
    
    .example {
      border: 10px double;
      padding: 10px;
      background: url("image.jpg");
      background-position: center left;
      background-origin: content-box;
    }
    
    
    #example2 {
      border: 4px solid black;
      padding: 10px;
      background: url("image.gif");
      background-repeat: no-repeat;
      background-origin: border-box;
    }
    
    
    div {
      background-image:
        url("logo.jpg"), url("main-back.png"); /* Applies two images to the background */
      background-position:
        top right,
        0px 0px;
      background-origin: content-box, padding-box;
    }
    
### Using two gradients
In this example the box has a thick dotted border. The first gradient uses the `padding-box` as the `background-origin` and therefore the background sits inside the border. The second uses the `content-box` and so only displays behind the content.
    
    .box {
      margin: 10px 0;
      color: white;
      background:
        linear-gradient(
          90deg,
          rgb(131 58 180 / 100%) 0%,
          rgb(253 29 29 / 60%) 60%,
          rgb(252 176 69 / 100%) 100%
        ),
        radial-gradient(circle, white 0%, black 28%);
      border: 20px dashed black;
      padding: 20px;
      width: 400px;
      background-origin: padding-box, content-box;
      background-repeat: no-repeat;
    }
    
    
    <div class="box">Hello!</div>
    
# rem()
The `rem()` CSS function returns a remainder left over when the first parameter is divided by the second parameter, similar to the JavaScript remainder operator (`%`). The remainder is the value left over when one operand, the dividend, is divided by a second operand, the divisor. It always takes the sign of the dividend.
Note: To read about the unit `rem`, see the `<length>` page.
For example, the CSS `rem(27, 5)` function returns the remainder of `2`. When dividing 27 by 5, the result is 5 with a remainder of 2. The full calculation is `27 / 5 = 5 * 5 + 2`.
## Syntax
    
    /* Unitless <number> */
    line-height: rem(21, 2); /* 1 */
    line-height: rem(14, 5); /* 4 */
    line-height: rem(5.5, 2); /* 1.5 */
    
    /* Unit based <percentage> and <dimension> */
    margin: rem(14%, 3%); /* 2% */
    margin: rem(18px, 5px); /* 3px */
    margin: rem(10rem, 6rem); /* 4rem */
    margin: rem(26vmin, 7vmin); /* 5vmin */
    margin: rem(1000px, 29rem); /* 72px - if root font-size is 16px */
    
    /* Negative/positive values */
    rotate: rem(200deg, 30deg); /* 20deg */
    rotate: rem(140deg, -90deg); /* 50deg */
    rotate: rem(-90deg, 20deg); /* -10deg */
    rotate: rem(-55deg, -15deg); /* -10deg */
    
    /* Calculations */
    scale: rem(10 * 2, 1.7); /* 1.3 */
    rotate: rem(10turn, 18turn / 3); /* 4turn */
    transition-duration: rem(20s / 2, 3000ms * 2); /* 4s */
    
### Parameters
The `rem(dividend, divisor)` function accepts two comma-separated values as its parameters. Both parameters must have the same type, number, dimension, or `<percentage>`, for the function to be valid. While the units in the two parameters don't need to be the same, they do need of the same dimension type, such as `<length>`, `<angle>`, `<time>`, or `<frequency>` to be valid.
`dividend`
    
A calculation that resolves to a `<number>`, `<dimension>`, or `<percentage>` representing the dividend.
`divisor`
    
A calculation that resolves to a `<number>`, `<dimension>`, or `<percentage>` representing the divisor.
### Return value
Returns a `<number>`, `<dimension>`, or `<percentage>` (corresponds to the parameters' type) representing the remainder, that is, the operation left over.
  * If `divisor` is `0`, the result is `NaN`.
  * If `dividend` is `infinite`, the result is `NaN`.
  * If `dividend` is positive the result is positive (`0⁺`), and if `dividend` is negative the result is negative (`0⁻`).


# :link
The `:link` CSS pseudo-class represents an element that has not yet been visited. It matches every unvisited `<a>` or `<area>` element that has an `href` attribute.
## Try it
    
    p {
      font-weight: bold;
    }
    
    a:link {
      color: forestgreen;
      text-decoration-color: hotpink;
    }
    
    
    <p>Pages that you might have visited:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org">MDN Web Docs</a>
      </li>
      <li>
        <a href="https://www.youtube.com/">YouTube</a>
      </li>
    </ul>
    <p>Pages unlikely to be in your history:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org/missing-2">Random MDN page</a>
      </li>
      <li>
        <a href="https://example.com/missing-2">Random Example page</a>
      </li>
    </ul>
    
Styles defined by the `:link` and `:visited` pseudo-classes can be overridden by any subsequent user-action pseudo-classes (`:hover` or `:active`) that have at least equal specificity. To style links appropriately, put the `:link` rule before all other link-related rules, as defined by the LVHA-order: `:link` — `:visited` — `:hover` — `:active`. The `:visited` pseudo-class and `:link` pseudo-class are mutually exclusive.
Note: Use `:any-link` to select an element independent of whether it has been visited or not.
## Syntax
    
    :link {
      /* ... */
    }
    
## Examples
By default, most browsers apply a special `color` value to visited links. Thus, the links in this example will probably have special font colors only before you visit them. (After that, you'll need to clear your browser history to see them again.) However, the `background-color` values are likely to remain, as most browsers do not set that property on visited links by default.
### HTML
    
    <a href="#ordinary-target">This is an ordinary link.</a><br />
    <a href="">You've already visited this link.</a><br />
    <a>Placeholder link (won't get styled)</a>
    
### CSS
    
    a:link {
      background-color: gold;
      color: green;
    }
    
### Result
# pow()
The `pow()` CSS function is an exponential function that returns the value of a base raised to the power of a number.
The `exp()` function is a special case of `pow()` where the value of the base is the mathematical constant e.
## Syntax
    
    /* A <number> value */
    width: calc(10px * pow(5, 2)); /* 10px * 25 = 250px */
    width: calc(10px * pow(5, 3)); /* 10px * 125 = 1250px */
    width: calc(10px * pow(2, 10)); /* 10px * 1024 = 10240px */
    
### Parameters
The `pow(base, number)` function accepts two comma-separated values as its parameters.
`base`
    
A calculation that resolves to a `<number>`, representing the base.
`number`
    
A calculation that resolves to a `<number>`, representing the exponent.
### Return value
Returns a `<number>` representing basenumber, that is, `base` raised to the power of `number`.
## Examples
>
### Scale headings by fixed ratio
The `pow()` function can be useful for strategies like CSS Modular Scale, which relates all the font-sizes on a page to each other by a fixed ratio.
#### HTML
    
    <h1>Heading 1</h1>
    <h2>Heading 2</h2>
    <h3>Heading 3</h3>
    <h4>Heading 4</h4>
    <h5>Heading 5</h5>
    <h6>Heading 6</h6>
    
#### CSS
    
    h1 {
      font-size: calc(1rem * pow(1.5, 4));
    }
    h2 {
      font-size: calc(1rem * pow(1.5, 3));
    }
    h3 {
      font-size: calc(1rem * pow(1.5, 2));
    }
    h4 {
      font-size: calc(1rem * pow(1.5, 1));
    }
    h5 {
      font-size: calc(1rem * pow(1.5, 0));
    }
    h6 {
      font-size: calc(1rem * pow(1.5, -1));
    }
    
#### Result
# exp()
The `exp()` CSS function is an exponential function that takes a number as an argument and returns the mathematical constant `e` raised to the power of the given number.
The mathematical constant `e` is the base of natural logarithms, and is approximately `2.718281828459045`.
The `exp(number)` function contains a calculation which returns the same value as `pow(e, number)`.
## Syntax
    
    /* A <number> value */
    width: calc(100px * exp(-1)); /* 100px * 0.367879441171442 = 36.8px */
    width: calc(100px * exp(0)); /* 100px * 1 = 100px */
    width: calc(100px * exp(1)); /* 100px * 2.718281828459045 = 271.8px */
    
### Parameters
The `exp(number)` function accepts only one value as its parameter.
`number`
    
A calculation which resolves to a `<number>`. Representing the value to be raised by a power of `e`.
### Return value
Returns a non-negative `<number>` representing enumber, which is the result of calculating `e` raised to the power of `number`.
  * If `number` is `-Infinity`, the result is `0`.
  * If `number` is `0`, the result is `1`.
  * If `number` is `1`, the result is `e` (i.e., `2.718281828459045`).
  * If `number` is `Infinity`, the result is `Infinity`.


## Examples
>
### Rotate elements
The `exp()` function can be used to `rotate` elements as it return a `<number>`.
#### HTML
    
    <div class="box box-1"></div>
    <div class="box box-2"></div>
    <div class="box box-3"></div>
    <div class="box box-4"></div>
    <div class="box box-5"></div>
    
#### CSS
    
    div.box {
      width: 100px;
      height: 100px;
      background: linear-gradient(orange, red);
    }
    div.box-1 {
      transform: rotate(calc(1turn * exp(-1))); /* 0.3678794411714423turn */
    }
    div.box-2 {
      transform: rotate(calc(1turn * exp(-0.75))); /* 0.4723665527410147turn */
    }
    div.box-3 {
      transform: rotate(calc(1turn * exp(-0.5))); /* 0.6065306597126334turn */
    }
    div.box-4 {
      transform: rotate(calc(1turn * exp(-0.25))); /* 0.7788007830714049turn */
    }
    div.box-5 {
      transform: rotate(calc(1turn * exp(0))); /* 1turn */
    }
    
#### Result
### Scale headings by fixed ratio
The `exp()` function can be useful for strategies like CSS modular scale, which relates all the font-sizes on a page to each other by a fixed ratio.
#### HTML
    
    <h1>Heading 1</h1>
    <h2>Heading 2</h2>
    <h3>Heading 3</h3>
    <h4>Heading 4</h4>
    <h5>Heading 5</h5>
    <h6>Heading 6</h6>
    
#### CSS
    
    h1 {
      font-size: calc(1rem * exp(1.25)); /* 3.4903429574618414rem */
    }
    h2 {
      font-size: calc(1rem * exp(1)); /* 2.718281828459045rem */
    }
    h3 {
      font-size: calc(1rem * exp(0.75)); /* 2.117000016612675rem */
    }
    h4 {
      font-size: calc(1rem * exp(0.5)); /* 1.6487212707001282rem */
    }
    h5 {
      font-size: calc(1rem * exp(0.25)); /* 1.2840254166877414rem */
    }
    h6 {
      font-size: calc(1rem * exp(0)); /* 1rem */
    }
    
#### Result
# Universal selectors
The CSS universal selector (`*`) matches elements of any type.
    
    /* Selects all elements */
    * {
      color: green;
    }
    
The universal selector is a special type selector and can therefore be namespaced when using `@namespace`. This is useful when dealing with documents containing multiple namespaces such as HTML with inline SVG or MathML, or XML that mixes multiple vocabularies.
  * `ns|*` \- matches all elements in namespace ns 
  * `*|*` \- matches all elements
  * `|*` \- matches all elements without any declared namespace


## Syntax
    
    * { style properties }
    
The asterisk is optional with simple selectors. For instance, `*.warning` and `.warning` are equivalent.
## Examples
>
### CSS
    
    * [lang^="en"] {
      color: green;
    }
    
    *.warning {
      color: red;
    }
    
    *#maincontent {
      border: 1px solid blue;
    }
    
    .floating {
      float: left;
    }
    
    /* automatically clear the next sibling after a floating element */
    .floating + * {
      clear: left;
    }
    
### HTML
    
    <p class="warning">
      <span lang="en-us">A green span</span> in a red paragraph.
    </p>
    <p id="maincontent" lang="en-gb">
      <span class="warning">A red span</span> in a green paragraph.
    </p>
    
### Result
### Namespaces
In this example the selector will only match elements in the example namespace.
    
    @namespace example url("http://www.example.com/");
    example|* {
      color: blue;
    }
    
# scroll-padding-right
The `scroll-padding-right` property defines offsets for the right of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-right: 0;
    
    
    scroll-padding-right: 20px;
    
    
    scroll-padding-right: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-right: auto;
    
    /* <length> values */
    scroll-padding-right: 10px;
    scroll-padding-right: 1em;
    scroll-padding-right: 10%;
    
    /* Global values */
    scroll-padding-right: inherit;
    scroll-padding-right: initial;
    scroll-padding-right: revert;
    scroll-padding-right: revert-layer;
    scroll-padding-right: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the top edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# overscroll-behavior-x
The `overscroll-behavior-x` CSS property sets the browser's behavior when the horizontal boundary of a scrolling area is reached.
See `overscroll-behavior` for a full explanation.
## Syntax
    
    /* Keyword values */
    overscroll-behavior-x: auto; /* default */
    overscroll-behavior-x: contain;
    overscroll-behavior-x: none;
    
    /* Global values */
    overscroll-behavior-x: inherit;
    overscroll-behavior-x: initial;
    overscroll-behavior-x: revert;
    overscroll-behavior-x: revert-layer;
    overscroll-behavior-x: unset;
    
The `overscroll-behavior-x` property is specified as a keyword chosen from the list of values below.
### Values
`auto`
    
The default scroll overflow behavior occurs as normal.
`contain`
    
Default scroll overflow behavior (e.g., "bounce" effects) is observed inside the element where this value is set. However, no scroll chaining occurs on neighboring scrolling areas; the underlying elements will not scroll. The `contain` value disables native browser navigation, including the vertical pull-to-refresh gesture and horizontal swipe navigation.
`none`
    
No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
## Examples
>
### Preventing an underlying element from scrolling horizontally
In our overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other. The outer box has a large `width` set on it so the page will scroll horizontally. The inner box has a small width (and `height`) set on it so it sits comfortably inside the viewport, but its content is given a large `width` so it will scroll horizontally.
By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. To avoid this, you can set `overscroll-behavior-x: contain` on the inner box:
    
    main > div {
      height: 300px;
      width: 500px;
      overflow: auto;
      position: relative;
      top: 100px;
      left: 100px;
      overscroll-behavior-x: contain;
    }
    
# scroll-padding-left
The `scroll-padding-left` property defines offsets for the left of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-left: 0;
    
    
    scroll-padding-left: 20px;
    
    
    scroll-padding-left: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-left: auto;
    
    /* <length> values */
    scroll-padding-left: 10px;
    scroll-padding-left: 1em;
    scroll-padding-left: 10%;
    
    /* Global values */
    scroll-padding-left: inherit;
    scroll-padding-left: initial;
    scroll-padding-left: revert;
    scroll-padding-left: revert-layer;
    scroll-padding-left: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the left edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# z-index
The `z-index` CSS property sets the z-order of a positioned element and its descendants or flex and grid items. Overlapping elements with a larger z-index cover those with a smaller one.
## Try it
    
    z-index: auto;
    
    
    z-index: 1;
    
    
    z-index: 3;
    
    
    z-index: 5;
    
    
    z-index: 7;
    
    
    <section class="default-example container" id="default-example">
      <div id="example-element">Change my z-index</div>
      <div class="block blue position1">z-index: 6</div>
      <div class="block blue position2">z-index: 4</div>
      <div class="block blue position3">z-index: 2</div>
      <div class="block red position4">z-index: auto</div>
      <div class="block red position5">z-index: auto</div>
      <div class="block red position6">z-index: auto</div>
    </section>
    
    
    #example-element {
      top: 15px;
      left: 15px;
      width: 180px;
      height: 230px;
      position: absolute;
      /* center the text so it is visible even when z-index is set to auto */
      line-height: 215px;
      font-family: monospace;
      background-color: #fcfbe5;
      border: solid 5px #e3e0a1;
      z-index: auto;
      color: black;
    }
    
    .container {
      display: inline-block;
      width: 250px;
      position: relative;
    }
    
    .block {
      width: 150px;
      height: 50px;
      position: absolute;
      font-family: monospace;
      color: black;
    }
    
    .blue {
      background-color: #e5e8fc;
      border: solid 5px #112382;
      /* move text to the bottom of the box */
      line-height: 55px;
    }
    
    .red {
      background-color: #fce5e7;
      border: solid 5px #e3a1a7;
    }
    
    .position1 {
      top: 0;
      left: 0;
      z-index: 6;
    }
    
    .position2 {
      top: 30px;
      left: 30px;
      z-index: 4;
    }
    
    .position3 {
      top: 60px;
      left: 60px;
      z-index: 2;
    }
    
    .position4 {
      top: 150px;
      left: 0;
      z-index: auto;
    }
    
    .position5 {
      top: 180px;
      left: 30px;
      z-index: auto;
    }
    
    .position6 {
      top: 210px;
      left: 60px;
      z-index: auto;
    }
    
For a positioned box (that is, one with any `position` other than `static`), the `z-index` property specifies:
  1. The stack level of the box in the current stacking context.
  2. Whether the box establishes a local stacking context.


## Syntax
    
    /* Keyword value */
    z-index: auto;
    
    /* <integer> values */
    z-index: 0;
    z-index: 3;
    z-index: 289;
    z-index: -1; /* Negative values to lower the priority */
    
    /* Global values */
    z-index: inherit;
    z-index: initial;
    z-index: revert;
    z-index: revert-layer;
    z-index: unset;
    
The `z-index` property is specified as either the keyword `auto` or an `<integer>`.
### Values
`auto`
    
The box does not establish a new local stacking context. The stack level of the generated box in the current stacking context is `0`.
`<integer>`
    
This `<integer>` is the stack level of the generated box in the current stacking context. The box also establishes a local stacking context. This means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element.
## Examples
>
### Visually layering elements
#### HTML
    
    <div class="wrapper">
      <div class="dashed-box">Dashed box</div>
      <div class="gold-box">Gold box</div>
      <div class="green-box">Green box</div>
    </div>
    
#### CSS
    
    .wrapper {
      position: relative;
    }
    
    .dashed-box {
      position: relative;
      z-index: 1;
      border: dashed;
      height: 8em;
      margin-bottom: 1em;
      margin-top: 2em;
    }
    .gold-box {
      position: absolute;
      z-index: 3; /* put .gold-box above .green-box and .dashed-box */
      background: gold;
      width: 80%;
      left: 60px;
      top: 3em;
    }
    .green-box {
      position: absolute;
      z-index: 2; /* put .green-box above .dashed-box */
      background: lightgreen;
      width: 20%;
      left: 65%;
      top: -25px;
      height: 7em;
      opacity: 0.9;
    }
    
#### Result
# alignment-baseline
The `alignment-baseline` CSS property specifies the specific baseline used to align the box's text and inline-level contents. Baseline alignment is the relationship among the baselines of multiple alignment subjects within an alignment context. When performing baseline alignment, the `alignment-baseline` property value specifies which baseline of the box is aligned to the corresponding baseline of its alignment context.
Note: The `alignment-baseline` property only has an effect on inline-level boxes, flex items, grid items, table cells, and the `<text>`, `<textPath>`, and `<tspan>` SVG elements. If present, it overrides the shape's `alignment-baseline` attribute.
In an inline formatting context, inline-level box fragments and glyphs share an alignment context established by their parent inline box fragment along its inline axis. In SVG text layout, these values instead specify the baseline that is aligned to the SVG current text position.
## Syntax
    
    /* Initial value */
    alignment-baseline: baseline;
    
    /* Keyword values */
    alignment-baseline: alphabetic;
    alignment-baseline: central;
    alignment-baseline: ideographic;
    alignment-baseline: mathematical;
    alignment-baseline: middle;
    alignment-baseline: text-bottom;
    alignment-baseline: text-top;
    
    /* Mapped values */
    alignment-baseline: text-before-edge; /* text-top */
    alignment-baseline: text-after-edge; /* text-bottom */
    
    /* Deprecated values  */
    alignment-baseline: auto;
    alignment-baseline: before-edge;
    alignment-baseline: after-edge;
    alignment-baseline: hanging;
    
    /* Global values */
    alignment-baseline: inherit;
    alignment-baseline: initial;
    alignment-baseline: revert;
    alignment-baseline: revert-layer;
    alignment-baseline: unset;
    
### Values
`baseline`
    
Use the `dominant-baseline` value of the parent.
`alphabetic`
    
Used in writing Latin, Cyrillic, Greek, and many other scripts; matches the box's alphabetic baseline to that of its parent, corresponding to the bottom of most, but not all characters.
`central`
    
Matches the box's central baseline to the central baseline of its parent, corresponding to the ideographic central baseline, halfway between the ideographic-under and ideographic-over baselines.
`ideographic`
    
Matches the box's ideographic character face under-side baseline to that of its parent, with the derived baseline-table constructed using the ideographic baseline-table in the font.
`mathematical`
    
Matches the box's mathematical baseline to that of its parent, corresponding to the center baseline around which mathematical characters are designed.
`middle`
    
Aligns the vertical midpoint of the box with the baseline of the parent box plus half the x-height of the parent. Uses the x-middle baselines; except under `text-orientation: upright;` (where the alphabetic and x-height baselines are essentially meaningless), in which case it uses the `central` baseline instead.
`text-bottom`
    
Matches the bottom of the box to the top of the parent's content area, using the line-under edge of an inline's content box.
`text-top`
    
Matches the top of the box to the top of the parent's content area; the line-over edge of an inline's content box.
Note: In SVG2, the `auto`, `before-edge`, and `after-edge` were deprecated and `text-before-edge` is an alias for `text-top`, and `text-after-edge` is an alias for `text-bottom`. These keywords should not be used as part of the `vertical-align` shorthand property. Browsers support `auto` as a synonym for `baseline` and `hanging`, wherein the alignment-point of the object being aligned is aligned with the "hanging" baseline of the parent text content element, but neither is part of the specification.
## Example
    
    <svg viewBox="0 0 450 160" width="700" height="200">
      <text x="50" y="20">alphabetic</text>
      <text x="50" y="60">central</text>
      <text x="50" y="100">hanging</text>
      <text x="50" y="140">ideographic</text>
      <text x="250" y="20">mathematical</text>
      <text x="250" y="60">middle</text>
      <text x="250" y="100">text-bottom</text>
      <text x="250" y="140">text-top</text>
      <path
        d="M   0,20 l 400,0
           m -400,40 l 400,0
           m -400,40 l 400,0
           m -400,40 l 400,0"
        stroke="grey" />
      <text x="0" y="20" fill="red">baseline</text>
      <text x="0" y="60" fill="red">baseline</text>
      <text x="0" y="100" fill="red">baseline</text>
      <text x="0" y="140" fill="red">baseline</text>
    </svg>
    
    
    text {
      font-size: 20px;
      alignment-baseline: baseline;
    }
    text:nth-of-type(1) {
      alignment-baseline: alphabetic;
    }
    text:nth-of-type(2) {
      alignment-baseline: central;
    }
    text:nth-of-type(3) {
      alignment-baseline: hanging;
    }
    text:nth-of-type(4) {
      alignment-baseline: ideographic;
    }
    text:nth-of-type(5) {
      alignment-baseline: mathematical;
    }
    text:nth-of-type(6) {
      alignment-baseline: middle;
    }
    text:nth-of-type(7) {
      alignment-baseline: text-bottom;
    }
    text:nth-of-type(8) {
      alignment-baseline: text-top;
    }
    
# float
The `float` CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).
## Try it
    
    float: none;
    
    
    float: left;
    
    
    float: right;
    
    
    float: inline-start;
    
    
    float: inline-end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">Float me</div>
        As much mud in the streets as if the waters had but newly retired from the
        face of the earth, and it would not be wonderful to meet a Megalosaurus,
        forty feet long or so, waddling like an elephantine lizard up Holborn Hill.
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      padding: 0.75em;
      text-align: left;
      width: 80%;
      line-height: normal;
    }
    
    #example-element {
      border: solid 10px #efac09;
      background-color: #040d46;
      color: white;
      padding: 1em;
      width: 40%;
    }
    
A floating element is one where the computed value of `float` is not `none`.
As `float` implies the use of the block layout, it modifies the computed value of the `display` values, in some cases:
Specified value Computed value  
`inline` `block`  
`inline-block` `block`  
`inline-table` `table`  
`table-row` `block`  
`table-row-group` `block`  
`table-column` `block`  
`table-column-group` `block`  
`table-cell` `block`  
`table-caption` `block`  
`table-header-group` `block`  
`table-footer-group` `block`  
`inline-flex` `flex`  
`inline-grid` `grid`  
other unchanged  
Note: When accessing a CSS property in JavaScript through the `HTMLElement.style` object, single-word property names are used as is. Although `float` is a reserved keyword in JavaScript, the CSS `float` property is accessed as `float` in modern browsers. In older browsers, you must use `cssFloat` to access the `float` property. (This is similar to how the "class" attribute is accessed as "className" and the "for" attribute of a `<label>` element is accessed as "htmlFor".)
## Syntax
    
    /* Keyword values */
    float: left;
    float: right;
    float: none;
    float: inline-start;
    float: inline-end;
    
    /* Global values */
    float: inherit;
    float: initial;
    float: revert;
    float: revert-layer;
    float: unset;
    
The `float` property is specified as a single keyword, chosen from the list of values below.
### Values
`left`
    
The element must float on the left side of its containing block.
`right`
    
The element must float on the right side of its containing block.
`none`
    
The element must not float.
`inline-start`
    
The element must float on the start side of its containing block. That is the left side with `ltr` scripts, and the right side with `rtl` scripts.
`inline-end`
    
The element must float on the end side of its containing block. That is the right side with `ltr` scripts, and the left side with `rtl` scripts.
## Examples
>
### How floated elements are positioned
As mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it). It is shifted to the left, or right, until it touches the edge of its containing box, or another floated element.
In this example, there are three colored squares. Two are floated left, and one is floated right. Note that the second "left" square is placed to the right of the first. Additional squares would continue to stack to the right, until they filled the containing box, after which they would wrap to the next line.
A floated element is at least as tall as its tallest nested floated children. We gave the parent `width: 100%` and floated it to ensure it is tall enough to encompass its floated children, and to make sure it takes up the width of the parent so we don't have to clear its adjacent sibling.
#### HTML
    
    <section>
      <div class="left">1</div>
      <div class="left">2</div>
      <div class="right">3</div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi tristique
        sapien ac erat tincidunt, sit amet dignissim lectus vulputate. Donec id
        iaculis velit. Aliquam vel malesuada erat. Praesent non magna ac massa
        aliquet tincidunt vel in massa. Phasellus feugiat est vel leo finibus
        congue.
      </p>
    </section>
    
#### CSS
    
    section {
      box-sizing: border-box;
      border: 1px solid blue;
      width: 100%;
      float: left;
    }
    
    div {
      margin: 5px;
      width: 50px;
      height: 150px;
    }
    
    .left {
      float: left;
      background: pink;
    }
    
    .right {
      float: right;
      background: cyan;
    }
    
#### Result
### Clearing floats
Sometimes you may want to force an item to move below any floated elements. For instance, you may want paragraphs to remain adjacent to floats, but force headings to be on their own line. See `clear` for examples.
# :nth-of-type()
The `:nth-of-type()` CSS pseudo-class matches elements based on their position among siblings of the same type (tag name).
## Try it
    
    dt {
      font-weight: bold;
    }
    
    dd {
      margin: 3px;
    }
    
    dd:nth-of-type(even) {
      border: 2px solid orange;
    }
    
    
    <dl>
      <dt>Vegetables:</dt>
      <dd>1. Tomatoes</dd>
      <dd>2. Cucumbers</dd>
      <dd>3. Mushrooms</dd>
      <dt>Fruits:</dt>
      <dd>4. Apples</dd>
      <dd>5. Mangos</dd>
      <dd>6. Pears</dd>
      <dd>7. Oranges</dd>
    </dl>
    
## Syntax
    
    :nth-of-type(<An+B> | even | odd) {
      /* ... */
    }
    
### Parameters
The `:nth-of-type()` pseudo-class is specified with a single argument, which represents the pattern for matching elements.
See `:nth-child` for a more detailed explanation of its syntax.
## Examples
>
### Basic example
#### HTML
    
    <div>
      <div>This element isn't counted.</div>
      <p>1st paragraph.</p>
      <p class="fancy">2nd paragraph.</p>
      <div>This element isn't counted.</div>
      <p class="fancy">3rd paragraph.</p>
      <p>4th paragraph.</p>
    </div>
    
#### CSS
    
    /* Odd paragraphs */
    p:nth-of-type(2n + 1) {
      color: red;
    }
    
    /* Even paragraphs */
    p:nth-of-type(2n) {
      color: blue;
    }
    
    /* First paragraph */
    p:nth-of-type(1) {
      font-weight: bold;
    }
    
    /* This will match the 3rd paragraph as it will match elements which are 2n+1 AND have a class of fancy.
    The second paragraph has a class of fancy but is not matched as it is not :nth-of-type(2n+1) */
    p.fancy:nth-of-type(2n + 1) {
      text-decoration: underline;
    }
    
#### Result
Note: There is no way to select the nth-of-class using this selector. The selector looks at the type only when creating the list of matches. You can however apply CSS to an element based on `:nth-of-type` location and a class, as shown in the example above.
# inset-block-end
The `inset-block-end` CSS property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    writing-mode: horizontal-tb;
    
    
    writing-mode: vertical-rl;
    
    
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="example-container" id="example-element">
        <div id="abspos">I am absolutely positioned with inset-block-end: 20px</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    #example-element {
      border: 0.75em solid;
      padding: 0.75em;
      position: relative;
      width: 100%;
      min-height: 200px;
      unicode-bidi: bidi-override;
    }
    
    #abspos {
      background-color: yellow;
      color: black;
      border: 3px solid red;
      position: absolute;
      inset-block-end: 20px;
      inline-size: 140px;
      min-block-size: 200px;
    }
    
## Syntax
    
    /* <length> values */
    inset-block-end: 3px;
    inset-block-end: 2.4em;
    inset-block-end: calc(anchor(start) + 20px);
    inset-block-end: anchor-size(--my-anchor width, 10%);
    
    /* <percentage>s of the width or height of the containing block */
    inset-block-end: 10%;
    
    /* Keyword value */
    inset-block-end: auto;
    
    /* Global values */
    inset-block-end: inherit;
    inset-block-end: initial;
    inset-block-end: revert;
    inset-block-end: revert-layer;
    inset-block-end: unset;
    
### Values
The `inset-block-end` property takes the same values as the `left` property.
## Examples
>
### Setting block end offset
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      position: relative;
      inset-block-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# break-after
The `break-after` CSS property sets how page, column, or region breaks should behave after a generated box. If there is no generated box, the property is ignored.
## Try it
    
    break-after: auto;
    
    
    break-after: page;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'break-after'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Generic break values */
    break-after: auto;
    break-after: avoid;
    break-after: always;
    break-after: all;
    
    /* Page break values */
    break-after: avoid-page;
    break-after: page;
    break-after: left;
    break-after: right;
    break-after: recto;
    break-after: verso;
    
    /* Column break values */
    break-after: avoid-column;
    break-after: column;
    
    /* Region break values */
    break-after: avoid-region;
    break-after: region;
    
    /* Global values */
    break-after: inherit;
    break-after: initial;
    break-after: revert;
    break-after: revert-layer;
    break-after: unset;
    
Each possible break point (in other words, each element boundary) is affected by three properties: the `break-after` value of the previous element, the `break-before` value of the next element, and the `break-inside` value of the containing element.
To determine if a break must be done, the following rules are applied:
  1. If any of the three concerned values is a forced break value (`always`, `left`, `right`, `page`, `column`, or `region`), it has precedence. If more than one of them are such a break, the one of the element that appears the latest in the flow is taken (i.e., the `break-before` value has precedence over the `break-after` value, which itself has precedence over the `break-inside` value).
  2. If any of the three concerned values is an avoid break value (`avoid`, `avoid-page`, `avoid-region`, or `avoid-column`), no such break will be applied at that point.


Once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding `avoid` value.
### Values
#### Generic break values
`auto`
    
Allows, but does not force, any break (page, column, or region) to be inserted right after the principal box.
`avoid`
    
Avoids any break (page, column, or region) from being inserted right after the principal box.
`always`
    
Forces a page break right after the principal box. The type of this break is that of the immediately-containing fragmentation context. If we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
`all`
    
Forces a page break right after the principal box. Breaking through all possible fragmentation contexts. So a break inside a multicol container, which was inside a page container would force a column and page break.
#### Page break values
`avoid-page`
    
Avoids any page break right after the principal box.
`page`
    
Forces a page break right after the principal box.
`left`
    
Forces one or two page breaks right after the principal box, whichever will make the next page into a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing.
`right`
    
Forces one or two page breaks right after the principal box, whichever will make the next page into a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing.
`recto`
    
Forces one or two page breaks right after the principal box, whichever will make the next page into a recto page. (A recto page is a right page in a left-to-right spread or a left page in a right-to-left spread.)
`verso`
    
Forces one or two page breaks right after the principal box, whichever will make the next page into a verso page. (A verso page is a left page in a left-to-right spread or a right page in a right-to-left spread.)
#### Column break values
`avoid-column`
    
Avoids any column break right after the principal box.
`column`
    
Forces a column break right after the principal box.
#### Region break values
`avoid-region`
    
Avoids any region break right after the principal box.
`region`
    
Forces a region break right after the principal box.
## Page break aliases
For compatibility reasons, the legacy `page-break-after` property should be treated by browsers as an alias of `break-after`. This ensures that sites using `page-break-after` continue to work as designed. A subset of values should be aliased as follows:
page-break-after break-after  
`auto` `auto`  
`left` `left`  
`right` `right`  
`avoid` `avoid`  
`always` `page`  
Note: The `always` value of `page-break-*` was implemented by browsers as a page break, and not as a column break. Therefore the aliasing is to `page`, rather than the `always` value in the Level 4 spec.
## Examples
>
### Breaking into neat columns
In the following example we have a container that contains an `<h1>` spanning all columns (achieved using `column-span: all`) and a series of `<h2>`s and paragraphs laid out in multiple columns using `column-width: 200px`.
By default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. However, we used `break-after: column` on the `<p>` elements to force a column break after each one, meaning that you end up with an `<h2>` neatly at the top of each column.
#### HTML
    
    <article>
      <h1>Main heading</h1>
    
      <h2>Subheading</h2>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae
        fringilla mauris. Quisque commodo eget nisi sed pretium. Mauris luctus nec
        lacus in ultricies. Mauris vitae hendrerit arcu, ac scelerisque lacus.
        Aliquam lobortis in lacus sit amet posuere. Fusce iaculis urna id neque
        dapibus, eu lacinia lectus dictum.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        Praesent condimentum dui dui, sit amet rutrum diam tincidunt eu. Cras
        suscipit porta leo sit amet rutrum. Sed vehicula ornare tincidunt. Curabitur
        a ipsum ac diam mattis volutpat ac ut elit. Nullam luctus justo non
        vestibulum gravida. Morbi metus libero, pharetra non porttitor a, molestie
        nec nisi.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        Vivamus eleifend metus vitae neque placerat, eget interdum elit mattis.
        Donec eu vulputate nibh. Ut turpis leo, malesuada quis nisl nec, volutpat
        egestas tellus.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        In finibus viverra enim vel suscipit. Quisque consequat velit eu orci
        malesuada, ut interdum tortor molestie. Proin sed pellentesque augue. Nam
        risus justo, faucibus non porta a, congue vel massa. Cras luctus lacus nisl,
        sed tincidunt velit pharetra ac. Duis suscipit faucibus dui sed ultricies.
      </p>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
      letter-spacing: 2px;
      column-span: all;
    }
    
    h2 {
      font-size: 1.2rem;
      color: red;
      letter-spacing: 1px;
    }
    
    p {
      line-height: 1.5;
      break-after: column;
    }
    
    article {
      column-width: 200px;
      gap: 20px;
    }
    
### Result
# animation-timeline
The `animation-timeline` CSS property specifies the timeline that is used to control the progress of a CSS animation.
The following types of timelines can be set via `animation-timeline`:
  * The default document timeline, which is progressed through by the passing of time since the document was first loaded in the browser. This is the timeline traditionally associated with CSS animations and is selected with a value of `auto`, or by not specifying an `animation-timeline` value at all.
  * A scroll progress timeline, which is progressed through by scrolling a scrollable element (scroller) between top and bottom (or left and right). The position in the scroll range is converted into a percentage of progress — 0% at the start and 100% at the end. The element that provides the scroll progress timeline can be specified in two ways: 
    * A named scroll progress timeline is one where the scroller providing the scroll progress timeline is explicitly named using the `scroll-timeline-name` property (or the `scroll-timeline` shorthand property). The name is then linked to the element to animate by specifying it as the value of that element's `animation-timeline` property.
    * An anonymous scroll progress timeline is one where the element to animate is given a `scroll()` function as an `animation-timeline` value, which selects the scroller providing the scroll progress timeline and the scroll axis to be used based on the arguments you pass to it.
  * A view progress timeline, which is progressed through based on the change in visibility of an element (known as the subject) inside a scroller. The visibility of the subject inside the scroller is tracked — by default, the timeline is at 0% when the subject is first visible at one edge of the scroller, and 100% when it reaches the opposite edge. Unlike with scroll progress timelines, you can't specify the scroller — the subject's visibility is always tracked within its nearest ancestor scroller. The subject that provides the view progress timeline can be specified in two ways: 
    * A named view progress timeline is one where the subject is explicitly named using the `view-timeline-name` property (or the `view-timeline` shorthand property). The name is then linked to the element to animate by specifying it as the value of that element's `animation-timeline` property. This is a key point — with named view progress timelines, the element to animate does not have to be the same as the subject.
    * An anonymous view progress timeline is one where the subject is given a `view()` function as an `animation-timeline` value, causing it to be animated based on its position inside its nearest parent scroller.


Note: `animation-timeline` is included in the `animation` shorthand as a reset-only value. This means that including `animation` resets a previously-declared `animation-timeline` value to `auto`, but a specific value cannot be set via `animation`. When creating CSS scroll-driven animations, you need to declare `animation-timeline` after declaring any `animation` shorthand for it to take effect.
## Syntax
    
    /* Keyword */
    animation-timeline: none;
    animation-timeline: auto;
    
    /* Single animation named timeline */
    animation-timeline: --timeline_name;
    
    /* Single animation anonymous scroll progress timeline */
    animation-timeline: scroll();
    animation-timeline: scroll(scroller axis);
    
    /* Single animation anonymous view progress timeline */
    animation-timeline: view();
    animation-timeline: view(axis inset);
    
    /* Multiple animations */
    animation-timeline: --progress-bar-timeline, --carousel-timeline;
    animation-timeline: none, --sliding-timeline;
    
    /* Global values */
    animation-timeline: inherit;
    animation-timeline: initial;
    animation-timeline: revert;
    animation-timeline: revert-layer;
    animation-timeline: unset;
    
### Values
`none`
    
The animation is not associated with a timeline.
`auto`
    
The animation's timeline is the document's default DocumentTimeline.
`scroll()`
    
An anonymous scroll progress timeline is provided by some ancestor scroller of the current element. The function parameters allow you to select the scroller, and the scrolling axis the timeline will be measured along.
See `scroll()` for more information.
`view()`
    
An anonymous view progress timeline is provided by the subject that `animation-timeline: view();` is set on. The function parameters allow you to select the scrollbar axis along which timeline progress will be tracked and an inset that adjusts the position of the box in which the subject is deemed to be visible.
See `view()` for more information.
`<dashed-ident>`
    
A `<dashed-ident>` identifying a named timeline previously declared with the `scroll-timeline-name` or `view-timeline-name` property (or the `scroll-timeline` or `view-timeline` shorthand property).
Note: If two or more timelines share the same name, the last declared within the cascade will be used. Also, if no timeline is found that matches the given name, the animation is not associated with a timeline.
Note: The `<dashed-ident>` values must start with `--`. This helps avoid name clashes with standard CSS keywords.
## Examples
>
### Setting a named scroll progress timeline
A scroll progress timeline named `--square-timeline` is defined using the `scroll-timeline-name` property on an element with an `id` of `container`. This is then set as the timeline for the animation on the `#square` element using `animation-timeline: --square-timeline`.
#### HTML
The HTML for the example is shown below.
    
    <div id="container">
      <div id="square"></div>
      <div id="stretcher"></div>
    </div>
    
#### CSS
The CSS for the container sets it as the source of a scroll progress timeline named `--square-timeline` using the `scroll-timeline-name` property (we could explicitly set which scrollbar axis to use with `scroll-timeline-axis`, but there is only a block direction scrollbar here, and it will be used by default).
The height of the container is set to 300px and we also set the container to create a vertical scrollbar if it overflows (below we will use CSS on the "stretcher" element to ensure that it does overflow).
    
    #container {
      height: 300px;
      overflow-y: scroll;
      scroll-timeline-name: --square-timeline;
      position: relative;
    }
    
The CSS below defines a square that rotates in alternate directions according to the timeline provided by the `animation-timeline` property, which is set to the `--square-timeline` timeline named above.
    
    #square {
      background-color: deeppink;
      width: 100px;
      height: 100px;
      margin-top: 100px;
      animation-name: rotateAnimation;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
      animation-direction: alternate;
      animation-timeline: --square-timeline;
    
      position: absolute;
      bottom: 0;
    }
    
    @keyframes rotateAnimation {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
    
The "stretcher" CSS sets the block height to 600px, which forces the container element to overflow and create scroll bars. Without this element there would be no scrollbar, and hence no scroll progress timeline to associate with the animation timeline.
    
    #stretcher {
      height: 600px;
    }
    
#### Result
Scroll to see the square element being animated.
### Setting an anonymous scroll progress timeline
In this example, the `#square` element is animated using an anonymous scroll progress timeline, which is applied to the element to be animated using the `scroll()` function. The timeline in this particular example is provided by the nearest parent element that has (any) scrollbar, from the scrollbar in the block direction.
#### HTML
The HTML for the example is shown below.
    
    <div id="container">
      <div id="square"></div>
      <div id="stretcher"></div>
    </div>
    
#### CSS
The CSS below defines a square that rotates in alternate directions according to the timeline provided by the `animation-timeline` property. In this case, the timeline is provided by `scroll(block nearest)`, which means that it will select the scrollbar in the block direction of the nearest ancestor element that has scrollbars; in this case the vertical scrollbar of the "container" element.
Note: `block` and `nearest` are actually the default parameter values, so we could have used just `scroll()`.
    
    #square {
      background-color: deeppink;
      width: 100px;
      height: 100px;
      margin-top: 100px;
      position: absolute;
      bottom: 0;
    
      animation-name: rotateAnimation;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
      animation-direction: alternate;
      animation-timeline: scroll(block nearest);
    }
    
    @keyframes rotateAnimation {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
    
The CSS for the container sets its height to 300px and we also set the container to create a vertical scrollbar if it overflows. The "stretcher" CSS sets the block height to 600px, which forces the container element to overflow. These two together ensure that the container has a vertical scrollbar, which allows it to be used as the source of the anonymous scroll progress timeline.
    
    #container {
      height: 300px;
      overflow-y: scroll;
      position: relative;
    }
    
    #stretcher {
      height: 600px;
    }
    
#### Result
Scroll to see the square element being animated.
### Setting a named view progress timeline
A view progress timeline named `--subject-reveal` is defined using the `view-timeline-name` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where the `view-timeline-name` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed.
Lastly, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline-name: --subject-reveal;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
### Setting an anonymous view progress timeline
An anonymous view progress timeline is set on an element with class `subject` using `animation-timeline: view()`. The result is that the `subject` element animates as it moves upwards through the document as it is scrolled.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `animation-timeline: view()` is set to declare that it will be animated as it progresses through the view progress timeline provided by its scrolling ancestor (in this case the document's root element).
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      animation-timeline: view();
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# text-justify
The `text-justify` CSS property sets what type of justification should be applied to text when `text-align: justify;` is set on an element.
## Syntax
    
    text-justify: none;
    text-justify: auto;
    text-justify: inter-word;
    text-justify: inter-character;
    text-justify: distribute; /* Deprecated value */
    
    /* Global values */
    text-justify: inherit;
    text-justify: initial;
    text-justify: revert;
    text-justify: revert-layer;
    text-justify: unset;
    
### Values
`none`
    
The text justification is turned off. This has the same effect as not setting `text-align` at all, although it is useful if you need to turn justification on and off for some reason.
`auto`
    
The browser chooses the best type of justification for the current situation based on a balance between performance and quality, but also on what is most appropriate for the language of the text (e.g., English, CJK languages, etc.). This is the default justification used if `text-justify` is not set at all.
`inter-word`
    
The text is justified by adding space between words (effectively varying `word-spacing`), which is most appropriate for languages that separate words using spaces, like English or Korean.
`inter-character`
    
The text is justified by adding space between characters (effectively varying `letter-spacing`), which is most appropriate for languages like Japanese.
`distribute`
    
Exhibits the same behavior as `inter-character`; this value is kept for backwards compatibility.
## Examples
>
### Demonstration of the different values of text-justify
    
    p {
      font-size: 1.5em;
      border: 1px solid black;
      padding: 10px;
      width: 95%;
      margin: 10px auto;
      text-align: justify;
    }
    
    .none {
      text-justify: none;
    }
    
    .auto {
      text-justify: auto;
    }
    
    .dist {
      text-justify: distribute;
    }
    
    .word {
      text-justify: inter-word;
    }
    
    .char {
      text-justify: inter-character;
    }
    
# scroll-padding-block-end
The `scroll-padding-block-end` property defines offsets for the end edge in the block dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-block-end: 0;
    
    
    scroll-padding-block-end: 20px;
    
    
    scroll-padding-block-end: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-block-end: auto;
    
    /* <length> values */
    scroll-padding-block-end: 10px;
    scroll-padding-block-end: 1em;
    scroll-padding-block-end: 10%;
    
    /* Global values */
    scroll-padding-block-end: inherit;
    scroll-padding-block-end: initial;
    scroll-padding-block-end: revert;
    scroll-padding-block-end: revert-layer;
    scroll-padding-block-end: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the block end edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# margin-trim
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `margin-trim` property allows the container to trim the margins of its children where they adjoin the container's edges.
## Syntax
    
    margin-trim: none;
    margin-trim: block;
    margin-trim: block-start;
    margin-trim: block-end;
    margin-trim: inline;
    margin-trim: inline-start;
    margin-trim: inline-end;
    
    /* Global values */
    margin-trim: inherit;
    margin-trim: initial;
    margin-trim: revert;
    margin-trim: revert-layer;
    margin-trim: unset;
    
### Values
`none`
    
Margins are not trimmed by the container.
`block`
    
Margins provided to the block children where they adjoin the container's edges are trimmed to zero without affecting the margins provided to the container.
`block-start`
    
Margin of the first block child with the container's edge is trimmed to zero.
`block-end`
    
Margin of last block child with the container's edge is trimmed to zero.
`inline`
    
Margins provided to the inline children where they adjoin the container's edges are trimmed to zero, without affecting the spacing at the beginning and end of the row.
`inline-start`
    
Margin between the container's edge and the first inline child is trimmed to zero.
`inline-end`
    
Margin between the container's edge and the last inline child is trimmed to zero.
## Examples
>
### Basic usage
Once support is implemented for this property, it will probably work like so:
When you've got a container with some inline children and you want to put a margin between each child but not have it interfere with the spacing at the end of the row, you might do something like this:
    
    article {
      background-color: red;
      margin: 20px;
      padding: 20px;
      display: inline-block;
    }
    
    article > span {
      background-color: black;
      color: white;
      text-align: center;
      padding: 10px;
      margin-right: 20px;
      margin-left: 30px;
    }
    
The problem here is that you'd end up with 20px too much spacing at the right of the row, so you'd maybe do this to fix it:
    
    span:last-child {
      margin-right: 0;
      margin-left: 0;
    }
    
It is a pain having to write another rule to achieve this, and it is also not very flexible. Instead, `margin-trim` could fix it:
    
    article {
      margin-trim: inline-end;
      /* … */
    }
    
Similarly, to remove left margin with the container's edge:
    
    article {
      margin-trim: inline-start;
      /* … */
    }
    
# grid-template-areas
The `grid-template-areas` CSS property specifies named grid areas, establishing the cells in the grid and assigning them names.
## Try it
    
    grid-template-areas:
      "a a a"
      "b c c"
      "b c c";
    
    
    grid-template-areas:
      "b b a"
      "b b c"
      "b b c";
    
    
    grid-template-areas:
      "a a ."
      "a a ."
      ". b c";
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One (a)</div>
          <div>Two (b)</div>
          <div>Three (c)</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    #example-element :nth-child(1) {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      grid-area: a;
    }
    
    #example-element :nth-child(2) {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
      grid-area: b;
    }
    
    #example-element :nth-child(3) {
      background-color: rgb(94 255 0 / 0.2);
      border: 3px solid green;
      grid-area: c;
    }
    
Those areas are not associated with any particular grid item, but can be referenced from the grid-placement properties `grid-row-start`, `grid-row-end`, `grid-column-start`, `grid-column-end`, and their shorthands `grid-row`, `grid-column`, and `grid-area`.
## Syntax
    
    /* Keyword value */
    grid-template-areas: none;
    
    /* <string> values */
    grid-template-areas: "a b";
    grid-template-areas:
      "a b ."
      "a c d";
    
    /* Global values */
    grid-template-areas: inherit;
    grid-template-areas: initial;
    grid-template-areas: revert;
    grid-template-areas: revert-layer;
    grid-template-areas: unset;
    
### Values
`none`
    
The grid container doesn't define any named grid areas.
`<string>`
    
A row is created for every separate string listed, and a column is created for each cell in the string. Multiple cell tokens with the same name within and between rows create a single named grid area that spans the corresponding grid cells. Unless those cells form a rectangle, the declaration is invalid.
All the remaining unnamed areas in a grid can be referred using null cell tokens. A null cell token is a sequence of one or more `.` (U+002E FULL STOP) characters, e.g., `.`, `...`, or `.....` etc. A null cell token can be used to create empty spaces in the grid.
## Examples
>
### Specifying named grid areas
#### HTML
    
    <div id="page">
      <header>Header</header>
      <nav>Navigation</nav>
      <main>Main area</main>
      <footer>Footer</footer>
    </div>
    
#### CSS
    
    #page {
      display: grid;
      width: 100%;
      height: 250px;
      grid-template-areas:
        "head head"
        "nav  main"
        ".  foot";
      grid-template-rows: 50px 1fr 30px;
      grid-template-columns: 150px 1fr;
    }
    
    #page > header {
      grid-area: head;
      background-color: #8ca0ff;
    }
    
    #page > nav {
      grid-area: nav;
      background-color: #ffa08c;
    }
    
    #page > main {
      grid-area: main;
      background-color: #ffff64;
    }
    
    #page > footer {
      grid-area: foot;
      background-color: #8cffa0;
    }
    
In the above code, a null token (`.`) was used to create an unnamed area in the grid container, which we used to create an empty space at the bottom left corner of the grid.
#### Result
# mask-size
The `mask-size` CSS property specifies the sizes of specified mask images. Mask image sizes can be fully or partially constrained to preserve their intrinsic aspect ratios.
## Syntax
    
    /* Keyword syntax */
    mask-size: cover;
    mask-size: contain;
    mask-size: auto;
    
    /* One-value syntax */
    /* Mask width. Sets height to 'auto'. */
    mask-size: 50%;
    mask-size: 3em;
    mask-size: 12px;
    
    /* Two-value syntax */
    /* First value: mask width. Second value: mask height */
    mask-size: 3em 25%;
    mask-size: auto 6px;
    mask-size: auto 50%;
    
    /* Multiple values */
    mask-size: auto, contain;
    mask-size:
      50%,
      50% 25%,
      auto 25%;
    mask-size: 6px, auto, contain;
    
    /* Global values */
    mask-size: inherit;
    mask-size: initial;
    mask-size: revert;
    mask-size: revert-layer;
    mask-size: unset;
    
### Values
The `mask-size` property accepts a comma-separated list of `<bg-size>` values. A `<bg-size>` value is either `cover`, `contain`, a pair of values specifying the width and height (in that order), or a single value specifying the width (in which case, the height is set to `auto`). Values include:
`contain`
    
Scales the mask image up or down, while preserving its aspect-ratio, making the mask as large as possible within its container without cropping or stretching it. If the mask image is smaller than the container, the mask will tile, or repeat, unless the `mask-repeat` property is set to `no-repeat`.
`cover`
    
Scales the mask image to the smallest possible size to fill the container while preserving its aspect ratio. If the aspect ratio of the mask image differs from the element, it will be cropped vertically or horizontally.
`auto`
    
Maintains the original aspect ratio of the mask source. When set for both the width and height, the origin size of the mask resource is used. Otherwise, `auto` scales the mask image in the corresponding direction such that its original aspect ratio is maintained.
`<length>`
    
Renders the mask image at the specified length in the corresponding dimension (width if set as the first or only value, height if set as the second value). Negative values are not allowed.
`<percentage>`
    
Renders the mask image in the corresponding dimension to the specified percentage of the box origin area as defined by the `mask-origin` property, which defaults to `padding-box`. Negative values are not allowed.
## Description
The `mask-size` property is used to size mask layers.
An element can have multiple mask layers applied. The number of mask layers is determined by the number of comma-separated values in the `mask-image` property value (a value creates a mask layer, even if it is `none`).
Each `mask-size` value in the comma-separated list of values is matched up with an associated mask layer as defined by the list of `mask-image` values, in order. If the number of values in the two properties differs:
  * If `mask-size` has more values than `mask-image`, the excess values of `mask-size` are not used.
  * If `mask-size` has fewer values than `mask-image`, the `mask-size` values are repeated.


Each `mask-size` value is a `<bg-size>` value. There are three ways to declare each `<bg-size>`: one keyword, two lengths, percentages or the keyword `auto`, or one length, percentage, or `auto`:
  * The available keywords are `cover` and `contain`.
  * When two values are specified, the first defines the mask width and the second defines its height.
  * When one value is specified, it defines only the mask width, with the height set to `auto`.


The width and height values are a `<length>`, a `<percentage>`, or the `auto` keyword, which is the default. Setting one or both values to `auto` maintains the mask image's original aspect ratio.
The rendered size of the mask image is computed as follows:
  * If both components of `mask-size` are specified and are not `auto`, the mask image renders at the specified size.
  * If the `mask-size` is `contain` or `cover`, the image is rendered by preserving its aspect ratio at the largest size contained within or covering the mask positioning area. If the image has no intrinsic proportion, such as with gradients, then it is rendered at the size of the mask positioning area.
  * If the `mask-size` is `auto` (which resolves to `auto auto`), it is rendered at the size at which the mask would be displayed if no CSS were applied to change the rendering; this is its intrinsic size. If it has no intrinsic dimensions and no intrinsic proportion, as is the case with CSS gradients, it is rendered at the size of the mask positioning area, defined by the `mask-origin` (which defaults to `border-box`). If the mask source has no dimensions but has a proportion (aspect-ratio), a value of `auto` will render it as if `contain` had been specified instead. If the image has one intrinsic dimension and a proportion, it is rendered at the size determined by that one dimension and the proportion. If the image has one intrinsic dimension but no proportion, it's rendered using the intrinsic dimension and the corresponding dimension of the mask positioning area.
  * If `mask-size` has one `auto` component and one non-`auto` component, which applies to all single-value values, the aspect ratio is maintained if the mask source has an intrinsic proportion. If there are no intrinsic proportions, the `auto` value is assumed to be the dimension of the mask positioning area.


Like with all longhand components of shorthand property, if the `mask` shorthand property is set and the value of the `mask-size` property is not defined within any mask layer, the `mask-size` value is reset to its initial value of `auto` for those mask layers.
## Examples
>
### Setting mask size as a percentage
This example demonstrates basic usage, while also demonstrating percentage values for `mask-size`.
#### HTML
We include two `<div>` elements:
    
    <div class="width"></div>
    <div class="height"></div>
    
#### CSS
The `<div>` elements are defined to be twice as tall as they are wide, with a gradient background and mask:
    
    div {
      width: 200px;
      height: 400px;
      background: blue linear-gradient(red, blue);
      mask-image: url("/shared-assets/images/examples/mdn.svg");
    }
    
The width of one `<div>` element's mask is set to `50%`, with the height defaulting to `auto`. The mask's height for the second `<div>` element is set to `50%` with the width set to `auto`:
    
    .width {
      mask-size: 50%;
    }
    
    .height {
      mask-size: auto 50%;
    }
    
In the `width` case, the mask is rendered `100px` wide (`50%` of the `200px`-wide element). The height defaults to `auto`, maintaining the mask's aspect ratio. In the `height` case, the mask is rendered `200px` tall (`50%` of the `400px`-high container). The width is explicitly set to `auto`, maintaining the mask's aspect ratio.
#### Results
### Cover and contain
This example demonstrates the keyword values for `mask-size`.
#### HTML
Three `<section>` elements are defined, each with a different class name, and each containing a `<div>`.
    
    <section class="auto">
      <div></div>
    </section>
    <section class="cover">
      <div></div>
    </section>
    <section class="contain">
      <div></div>
    </section>
    
#### CSS
The `<div>` elements are defined to be twice as tall as they are wide, with a gradient background and mask:
    
    div {
      width: 200px;
      height: 400px;
      background: blue linear-gradient(red, blue);
      mask-image: url("/shared-assets/images/examples/mask-star.svg");
    }
    
The `mask-size` of two of the `<div>` elements is set to one of the property's keyword values. The third `<div>` has a `mask-size` of `auto` set demonstrating the original intrinsic dimensions of the mask:
    
    .auto div {
      mask-size: auto;
    }
    
    .cover div {
      mask-size: cover;
    }
    
    .contain div {
      mask-size: contain;
    }
    
The property values is displayed using generated content.
    
    section::before {
      content: "mask-size: " attr(class) ";";
      display: block;
      text-align: center;
      border-bottom: 1px solid;
    }
    
#### Results
With `auto`, the star is displayed at its intrinsic `100px` by `100px` size. With `cover`, the star grows to be `400px` tall, covering the entire origin box. With `contain`, the star grows until one dimension equals the same dimension of the origin box, meaning that the star is as large as it can be (`200px` wide) but still contained by it.
### When the mask is larger than the container
Using the same HTML and CSS as above, with just a different origin box size, this example explores what happens when the origin box is smaller than the intrinsic dimensions of the mask.
The only difference is the size of the containing box (and the generated content):
    
    div {
      width: 70px;
      height: 70px;
    }
    
The `contain` value contains the mask within the origin box. The `cover` value covers it. In both cases, the mask shrinks while maintaining the original aspect ratio. With `auto`, the mask is clipped because the intrinsic dimensions are larger than the box dimensions.
# :has-slotted
The `:has-slotted` CSS pseudo-class matches when the content of a `<slot>` element is not empty or not using the default value (see Using templates and slots for more information).
Note: Even a single whitespace text node is sufficient to make `:has-slotted` apply.
This only works when used inside CSS placed within a shadow DOM.
    
    /* Selects the content of a <slot> element that has content that is not default  */
    :has-slotted {
      color: green;
    }
    
    /* Selects the content of a <slot> element that has no content or default  */
    :not(:has-slotted) {
      color: red;
    }
    
## Syntax
    
    :has-slotted {
      /* ... */
    }
    
## Examples
This example has two `<slot>` elements, one of which has been assigned some content and the other has not.
### HTML
    
    <p>
      <template shadowrootmode="open">
        <style>
          :has-slotted {
            color: rebeccapurple;
          }
        </style>
        <slot name="one">Placeholder 1</slot>
        <slot name="two">Placeholder 2</slot>
      </template>
      <span slot="one">Slotted content</span>
    </p>
    
### Result
The `<slot>` element that has been assigned content matched the `:has-slotted` pseudo-class and has the `color` value of `rebeccapurple` applied.
# column-fill
The `column-fill` CSS property controls how an element's contents are balanced when broken into columns.
## Try it
    
    column-fill: auto;
    
    
    column-fill: balance;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather.
      </p>
    </section>
    
    
    #example-element {
      width: 100%;
      height: 90%;
      columns: 3;
      text-align: left;
    }
    
## Syntax
    
    /* Keyword values */
    column-fill: auto;
    column-fill: balance;
    
    /* Global values */
    column-fill: inherit;
    column-fill: initial;
    column-fill: revert;
    column-fill: revert-layer;
    column-fill: unset;
    
The `column-fill` property is specified as one of the keyword values listed below. The initial value is `balance` so the content will be balanced across the columns.
### Values
`auto`
    
Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
`balance`
    
Content is equally divided between columns. In fragmented contexts, such as paged media, only the last fragment is balanced. Therefore in paged media, only the last page would be balanced.
The specification defines a `balance-all` value, in which content is equally divided between columns in fragmented contexts, such as paged media. This value is not yet supported in any browser.
## Examples
>
### Balancing column content
#### HTML
    
    <p class="fill-auto">
      This paragraph fills columns one at a time. Since all of the text can fit in
      the first column, the others are empty.
    </p>
    
    <p class="fill-balance">
      This paragraph attempts to balance the amount of content in each column.
    </p>
    
#### CSS
    
    p {
      height: 7em;
      background: #ffff99;
      columns: 3;
      column-rule: 1px solid;
    }
    
    p.fill-auto {
      column-fill: auto;
    }
    
    p.fill-balance {
      column-fill: balance;
    }
    
#### Result
Warning: There are some interoperability issues and bugs with `column-fill` across browsers, due to unresolved issues in the specification.
In particular, when using `column-fill: auto` to fill columns sequentially, Chrome will only consult this property if the multicol container has a size in the block dimension (e.g., height in a horizontal writing mode). Firefox will always consult this property, therefore filling the first column with all of the content in cases where there is no size.
# Namespace separator
The namespace separator (`|`) separates the selector from the namespace, identifying the namespace, or lack thereof, for a type selector.
    
    /* Links in the namespace named myNameSpace */
    myNameSpace|a {
      font-weight: bold;
    }
    /* paragraphs in any namespace (including no namespace) */
    *|p {
      color: darkblue;
    }
    /* heading level 2 not in a namespace */
    |h2 {
      margin-bottom: 0;
    }
    
Type selectors and the universal selector allow an optional namespace component. When a namespace has been previously declared via `@namespace`, these selectors can be namespaced by prepending the selector with the name of the namespace separated by the namespace separator (`|`). This is useful when dealing with documents containing multiple namespaces such as HTML with inline SVG or MathML, or XML that mixes multiple vocabularies.
  * `ns|h1` \- matches `<h1>` elements in namespace `ns`
  * `*|h1` \- matches all `<h1>` elements
  * `|h1` \- matches all `<h1>` elements outside of any declared or implied namespace


## Syntax
    
    namespace|element { style properties }
    
## Examples
By default, all elements in an HTML or SVG element have a namespace as the `http://www.w3.org/1999/xhtml` and `http://www.w3.org/2000/svg` namespace are implied. The `document.createElementNS` method, with an empty string for the namespace parameter, can be used to create elements with no namespace.
### Named namespace example
In this example, all elements are in a namespace.
#### HTML
No namespaces are explicitly declared in the HTML or within the SVG.
    
    <p>This paragraph <a href="#">has a link</a>.</p>
    
    <svg width="400" viewBox="0 0 400 20">
      <a href="#">
        <text x="0" y="15">Link created in SVG</text>
      </a>
    </svg>
    
#### CSS
The CSS declares two namespaces, then assigns styles to links globally (`a`), to links in no namespace (`|a`), to links in any namespace or no namespace (`*|a`), and then to two different named namespaces (`svgNamespace|a` and `htmlNameSpace|a`).
    
    @namespace svgNamespace url("http://www.w3.org/2000/svg");
    @namespace htmlNameSpace url("http://www.w3.org/1999/xhtml");
    /* All `<a>`s in the default namespace, in this case, all `<a>`s */
    a {
      font-size: 1.4rem;
    }
    /* no namespace */
    |a {
      text-decoration: wavy overline lime;
      font-weight: bold;
    }
    /* all namespaces (including no namespace) */
    *|a {
      color: red;
      fill: red;
      font-style: italic;
    }
    /* only the svgNamespace namespace, which is <svg> content */
    svgNamespace|a {
      color: green;
      fill: green;
    }
    /* The htmlNameSpace namespace, which is the HTML document */
    htmlNameSpace|a {
      text-decoration-line: line-through;
    }
    
#### Result
The selector `|a`, a link not in a namespace, doesn't match any links. In HTML, the `http://www.w3.org/1999/xhtml` is implied, meaning all HTML is in a namespace, even if none is explicitly declared. In SVG, even if not explicitly set, the `http://www.w3.org/2000/svg` namespace is also implied. This means all the content is within at least one namespace.
### Default namespace and no namespace
In this example, we use JavaScript to create an element without a namespace and append it to the document. We set the SVG namespace to be the default namespace by defining the unnamed namespace with `@namespace`.
Note: If a default, or unnamed, namespace is defined, universal and type selectors apply only to elements in that namespace.
#### HTML
No namespaces are explicitly declared in the HTML or within the SVG.
    
    <p><a href="#">A link</a> in the implied HTML namespace.</p>
    
    <svg width="400" viewBox="0 0 400 20">
      <a href="#">
        <text x="0" y="15">Link created in SVG namespace</text>
      </a>
    </svg>
    
#### JavaScript
With JavaScript, with `document.createElementNS`, we create an anchor link without a namespace, then append the link.
    
    // create 'no namespace' anchor
    const a = document.createElementNS("", "a");
    a.href = "#";
    a.appendChild(document.createTextNode("Link created without a namespace"));
    
    document.body.appendChild(a);
    
#### CSS
We declare a namespace with `@namespace`. By omitting the name for the namespace, the `@namespace` declaration creates a default namespace.
    
    /* By omitting a name, this sets SVG as the default namespace */
    @namespace url("http://www.w3.org/2000/svg");
    
    /* `<a>` in the default (set to SVG) namespace */
    a {
      font-size: 1.4rem;
    }
    
    /* `<svg>` and `<p>` in the default (set to SVG) namespace */
    svg,
    p {
      border: 5px solid gold;
    }
    
    /* links outside of any namespace */
    |a {
      text-decoration: wavy underline purple;
      font-weight: bold;
    }
    
    /* links with any namespace or no namespace */
    *|a {
      font-style: italic;
      color: magenta;
      fill: magenta;
    }
    
#### Result
The selector with no namespace separator, the `a`, matched only the SVG `<a>` elements, as SVG was set as the default namespace.
The selector with no namespace, the `|a`, matched the JavaScript defined and appended `<a>`, as that node is the only node that doesn't have a default namespace.
# padding-block
The `padding-block` CSS shorthand property defines the logical block start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-block: 10px 20px;
    writing-mode: horizontal-tb;
    
    
    padding-block: 20px 40px;
    writing-mode: vertical-rl;
    
    
    padding-block: 5% 10%;
    writing-mode: horizontal-tb;
    
    
    padding-block: 2em 4em;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `padding-block-start`
  * `padding-block-end`


## Syntax
    
    /* <length> values */
    padding-block: 10px 20px; /* An absolute length */
    padding-block: 1em 2em; /* relative to the text size */
    padding-block: 10px; /* sets both start and end values */
    
    /* <percentage> values */
    padding-block: 5% 2%; /* relative to the nearest block container's width */
    
    /* Global values */
    padding-block: inherit;
    padding-block: initial;
    padding-block: revert;
    padding-block: revert-layer;
    padding-block: unset;
    
The `padding-block` property may be specified with one or two values. If one value is given, it is used as the value for both `padding-block-start` and `padding-block-end`. If two values are given, the first is used for `padding-block-start` and the second for `padding-block-end`.
### Values
The `padding-block` property takes the same values as the `padding-left` property.
## Description
The padding values specified by `padding-block` can be equivalent to the `padding-top` and `padding-bottom` properties or the `padding-right` and `padding-left` properties, depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Examples
>
### Setting block padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding-block: 20px 40px;
      background-color: #c8c800;
    }
    
#### Result
# ray()
The `ray()` CSS function defines the `offset-path` line segment that an animated element can follow. The line segment is referred to as "ray". The ray begins from an `offset-position` and extends in the direction of the specified angle. The length of a ray can be constrained by specifying a size and using the `contain` keyword.
## Syntax
    
    /* all parameters specified */
    offset-path: ray(50deg closest-corner contain at 100px 20px);
    
    /* two parameters specified, order does not matter */
    offset-path: ray(contain 200deg);
    
    /* only one parameter specified */
    offset-path: ray(45deg);
    
### Parameters
The parameters can be specified in any order.
`<angle>`
    
Specifies the direction in which the line segment extends from the offset starting position. The angle `0deg` lies on the y-axis pointing up, and positive angles increase in the clockwise direction.
`<size>`
    
Specifies the length of the line segment, which is the distance between `offset-distance` `0%` and `100%`, relative to the containing box. This is an optional parameter (`closest-side` is used if no `<size>` is specified). It accepts one of the following keyword values:
`closest-side`: Distance between the ray's starting point and the closest side of the containing block of the element. If the ray's starting point lies on an edge of the containing block, the length of the line segment is zero. If the ray's starting point is outside the containing block, the edge of the containing block is considered to extend to infinity. This is the default value.
`closest-corner`: Distance between the ray's starting point and the closest corner in the element's containing block. If the ray's starting point lies on a corner of the containing block, the length of the line segment is zero.
`farthest-side`: Distance between the ray's starting point and the farthest side of the containing block of the element. If the ray's starting point is outside the containing block, the edge of the containing block is considered to extend to infinity.
`farthest-corner`: Distance between the ray's starting point and the farthest corner in the element's containing block.
`sides`: Distance between the ray's starting point and the point where the line segment intersects the containing block's boundary. If the starting point is on or outside the containing block's boundary, the length of the line segment is zero.
`contain`
    
Reduces the length of the line segment so that the element stays within the containing block even at `offset-distance: 100%`. Specifically, the segment's length is reduced by half the width or half the height of the element's border box, whichever is greater, and never less than zero. This is an optional parameter.
`at <position>`
    
Specifies the point where the ray begins and where the element is placed in its containing block. This is an optional parameter. If included, the `<position>` value must be preceded by the `at` keyword. If omitted, the value used is the `offset-position` value of the element. If omitted and the element doesn't have an `offset-position` value, the value used for the ray's starting position is `offset-position: normal`, which places the element at the center (or `50% 50%`) of the containing block.
## Description
The `ray()` function positions an element along a path by specifying its location in a two-dimensional space through an angle and a distance from a reference point (polar coordinates). This feature makes the `ray()` function useful for creating 2D spatial transitions. For comparison, this approach differs from the method of specifying a point by its horizontal and vertical distances from a fixed origin (rectangular coordinates), which is used by the `translate()` function, and from moving an element along a defined path through animation.
As `ray()` works in 2D space, it's important to consider both the initial position and orientation of the element. When the `ray()` function is applied as the `offset-path` value on an element, here's how you can control these aspects:
  * The element is initially positioned by moving the element's `offset-anchor` point to the element's offset starting position. By default, the ray's starting position is determined by the `offset-position` value. If `offset-position` is explicitly specified as `normal` (or omitted and allowed to default to `normal`), the element is positioned at the `center` (or `50% 50%`) of its containing block. Specifying `offset-position: auto` sets the starting position at the `top left` corner (or `0 0`) of the element's position.
  * The element is initially rotated such that its inline axis — its direction of text flow — aligns with the angle specified by `ray()`. For example, with the `ray()` angle of `0deg`, which lies on the y-axis pointing up, the element's inline axis is rotated to be vertical to match the ray's angle. The element maintains this rotation throughout its path. To customize this behavior, use the `offset-rotate` property, which allows you to specify a different rotation angle or direction for the element, enabling more precise control over its appearance as it follows the path. For example, setting `offset-rotate: 0deg` will remove any rotation applied by `ray()`, aligning back the element's inline axis with the direction of text flow.


## Examples
>
### Defining the angle and starting position for a ray
This example shows how to work with an element's starting position and how the element's orientation is impacted by the specified ray angle.
#### CSS
    
    .box {
      background-color: palegreen;
      border-top: 4px solid black;
      opacity: 20%;
    }
    
    .box:first-of-type {
      position: absolute;
    }
    
    .box1 {
      offset-path: ray(0deg);
    }
    
    .box2 {
      offset-path: ray(150deg);
    }
    
    .box3 {
      offset-rotate: 0deg;
      offset-position: 20% 40%;
      offset-path: ray(150deg);
    }
    
    .box4 {
      offset-position: 0 0;
      offset-path: ray(0deg);
    }
    
    .box5 {
      offset-path: ray(60deg closest-side at bottom right);
    }
    
Similar to `transform-origin`, the default anchor point is at the center of an element. This anchor point can be modified using the `offset-anchor` property.
In this example, various `offset-path: ray()` values are applied to the boxes numbered `1` to `5`. The "containing block" of each box is depicted with a dashed border. A faded box in the upper left corner shows each box's default position without any `offset-position` or `offset-path` applied, allowing for a side-by-side comparison. The top of each box is highlighted with a `solid` border to illustrate variations in ray starting points and orientations. After positioning at the ray's starting point, a box aligns with the direction of the specified ray angle. If `offset-position` is not specified, the default offset starting position of the ray is the center (or `50% 50%`) of the box's containing block.
#### Result
  * `box1` gets initially positioned such that its anchor point (its center) is at the default offset starting position (`50% 50%` of the containing block). `box1` is also rotated to orient it towards the `0deg` angle of the ray. This will now be the starting point of the path. You can observe the change in position and rotation of the box by comparing it to the faded `box0` on the left. The box is rotated to match the `0deg` angle along y-axis, pointing up. The box rotation is evident from the orientation of the number inside the box.
  * In `box2`, a greater positive angle of `150deg` is applied to the ray to show how the ray angle works. Starting from the top-left corner, the box is rotated in a clockwise direction to reach the specified angle of `150deg`.
  * `box2` and `box3` have the same `offset-path` values. In `box3`, an `offset-rotate` of `0deg` is also applied to the element. As a result, the element will remain rotated at this specific angle all along the ray's path, and the element will not rotate in the direction of the path. Notice in `box3` that the ray path is at `150deg`, but the box orientation will not change along the path because of `offset-rotate`. Also note that the `offset-path` property of `box3` does not specify a starting `<position>`, so the ray's starting position is derived from the element's `offset-position`, which in this case is `top 20% left 40%`.
  * The `offset-position` of `box4` is set to top-left corner (`0 0`) of the containing block, and as a result, the element's anchor point and the offset starting position coincide. The ray angle of `0deg` is applied to the element at this starting point.
  * In `box5`, the `offset-path` property specifies the `at <position>` value, which places the box at the `bottom` and `right` edge of the element's containing block and `60deg` is applied to the ray's angle.


### Animating an element along the ray
In this example, the first shape is shown as a reference for its position and orientation. A ray motion path is applied on the other shapes.
#### CSS
    
    body {
      display: grid;
      grid-template-columns: 200px 100px;
      gap: 40px;
      margin-left: 40px;
    }
    
    .container {
      transform-style: preserve-3d;
      width: 150px;
      height: 100px;
      border: 2px dotted green;
    }
    
    .shape {
      width: 40px;
      height: 40px;
      background: #2bc4a2;
      margin: 5px;
      text-align: center;
      line-height: 40px;
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
      animation: move 5000ms infinite alternate ease-in-out;
    }
    
    .shape2 {
      offset-path: ray(120deg sides contain);
    }
    
    .shape3 {
      offset-rotate: 0deg;
      offset-path: ray(120deg sides contain);
    }
    
    .shape4 {
      offset-position: auto;
      offset-path: ray(120deg closest-corner);
    }
    
    .shape5 {
      offset-position: auto;
      offset-path: ray(120deg farthest-corner);
    }
    
    @keyframes move {
      0%,
      20% {
        offset-distance: 0%;
      }
      80%,
      100% {
        offset-distance: 100%;
      }
    }
    
#### Result
In the first two samples where `offset-path` is applied, notice the orientation of the shape without `offset-rotate` and with `offset-rotate`. Both these samples use the default `offset-position` value `normal`, and therefore, the path motion starts from `50% 50%`. The last two `offset-path` samples show the impact of corner `<size>` values: `closest-corner` and `farthest-corner`. The `closest-corner` value creates a very short offset-path because the shape is already at the corner (`offset-position: auto`). The `farthest-corner` value creates the longest offset-path, going from the top-left corner of the containing block to the bottom-right corner.
# animation-delay
The `animation-delay` CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation.
## Try it
    
    animation-delay: 250ms;
    
    
    animation-delay: 2s;
    
    
    animation-delay: -2s;
    
    
    <section class="flex-column" id="default-example">
      <div>Animation <span id="play-status"></span></div>
      <div id="example-element">Select a delay to start!</div>
    </section>
    
    
    #example-element {
      background-color: #1766aa;
      color: white;
      margin: auto;
      margin-left: 0;
      border: 5px solid #333333;
      width: 150px;
      height: 150px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
    }
    
    #play-status {
      font-weight: bold;
    }
    
    .animating {
      animation-name: slide;
      animation-duration: 3s;
      animation-timing-function: ease-in;
      animation-iteration-count: 2;
      animation-direction: alternate;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const status = document.getElementById("play-status");
    
    function update() {
      status.textContent = "delaying";
      el.className = "";
      window.requestAnimationFrame(() => {
        window.requestAnimationFrame(() => {
          el.className = "animating";
        });
      });
    }
    
    el.addEventListener("animationstart", () => {
      status.textContent = "playing";
    });
    
    el.addEventListener("animationend", () => {
      status.textContent = "finished";
    });
    
    const observer = new MutationObserver(() => {
      update();
    });
    
    observer.observe(el, {
      attributes: true,
      attributeFilter: ["style"],
    });
    
    update();
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Single animation */
    animation-delay: 3s;
    animation-delay: 0s;
    animation-delay: -1500ms;
    
    /* Multiple animations */
    animation-delay: 2.1s, 480ms;
    
    /* Global values */
    animation-delay: inherit;
    animation-delay: initial;
    animation-delay: revert;
    animation-delay: revert-layer;
    animation-delay: unset;
    
### Values
`<time>`
    
The time offset, from the moment at which the animation is applied to the element, at which the animation should begin. This may be specified in either seconds (`s`) or milliseconds (`ms`). The unit is required.
A positive value indicates that the animation should begin after the specified amount of time has elapsed. A value of `0s`, which is the default, indicates that the animation should begin as soon as it's applied.
A negative value causes the animation to begin immediately, but partway through its cycle. For example, if you specify `-1s` as the animation delay time, the animation will begin immediately but will start 1 second into the animation sequence. If you specify a negative value for the animation delay, but the starting value is implicit, the starting value is taken from the moment the animation is applied to the element.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: `animation-delay` has no effect on CSS scroll-driven animations.
## Examples
>
### Setting an animation delay
This animation has a delay of 2 seconds.
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
    }
    
    .box:hover {
      animation-name: rotate;
      animation-duration: 0.7s;
      animation-delay: 2s;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
Hover over the rectangle to start the animation.
See CSS animations for examples.
# padding-inline-start
The `padding-inline-start` CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-inline-start: 20px;
    writing-mode: horizontal-tb;
    
    
    padding-inline-start: 20px;
    writing-mode: vertical-rl;
    
    
    padding-inline-start: 5em;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    padding-inline-start: 10px; /* An absolute length */
    padding-inline-start: 1em; /* A length relative to the text size */
    
    /* <percentage> value */
    padding-inline-start: 5%; /* A padding relative to the block container's width */
    
    /* Global values */
    padding-inline-start: inherit;
    padding-inline-start: initial;
    padding-inline-start: revert;
    padding-inline-start: revert-layer;
    padding-inline-start: unset;
    
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Description
The `padding-inline-start` property takes the same values as physical properties such as `padding-top`. However, it can be equivalent to `padding-left`, `padding-right`, `padding-top`, or `padding-bottom` depending on the values set for `writing-mode`, `direction`, and `text-orientation`.
It relates to `padding-block-start`, `padding-block-end`, and `padding-inline-end`, which define the other padding values of the element.
## Examples
>
### Setting inline start padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      padding-inline-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# <time>
The `<time>` CSS data type represents a time value expressed in seconds or milliseconds. It is used in `animation`, `transition`, and related properties.
## Syntax
The `<time>` data type consists of a `<number>` followed by one of the units listed below. Optionally, it may be preceded by a single `+` or `-` sign. As with all dimensions, there is no space between the unit literal and the number.
Note: Although the number `0` is always the same regardless of unit, the unit may not be omitted. In other words, `0` is invalid and does not represent `0s` or `0ms`.
### Units
`s`
    
Represents a time in seconds. Examples: `0s`, `1.5s`, `-60s`.
`ms`
    
Represents a time in milliseconds. Examples: `0ms`, `150.25ms`, `-60000ms`.
Note: Conversion between `s` and `ms` follows the logical `1s` = `1000ms`.
## Examples
>
### Valid times
    
    12s         Positive integer
    -456ms      Negative integer
    4.3ms       Non-integer
    14mS        The unit is case-insensitive, although capital letters are not recommended.
    +0s         Zero with a leading + and a unit
    -0ms        Zero with a leading - and a unit
    
### Invalid times
    
    0           Although unitless zero is allowed for <length>s, it's invalid for <time>s.
    12.0        This is a <number>, not a <time>, because it's missing a unit.
    7 ms        No space is allowed between the number and the unit.
    
# text-combine-upright
The `text-combine-upright` CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes.
This is used to produce an effect that is known as tate-chū-yoko "縦中横" in Japanese, or as "橫向文字" in Chinese.
## Try it
    
    text-combine-upright: none;
    
    
    text-combine-upright: all;
    
    
    <section class="default-example" id="default-example">
      <div>
        <p>
          <span class="transition-all" id="example-element"
            >2022<span>年</span>12<span>月</span>8</span
          >日から楽しい
        </p>
      </div>
    </section>
    
    
    p {
      writing-mode: vertical-rl;
    }
    
## Syntax
    
    /* Keyword values */
    text-combine-upright: none;
    text-combine-upright: all;
    
    /* Global values */
    text-combine-upright: inherit;
    text-combine-upright: initial;
    text-combine-upright: revert;
    text-combine-upright: revert-layer;
    text-combine-upright: unset;
    
### Values
`none`
    
There is no special processing.
`all`
    
Attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box.
Note: The CSS writing modes module defines a `digits <integer>` value for the `text-combine-upright` property to display two to four consecutive ASCII digits (U+0030–U+0039) such that it takes up the space of a single character within the vertical line box, however, this is not supported in any browsers.
## Examples
>
### Using 'all' with horizontal text
The all value requires markup around every piece of horizontal text, but it is currently supported by more browsers than the digits value.
#### HTML
    
    <p lang="zh-Hant">
      民國<span class="num">105</span>年<span class="num">4</span>月<span
        class="num"
        >29</span
      >日
    </p>
    
#### CSS
    
    html {
      writing-mode: vertical-rl;
      font: 24px serif;
    }
    .num {
      text-combine-upright: all;
    }
    
#### Results
# <display-outside>
The `<display-outside>` keywords specify the element's outer `display` type, which is essentially its role in flow layout. These keywords are used as values of the `display` property, and can be used for legacy purposes as a single keyword, or as defined in the Level 3 specification alongside a value from the `<display-inside>` keywords.
## Syntax
Valid `<display-outside>` values:
`block`
    
The element generates a block element box, generating line breaks both before and after the element when in the normal flow.
`inline`
    
The element generates one or more inline element boxes that do not generate line breaks before or after themselves. In normal flow, the next element will be on the same line if there is space.
Note: When browsers encounter a display property with only an outer `display` value (e.g., `display: block` or `display: inline`), the inner value defaults to `flow` (e.g., `display: block flow` and `display: inline flow`). This is backwards-compatible with single-keyword syntax.
## Examples
In the following example, span elements (normally displayed as inline elements) are set to `display: block` and so break onto new lines and expand to fill their container in the inline dimension.
### HTML
    
    <span>span 1</span> <span>span 2</span>
    
### CSS
    
    span {
      display: block;
      border: 1px solid rebeccapurple;
    }
    
### Result
>
### css.properties.display.block
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-outside` 1 12 1 7 1 18 4 10.1 1 1.0 4.4 1  
### css.properties.display.inline
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-outside` 1 12 1 7 1 18 4 10.1 1 1.0 4.4 1  
# overflow-clip-margin
The `overflow-clip-margin` CSS property determines how far outside its bounds an element with `overflow: clip` may be painted before being clipped. The bound defined by this property is called the overflow clip edge of the box.
## Syntax
    
    /* <length> values */
    overflow-clip-margin: 20px;
    overflow-clip-margin: 1em;
    
    /* <visual-box> | <length> */
    overflow-clip-margin: content-box 5px;
    
    /* Global values */
    overflow-clip-margin: inherit;
    overflow-clip-margin: initial;
    overflow-clip-margin: revert;
    overflow-clip-margin: revert-layer;
    overflow-clip-margin: unset;
    
The `<visual-box>` value, which defaults to `padding-box`, specifies the box edge to use as the overflow clip edge origin. The `<length>` value specified in `overflow-clip-margin` must be nonnegative.
Note: If the element does not have `overflow: clip` then this property will be ignored.
## Examples
>
### HTML
    
    <div class="box">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
      quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
      consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
      cillum dolore eu fugiat nulla pariatur.
    </div>
    
### CSS
    
    .box {
      border: 3px solid black;
      width: 250px;
      height: 100px;
      overflow: clip;
      overflow-clip-margin: 20px;
    }
    
### Result
# column-gap
The `column-gap` CSS property sets the size of the gap (gutter) between an element's columns.
Initially a part of Multi-column Layout, the definition of `column-gap` has been broadened to include multiple layout methods. Now specified in CSS box alignment, it may be used in multi-column, flexible box, and grid layouts.
Early versions of the specification called this property `grid-column-gap`, and to maintain compatibility with legacy websites, browsers will still accept `grid-column-gap` as an alias for `column-gap`.
## Try it
    
    column-gap: 0;
    
    
    column-gap: 10%;
    
    
    column-gap: 1em;
    
    
    column-gap: 20px;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 200px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Syntax
    
    /* Keyword value */
    column-gap: normal;
    
    /* <length> values */
    column-gap: 3px;
    column-gap: 2.5em;
    
    /* <percentage> value */
    column-gap: 3%;
    
    /* Global values */
    column-gap: inherit;
    column-gap: initial;
    column-gap: revert;
    column-gap: revert-layer;
    column-gap: unset;
    
The `column-gap` property is specified as one of the values listed below.
### Values
`normal`
    
The browser's default spacing is used between columns. For multi-column layout this is specified as `1em`. For all other layout types it is 0.
`<length>`
    
The size of the gap between columns, defined as a `<length>`. The `<length>` property's value must be non-negative.
`<percentage>`
    
The size of the gap between columns, defined as a `<percentage>`. The `<percentage>` property's value must be non-negative.
## Examples
>
### Flex layout
In this example, a flex container contains six flex items of two different widths (`200px` and `300px`), creating flex items that are not laid out as a grid. The `column-gap` property is used to add horizontal space between the adjacent flex items.
#### HTML
    
    <div class="flexbox">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
To create a flex container, we set its `display` property value to `flex`. We then use the `flex-flow` shorthand property to set the `flex-direction` to row (the default) and `flex-wrap` to `wrap`, allowing the flex items to flow onto new lines if needed. By default, flex items stretch to be as tall as their container. By setting a `height`, even the empty flex items will be `100px` tall.
To better demonstrate the `column-gap` property, the flex items in this example have two different width values. The width of the flex items is set within the `<div>` flex items. We use the `flex-basis` component of the `flex` shorthand property to make all the flex items `200px` wide. We then target every third flex item by using the `:nth-of-type(3n)` selector, widening them to `300px`.
The `column-gap` value is set as `20px` on the flex container to create a `20px` gap between the adjacent flex items in each row.
    
    .flexbox {
      display: flex;
      flex-flow: row wrap;
      height: 100px;
      column-gap: 20px;
    }
    
    .flexbox > div {
      border: 1px solid green;
      background-color: lime;
      flex: 200px;
    }
    div:nth-of-type(3n) {
      flex: 300px;
    }
    
#### Result
Note: While there is horizontal space between adjacent flex items in each flex row, there is no space between the rows. To set vertical space between flex rows, you can specify a non-zero value for the `row-gap` property. The `gap` shorthand property is also available to set both the `row-gap` and `column-gap` in one declaration, in that order.
### Grid layout
#### HTML
    
    <div id="grid">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 100px;
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: 100px;
      column-gap: 20px;
    }
    
    #grid > div {
      border: 1px solid green;
      background-color: lime;
    }
    
#### Result
### Multi-column layout
#### HTML
    
    <p class="content-box">
      This is some multi-column text with a 40px column gap created with the CSS
      `column-gap` property. Don't you think that's fun and exciting? I sure do!
    </p>
    
#### CSS
    
    .content-box {
      column-count: 3;
      column-gap: 40px;
    }
    
#### Result
# :dir()
The `:dir()` CSS pseudo-class matches elements based on the directionality of the text contained in them.
    
    /* Selects any element with right-to-left text */
    :dir(rtl) {
      background-color: red;
    }
    
The `:dir()` pseudo-class uses only the semantic value of the directionality, i.e., the one defined in the document itself. It doesn't account for styling directionality, i.e., the directionality set by CSS properties such as `direction`.
Note: Be aware that the behavior of the `:dir()` pseudo-class is not equivalent to the `[dir=…]` attribute selectors. The latter match the HTML `dir` attribute, and ignore elements that lack it — even if they inherit a direction from their parent. (Similarly, `[dir=rtl]` and `[dir=ltr]` won't match the `auto` value.) In contrast, `:dir()` will match the value calculated by the user agent, even if inherited.
Note: In HTML, the direction is determined by the `dir` attribute. Other document types may have different methods.
## Syntax
    
    :dir([ltr | rtl]) {
      /* ... */
    }
    
### Parameters
The `:dir()` pseudo-class requires one parameter, representing the text directionality you want to target.
`ltr`
    
Target left-to-right elements.
`rtl`
    
Target right-to-left elements.
## Examples
>
### HTML
    
    <div dir="rtl">
      <span>test1</span>
      <div dir="ltr">
        test2
        <div dir="auto">עִבְרִית</div>
      </div>
    </div>
    
### CSS
    
    :dir(ltr) {
      background-color: yellow;
    }
    
    :dir(rtl) {
      background-color: powderblue;
    }
    
### Result
# :empty
The `:empty` CSS pseudo-class represents any element that has no children. Children can be either element nodes or text (including whitespace). Comments, processing instructions, and CSS `content` do not affect whether an element is considered empty.
## Try it
    
    div:empty {
      outline: 2px solid deeppink;
      height: 1em;
    }
    
    
    <p>Element with no content:</p>
    <div></div>
    
    <p>Element with comment:</p>
    <div><!-- A comment --></div>
    
    <p>Element with nested empty element:</p>
    <div><p></p></div>
    
Note: In Selectors Level 4, the `:empty` pseudo-class was changed to act like `:-moz-only-whitespace`, but no browser currently supports this yet.
## Syntax
    
    :empty {
      /* ... */
    }
    
## Accessibility
Assistive technology such as screen readers cannot parse interactive content that is empty. All interactive content must have an accessible name, which is created by providing a text value for the interactive control's parent element (anchors, buttons, etc.). Accessible names expose the interactive control to the accessibility tree, an API that communicates information useful for assistive technologies.
The text that provides the interactive control's accessible name can be hidden using a combination of properties that remove it visually from the screen but keep it parsable by assistive technology. This is commonly used for buttons that rely solely on an icon to convey purpose.
  * What is an accessible name? | The Paciello Group
  * Hidden content for better a11y | Go Make Things
  * MDN Understanding WCAG, Guideline 2.4 explanations
  * Understanding Success Criterion 2.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### HTML
    
    <div class="box"><!-- I will be lime. --></div>
    <div class="box">I will be pink.</div>
    <div class="box">
      <!-- I will be pink in older browsers because of the whitespace around this comment. -->
    </div>
    <div class="box">
      <p>
        <!-- I will be pink in all browsers because of the non-collapsible whitespace and elements around this comment. -->
      </p>
    </div>
    
### CSS
    
    .box {
      background: pink;
      height: 80px;
      width: 80px;
    }
    
    .box:empty {
      background: lime;
    }
    
### Result
# widows
The `widows` CSS property sets the minimum number of lines in a block container that must be shown at the top of a page, region, or column.
In typography, a widow is the last line of a paragraph that appears alone at the top of a page. (The paragraph is continued from a prior page.)
## Syntax
    
    /* <integer> values */
    widows: 2;
    widows: 3;
    
    /* Global values */
    widows: inherit;
    widows: initial;
    widows: revert;
    widows: revert-layer;
    widows: unset;
    
### Values
`<integer>`
    
The minimum number of lines that can stay by themselves at the top of a new fragment after a fragmentation break. The value must be positive.
## Examples
>
### Controlling column widows
#### HTML
    
    <div>
      <p>This is the first paragraph containing some text.</p>
      <p>
        This is the second paragraph containing some more text than the first one.
        It is used to demonstrate how widows work.
      </p>
      <p>
        This is the third paragraph. It has a little bit more text than the first
        one.
      </p>
    </div>
    
#### CSS
    
    div {
      background-color: #8cffa0;
      columns: 3;
      widows: 2;
    }
    
    p {
      background-color: #8ca0ff;
    }
    
    p:first-child {
      margin-top: 0;
    }
    
#### Result
# mask-repeat
The `mask-repeat` CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all.
## Syntax
    
    /* One-value syntax */
    mask-repeat: repeat-x;
    mask-repeat: repeat-y;
    mask-repeat: repeat;
    mask-repeat: space;
    mask-repeat: round;
    mask-repeat: no-repeat;
    
    /* Two-value syntax: horizontal | vertical */
    mask-repeat: repeat space;
    mask-repeat: repeat repeat;
    mask-repeat: round space;
    mask-repeat: no-repeat round;
    
    /* Multiple values */
    mask-repeat:
      space round,
      no-repeat;
    mask-repeat:
      round repeat,
      space,
      repeat-x;
    
    /* Global values */
    mask-repeat: inherit;
    mask-repeat: initial;
    mask-repeat: revert;
    mask-repeat: revert-layer;
    mask-repeat: unset;
    
### Values
The `mask-repeat` property is a comma-separated list of two `<repeat-style>` values, with the first `<repeat-style>` value being the horizontal repetition value and the second value the vertical repetition value, or one keyword value that is a shorthand for two `<repeat-style>` values.
####  `<repeat-style>` values
The `<repeat-style>` values include:
`repeat`
    
The image is repeated as much as needed to cover the whole mask painting area. Mask images along the edges are clipped when the size of the mask origin box is not an exact multiple of the mask image's size.
`space`
    
The mask image is repeated as many times as possible without clipping. If the element's origin size is at least twice the size as the mask image's size in the associated dimension, the `mask-position` property is ignored and the first and last images are positioned at the edges of the mask origin container. If the mask origin box is not an exact multiple of the mask image's size, whitespace is distributed evenly between the repeated mask images.
If the origin box size is less than twice the mask image's size in the given dimension, only one mask image can be displayed. In this case, the image is positioned as defined by the `mask-position` property, which defaults to `0% 0%`. The mask image will only be clipped if the mask image is larger than the mask origin box.
`round`
    
The mask image is repeated as many times as possible in its original dimensions. If the size of the mask origin box is not an exact multiple of the mask image's size, all mask images will be rescaled, shrinking or stretching to ensure no repetitions are clipped.
`no-repeat`
    
The mask image is not repeated (and hence the mask painting area will not necessarily be entirely covered). The position of the non-repeated mask image is defined by the `mask-position` CSS property.
#### Shorthand values
The one-value syntax is a shorthand for the full two-value syntax:
Single value Two-value equivalent  
`repeat-x` `repeat no-repeat`  
`repeat-y` `no-repeat repeat`  
`repeat` `repeat repeat`  
`space` `space space`  
`round` `round round`  
`no-repeat` `no-repeat no-repeat`  
`repeat-x`
    
The equivalent of `repeat no-repeat`. The image is repeated in the horizontal direction as many times as needed to cover the width of the mask painting area. Mask images along the right or left edges, or both depending on the `mask-position` value, will be clipped if the width of the mask origin box is not an exact multiple of the mask image's width.
`repeat-y`
    
The equivalent of `no-repeat repeat`. The image is repeated in the vertical direction as many times as needed to cover the height of the mask painting area. Mask images along the top or bottom edges, or both depending on the `mask-position` value, will be clipped if the height of the mask origin box is not an exact multiple of the mask image's height.
## Description
The `mask-repeat` property accepts a comma-separated pair of values or one shorthand value. In the two-value syntax, the first value represents the horizontal repetition behavior and the second value represents the vertical behavior.
### Multiple values
Each `mask-repeat` value in this comma-separated list applies to a separate mask layer. An element can have multiple mask layers applied. The number of layers is determined by the number of comma-separated values in the `mask-image` property value (even if a value is `none`). Each `mask-repeat` value is matched up with the `mask-image` values, in order. If the number of values in the two properties differs, any excess values of `mask-repeat` values are ignored, or, if `mask-repeat` has fewer values than `mask-image`, the `mask-repeat` values are repeated.
### Sizing and positioning
The `mask-repeat` property value defines how mask images are tiled after they have been sized and positioned. The first (and possibly only) mask-image repetition is positioned by the `mask-position` property, which defaults to `0% 0%`, the top-left corner of the origin box. The size is defined by the `mask-size` property, which defaults to `auto`. The positions of the repeated masks are based on this initial mask instance.
### Clipping
Mask images will not repeat but will be clipped if the mask image's size is larger than the origin box, except in the case of `round`, where a single mask will be scaled down to fit the origin box.
With `repeat` values, mask images may be clipped at the edge of the origin box if the dimension (width or height) of the box is not an exact multiple of the mask's.
### Aspect ratio
By default, mask images maintain the aspect ratio set by the `mask-size` property or their default aspect ratio if the `mask-size` defaults to or is explicitly set to `auto`. Only in the case of `round` value in both directions might the mask aspect ratio be distorted.
If `round` is set in both directions, the resulting repeated mask images will match the aspect ratio of the origin box. As the mask images are scaled to fit, they may be distorted, ensuring the mask images are not clipped. If `round` is set in only one dimension, the aspect ratio of the mask size is respected.
### Rounded repetitions
In the case of `round`, mask images are scaled up or down to fit the mask image in the positioning area a whole number of times. The mask size increases or decreases to fit the nearest natural number or masks, with a minimum of one mask.
The rendered dimensions of the mask is the size of the origin box divided by the number of iterations of masks in that dimension, where the iterations being an integer greater than zero. The number of iterations is: `X' = D / round(D / X)` where `D` is the width or height, and `round()` is a function that returns the nearest integer greater than zero.
For example, if `mask-repeat` is set to `round` and the `mask-size` sets the mask to be `40px` wide, when the origin box is present (greater than `0px` wide) but less than `60px` wide, there will be a single iteration that is 100% of the width of that box. If the box is at least `60px` wide but less than `100px` wide, there will be two iterations that are each `50%` of the box. From 100px to 140px, three masks will fit along the horizontal axis. These "`40px`-wide" masks will only be `40px` wide if the origin box is an exact multiple of `40px`.
## Examples
>
### Basic usage
This example demonstrates setting the `mask-repeat` property for a single mask.
#### HTML
Our HTML includes a basic `<div>` element:
    
    <div></div>
    
#### CSS
We define a `250px` square with a red to blue gradient with a `100px` by `100px` star as a mask image. We use the `mask-repeat` property, setting `round` for the horizontal direction and `space` for the vertical value.
    
    div {
      width: 250px;
      height: 250px;
      background-image: linear-gradient(red, blue);
    
      mask-image: url("/shared-assets/images/examples/mask-star.svg");
      mask-size: 100px 100px;
    
      mask-repeat: round space;
    }
    
#### Results
With `space` and `round` on a mask image that is smaller than the origin box, the mask is not clipped. Rather, the `round` value distorts the star to prevent clipping and preventing white space, while `space` maintains the star's aspect ratio, but adds space as needed between masks.
### Round iterations
Using the same HTML and CSS, this demonstration includes a slider that changes the width of the container to show how, with `round`, masks will grow as space allows until another iteration of the mask fits, or shrink until the number of iterations no longer fits.
The mask is defined as `100px` wide. There is a single star when the origin box is from `1px` to `149px` wide, two stars from `150px` to `249px`, three stars from `250px` to `349px`, and so on.
### The shorthand values
This examples demonstrates all `mask-repeat` shorthand (single-keyword) values.
#### HTML
We include several `<section>` elements each containing a `<div>`, each with a different class name.
    
    <section class="repeat">
      <div></div>
    </section>
    <section class="space">
      <div></div>
    </section>
    <section class="round">
      <div></div>
    </section>
    <section class="no-repeat">
      <div></div>
    </section>
    <section class="repeat-x">
      <div></div>
    </section>
    <section class="repeat-y">
      <div></div>
    </section>
    
#### CSS
We give every `<div>` the same CSS, except for the `mask-repeat` value, which we match to their parent's class name. We define a mask size, setting the initial `mask-image` at the bottom right, meaning any clipping will occur on the top-most and left-most masks, on their top and left sides.
    
    div {
      width: 180px;
      height: 180px;
      background-image: linear-gradient(red, blue);
    
      mask-image: url("/shared-assets/images/examples/mask-star.svg");
    
      mask-size: 50px 50px;
      mask-position: bottom right;
    }
    
    .repeat div {
      mask-repeat: repeat;
    }
    .space div {
      mask-repeat: space;
    }
    .round div {
      mask-repeat: round;
    }
    .no-repeat div {
      mask-repeat: no-repeat;
    }
    .repeat-x div {
      mask-repeat: repeat-x;
    }
    .repeat-y div {
      mask-repeat: repeat-y;
    }
    
We display the class name using generated content.
    
    section::before {
      content: attr(class);
      display: block;
      text-align: center;
      border-bottom: 1px solid;
    }
    
#### Results
The first (and, in the case of `no-repeat`, only) mask star is sized to be 50px by 50px, and positioned at the bottom-right of the painting area, with repeated stars placed above and/or to the left of it with any clipping occurring on the top and left of the top-most and left-most stars. Note that all the stars are the same size and shape, except for `round`, where all the masks shrank to 45px x 45px to fit four complete masks in each direction. Had the container been 174px, there would have been three stars in each direction, instead of four, and each star would have been stretched.
### Multiple mask images and repeats
You can specify a different `<repeat-style>` for each mask image, separated by commas:
    
    .extra-repeats {
      mask-image: url("mask1.png"), url("mask2.png");
      mask-repeat: repeat-x, repeat-y, space;
    }
    
Each image is matched with the corresponding repeat style. As there are more `mask-repeat` values than `mask-image` values, the excess `mask-repeat` values are ignored.
    
    .missing-repeats {
      mask-image:
        url("mask1.png"), url("mask2.png"), url("mask3.png"), url("mask4.png");
      mask-repeat: repeat-x, repeat-y;
    }
    
Each image is matched with a corresponding repeat style. As there are more `mask-image` values than `mask-repeat` values, the `mask-repeat` is repeated until every `mask-image` has an associated `mask-repeat` value. Here, odd numbered masks repeat along the x-axis, while the even numbered masks repeat along the y-axis.
# Next-sibling combinator
The next-sibling combinator (`+`) separates two selectors and matches the second element only if it immediately follows the first element, and both are children of the same parent `element`.
    
    /* Paragraphs that come immediately after any image */
    img + p {
      font-weight: bold;
    }
    
## Syntax
    
    /* The white space around the + combinator is optional but recommended. */
    former_element + target_element { style properties }
    
## Examples
>
### Basic usage
This example demonstrates how to select the next sibling if that next sibling is of a specific type.
#### CSS
We only style the `<li>` that comes immediately after an `<li>` that is the first of its type:
    
    li:first-of-type + li {
      color: red;
      font-weight: bold;
    }
    
#### HTML
    
    <ul>
      <li>One</li>
      <li>Two!</li>
      <li>Three</li>
    </ul>
    
#### Result
### Selecting a previous sibling
The next-sibling combinator can be included within the `:has()` functional selector to select the previous sibling.
#### CSS
We only style the `<li>` with a next sibling that is an `<li>` that is the last of its type:
    
    li:has(+ li:last-of-type) {
      color: red;
      font-weight: bold;
    }
    
#### HTML
    
    <ul>
      <li>One</li>
      <li>Two</li>
      <li>Three!</li>
      <li>Four</li>
    </ul>
    
#### Result
# font-feature-settings
The `font-feature-settings` CSS property controls advanced typographic features in OpenType fonts.
## Try it
    
    font-feature-settings: normal;
    
    
    font-feature-settings: "liga" 0;
    
    
    font-feature-settings: "tnum";
    
    
    font-feature-settings: "smcp", "zero";
    
    
    <section id="default-example">
      <div id="example-element">
        <p>Difficult waffles</p>
        <table>
          <tr>
            <td><span class="tabular">0O</span></td>
          </tr>
          <tr>
            <td><span class="tabular">3.14</span></td>
          </tr>
          <tr>
            <td><span class="tabular">2.71</span></td>
          </tr>
        </table>
      </div>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    section {
      font-family: "Fira Sans", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
    #example-element table {
      margin-left: auto;
      margin-right: auto;
    }
    
    .tabular {
      border: 1px solid;
    }
    
## Syntax
    
    /* Use the default settings */
    font-feature-settings: normal;
    
    /* Set values for OpenType feature tags */
    font-feature-settings: "smcp";
    font-feature-settings: "smcp" on;
    font-feature-settings: "swsh" 2;
    font-feature-settings:
      "smcp",
      "swsh" 2;
    
    /* Global values */
    font-feature-settings: inherit;
    font-feature-settings: initial;
    font-feature-settings: revert;
    font-feature-settings: revert-layer;
    font-feature-settings: unset;
    
Whenever possible, Web authors should instead use the `font-variant` shorthand property or an associated longhand property such as `font-variant-ligatures`, `font-variant-caps`, `font-variant-east-asian`, `font-variant-alternates`, `font-variant-numeric` or `font-variant-position`.
These lead to more effective, predictable, understandable results than `font-feature-settings`, which is a low-level feature designed to handle special cases where no other way exists to enable or access an OpenType font feature. In particular, `font-feature-settings` shouldn't be used to enable small caps.
### Values
This property is specified as either the keyword `normal` or as a comma-separated list of `<feature-tag-value>` values. When rendering text, the list of OpenType `<feature-tag-value>` values are passed to the text layout engine to enable or disable font features.
`normal`
    
Indicates that text is laid out using default font settings. This is the default value.
`<feature-tag-value>`
    
Represents a space-separated tuple consisting of a tag name and an optional value.
The tag name is always a `<string>` of four ASCII characters. If the tag name has more or fewer characters or if it contains characters outside the `U+20` – `U+7E` code point range, the descriptor is invalid.
The optional value can be a positive integer or the keyword `on` or `off`. The keywords `on` and `off` are synonyms for the values `1` and `0`, respectively. If no value is set, the default is `1`. For non-boolean OpenType features (e.g., stylistic alternates), the value implies a particular glyph to be selected; for boolean features, the value turns the feature on or off.
## Examples
>
### Enabling various font features
    
    /* use small-cap alternate glyphs */
    .small-caps {
      font-feature-settings: "smcp" on;
    }
    
    /* convert both upper and lowercase to small caps (affects punctuation also) */
    .all-small-caps {
      font-feature-settings: "c2sc", "smcp";
    }
    
    /* use zeros with a slash through them to differentiate from "O" */
    .nice-zero {
      font-feature-settings: "zero";
    }
    
    /* enable historical forms */
    .historical {
      font-feature-settings: "hist";
    }
    
    /* disable common ligatures, usually on by default */
    .no-ligatures {
      font-feature-settings: "liga" 0;
    }
    
    /* enable tabular (monospaced) figures */
    td.tabular {
      font-feature-settings: "tnum";
    }
    
    /* enable automatic fractions */
    .fractions {
      font-feature-settings: "frac";
    }
    
    /* use the second available swash character */
    .swash {
      font-feature-settings: "swsh" 2;
    }
    
    /* enable stylistic set 7 */
    .fancy-style {
      font-family: Gabriola, cursive;
      font-feature-settings: "ss07";
    }
    
# stroke-linecap
The `stroke-linecap` CSS property defines the shape to be used at the end of open subpaths of SVG elements' unclosed strokes. If present, it overrides the element's `stroke-linecap` attribute.
This property applies to any SVG shape that can have unclosed strokes and text-content element (see `stroke-linecap` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes.
## Syntax
    
    /* keyword values */
    stroke-linecap: butt;
    stroke-linecap: round;
    stroke-linecap: square;
    
    /* Global values */
    stroke-linecap: inherit;
    stroke-linecap: initial;
    stroke-linecap: revert;
    stroke-linecap: revert-layer;
    stroke-linecap: unset;
    
### Values
`butt`
    
Indicates that the stroke for each subpath does not extend beyond its two endpoints. On a zero-length subpath, the path will not be rendered at all. This is the default value.
`round`
    
Indicates that at the end of each subpath the stroke will be extended by a half circle with a diameter equal to the stroke width. On a zero-length subpath, the stroke consists of a full circle centered at the subpath's point.
`square`
    
Indicates that at the end of each subpath the stroke will be extended by a rectangle with a width equal to half the width of the stroke and a height equal to the width of the stroke. On a zero-length subpath, the stroke consists of a square with its width equal to the stroke width, centered at the subpath's point.
## Examples
>
### Linecaps
This example demonstrates the property's three keyword values.
#### HTML
We first set up a light-gray rectangle. Then, in a group, three paths are defined whose length is exactly the same as the width of the rectangle, and all of which start at the left edge of the rectangle. They are all set to have a `dodgerblue` stroke with a width of seven.
    
    <svg viewBox="0 0 100 50" width="500" height="250">
      <rect x="10" y="5" width="80" height="30" fill="#dddddd" />
      <g stroke="dodgerblue" stroke-width="7">
        <path d="M 10,10 h 80" />
        <path d="M 10,20 h 80" />
        <path d="M 10,30 h 80" />
      </g>
    </svg>
    
#### CSS
We then apply a different linecap style to each path via CSS.
    
    path:nth-of-type(1) {
      stroke-linecap: butt;
    }
    path:nth-of-type(2) {
      stroke-linecap: square;
    }
    path:nth-of-type(3) {
      stroke-linecap: round;
    }
    
#### Results
The first path has `butt` linecaps, which essentially means the stroke runs exactly to the end points (both the start and the end) of the path, and no further. The second path has `square` linecaps, so the visible path extends out past the end points of the path, making the overall length of the path appear to be 87, since the path length is 80 and each of the two square caps is 3.5 wide. The third path has `circle` caps, so while it also appears to be 87 units long, the two caps are semicircular instead of square.
# max-height
The `max-height` CSS property sets the maximum height of an element. It prevents the used value of the `height` property from becoming larger than the value specified for `max-height`.
## Try it
    
    max-height: 150px;
    
    
    max-height: 7em;
    
    
    max-height: 75%;
    
    
    max-height: 10px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the maximum height. <br />This will limit
        how tall the box can be, potentially causing an overflow.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
`max-height` overrides `height`, but `min-height` overrides `max-height`.
## Syntax
    
    /* <length> value */
    max-height: 3.5em;
    max-height: anchor-size(height);
    max-height: calc(anchor-size(--my-anchor self-block, 250px) + 2em);
    
    /* <percentage> value */
    max-height: 75%;
    
    /* Keyword values */
    max-height: none;
    max-height: max-content;
    max-height: min-content;
    max-height: fit-content;
    max-height: fit-content(20em);
    max-height: stretch;
    
    /* Global values */
    max-height: inherit;
    max-height: initial;
    max-height: revert;
    max-height: revert-layer;
    max-height: unset;
    
### Values
`<length>`
    
Defines the `max-height` as an absolute value.
`<percentage>`
    
Defines the `max-height` as a percentage of the containing block's height.
`none`
    
No limit on the size of the box.
`max-content`
    
The intrinsic preferred `max-height`.
`min-content`
    
The intrinsic minimum `max-height`.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the `fit-content` formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, argument))`.
`stretch`
    
Limits the maximum height of the element's margin box to the height of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
Note: To check aliases used by browsers for the `stretch` value and its implementation status, see the Browser compatibility section.
## Accessibility
Ensure that elements set with a `max-height` are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Setting max-height using percentage and keyword values
    
    table {
      max-height: 75%;
    }
    
    form {
      max-height: none;
    }
    
# <hex-color>
The `<hex-color>` CSS data type is a notation for describing the hexadecimal color syntax of an sRGB color using its primary color components (red, green, blue) written as hexadecimal numbers, as well as its transparency.
A `<hex-color>` value can be used everywhere where a `<color>` can be used.
## Syntax
    
    #RGB        // The three-value syntax
    #RGBA       // The four-value syntax
    #RRGGBB     // The six-value syntax
    #RRGGBBAA   // The eight-value syntax
    
### Value
`R` or `RR`
    
The red component of the color, as a case-insensitive hexadecimal number between `0` and `ff` (255). If there is only one number, it is duplicated: `1` means `11`.
`G` or `GG`
    
The green component of the color, as a case-insensitive hexadecimal number between `0` and `ff` (255). If there is only one number, it is duplicated: `c` means `cc`.
`B` or `BB`
    
The blue component of the color, as a case-insensitive hexadecimal number between `0` and `ff` (255). If there is only one number, it is duplicated: `9` means `99`.
`A` or `AA` Optional
    
The alpha component of the color, indicating its transparency, as a case-insensitive hexadecimal number between `0` and `ff` (255). If there is only one number, it is duplicated: `e` means `ee`. `0`, or `00`, represents a fully transparent color, and `f`, or `ff`, a fully opaque one.
Note: The syntax is case-insensitive: `#00ff00` is the same as `#00FF00`.
## Examples
>
### Hexadecimal hot pink
This example includes four hot pink squares, with fully opaque or semi-transparent backgrounds created using four different-length case-insensitive hex-color syntaxes.
#### HTML
    
    <div>
      #F09
      <div class="c1"></div>
    </div>
    <div>
      #f09a
      <div class="c2"></div>
    </div>
    <div>
      #ff0099
      <div class="c3"></div>
    </div>
    <div>
      #FF0099AA
      <div class="c4"></div>
    </div>
    
#### CSS
The hot pink background colors are created using the three-, four-, six-, and eight-value hex notations, using both uppercase and lowercase letters.
    
    [class] {
      width: 40px;
      height: 40px;
    }
    .c1 {
      background: #f09;
    }
    .c2 {
      background: #f09a;
    }
    .c3 {
      background: #ff0099;
    }
    .c4 {
      background: #ff0099aa;
    }
    
#### Result
# font-variant-east-asian
The `font-variant-east-asian` CSS property controls the use of alternate glyphs for East Asian scripts, like Japanese and Chinese.
## Try it
    
    font-variant-east-asian: normal;
    
    
    font-variant-east-asian: ruby;
    
    
    font-variant-east-asian: jis78;
    
    
    font-variant-east-asian: proportional-width;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>
          JIS78とJIS83以降では、檜と桧、籠と篭など、一部の文字の入れ替えが行われている。また、「唖然」や「躯体」などの書体が変更されている。
        </p>
      </div>
    </section>
    
    
    section {
      font-family:
        "YuGothic Medium", YuGothic, "Yu Gothic Medium", "Yu Gothic", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
## Syntax
    
    font-variant-east-asian: normal;
    font-variant-east-asian: ruby;
    font-variant-east-asian: jis78; /* <east-asian-variant-values> */
    font-variant-east-asian: jis83; /* <east-asian-variant-values> */
    font-variant-east-asian: jis90; /* <east-asian-variant-values> */
    font-variant-east-asian: jis04; /* <east-asian-variant-values> */
    font-variant-east-asian: simplified; /* <east-asian-variant-values> */
    font-variant-east-asian: traditional; /* <east-asian-variant-values> */
    font-variant-east-asian: full-width; /* <east-asian-width-values> */
    font-variant-east-asian: proportional-width; /* <east-asian-width-values> */
    font-variant-east-asian: ruby full-width jis83;
    
    /* Global values */
    font-variant-east-asian: inherit;
    font-variant-east-asian: initial;
    font-variant-east-asian: revert;
    font-variant-east-asian: revert-layer;
    font-variant-east-asian: unset;
    
### Values
`normal`
    
This keyword leads to the deactivation of the use of such alternate glyphs.
`ruby`
    
This keyword forces the use of special glyphs for ruby characters. As these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. This keyword corresponds to the OpenType values `ruby`.
`<east-asian-variant-values>`
    
These values specify a set of logographic glyph variants which should be used for display. Possible values are:
Keyword Standard defining the glyphs OpenType equivalent  
`jis78` JIS X 0208:1978 `jp78`  
`jis83` JIS X 0208:1983 `jp83`  
`jis90` JIS X 0208:1990 `jp90`  
`jis04` JIS X 0213:2004 `jp04`  
`simplified` None, use the simplified Chinese glyphs `smpl`  
`traditional` None, use the traditional Chinese glyphs `trad`  
`<east-asian-width-values>`
    
These values control the sizing of figures used for East Asian characters. Two values are possible:
  * `proportional-width` activating the set of East Asian characters which vary in width. It corresponds to the OpenType values `pwid`.
  * `full-width` activating the set of East Asian characters which are all of the same, roughly square, width metric. It corresponds to the OpenType values `fwid`.


## Examples
>
### Setting East Asian glyph variants
This example require font "Yu Gothic" installed in your OS, other fonts may not support OpenType features.
#### HTML
    
    <table>
      <thead></thead>
      <tbody>
        <tr>
          <th>normal/jis78:</th>
          <td>麹町</td>
          <td class="jis78">麹町</td>
        </tr>
        <tr>
          <th>normal/ruby:</th>
          <td>しんかんせん</td>
          <td class="ruby">しんかんせん</td>
        </tr>
        <tr>
          <th>normal/traditional:</th>
          <td>大学</td>
          <td class="traditional">大学</td>
        </tr>
      </tbody>
    </table>
    
#### CSS
    
    tbody {
      border: 0;
    }
    
    td {
      font-family: "Yu Gothic", fantasy;
      font-size: 20px;
    }
    th {
      color: grey;
      padding-right: 10px;
    }
    
    .ruby {
      font-variant-east-asian: ruby;
    }
    
    .jis78 {
      font-variant-east-asian: jis78;
    }
    
    .traditional {
      font-variant-east-asian: traditional;
    }
    
#### Result
# CSS media queries
The CSS media queries module enables testing and querying of viewport values and browser or device features, to conditionally apply CSS styles based on the current user environment. Media queries are used in the CSS `@media` rule and other contexts and languages such as HTML and JavaScript.
Media queries are a key component of responsive design. They enable conditional setting of CSS styles depending on the presence or value of device characteristics. It's common to use a media query based on viewport size to set appropriate layouts on devices with different screen sizes — for example three columns on a wide screen or a single column on a narrow screen.
Other common examples include increasing the font size and hiding navigation menus when printing a page, adjusting the padding between paragraphs when a page is viewed in portrait or landscape mode, or increasing the size of buttons to provide a larger hit area on touchscreens.
In CSS, use the `@media` at-rule to conditionally apply part of a style sheet based on the result of a media query. To conditionally apply an entire style sheet, use `@import`.
When designing reusable HTML components, you may also use container queries, which allow you to apply styles based on the size of a containing element rather than the viewport or other device characteristics.
## Reference
>
### At-rules
  * `@import`
  * `@media`


### Descriptors
  * `any-hover`
  * `any-pointer`
  * `aspect-ratio`
  * `color`
  * `color-gamut`
  * `color-index`
  * `device-aspect-ratio`
  * `device-height`
  * `device-width`
  * `display-mode`
  * `dynamic-range`
  * `forced-colors`
  * `grid`
  * `height`
  * `hover`
  * `inverted-colors`
  * `monochrome`
  * `orientation`
  * `overflow-block`
  * `overflow-inline`
  * `pointer`
  * `prefers-color-scheme`
  * `prefers-contrast`
  * `prefers-reduced-data`
  * `prefers-reduced-motion`
  * `prefers-reduced-transparency`
  * `resolution`
  * `scan`
  * `scripting`
  * `update`
  * `video-dynamic-range`
  * `width`


The CSS media queries level 5 module also introduces the `environment-blending`, `horizontal-viewport-segments`, `nav-controls`, `vertical-viewport-segments`, and `video-color-gamut` `@media` descriptors. Currently, no browsers support these features.
Note: CSS media queries level 4 deprecated three `@media` descriptors: `device-aspect-ratio`, `device-height`, and `device-width`.
### Data types and operators
  * `<media-types>`
  * `<media-features>`
  * `<resolution>`
  * Logical operators


### Glossary terms
  * media
  * media query


## Guides
Using media queries
    
Introduces media queries, their syntax, and the operators and media features used to construct media query expressions.
Learn: Media query fundamentals
    
Introduction to media queries and approaches for using them to create responsive designs.
Testing media queries
    
Describes how to use media queries in your JavaScript code to determine the state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser).
Using media queries for accessibility
    
Learn how media queries can help users understand your website better.
Printing
    
Tips and techniques for helping improve web content printer output.
Responsive images
    
Learn how to use media queries with `sizes` to implement responsive image solutions on websites.
## Related concepts
  * CSS containment module 
    * `@container` at-rule
    * Using container queries
    * Using size and style container queries
  * CSS conditional rules module 
    * `@supports` at-rule
    * Using feature queries
  * CSS paged media module 
    * `@page` at-rule
  * CSS object model module 
    * `MediaQueryList` interface 
      * `matches` property
      * `media` property
      * `change` event
    * `MediaList` interface 
      * `mediaText` property
    * `MediaQueryListEvent` object
  * Device Posture API
    * `device-posture` descriptor
  * HTML 
    * `sizes` attribute for `<img>`, `<link>`, and `<source>` for `<picture>`
    * `media` attribute for `<link>`, `<source>`, and `<style>` HTML
    * Viewport `<meta>` tag
  * SVG `media` attribute


# <dashed-ident>
The `<dashed-ident>` CSS data type denotes an arbitrary string used as an identifier.
## Syntax
The syntax of `<dashed-ident>` is similar to CSS identifiers (such as property names), except that it is case-sensitive. It starts with two dashes, followed by the user-defined identifier.
The double dash at the beginning makes them easily identifiable when reading through a CSS code block, and helps to avoid name clashes with standard CSS keywords.
Just like `<custom-ident>` `<dashed-ident>`s are defined by the user, but unlike `<custom-ident>` CSS will never define a `<dashed-ident>`.
## Examples
>
### Using with CSS custom properties
When `<dashed-ident>` is used with CSS custom properties, the property is declared first and then used within a CSS var() function.
    
    html {
      --primary-color: red;
      --secondary-color: blue;
      --tertiary-color: green;
    }
    
    h1,
    h4 {
      color: var(--primary-color);
    }
    
    h2,
    h5 {
      color: var(--secondary-color);
    }
    
    h3,
    h6 {
      color: var(--tertiary-color);
    }
    
### Using with @color-profile
When `<dashed-ident>` is used with the @color-profile at-rule, the at-rule is declared first and then used within a CSS color() function.
    
    @color-profile --my-color-profile {
      src: url("https://example.org/SWOP2006_Coated5v2.icc");
    }
    
    .header {
      background-color: color(--my-color-profile 0% 70% 20% 0%);
    }
    
### Using with @font-palette-values
When `<dashed-ident>` is used with the @font-palette-values at-rule, the at-rule is declared first and then used as the value for the font-palette property.
    
    @font-palette-values --my-palette {
      font-family: Bixa;
      base-palette: 1;
      override-colors: 0 red;
    }
    
    h1,
    h2,
    h3,
    h4 {
      font-palette: --my-palette;
    }
    
As this type is not a real type but a convenience type used to simplify the definition of other CSS syntax, there is no browser compatibility information as such.
# animation-timing-function
The `animation-timing-function` CSS property sets how an animation progresses through the duration of each cycle.
## Try it
    
    animation-timing-function: linear;
    
    
    animation-timing-function: ease-in-out;
    
    
    animation-timing-function: steps(5, end);
    
    
    animation-timing-function: cubic-bezier(0.1, -0.6, 0.2, 0);
    
    
    <section class="flex-column" id="default-example">
      <div class="animating" id="example-element"></div>
      <button id="play-pause">Play</button>
    </section>
    
    
    #example-element {
      animation-duration: 3s;
      animation-iteration-count: infinite;
      animation-name: slide;
      animation-play-state: paused;
      background-color: #1766aa;
      border-radius: 50%;
      border: 5px solid #333333;
      color: white;
      height: 150px;
      margin: auto;
      margin-left: 0;
      width: 150px;
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    #play-pause {
      font-size: 2rem;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const button = document.getElementById("play-pause");
    
    button.addEventListener("click", () => {
      if (el.classList.contains("running")) {
        el.classList.remove("running");
        button.textContent = "Play";
      } else {
        el.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Keyword values */
    animation-timing-function: ease;
    animation-timing-function: ease-in;
    animation-timing-function: ease-out;
    animation-timing-function: ease-in-out;
    animation-timing-function: linear;
    animation-timing-function: step-start;
    animation-timing-function: step-end;
    
    /* cubic-bezier() function values */
    animation-timing-function: cubic-bezier(0.42, 0, 1, 1); /* ease-in */
    animation-timing-function: cubic-bezier(0, 0, 0.58, 1); /* ease-out */
    animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1); /* ease-in-out */
    
    /* linear() function values */
    animation-timing-function: linear(0, 0.25, 1);
    animation-timing-function: linear(0 0%, 0.25 50%, 1 100%);
    animation-timing-function: linear(0, 0.25 50% 75%, 1);
    animation-timing-function: linear(0, 0.25 50%, 0.25 75%, 1);
    
    /* steps() function values */
    animation-timing-function: steps(4, jump-start);
    animation-timing-function: steps(10, jump-end);
    animation-timing-function: steps(20, jump-none);
    animation-timing-function: steps(5, jump-both);
    animation-timing-function: steps(6, start);
    animation-timing-function: steps(8, end);
    
    /* Multiple animations */
    animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1, 0.1);
    
    /* Global values */
    animation-timing-function: inherit;
    animation-timing-function: initial;
    animation-timing-function: revert;
    animation-timing-function: revert-layer;
    animation-timing-function: unset;
    
### Values
`<easing-function>`
    
The easing function that corresponds to a given animation, as determined by `animation-name`.
The non-step keyword values (`ease`, `linear`, `ease-in-out`, etc.) each represent cubic Bézier curves with fixed four-point values, while the `cubic-bezier()` function value allows non-predefined values to be specified. The `steps()` easing function divides the input time into a specified number of equal-length intervals. Its parameters include a number of steps and a step position.
`linear`
    
Equal to `cubic-bezier(0.0, 0.0, 1.0, 1.0)`, animates at an even speed.
`ease`
    
Equal to `cubic-bezier(0.25, 0.1, 0.25, 1.0)`, the default value, increases in velocity towards the middle of the animation, slowing back down at the end.
`ease-in`
    
Equal to `cubic-bezier(0.42, 0, 1.0, 1.0)`, starts off slowly, with the speed of the transition of the animating property increasing until complete.
`ease-out`
    
Equal to `cubic-bezier(0, 0, 0.58, 1.0)`, starts quickly, slowing down the animation continues.
`ease-in-out`
    
Equal to `cubic-bezier(0.42, 0, 0.58, 1.0)`, with the animating properties slowly transitioning, speeding up, and then slowing down again.
`cubic-bezier(<number [0,1]> , <number> , <number [0,1]> , <number>)`
    
An author defined cubic-bezier curve, where the first and third values must be in the range of 0 to 1.
`linear(<number> <percentage>{1,2}, …)`
    
The function interpolates linearly between the provided easing stop points. A stop point is a pair of an output progress and an input percentage. The input percentage is optional and is inferred if not specified. If an input percentage is not provided then the first and last stop points are set to `0%` and `100%` respectively, and the stop points in the middle receive percentage values derived by linearly interpolating between the closest previous and next points that have a percentage value.
`steps(<integer>, <step-position>)`
    
Displays an animation iteration along n stops along the transition, displaying each stop for equal lengths of time. For example, if n is 5, there are 5 steps. Whether the animation holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the animation, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following step position is used:
`jump-start`
    
Denotes a left-continuous function, so that the first jump happens when the animation begins.
`jump-end`
    
Denotes a right-continuous function, so that the last jump happens when the animation ends. This is the default.
`jump-none`
    
There is no jump on either end, effectively removing a step during the interpolation iteration. Instead, it holds at both the 0% mark and the 100% mark, each for 1/n of the duration.
`jump-both`
    
Includes pauses at both the 0% and 100% marks, effectively adding a step during the animation iteration.
`start`
    
Same as `jump-start`.
`end`
    
Same as `jump-end`.
`step-start`
    
Equal to `steps(1, jump-start)`
`step-end`
    
Equal to `steps(1, jump-end)`
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: `animation-timing-function` has the same effect when creating CSS scroll-driven animations as it does for regular time-based animations.
## Description
Easing functions may be specified on individual keyframes in a `@keyframes` rule. If no `animation-timing-function` is specified on a keyframe, the corresponding value of `animation-timing-function` from the element to which the animation is applied is used for that keyframe.
Within a keyframe, `animation-timing-function` is an at-rule-specific descriptor, not the property of the same name. The timing is not being animated. Rather, a keyframe's easing function is applied on a property-by-property basis from the keyframe on which it is specified until the next keyframe specifying that property, or until the end of the animation if there is no subsequent keyframe specifying that property. As a result, an `animation-timing-function` specified on the `100%` or `to` keyframe will never be used.
## Examples
All the examples in this section animate the `width` and `background-color` properties of several `<div>` elements with different `animation-timing-function` values. The width is being animated from `0` to `100%`, and the background color is being animated from lime to magenta.
### Linear function examples
The example demonstrates the effects of various `linear()` easing function values.
The following image shows graphs of all the `linear()` function values used in this example. Input progress (time) is plotted on the x-axis and output progress is plotted on the y-axis. As per the syntax, the input progress ranges from 0 to 100%, and the output ranges from 0 to 1.
Note that the output can go forward or backward.
### Cubic-Bézier examples
The example demonstrates the effects of various bézier curve easing functions.
The following image shows graphs of all the cubic bézier function values used in this example. The input progress (time) ranges from 0 to 1 and the output progress ranges from 0 to 1.
### Step examples
This example demonstrates the effects of several step easing function values.
The following image shows graphs of all the `step()` function values used in this example. The input progress (time) and output progress range from 0 to 1.
# ::-webkit-scrollbar
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-webkit-scrollbar` CSS pseudo-element affects the style of an element's scrollbar when it has scrollable overflow.
The `scrollbar-color` and `scrollbar-width` standard properties may be used as alternatives for browsers that do not support this pseudo-element and the related `::-webkit-scrollbar-*` pseudo-elements (see Browser compatibility).
Note: If `scrollbar-color` and `scrollbar-width` are supported and have any value other than `auto` set, they will override `::-webkit-scrollbar-*` styling. See Adding a fallback for scrollbar styles for more details.
## CSS Scrollbar Selectors
You can use the following pseudo-elements to customize various parts of the scrollbar for WebKit browsers:
  * `::-webkit-scrollbar` — the entire scrollbar.
  * `::-webkit-scrollbar-button` — the buttons on the scrollbar (arrows pointing upwards and downwards that scroll one line at a time).
  * `::-webkit-scrollbar:horizontal` — the horizontal scrollbar.
  * `::-webkit-scrollbar-thumb` — the draggable scrolling handle.
  * `::-webkit-scrollbar-track` — the track (progress bar) of the scrollbar, where there is a gray bar on top of a white bar.
  * `::-webkit-scrollbar-track-piece` — the part of the track (progress bar) not covered by the handle.
  * `::-webkit-scrollbar:vertical` — the vertical scrollbar.
  * `::-webkit-scrollbar-corner` — the bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet. This is often the bottom-right corner of the browser window.
  * `::-webkit-resizer` — the draggable resizing handle that appears at the bottom corner of some elements.


## Accessibility
Authors should avoid styling scrollbars, as changing the appearance of scrollbars away from the default breaks external consistency which negatively impacts usability. If styling scrollbars, ensure there is enough color contrast and touch targets are at least 44px wide and tall. See Techniques for WCAG 2.0: G183: Using a contrast ratio of 3:1 and Understanding WCAG 2.1 : Target Size.
## Examples
>
### Styling scrollbars using `-webkit-scrollbar`
#### CSS
    
    .visible-scrollbar,
    .invisible-scrollbar,
    .mostly-customized-scrollbar {
      display: block;
      width: 10em;
      overflow: auto;
      height: 2em;
      padding: 1em;
      margin: 1em auto;
      outline: 2px dashed cornflowerblue;
    }
    
    .invisible-scrollbar::-webkit-scrollbar {
      display: none;
    }
    
    /* Demonstrate a "mostly customized" scrollbar
     * (won't be visible otherwise if width/height is specified) */
    .mostly-customized-scrollbar::-webkit-scrollbar {
      width: 5px;
      height: 8px;
      background-color: #aaaaaa; /* or add it to the track */
    }
    
    /* Add a thumb */
    .mostly-customized-scrollbar::-webkit-scrollbar-thumb {
      background: black;
    }
    
#### HTML
    
    <div class="visible-scrollbar">
      <h3>Visible scrollbar</h3>
      <p>
        Etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor. Proin at
        nulla elementum, consectetur ex eget, commodo ante. Sed eros mi, bibendum ut
        dignissim et, maximus eget nibh. Phasellus blandit quam turpis, at mollis
        velit pretium ut. Nunc consequat efficitur ultrices. Nullam hendrerit
        posuere est. Nulla libero sapien, egestas ac felis porta, cursus ultricies
        quam. Vestibulum tincidunt accumsan sapien, a fringilla dui semper in.
        Vivamus consectetur ipsum a ornare blandit. Aenean tempus at lorem sit amet
        faucibus. Curabitur nibh justo, faucibus sed velit cursus, mattis cursus
        dolor. Pellentesque id pretium est. Quisque convallis nisi a diam malesuada
        mollis. Aliquam at enim ligula.
      </p>
    </div>
    
    <div class="invisible-scrollbar">
      <h3>Invisible scrollbar</h3>
      <p>
        Thisisaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylongword
      </p>
    </div>
    
    <div class="mostly-customized-scrollbar">
      <h3>Custom scrollbar</h3>
      <p>
        Thisisaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylongword<br />
        And pretty tall<br />
        thing with weird scrollbars.<br />
        Who thought scrollbars could be made weird?
      </p>
    </div>
    
#### Result
### Adding a fallback for scrollbar styles
You can use a `@supports` at-rule to detect if a browser supports the standard `scrollbar-color` and `scrollbar-width` properties, and otherwise use a fallback with `::-webkit-scrollbar-*` pseudo-elements. The following example shows how to apply colors to scrollbars using `scrollbar-color` if supported and `::-webkit-scrollbar-*` pseudo-elements if not.
#### HTML
    
    <div class="scroll-box">
      <h1>Yoshi</h1>
      <p>
        Yoshi is a fictional dinosaur who appears in video games published by
        Nintendo. Yoshi debuted in Super Mario World (1990) on the SNES as Mario and
        Luigi's sidekick.
      </p>
      <p>
        Throughout the mainline Super Mario series, Yoshi typically serves as
        Mario's trusted steed.
      </p>
      <p>
        With a gluttonous appetite, Yoshi can gobble enemies with his long tongue,
        and lay eggs that doubly function as projectiles.
      </p>
    </div>
    
#### CSS
    
    /* For browsers that support `scrollbar-*` properties */
    @supports (scrollbar-color: auto) {
      .scroll-box {
        scrollbar-color: aquamarine cornflowerblue;
      }
    }
    
    /* Otherwise, use `::-webkit-scrollbar-*` pseudo-elements */
    @supports selector(::-webkit-scrollbar) {
      .scroll-box::-webkit-scrollbar {
        background: aquamarine;
      }
      .scroll-box::-webkit-scrollbar-thumb {
        background: cornflowerblue;
      }
    }
    
#### Result
In the example below, you can scroll the bordered box vertically to see the effect of styling the scrollbar.
Not part of any standard.
>
### css.selectors.-webkit-scrollbar
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3From Safari 13, only `display: none` works with this pseudo-element. Other styles have no effect. 1.0 4.4 3From Safari 13, only `display: none` works with this pseudo-element. Other styles have no effect.  
### css.selectors.-webkit-scrollbar-button
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3–13 1.0 4.4 3–13  
### css.selectors.-webkit-scrollbar-thumb
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3–13 1.0 4.4 3–13  
### css.selectors.-webkit-scrollbar-track
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3–13 1.0 4.4 3–13  
### css.selectors.-webkit-scrollbar-track-piece
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3–13 1.0 4.4 3–13  
### css.selectors.-webkit-scrollbar-corner
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3–13 1.0 4.4 3–13  
### css.selectors.-webkit-resizer
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`::-webkit-scrollbar` 2 79 No 15 4 18 No 14 3.2 1.0 4.4 3.2  
# Descendant combinator
The descendant combinator — typically represented by a single space (" ") character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc.) element matching the first selector. Selectors that utilize a descendant combinator are called descendant selectors.
    
    /* List items that are descendants of the "my-things" list */
    ul.my-things li {
      margin: 2em;
    }
    
The descendant combinator is technically one or more CSS white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. Additionally, the white space characters of which the combinator is comprised may contain any number of CSS comments.
## Syntax
    
    selector1 selector2 {
      /* property declarations */
    }
    
## Examples
>
### CSS
    
    li {
      list-style-type: disc;
    }
    
    li li {
      list-style-type: circle;
    }
    
### HTML
    
    <ul>
      <li>
        <div>Item 1</div>
        <ul>
          <li>Subitem A</li>
          <li>Subitem B</li>
        </ul>
      </li>
      <li>
        <div>Item 2</div>
        <ul>
          <li>Subitem A</li>
          <li>Subitem B</li>
        </ul>
      </li>
    </ul>
    
### Result
# transition-duration
The `transition-duration` CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur.
## Try it
    
    transition-duration: 500ms;
    transition-property: margin-right;
    
    
    transition-duration: 2s;
    transition-property: background-color;
    
    
    transition-duration: 2s;
    transition-property: margin-right, color;
    
    
    transition-duration: 3s, 1s;
    transition-property: margin-right, color;
    
    
    <section id="default-example">
      <div id="example-element">Hover to see<br />the transition.</div>
    </section>
    
    
    #example-element {
      background-color: #e4f0f5;
      color: black;
      padding: 1rem;
      border-radius: 0.5rem;
      font: 1em monospace;
      width: 100%;
      transition: margin-right 2s;
    }
    
    #default-example:hover > #example-element {
      background-color: #990099;
      color: white;
      margin-right: 40%;
    }
    
You may specify multiple durations; each duration will be applied to the corresponding property as specified by the `transition-property` property, which acts as a master list. If the number of specified durations is less than in the master list, the user agent repeats the list of durations. If the number of specified durations is more than in the master list, the list is truncated to the right size. In both the cases, the CSS declaration stays valid.
## Syntax
    
    /* <time> values */
    transition-duration: 6s;
    transition-duration: 120ms;
    transition-duration: 1s, 15s;
    transition-duration: 10s, 30s, 230ms;
    
    /* Global values */
    transition-duration: inherit;
    transition-duration: initial;
    transition-duration: revert;
    transition-duration: revert-layer;
    transition-duration: unset;
    
### Values
`<time>`
    
Is a `<time>` denoting the amount of time the transition from the old value of a property to the new value should take. A time of `0s` indicates that no transition will happen, that is the switch between the two states will be instantaneous. A negative value for the time renders the declaration invalid.
## Examples
>
### Example showing different durations
#### HTML
    
    <div class="box duration-1">0.5 seconds</div>
    
    <div class="box duration-2">2 seconds</div>
    
    <div class="box duration-3">4 seconds</div>
    
    <button id="change">Change</button>
    
#### CSS
    
    .box {
      margin: 20px;
      padding: 10px;
      display: inline-block;
      width: 100px;
      height: 100px;
      background-color: red;
      font-size: 18px;
      transition-property: background-color, font-size, transform, color;
      transition-timing-function: ease-in-out;
    }
    
    .transformed-state {
      transform: rotate(270deg);
      background-color: blue;
      color: yellow;
      font-size: 12px;
      transition-property: background-color, font-size, transform, color;
      transition-timing-function: ease-in-out;
    }
    
    .duration-1 {
      transition-duration: 0.5s;
    }
    
    .duration-2 {
      transition-duration: 2s;
    }
    
    .duration-3 {
      transition-duration: 4s;
    }
    
#### JavaScript
    
    function change() {
      const elements = document.querySelectorAll("div.box");
      for (const element of elements) {
        element.classList.toggle("transformed-state");
      }
    }
    
    const changeButton = document.querySelector("#change");
    changeButton.addEventListener("click", change);
    
#### Result
# :past
The `:past` CSS pseudo-class selector is a time-dimensional pseudo-class that will match for any element which appears entirely before an element that matches `:current`. For example in a video with captions which are being displayed by WebVTT.
    
    :past(p, span) {
      display: none;
    }
    
## Syntax
    
    :past {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :past(p, span) {
      display: none;
    }
    
### HTML
    
    <video controls preload="metadata">
      <source src="video.mp4" type="video/mp4" />
      <source src="video.webm" type="video/webm" />
      <track
        label="English"
        kind="subtitles"
        srclang="en"
        src="subtitles.vtt"
        default />
    </video>
    
### WebVTT
    
    WEBVTT FILE
    
    1
    00:00:03.500 --> 00:00:05.000
    This is the first caption
    
    2
    00:00:06.000 --> 00:00:09.000
    This is the second caption
    
    3
    00:00:11.000 --> 00:00:19.000
    This is the third caption
    
# font
The `font` CSS shorthand property sets all the different properties of an element's font. Alternatively, it sets an element's font to a system font.
## Try it
    
    font:
      1.2rem "Fira Sans",
      sans-serif;
    
    
    font:
      italic 1.2rem "Fira Sans",
      serif;
    
    
    font: italic small-caps bold 16px/2 cursive;
    
    
    font: small-caps bold 24px/1 sans-serif;
    
    
    font: caption;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Italic"),
        url("/shared-assets/fonts/FiraSans-Italic.woff2") format("woff2");
      font-weight: normal;
      font-style: italic;
    }
    
    section {
      margin-top: 10px;
      font-size: 1.1em;
    }
    
As with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties). Though not directly settable by `font`, the longhands `font-size-adjust` and `font-kerning` are also reset to their initial values.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `font-family`
  * `font-size`
  * `font-stretch`
  * `font-style`
  * `font-variant`
  * `font-weight`
  * `line-height`


## Syntax
    
    /* font-size font-family */
    font: 1.2em "Fira Sans", sans-serif;
    
    /* font-size/line height font-family */
    font: 1.2em/2 "Fira Sans", sans-serif;
    
    /* font-style font-weight font-size font-family */
    font: italic bold 1.2em "Fira Sans", sans-serif;
    
    /* font-stretch font-variant font-size font-family */
    font: ultra-condensed small-caps 1.2em "Fira Sans", sans-serif;
    
    /* system font */
    font: caption;
    
The `font` property may be specified as either a single keyword, which will select a system font, or as a shorthand for various font-related properties.
If `font` is specified as a system keyword, it must be one of: `caption`, `icon`, `menu`, `message-box`, `small-caption`, `status-bar`.
If `font` is specified as a shorthand for several font-related properties, then:
  * it must include values for:
    * `<font-size>`
    * `<font-family>`
  * it may optionally include values for:
    * `<font-style>`
    * `<font-variant>`
    * `<font-weight>`
    * `<font-stretch>`
    * `<line-height>`
  * `font-style`, `font-variant` and `font-weight` must precede `font-size`.
  * `font-variant` may only specify the values defined in CSS 2.1, that is `normal` and `small-caps`.
  * `font-stretch` may only be a single keyword value.
  * `line-height` must immediately follow `font-size`, preceded by "/", like this: `16px/3`.
  * `font-family` must be the last value specified.


### Values
`<'font-style'>`
    
See the `font-style` CSS property.
`<'font-variant'>`
    
See the `font-variant` CSS property.
`<'font-weight'>`
    
See the `font-weight` CSS property.
`<'font-stretch'>`
    
See the `font-stretch` CSS property.
`<'font-size'>`
    
See the `font-size` CSS property.
`<'line-height'>`
    
See the `line-height` CSS property.
`<'font-family'>`
    
See the `font-family` CSS property.
#### System font values
`caption`
    
The system font used for captioned controls (e.g., buttons, drop-downs, etc.).
`icon`
    
The system font used to label icons.
`menu`
    
The system font used in menus (e.g., dropdown menus and menu lists).
`message-box`
    
The system font used in dialog boxes.
`small-caption`
    
The system font used for labeling small controls.
`status-bar`
    
The system font used in window status bars.
Prefixed system font keywords
    
Browsers often implement several more, prefixed, keywords: Gecko implements `-moz-window`, `-moz-document`, `-moz-desktop`, `-moz-info`, `-moz-dialog`, `-moz-button`, `-moz-pull-down-menu`, `-moz-list`, and `-moz-field`.
## Examples
>
### Setting font properties
    
    /* Set the font size to 12px and the line height to 14px.
       Set the font family to sans-serif */
    p {
      font: 12px/14px sans-serif;
    }
    
    /* Set the font size to 80% of the parent element
       or default value (if no parent element present).
       Set the font family to sans-serif */
    p {
      font: 80% sans-serif;
    }
    
    /* Set the font weight to bold,
       the font-style to italic,
       the font size to large,
       and the font family to serif. */
    p {
      font: bold italic large serif;
    }
    
    /* Use the same font as the status bar of the window */
    p {
      font: status-bar;
    }
    
### Live sample
# cy
The `cy` CSS property defines the y-axis center point of an SVG `<circle>` or `<ellipse>` elements. If present, it overrides the element's `cy` attribute.
Note: While the SVG `<radialGradient>` element supports the `cy` attribute, the `cy` property only applies to `<circle>` and `<ellipse>` elements nested in an `<svg>`. This attribute does not apply to `<radialGradient>` or other SVG elements nor to HTML elements or pseudo-elements.
## Syntax
    
    /* length and percentage values */
    cy: 3px;
    cy: 20%;
    
    /* Global values */
    cy: inherit;
    cy: initial;
    cy: revert;
    cy: revert-layer;
    cy: unset;
    
### Values
The `<length>` and `<percentage>` values denote the vertical center of the circle or ellipse.
`<length>`
    
As an absolute or relative length, it can be expressed in any unit allowed by the CSS `<length>` data type. Negative values are invalid.
`<percentage>`
    
Percentages refer to the height of the current SVG viewport.
## Examples
>
### Defining the y-axis coordinate of a circle and ellipse
In this example, we have two identical `<circle>` and two identical `<ellipse>` elements in an SVG; their `cy` attribute values ar `50` and `150`, respectively.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="30" />
      <circle cx="50" cy="50" r="30" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
      <ellipse cx="150" cy="50" rx="20" ry="40" />
    </svg>
    
With CSS, we style only the first circle and first ellipse, allowing their twin shapes to use default styles (with (`fill` defaulting to black). We use the `cy` property to override the value of the SVG `cy` attribute and also give it a `fill` and `stroke` to differentiate the first shapes in each pair from their twin. The browser renders SVG images as `300px` wide and `150px` tall by default.
    
    svg {
      border: 1px solid;
    }
    
    circle:first-of-type {
      cy: 30px;
      fill: lightgreen;
      stroke: black;
    }
    ellipse:first-of-type {
      cy: 100px;
      fill: pink;
      stroke: black;
    }
    
The styled circle's center is `30px` from the top edge of the SVG viewport and the styled ellipse is `100px` from that edge, as defined in the CSS `cy` property values. The unstyled shapes centers are both `50px` from the top edge of the SVG viewport, as defined in their SVG `cy` attribute values.
### y-axis coordinates as percentage values
In this example, we use the same markup as the previous example. The only difference is the CSS `cy` property value; in this case, we use percentage values of `30%` and `50%`.
    
    svg {
      border: 1px solid;
    }
    
    circle:first-of-type {
      cy: 30%;
      fill: lightgreen;
      stroke: black;
    }
    ellipse:first-of-type {
      cy: 50%;
      fill: pink;
      stroke: black;
    }
    
In this case, the y-axis coordinates of the center of the circle and ellipse are `30%` and `50%` of the height of the current SVG viewport, respectively. As the image's height defaulted to `150px`, meaning the `cy` value is the equivalent of `45px` and `120px`.
# CSS font loading
The CSS font loading module describes events and interfaces used for dynamically loading font resources.
## Reference
>
### Interfaces
  * `fontFace` interface 
    * `FontFace()` constructor
    * `fontFace.family` property
    * `fontFace.style` property
    * `fontFace.weight` property
    * `fontFace.stretch` property
    * `fontFace.unicodeRange` property
    * `fontFace.variant` property
    * `fontFace.featureSettings` property
    * `fontFace.variationSettings` property
    * `fontFace.display` property
    * `fontFace.ascentOverride` property
    * `fontFace.descentOverride` property
    * `fontFace.lineGapOverride` property
    * `fontFace.load()` method (returns a promise)
  * `fontFaceSet` interface
  * `fontFaceSetLoadEvent` event


## Guides
CSS font loading API
    
Overview of the CSS Font Loading API, which provide events and interfaces for dynamically loading font resources.
## Related concepts
  * CSS `@font-face` at-rule
  * CSS `@font-feature-values` at-rule
  * `CSSFontFaceRule` interface
  * Document `fonts` property (returns the `FontFaceSet` object instance)
  * WorkerGlobalScope `fonts` property (returns the `FontFaceSet` object instance)
  * JavaScript `Promise` object


# math-style
The `math-style` property indicates whether MathML equations should render with normal or compact height.
## Syntax
    
    /* Keyword values */
    math-style: normal;
    math-style: compact;
    
    /* Global values */
    math-style: inherit;
    math-style: initial;
    math-style: revert;
    math-style: revert-layer;
    math-style: unset;
    
### Values
`normal`
    
The initial value, indicates normal rendering.
`compact`
    
The math layout on descendants tries to minimize the logical height.
## Examples
>
### Changing the style of a formula to compact
#### CSS
    
    math {
      math-style: normal;
    }
    .compact {
      math-style: compact;
    }
    
#### HTML
    
    <p>
      Normal height
      <math>
        <mrow>
          <munderover>
            <mo>∑</mo>
            <mrow>
              <mi>n</mi>
              <mo>=</mo>
              <mn>1</mn>
            </mrow>
            <mrow>
              <mo>+</mo>
              <mn>∞</mn>
            </mrow>
          </munderover>
        </mrow>
      </math>
      and compact height
      <math class="compact">
        <mrow>
          <munderover>
            <mo>∑</mo>
            <mrow>
              <mi>n</mi>
              <mo>=</mo>
              <mn>1</mn>
            </mrow>
            <mrow>
              <mo>+</mo>
              <mn>∞</mn>
            </mrow>
          </munderover>
        </mrow>
      </math>
      equations.
    </p>
    
#### Result
# grid-auto-rows
The `grid-auto-rows` CSS property specifies the size of an implicitly-created grid row track or pattern of tracks.
## Try it
    
    grid-auto-rows: auto;
    
    
    grid-auto-rows: 50px;
    
    
    grid-auto-rows: min-content;
    
    
    grid-auto-rows: minmax(30px, auto);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      font-size: 22px;
    }
    
    #example-element div:last-child {
      font-size: 13px;
    }
    
If a grid item is positioned into a row that is not explicitly sized by `grid-template-rows`, implicit grid tracks are created to hold it. This can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows.
## Syntax
    
    /* Keyword values */
    grid-auto-rows: min-content;
    grid-auto-rows: max-content;
    grid-auto-rows: auto;
    
    /* <length> values */
    grid-auto-rows: 100px;
    grid-auto-rows: 20cm;
    grid-auto-rows: 50vmax;
    
    /* <percentage> values */
    grid-auto-rows: 10%;
    grid-auto-rows: 33.3%;
    
    /* <flex> values */
    grid-auto-rows: 0.5fr;
    grid-auto-rows: 3fr;
    
    /* minmax() values */
    grid-auto-rows: minmax(100px, auto);
    grid-auto-rows: minmax(max-content, 2fr);
    grid-auto-rows: minmax(20%, 80vmax);
    
    /* fit-content() values */
    grid-auto-rows: fit-content(400px);
    grid-auto-rows: fit-content(5cm);
    grid-auto-rows: fit-content(20%);
    
    /* multiple track-size values */
    grid-auto-rows: min-content max-content auto;
    grid-auto-rows: 100px 150px 390px;
    grid-auto-rows: 10% 33.3%;
    grid-auto-rows: 0.5fr 3fr 1fr;
    grid-auto-rows: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax);
    grid-auto-rows: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px);
    
    /* Global values */
    grid-auto-rows: inherit;
    grid-auto-rows: initial;
    grid-auto-rows: revert;
    grid-auto-rows: revert-layer;
    grid-auto-rows: unset;
    
### Values
`<length>`
    
Is a non-negative length.
`<percentage>`
    
Is a non-negative `<percentage>` value relative to the block size of the grid container. If the block size of the grid container is indefinite, the percentage value is treated like `auto`.
`<flex>`
    
Is a non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor.
When appearing outside a `minmax()` notation, it implies an automatic minimum (i.e., `minmax(auto, <flex>)`).
`max-content`
    
Is a keyword representing the largest maximal content contribution of the grid items occupying the grid track.
`min-content`
    
Is a keyword representing the largest minimal content contribution of the grid items occupying the grid track.
`minmax(min, max)`
    
Is a functional notation that defines a size range greater than or equal to min and less than or equal to max. If max is smaller than min, then max is ignored and the function is treated as min. As a maximum, a `<flex>` value sets the track's flex factor. As a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint).
`fit-content( [ <length> | <percentage> ] )`
    
Represents the formula `min(max-content, max(auto, argument))`, which is calculated similar to `auto` (i.e., `minmax(auto, max-content)`), except that the track size is clamped at argument if it is greater than the `auto` minimum.
`auto`
    
As a maximum represents the largest `max-content` size of the items in that track.
As a minimum represents the largest minimum size of items in that track (specified by the `min-width`/`min-height` of the items). This is often, though not always, the `min-content` size.
If used outside of `minmax()` notation, `auto` represents the range between the minimum and maximum described above. This behaves similarly to `minmax(min-content,max-content)` in most cases.
Note: `auto` track sizes (and only `auto` track sizes) can be stretched by the `align-content` and `justify-content` properties. Therefore by default, an `auto` sized track will take up any remaining space in the grid container.
## Examples
>
### Setting grid row size
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
    </div>
    
#### CSS
    
    #grid {
      width: 200px;
      display: grid;
      grid-template-areas: "a a";
      gap: 10px;
      grid-auto-rows: 100px;
    }
    
    #grid > div {
      background-color: lime;
    }
    
#### Result
# :focus
The `:focus` CSS pseudo-class represents an element (such as a form input) that has received focus. It is generally triggered when the user clicks or taps on an element or selects it with the keyboard's `Tab` key.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:focus {
      background-color: lightblue;
    }
    
    select:focus {
      background-color: ivory;
    }
    
    
    <form>
      <p>Which flavor would you like to order?</p>
      <label>Full Name: <input name="firstName" type="text" /></label>
      <label
        >Flavor:
        <select name="flavor">
          <option>Cherry</option>
          <option>Green Tea</option>
          <option>Moose Tracks</option>
          <option>Mint Chip</option>
        </select>
      </label>
    </form>
    
Note: This pseudo-class applies only to the focused element itself. Use `:focus-within` if you want to select an element that contains a focused element.
## Syntax
    
    :focus {
      /* ... */
    }
    
## Accessibility
Make sure the visual focus indicator can be seen by people with low vision. This will also benefit anyone use a screen in a brightly lit space (like outside in the sun). WCAG 2.1 SC 1.4.11 Non-Text Contrast requires that the visual focus indicator be at least 3 to 1.
  * Accessible Visual Focus Indicators: Give Your Site Some Focus! Tips for Designing Useful and Usable Focus Indicators


### `:focus { outline: none; }`
Never just remove the focus outline (visible focus indicator) without replacing it with a focus outline that will pass WCAG 2.1 SC 1.4.11 Non-Text Contrast.
  * Quick Tip: Never remove CSS outlines


## Examples
>
### HTML
    
    <div><input class="red-input" value="I'll be red when focused." /></div>
    <div><input class="blue-input" value="I'll be blue when focused." /></div>
    
### CSS
    
    .red-input:focus {
      background: yellow;
      color: red;
    }
    
    .blue-input:focus {
      background: yellow;
      color: blue;
    }
    
### Result
# margin-inline
The `margin-inline` CSS shorthand property is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    margin-inline: 5% 10%;
    writing-mode: horizontal-tb;
    
    
    margin-inline: 10px 40px;
    writing-mode: vertical-rl;
    
    
    margin-inline: 5% 10%;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div id="container">
        <div class="col">One</div>
        <div class="col transition-all" id="example-element">Two</div>
        <div class="col">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      justify-content: flex-start;
    }
    
    .col {
      width: 33.33%;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `margin-inline-start`
  * `margin-inline-end`


## Syntax
    
    /* <length> values */
    margin-inline: 10px 20px; /* An absolute length */
    margin-inline: 1em 2em; /* relative to the text size */
    margin-inline: 5% 2%; /* relative to the nearest block container's width */
    margin-inline: 10px; /* sets both start and end values */
    margin-inline: anchor-size(width);
    margin-inline: calc(anchor-size(self-block) / 5) auto;
    
    /* Keyword values */
    margin-inline: auto;
    
    /* Global values */
    margin-inline: inherit;
    margin-inline: initial;
    margin-inline: revert;
    margin-inline: revert-layer;
    margin-inline: unset;
    
This property corresponds to the `margin-top` and `margin-bottom`, or the `margin-right` and `margin-left` properties, depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
The `margin-inline` property may be specified using one or two values.
  * When one value is specified, it applies the same margin to both start and end.
  * When two values are specified, the first margin applies to the start, the second to the end.


### Values
The `margin-inline` property takes the same values as the `margin` property.
## Examples
>
### Setting inline start and end margins
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: auto;
      border: 1px solid green;
    }
    
    p {
      margin: 0;
      margin-inline: 20px 40px;
      background-color: tan;
    }
    
    .verticalExample {
      writing-mode: vertical-rl;
    }
    
#### HTML
    
    <div>
      <p>Example text</p>
    </div>
    <div class="verticalExample">
      <p>Example text</p>
    </div>
    
#### Result
# outline
The `outline` CSS shorthand property sets most of the outline properties in a single declaration.
## Try it
    
    outline: solid;
    
    
    outline: dashed red;
    
    
    outline: 1rem solid;
    
    
    outline: thick double #32a1ce;
    
    
    outline: 8px ridge rgb(170 50 220 / 0.6);
    border-radius: 2rem;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with an outline around it.
      </div>
    </section>
    
    
    #example-element {
      padding: 0.75rem;
      width: 80%;
      height: 100px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `outline-width`
  * `outline-style`
  * `outline-color`


## Syntax
    
    /* style */
    outline: solid;
    
    /* style | color */
    outline: dashed #ff6666;
    
    /* width | style */
    outline: thick inset;
    
    /* width | style | color*/
    outline: 3px solid green;
    
    /* Global values */
    outline: inherit;
    outline: initial;
    outline: revert;
    outline: revert-layer;
    outline: unset;
    
The `outline` property may be specified using one, two, or three of the values listed below. The order of the values does not matter. As with all shorthand properties, any omitted sub-values will be set to their initial value.
Note: The outline will be invisible for many elements if its style is not defined. This is because the style defaults to `none`. A notable exception is `input` elements, which are given default styling by browsers.
### Values
`<'outline-width'>`
    
Sets the thickness of the outline. Defaults to `medium` if absent. See `outline-width`.
`<'outline-style'>`
    
Sets the style of the outline. Defaults to `none` if absent. See `outline-style`.
`<'outline-color'>`
    
Sets the color of the outline. Defaults to `invert` for browsers supporting it, `currentColor` for the others. See `outline-color`.
## Description
Outline is a line outside of the element's border. Unlike other areas of the box, outlines don't take up space, so they don't affect the layout of the document in any way.
There are a few properties that affect an outline's appearance. It is possible to change the style, color, and width using the `outline` property, the distance from the border using the `outline-offset` property, and corner angles using the `border-radius` property.
An outline is not required to be rectangular: While dealing with multiline text, some browsers will draw an outline for each line box separately, while others will wrap the whole text with a single outline.
## Accessibility
Assigning `outline` a value of `0` or `none` will remove the browser's default focus style. If an element can be interacted with it must have a visible focus indicator. Provide obvious focus styling if the default focus style is removed.
  * How to Design Useful and Usable Focus Indicators
  * WCAG 2.1: Understanding Success Criterion 2.4.7: Focus Visible


## Examples
>
### Using outline to set a focus style
#### HTML
    
    <a href="#">This link has a special focus style.</a>
    
#### CSS
    
    a {
      border: 1px solid;
      border-radius: 3px;
      display: inline-block;
      margin: 10px;
      padding: 5px;
    }
    
    a:focus {
      outline: 4px dotted #ee7733;
      outline-offset: 4px;
      background: #ffffaa;
    }
    
#### Result
# container
The container shorthand CSS property establishes the element as a query container and specifies the name and type of the containment context used in a container query.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `container-name`
  * `container-type`


## Syntax
    
    /* <container-name> */
    container: my-layout;
    
    /* <container-name> / <container-type> */
    container: my-layout / size;
    
    /* Global Values */
    container: inherit;
    container: initial;
    container: revert;
    container: revert-layer;
    container: unset;
    
### Values
`<container-name>`
    
A case-sensitive name for the containment context. More details on the syntax are covered in the `container-name` property page.
`<container-type>`
    
The type of containment context. More details on the syntax are covered in the `container-type` property page.
## Examples
>
### Establishing inline size containment
Given the following HTML example which is a card component with an image, a title, and some text:
    
    <div class="post">
      <div class="card">
        <h2>Card title</h2>
        <p>Card content</p>
      </div>
    </div>
    
The explicit way to create a container context is to declare a `container-type` with an optional `container-name`:
    
    .post {
      container-type: inline-size;
      container-name: sidebar;
    }
    
The `container` shorthand is intended to make this simpler to define in a single declaration:
    
    .post {
      container: sidebar / inline-size;
    }
    
You can then target that container by name using the `@container` at-rule:
    
    @container sidebar (width >= 400px) {
      /* <stylesheet> */
    }
    
# border-left-color
The `border-left-color` CSS property sets the color of an element's left border. It can also be set with the shorthand CSS properties `border-color` or `border-left`.
## Try it
    
    border-left-color: red;
    
    
    border-left-color: #32a1ce;
    
    
    border-left-color: rgb(170 50 220 / 0.6);
    
    
    border-left-color: hsl(60 90% 50% / 0.8);
    
    
    border-left-color: transparent;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <color> values */
    border-left-color: red;
    border-left-color: #ffbb00;
    border-left-color: rgb(255 0 0);
    border-left-color: hsl(100deg 50% 25% / 75%);
    border-left-color: currentColor;
    border-left-color: transparent;
    
    /* Global values */
    border-left-color: inherit;
    border-left-color: initial;
    border-left-color: revert;
    border-left-color: revert-layer;
    border-left-color: unset;
    
The `border-left-color` property is specified as a single value.
### Values
`<color>`
    
The color of the left border.
## Examples
>
### A div with a border
#### HTML
    
    <div class="my-box">
      <p>
        This is a box with a border around it. Note which side of the box is
        <span class="red-text">red</span>.
      </p>
    </div>
    
#### CSS
    
    .my-box {
      border: solid 0.3em gold;
      border-left-color: red;
      width: auto;
    }
    
    .red-text {
      color: red;
    }
    
#### Result
# :buffering
The `:buffering` CSS pseudo-class selector represents an element that is playable, such as `<audio>` or `<video>`, when the playable element is buffering a media resource.
An element is considered as buffering when that element cannot continue playing because it is trying to load media data but does not yet have enough data to begin or continue playback. For more information, see the Media buffering, seeking, and time ranges guide.
Note: An element is still considered to be `:playing` when it is "buffering". If `:buffering` matches an element, `:playing` will also match that element.
## Syntax
    
    :buffering {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :buffering {
      outline: 5px solid red;
    }
    
    video:buffering {
      outline: 5px solid blue;
    }
    
# corner-bottom-right-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-bottom-right-shape` CSS property specifies the shape of a box's bottom-right corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-bottom-right-shape: notch;
    corner-bottom-right-shape: scoop;
    
    /* superellipse() function values */
    corner-bottom-right-shape: superellipse(1.7);
    corner-bottom-right-shape: superellipse(-3);
    
    /* Global values */
    corner-bottom-right-shape: inherit;
    corner-bottom-right-shape: initial;
    corner-bottom-right-shape: revert;
    corner-bottom-right-shape: revert-layer;
    corner-bottom-right-shape: unset;
    
### Values
The `corner-bottom-right-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-bottom-right-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `30% / 20%`, and a `corner-bottom-right-shape` of `notch`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 30% / 20%;
      corner-bottom-right-shape: notch;
    }
    
#### Result
The rendered result looks like this:
# page-break-after
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This property has been replaced by the `break-after` property.
The `page-break-after` CSS property adjusts page breaks after the current element.
## Try it
    
    page-break-after: auto;
    
    
    page-break-after: always;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'page-break-after'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Keyword values */
    page-break-after: auto;
    page-break-after: always;
    page-break-after: avoid;
    page-break-after: left;
    page-break-after: right;
    page-break-after: recto;
    page-break-after: verso;
    
    /* Global values */
    page-break-after: inherit;
    page-break-after: initial;
    page-break-after: revert;
    page-break-after: revert-layer;
    page-break-after: unset;
    
This property applies to block elements that generate a box. It won't apply on an empty `<div>` that won't generate a box.
### Values
`auto`
    
Initial value. Automatic page breaks (neither forced nor forbidden).
`always`
    
Always force page breaks after the element.
`avoid`
    
Avoid page breaks after the element.
`left`
    
Force page breaks after the element so that the next page is formatted as a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing.
`right`
    
Force page breaks after the element so that the next page is formatted as a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing.
`recto`
    
If pages progress left-to-right, then this acts like `right`. If pages progress right-to-left, then this acts like `left`.
`verso`
    
If pages progress left-to-right, then this acts like `left`. If pages progress right-to-left, then this acts like `right`.
## Page break aliases
The `page-break-after` property is now a legacy property, replaced by `break-after`.
For compatibility reasons, `page-break-after` should be treated by browsers as an alias of `break-after`. This ensures that sites using `page-break-after` continue to work as designed. A subset of values should be aliased as follows:
page-break-after break-after  
`auto` `auto`  
`left` `left`  
`right` `right`  
`avoid` `avoid`  
`always` `page`  
## Examples
>
### Setting a page break after footnotes
    
    /* move to a new page after footnotes */
    div.footnotes {
      page-break-after: always;
    }
    
# text-transform
The `text-transform` CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby.
## Try it
    
    text-transform: capitalize;
    
    
    text-transform: uppercase;
    
    
    text-transform: lowercase;
    
    
    text-transform: none;
    
    
    text-transform: full-width;
    
    
    text-transform: full-size-kana;
    
    
    text-transform: math-auto;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <p>
          LONDON. Michaelmas term lately over, and the Lord Chancellor sitting in
          Lincoln's Inn Hall.
        </p>
        <p lang="el">
          Σ is a Greek letter and appears in ΟΔΥΣΣΕΥΣ. Θα πάμε στο "Θεϊκό φαΐ" ή στη
          "Νεράιδα"
        </p>
        <p lang="ja">ァィゥェ ォヵㇰヶ</p>
      </div>
    </section>
    
    
    #example-element {
      font-size: 1.2em;
    }
    
The `text-transform` property takes into account language-specific case mapping rules such as the following:
  * In Turkic languages, like Turkish (`tr`), Azerbaijani (`az`), Crimean Tatar (`crh`), Volga Tatar (`tt`), and Bashkir (`ba`), there are two kinds of `i`, with and without the dot, and two case pairings: `i`/`İ` and `ı`/`I`.
  * In German (`de`), the `ß` becomes `SS` in uppercase.
  * In Dutch (`nl`), the `ij` digraph becomes `IJ`, even with `text-transform: capitalize`, which only puts the first letter of a word in uppercase.
  * In Greek (`el`), vowels lose their accent when the whole word is in uppercase (`ά`/`Α`), except for the disjunctive eta (`ή`/`Ή`). Also, diphthongs with an accent on the first vowel lose the accent and gain a diaeresis on the second vowel (`άι`/`ΑΪ`).
  * In Greek (`el`), the lowercase sigma character has two forms: `σ` and `ς`. `ς` is used only when sigma terminates a word. When applying `text-transform: lowercase` to an uppercase sigma (`Σ`), the browser needs to choose the right lowercase form based on context.
  * in Irish (`ga`), certain prefixed letters remain in lowercase when the base initial is capitalized, so for example `text-transform: uppercase` will change `ar aon tslí` to `AR AON tSLÍ` and not, as one might expect, `AR AON TSLÍ` (Firefox only). In some cases, a hyphen is also removed upon uppercasing: `an t-uisce` transforms to `AN tUISCE` (and the hyphen is correctly reinserted by `text-transform: lowercase`).


The language is defined by the `lang` HTML attribute or the `xml:lang` XML attribute.
Note: Support for language-specific cases varies between browsers, so check the browser compatibility table.
## Syntax
    
    /* Keyword values */
    text-transform: none;
    text-transform: capitalize;
    text-transform: uppercase;
    text-transform: lowercase;
    text-transform: full-width;
    text-transform: full-size-kana;
    text-transform: math-auto;
    
    /* Global values */
    text-transform: inherit;
    text-transform: initial;
    text-transform: revert;
    text-transform: revert-layer;
    text-transform: unset;
    
`capitalize`
    
Is a keyword that converts the first letter of each word to uppercase. Other characters remain unchanged (they retain their original case as written in the element's text). A letter is defined as a character that is part of Unicode's Letter or Number general categories; thus, any punctuation marks or symbols at the beginning of a word are ignored.
Note: Authors should not expect `capitalize` to follow language-specific title casing conventions (such as skipping articles in English).
Note: The `capitalize` keyword was under-specified in CSS 1 and CSS 2.1. This resulted in differences between browsers in the way the first letter was calculated (Firefox considered `-` and `_` as letters, but other browsers did not. Both WebKit and Gecko incorrectly considered letter-based symbols like `ⓐ` to be real letters.) By precisely defining the correct behavior, CSS Text Level 3 cleans this mess up. The `capitalize` line in the browser compatibility table contains the version the different engines started to support this now precisely-defined behavior.
`uppercase`
    
Is a keyword that converts all characters to uppercase.
`lowercase`
    
Is a keyword that converts all characters to lowercase.
`none`
    
Is a keyword that prevents the case of all characters from being changed.
`full-width`
    
Is a keyword that forces the writing of a character — mainly ideograms and Latin scripts — inside a square, allowing them to be aligned in the usual East Asian scripts (like Chinese or Japanese).
`full-size-kana`
    
Generally used for `<ruby>` annotation text, the keyword converts all small Kana characters to the equivalent full-size Kana, to compensate for legibility issues at the small font sizes typically used in ruby.
`math-auto`
    
Used to automatically render text in math italic where appropriate. It transforms Latin and Greek letters, and a few other math-related symbols, to italic mathematical symbols but only if it's applied on a text node containing a single character. For example, "x" will become "𝑥" (U+1D465), but "exp" will stay as "exp". It is primarily used to specify the behavior of `<mi>` elements in MathML. You should generally use MathML markup which automatically applies the right styling.
## Accessibility
Large sections of text set with a `text-transform` value of `uppercase` may be difficult for people with cognitive concerns such as Dyslexia to read.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * W3C Understanding WCAG 2.2


## Examples
>
### Example using "none"
    
    <p>
      Initial String
      <strong>Lorem ipsum dolor sit amet, consectetur adipisicing elit…</strong>
    </p>
    <p>
      text-transform: none
      <strong
        ><span
          >Lorem ipsum dolor sit amet, consectetur adipisicing elit…</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: none;
    }
    strong {
      float: right;
    }
    
This demonstrates no text transformation.
### Example using "capitalize" (general)
    
    <p>
      Initial String
      <strong>Lorem ipsum dolor sit amet, consectetur adipisicing elit…</strong>
    </p>
    <p>
      text-transform: capitalize
      <strong
        ><span
          >Lorem ipsum dolor sit amet, consectetur adipisicing elit…</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: capitalize;
    }
    strong {
      float: right;
    }
    
This demonstrates text capitalization.
### Example using "capitalize" (punctuation)
    
    <p>
      Initial String
      <strong
        >(this) "is" [a] –short– -test- «for» *the* _css_ ¿capitalize?
        ?¡transform!</strong
      >
    </p>
    <p>
      text-transform: capitalize
      <strong
        ><span
          >(this) "is" [a] –short– -test- «for» *the* _css_ ¿capitalize?
          ?¡transform!</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: capitalize;
    }
    strong {
      float: right;
    }
    
This demonstrates how initial punctuations of a word are ignored. The keyword target the first letter, that is the first Unicode character part of the Letter or Number general category.
### Example using "capitalize" (Symbols)
    
    <p>
      Initial String
      <strong>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</strong>
    </p>
    <p>
      text-transform: capitalize
      <strong><span>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</span></strong>
    </p>
    
    
    span {
      text-transform: capitalize;
    }
    strong {
      float: right;
    }
    
This demonstrates how initial symbols are ignored. The keyword target the first letter, that is the first Unicode character part of the Letter or Number general category.
### Example using "capitalize" (Dutch ij digraph)
    
    <p>
      Initial String
      <strong lang="nl">The Dutch word: "ijsland" starts with a digraph.</strong>
    </p>
    <p>
      text-transform: capitalize
      <strong
        ><span lang="nl"
          >The Dutch word: "ijsland" starts with a digraph.</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: capitalize;
    }
    strong {
      float: right;
    }
    
This demonstrates how the Dutch ij digraph must be handled like one single letter.
### Example using "uppercase" (general)
    
    <p>
      Initial String
      <strong>Lorem ipsum dolor sit amet, consectetur adipisicing elit…</strong>
    </p>
    <p>
      text-transform: uppercase
      <strong
        ><span
          >Lorem ipsum dolor sit amet, consectetur adipisicing elit…</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: uppercase;
    }
    strong {
      float: right;
    }
    
This demonstrates transforming the text to uppercase.
### Example using "uppercase" (Greek vowels)
    
    <p>
      Initial String
      <strong>Θα πάμε στο "Θεϊκό φαΐ" ή στη "Νεράιδα"</strong>
    </p>
    <p>
      text-transform: uppercase
      <strong
        ><span lang="el">Θα πάμε στο "Θεϊκό φαΐ" ή στη "Νεράιδα"</span></strong
      >
    </p>
    
    
    span {
      text-transform: uppercase;
    }
    strong {
      float: right;
    }
    
This demonstrates how Greek vowels except disjunctive eta should have no accent, and the accent on the first vowel of a vowel pair becomes a diaeresis on the second vowel.
### Example using "lowercase" (general)
    
    <p>
      Initial String
      <strong>Lorem ipsum dolor sit amet, consectetur adipisicing elit…</strong>
    </p>
    <p>
      text-transform: lowercase
      <strong
        ><span
          >Lorem ipsum dolor sit amet, consectetur adipisicing elit…</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: lowercase;
    }
    strong {
      float: right;
    }
    
This demonstrates transforming the text to lowercase.
### Example using "lowercase" (Greek Σ)
    
    <p>
      Initial String
      <strong>Σ IS A greek LETTER that appears SEVERAL TIMES IN ΟΔΥΣΣΕΥΣ.</strong>
    </p>
    <p>
      text-transform: lowercase
      <strong
        ><span
          >Σ IS A greek LETTER that appears SEVERAL TIMES IN ΟΔΥΣΣΕΥΣ.</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: lowercase;
    }
    strong {
      float: right;
    }
    
This demonstrates how the Greek character sigma (`Σ`) is transformed into the regular lowercase sigma (`σ`) or the word-final variant (`ς`), according the context.
### Example using "lowercase" (Lithuanian)
    
    <p>
      Initial String
      <strong>Ĩ is a Lithuanian LETTER as is J́</strong>
    </p>
    <p>
      text-transform: lowercase
      <strong><span lang="lt">Ĩ is a Lithuanian LETTER as is J́</span></strong>
    </p>
    
    
    span {
      text-transform: lowercase;
    }
    strong {
      float: right;
    }
    
This demonstrates how the Lithuanian letters `Ĩ` and `J́` retain their dot when transformed to lowercase.
### Example using "full-width" (general)
    
    <p>
      Initial String
      <strong
        >0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@{|}~</strong
      >
    </p>
    <p>
      text-transform: full-width
      <strong
        ><span
          >0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@{|}~</span
        ></strong
      >
    </p>
    
    
    span {
      text-transform: full-width;
    }
    strong {
      width: 100%;
      float: right;
    }
    
Some characters exist in two formats: normal width and a full-width, with different Unicode code points. The full-width version is used to mix them smoothly with Asian ideographic characters.
### Example using "full-width" (Japanese half-width katakana)
    
    <p>
      Initial String
      <strong>ｳｪﾌﾞﾌﾟﾛｸﾞﾗﾐﾝｸﾞの勉強</strong>
    </p>
    <p>
      text-transform: full-width
      <strong><span>ｳｪﾌﾞﾌﾟﾛｸﾞﾗﾐﾝｸﾞの勉強</span></strong>
    </p>
    
    
    span {
      text-transform: full-width;
    }
    strong {
      width: 100%;
      float: right;
    }
    
The Japanese half-width katakana was used to represent katakana in 8-bit character codes. Unlike regular (full-width) katakana characters, a letter with dakuten (voiced sound mark) is represented as two code points, the body of letter and dakuten. The `full-width` combines these into a single code point when converting these characters into full-width.
### Example using "full-size-kana"
    
    <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p>
    <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p>
    
    
    p:nth-of-type(2) {
      text-transform: full-size-kana;
    }
    
### Example using "math-auto"
In this example, we use pure HTML markup to create a math formula:
    
    <div>
      (<span class="math-id">sin</span>&#8198;<span class="math-id">x</span>)<sup
        >2</sup
      >
      + (<span class="math-id">cos</span>&#8198;<span class="math-id">x</span>)<sup
        >2</sup
      >
      = 1
    </div>
    
We give every `.math-id` element `text-transform: math-auto`. However, note how only the `x` characters become italic, while the `sin` and `cos` remain unchanged.
    
    .math-id {
      text-transform: math-auto;
    }
    
However, you are encouraged to use MathML for mathematical formulas, as it provides a more robust and accessible way to represent mathematical content. Here's the same formula using MathML:
    
    <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
      <semantics>
        <mrow>
          <mo stretchy="false">(</mo>
          <mo lspace="0em" rspace="0em">sin</mo>
          <mspace width="0.16666666666666666em"></mspace>
          <mi>x</mi>
          <msup>
            <mo stretchy="false">)</mo>
            <mn>2</mn>
          </msup>
          <mo>+</mo>
          <mo stretchy="false">(</mo>
          <mo lspace="0em" rspace="0em">cos</mo>
          <mspace width="0.16666666666666666em"></mspace>
          <mi>x</mi>
          <msup>
            <mo stretchy="false">)</mo>
            <mn>2</mn>
          </msup>
          <mo>=</mo>
          <mn>1</mn>
        </mrow>
        <annotation encoding="TeX">(\sin\,x)^2+(\cos\,x)^2=1</annotation>
      </semantics>
    </math>
    
# scrollbar-color
The `scrollbar-color` CSS property sets the color of the scrollbar track and thumb.
The track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position.
The thumb refers to the moving part of the scrollbar, which usually floats on top of the track.
When `scrollbar-color` value is set on the document's root element, the values are applied to the viewport scrollbars.
## Syntax
    
    /* Keyword values */
    scrollbar-color: auto;
    
    /* <color> values */
    scrollbar-color: rebeccapurple green; /* Two valid colors.
    The first applies to the thumb of the scrollbar, the second to the track. */
    
    /* Global values */
    scrollbar-color: inherit;
    scrollbar-color: initial;
    scrollbar-color: revert;
    scrollbar-color: revert-layer;
    scrollbar-color: unset;
    
### Values
`<scrollbar-color>`
    
Defines the color of the scrollbar.
`auto` Default platform rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color properties.   
`<color> <color>` Applies the first color to the scrollbar thumb, the second to the scrollbar track.   
Note: `@media (forced-colors: active)` sets `scrollbar-color` to `auto`.
## Accessibility
When using `scrollbar-color` property with specific color values, authors should ensure the specified colors have enough contrast between them. For keyword values, UAs should ensure the colors they use have enough contrast. See Techniques for WCAG 2.0: G183: Using a contrast ratio of 3:1.
## Examples
>
### Coloring overflow scrollbars
#### CSS
    
    .scroller {
      width: 300px;
      height: 100px;
      overflow-y: scroll;
      scrollbar-color: #000077 #bada55;
    }
    
#### HTML
    
    <div class="scroller">
      Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion
      daikon amaranth tatsoi tomatillo melon azuki bean garlic. Gumbo beet greens
      corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts
      fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber
      earthnut pea peanut soko zucchini.
    </div>
    
#### Result
# transition-property
The `transition-property` CSS property sets the CSS properties to which a transition effect should be applied.
## Try it
    
    transition-property: margin-right;
    
    
    transition-property: margin-right, color;
    
    
    transition-property: all;
    
    
    transition-property: none;
    
    
    <section id="default-example">
      <div id="example-element">Hover to see<br />the transition.</div>
    </section>
    
    
    #example-element {
      background-color: #e4f0f5;
      color: black;
      padding: 1rem;
      border-radius: 0.5rem;
      font: 1em monospace;
      width: 100%;
      transition: margin-right 2s;
    }
    
    #default-example:hover > #example-element {
      background-color: #990099;
      color: white;
      margin-right: 40%;
    }
    
If you specify a shorthand property (e.g., `background`), all of its longhand sub-properties that can be animated will be.
## Syntax
    
    /* Keyword values */
    transition-property: none;
    transition-property: all;
    
    /* <custom-ident> values */
    transition-property: test_05;
    transition-property: -specific;
    transition-property: sliding-vertically;
    
    /* Multiple values */
    transition-property: test1, animation4;
    transition-property: all, height, color;
    transition-property:
      all,
      -moz-specific,
      sliding;
    
    /* Global values */
    transition-property: inherit;
    transition-property: initial;
    transition-property: revert;
    transition-property: revert-layer;
    transition-property: unset;
    
### Values
`none`
    
No properties will transition.
`all`
    
All properties that can transition will.
`<custom-ident>`
    
A string identifying the property to which a transition effect should be applied when its value changes.
## Examples
>
### Basic example
When the button is hovered or focused, it undergoes a one-second color transition; the `transition-property` is `background-color`.
#### HTML
    
    <button class="target">Focus me!</button>
    
#### CSS
    
    .target {
      transition-property: background-color;
      transition-duration: 1s;
      background-color: #cccccc;
    }
    
    .target:hover,
    .target:focus {
      background-color: #eeeeee;
    }
    
See our Using CSS transitions guide for more `transition-property` examples.
# columns
The `columns` CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths.
## Try it
    
    columns: 2;
    
    
    columns: 6rem auto;
    
    
    columns: 12em;
    
    
    columns: 3;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      min-width: 21rem;
      text-align: left;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `column-count`
  * `column-width`


## Syntax
    
    /* Column width */
    columns: 18em;
    
    /* Column count */
    columns: auto;
    columns: 2;
    
    /* Both column width and count */
    columns: 2 auto;
    columns: auto 12em;
    columns: auto auto;
    
    /* Global values */
    columns: inherit;
    columns: initial;
    columns: revert;
    columns: revert-layer;
    columns: unset;
    
The `columns` property may be specified as one or two of the values listed below, in any order.
### Values
`<'column-width'>`
    
The ideal column width, defined as a `<length>` or the keyword `auto`. The actual width may be wider or narrower to fit the available space. See `column-width`.
`<'column-count'>`
    
The ideal number of columns into which the element's content should be flowed, defined as an `<integer>` or the keyword `auto`. If neither this value nor the column's width are `auto`, it merely indicates the maximum allowable number of columns. See `column-count`.
## Examples
>
### Setting three equal columns
#### HTML
    
    <p class="content-box">
      This is a bunch of text split into three columns using the CSS `columns`
      property. The text is equally distributed over the columns.
    </p>
    
#### CSS
    
    .content-box {
      columns: 3 auto;
    }
    
#### Result
# CSS scrollbars styling
The CSS scrollbars styling module defines properties that you can use for visual styling of scrollbars. You can customize the width of the scrollbar as required. You can also customize the color of the scrollbar track, which is the background of the scrollbar, and the color of the scrollbar thumb, which is the draggable handle of the scrollbar.
## Scrollbar styling in action
This example defines a thin scrollbar with a red thumb and an orange track. To view the thumb, you will need to scroll the text. After the scrollbar is visible, hover over it to see the track.
    
    .poem {
      overflow: scroll;
      scrollbar-color: red orange;
      scrollbar-width: thin;
    }
    
Note: When customizing scrollbars, ensure that the thumb and track have enough contrast with the surrounding background. Also ensure that the scrollbar hit area is large enough for people who use touch input.
## Reference
>
### CSS properties
  * `scrollbar-width`
  * `scrollbar-color`


## Related concepts
  * `overflow-block` CSS property
  * `overflow-inline` CSS property
  * `overflow-x` CSS property
  * `overflow-y` CSS property
  * `overflow` CSS shorthand property
  * `overflow-clip-margin` CSS property
  * `scrollbar-gutter` CSS property
  * `scroll-behavior` CSS property
  * `scroll-margin` CSS shorthand property
  * `scroll-padding` CSS shorthand property
  * `scroll-snap-align` CSS property
  * `scroll-snap-stop` CSS property
  * `scroll-snap-type` CSS property
  * `::-webkit-scrollbar` pseudo-element
  * scroll container glossary term
  * `scrollbar` ARIA role


# :current
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:current` CSS pseudo-class selector is a time-dimensional pseudo-class that represents an element or the ancestor of an element that is currently being displayed. For example, this pseudo-class can be used to represent a video that is being displayed with captions by WebVTT.
    
    :current(p, span) {
      background-color: yellow;
    }
    
## Syntax
    
    :current {
      /* ... */
    }
    
    :current(<compound-selector-list>) {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :current(p, span) {
      background-color: yellow;
    }
    
### HTML
    
    <video controls preload="metadata">
      <source src="video.mp4" type="video/mp4" />
      <source src="video.webm" type="video/webm" />
      <track
        label="English"
        kind="subtitles"
        srclang="en"
        src="subtitles.vtt"
        default />
    </video>
    
### WebVTT
    
    WEBVTT FILE
    
    1
    00:00:03.500 --> 00:00:05.000
    This is the first caption
    
    2
    00:00:06.000 --> 00:00:09.000
    This is the second caption
    
    3
    00:00:11.000 --> 00:00:19.000
    This is the third caption
    
Currently, no browsers support this feature.
# corner-start-end-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-start-end-shape` CSS property specifies the shape of a box's block-start and inline-end corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-start-end-shape: square;
    corner-start-end-shape: bevel;
    
    /* superellipse() function values */
    corner-start-end-shape: superellipse(1.5);
    corner-start-end-shape: superellipse(-2.2);
    
    /* Global values */
    corner-start-end-shape: inherit;
    corner-start-end-shape: initial;
    corner-start-end-shape: revert;
    corner-start-end-shape: revert-layer;
    corner-start-end-shape: unset;
    
### Values
The `corner-start-end-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-start-end-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `20px 40px 60px 80px`, and a `corner-start-end-shape` of `notch`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 20px 40px 60px 80px;
      corner-start-end-shape: notch;
    }
    
#### Result
The rendered result looks like this:
# border-left-width
The `border-left-width` CSS property sets the width of the left border of an element.
## Try it
    
    border-left-width: thick;
    
    
    border-left-width: 2em;
    
    
    border-left-width: 4px;
    
    
    border-left-width: 2ex;
    
    
    border-left-width: 0;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* Keyword values */
    border-left-width: thin;
    border-left-width: medium;
    border-left-width: thick;
    
    /* <length> values */
    border-left-width: 10em;
    border-left-width: 3vmax;
    border-left-width: 6px;
    
    /* Global keywords */
    border-left-width: inherit;
    border-left-width: initial;
    border-left-width: revert;
    border-left-width: revert-layer;
    border-left-width: unset;
    
### Values
`<line-width>`
    
Defines the width of the border, either as an explicit nonnegative `<length>` or a keyword. If it's a keyword, it must be one of the following values:
  * `thin`
  * `medium`
  * `thick`


Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern `thin ≤ medium ≤ thick`, and the values are constant within a single document.
## Examples
>
### Comparing border widths
#### HTML
    
    <div>Element 1</div>
    <div>Element 2</div>
    
#### CSS
    
    div {
      border: 1px solid red;
      margin: 1em 0;
    }
    
    div:nth-child(1) {
      border-left-width: thick;
    }
    div:nth-child(2) {
      border-left-width: 2em;
    }
    
#### Result
# <url>
The `<url>` CSS data type is a pointer to a resource. The resource could be an image, a video, a CSS file, a font file, an SVG feature etc.
## Syntax
    
    <url> = <url()>
    
### Values
The value is either of the following:
`<url()>`
    
The `url()` function accepts only a URL literal string (with or without quotes).
Note: The specification defines an alternative function called `src()` that accepts a URL string or a CSS variable. But no web browser has implemented the function yet.
# CSS cascading and inheritance
The CSS cascading and inheritance module defines the rules for assigning values to properties by way of cascading and inheritance. This module specifies the rules for finding the specified value for all properties on all elements.
One of the fundamental design principles of CSS is cascading of rules. It allows several style sheets to influence the presentation of a document. CSS property-value declarations define how a document is rendered. Multiple declarations may set different values for the same element and property combination, but only one value can be applied to any CSS property. The CSS cascade module defines how these conflicts are resolved.
The opposite also occurs. Sometimes there are no declarations defining the value of a property. The CSS cascade module defines how these missing values should be set via inheritance or from the property's initial value.
Note: The rules for finding the specified values in the page context and its margin boxes are described in the CSS page module.
## Reference
>
### Properties
  * `all`


### At-rules
  * `@import`
  * `@layer`


### Keywords
  * `initial`
  * `inherit`
  * `revert`
  * `revert-layer`
  * `unset`
  * `!important` flag


### Interfaces
  * `CSSLayerBlockRule`
  * `CSSGroupingRule`
  * `CSSLayerStatementRule`
  * `CSSRule`


### Glossary and definitions
  * Actual value
  * Anonymous layer
  * Author origin
  * Cascade
  * Computed value
  * Initial value
  * Named layer
  * Resolved value
  * Shorthand properties
  * Specificity
  * Specified value
  * style origin
  * Used value
  * User origin
  * User-agent origin


## Guides
Introducing the CSS Cascade
    
Guide to the cascade algorithm that defines how user agents combine property values originating from different sources.
CSS inheritance
    
A guide to CSS inheritance.
Learn: Handling conflicts
    
The most fundamental concepts of CSS — the cascade, specificity, and inheritance — which control how CSS is applied to HTML and how conflicts are resolved.
Learn: Cascade layers
    
Introduction to cascade layers, a more advanced feature that builds on the fundamental concepts of the CSS cascade and CSS specificity.
## Related concepts
  * Element-attached styles
  * Inline styles and the cascade
  * Conditional rules for @imports
  * Value definition syntax


# grid-auto-columns
The `grid-auto-columns` CSS property specifies the size of an implicitly-created grid column track or pattern of tracks.
## Try it
    
    grid-auto-columns: auto;
    
    
    grid-auto-columns: 1fr;
    
    
    grid-auto-columns: min-content;
    
    
    grid-auto-columns: minmax(10px, auto);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div></div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element > div:nth-child(1) {
      grid-column: 1 / 3;
    }
    
    #example-element > div:nth-child(2) {
      grid-column: 2;
    }
    
If a grid item is positioned into a column that is not explicitly sized by `grid-template-columns`, implicit grid tracks are created to hold it. This can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns.
## Syntax
    
    /* Keyword values */
    grid-auto-columns: min-content;
    grid-auto-columns: max-content;
    grid-auto-columns: auto;
    
    /* <length> values */
    grid-auto-columns: 100px;
    grid-auto-columns: 20cm;
    grid-auto-columns: 50vmax;
    
    /* <percentage> values */
    grid-auto-columns: 10%;
    grid-auto-columns: 33.3%;
    
    /* <flex> values */
    grid-auto-columns: 0.5fr;
    grid-auto-columns: 3fr;
    
    /* minmax() values */
    grid-auto-columns: minmax(100px, auto);
    grid-auto-columns: minmax(max-content, 2fr);
    grid-auto-columns: minmax(20%, 80vmax);
    
    /* fit-content() values */
    grid-auto-columns: fit-content(400px);
    grid-auto-columns: fit-content(5cm);
    grid-auto-columns: fit-content(20%);
    
    /* multiple track-size values */
    grid-auto-columns: min-content max-content auto;
    grid-auto-columns: 100px 150px 390px;
    grid-auto-columns: 10% 33.3%;
    grid-auto-columns: 0.5fr 3fr 1fr;
    grid-auto-columns: minmax(100px, auto) minmax(max-content, 2fr)
      minmax(20%, 80vmax);
    grid-auto-columns: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px);
    
    /* Global values */
    grid-auto-columns: inherit;
    grid-auto-columns: initial;
    grid-auto-columns: revert;
    grid-auto-columns: revert-layer;
    grid-auto-columns: unset;
    
### Values
`<length>`
    
Is a non-negative length.
`<percentage>`
    
Is a non-negative `<percentage>` value relative to the block size of the grid container. If the block size of the grid container is indefinite, the percentage value is treated like `auto`.
`<flex>`
    
Is a non-negative dimension with the unit `fr` specifying the track's flex factor. Each `<flex>`-sized track takes a share of the remaining space in proportion to its flex factor.
When appearing outside a `minmax()` notation, it implies an automatic minimum (i.e., `minmax(auto, <flex>)`).
`max-content`
    
Is a keyword representing the largest maximal content contribution of the grid items occupying the grid track.
`min-content`
    
Is a keyword representing the largest minimal content contribution of the grid items occupying the grid track.
`minmax(min, max)`
    
Is a functional notation that defines a size range greater than or equal to min and less than or equal to max. If max is smaller than min, then max is ignored and the function is treated as min. As a maximum, a `<flex>` value sets the track's flex factor. As a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint).
`fit-content( [ <length> | <percentage> ] )`
    
Represents the formula `min(max-content, max(auto, argument))`, which is calculated similar to `auto` (i.e., `minmax(auto, max-content)`), except that the track size is clamped at argument if it is greater than the `auto` minimum.
`auto`
    
As a maximum represents the largest `max-content` size of the items in that track.
As a minimum represents the largest minimum size of items in that track (specified by the `min-width`/`min-height` of the items). This is often, though not always, the `min-content` size.
If used outside of `minmax()` notation, `auto` represents the range between the minimum and maximum described above. This behaves similarly to `minmax(min-content,max-content)` in most cases.
Note: `auto` track sizes (and only `auto` track sizes) can be stretched by the `align-content` and `justify-content` properties. Therefore by default, an `auto` sized track will take up any remaining space in the grid container.
## Examples
>
### Setting grid column size
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
    </div>
    
#### CSS
    
    #grid {
      height: 100px;
      display: grid;
      grid-template-areas: "a a";
      gap: 10px;
      grid-auto-columns: 200px;
    }
    
    #grid > div {
      background-color: lime;
    }
    
#### Result
# <content-position>
The `<content-position>` enumerated value type is used by `justify-content` and `align-content` properties, and the `place-content` shorthand, to align the box's contents within itself.
## Syntax
    
    <content-position> = center | start | end | flex-start | flex-end
    
## Values
The `<content-position>` enumerated value type is specified using one of the following key terms.
`center`
    
Centers the alignment subject within its alignment container.
`start`
    
Aligns the alignment subject flush with the alignment container's start edge.
`end`
    
Aligns the alignment subject flush with the alignment container's end edge.
`flex-start`
    
In flex layout, aligns the alignment subject flush with the edge of the alignment container corresponding to the flex container's main-start or cross-start side, as appropriate. It is identical to `start` for layout modes other than flex layout.
`flex-end`
    
In flex layout, aligns the alignment subject flush with the edge of the alignment container corresponding to the flex container's main-end or cross-end side, as appropriate. Identical to `end` for layout modes other than flex layout.
Note: The `left` and `right` keywords are excluded from `<content-position>`, despite being valid positional alignment values for the `justify-*` properties (`justify-content`, `justify-self`, and `justify-items`), because they are not allowed in the `align-*` properties (`align-content`, `align-self`, and `align-items`). They are instead explicitly included in the `justify-*` properties' grammars.
# <string>
The `<string>` CSS data type represents a sequence of characters. Strings are used in numerous CSS properties, such as `content`, `font-family`, and `quotes`.
## Syntax
The `<string>` data type is composed of any number of Unicode characters surrounded by either double (`"`) or single (`'`) quotes.
Most characters can be represented literally. All characters can also be represented with their respective Unicode code points in hexadecimal, in which case they are preceded by a backslash (`\`). For example, `\22` represents a double quote, `\27` a single quote (`'`), and `\A9` the copyright symbol (`©`).
Importantly, certain characters which would otherwise be invalid can be escaped with a backslash. These include double quotes when used inside a double-quoted string, single quotes when used inside a single-quoted string, and the backslash itself. For example, `\\` will create a single backslash.
To output new lines, you must escape them with a line feed character such as `\A` or `\00000A`. In your code, however, strings can span multiple lines, in which case each new line must be escaped with a `\` as the last character of the line.
However, to get new lines, you must also set the `white-space` property to appropriate value.
Note: Character references (such as `&nbsp;` or `&#8212;`) cannot be used in a CSS `<string>`.
## Examples
>
### Examples of valid strings
    
    /* Basic strings */
    "This string is demarcated by double quotes."
    'This string is demarcated by single quotes.'
    
    /* Character escaping */
    "This is a string with \" an escaped double quote."
    "This string also has \22 an escaped double quote."
    'This is a string with \' an escaped single quote.'
    'This string also has \27 an escaped single quote.'
    "This is a string with \\ an escaped backslash."
    
    /* New line in a string */
    "This string has a \Aline break in it."
    
    /* String spanning two lines of code (these two strings will have identical output) */
    "A really long \
    awesome string"
    "A really long awesome string"
    
# font-variant-alternates
The `font-variant-alternates` CSS property controls the usage of alternate glyphs. These alternate glyphs may be referenced by alternative names defined in `@font-feature-values`.
The `@font-feature-values` at-rule can be used to associate, for a given font face, a human-readable name with a numeric index that controls a particular OpenType font feature. For features that select alternative glyphs (`stylistic`, `styleset`, `character-variant`, `swash`, `ornament` or `annotation`), the `font-variant-alternates` property can then reference the human-readable name in order to apply the associated feature.
This allows CSS rules to enable alternative glyphs without needing to know the specific index values that a particular font uses to control them.
## Syntax
    
    /* Keyword values */
    font-variant-alternates: normal;
    font-variant-alternates: historical-forms;
    
    /* Functional notation values */
    font-variant-alternates: stylistic(user-defined-ident);
    font-variant-alternates: styleset(user-defined-ident);
    font-variant-alternates: character-variant(user-defined-ident);
    font-variant-alternates: swash(user-defined-ident);
    font-variant-alternates: ornaments(user-defined-ident);
    font-variant-alternates: annotation(user-defined-ident);
    font-variant-alternates: swash(ident1) annotation(ident2);
    
    /* Global values */
    font-variant-alternates: inherit;
    font-variant-alternates: initial;
    font-variant-alternates: revert;
    font-variant-alternates: revert-layer;
    font-variant-alternates: unset;
    
This property may take one of two forms:
  * either the keyword `normal`
  * or one or more of the other keywords and functions listed below, space-separated, in any order.


### Values
`normal`
    
This keyword deactivates alternate glyphs.
`historical-forms`
    
This keyword enables historical forms — glyphs that were common in the past but not today. It corresponds to the OpenType value `hist`.
`stylistic()`
    
This function enables stylistic alternates for individual characters. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value `salt`, like `salt 2`.
`styleset()`
    
This function enables stylistic alternatives for sets of characters. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value `ssXY`, like `ss02`.
`character-variant()`
    
This function enables specific stylistic alternatives for characters. It is similar to `styleset()`, but doesn't create coherent glyphs for a set of characters; individual characters will have independent and not necessarily coherent styles. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value `cvXY`, like `cv02`.
`swash()`
    
This function enables swash glyphs. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType values `swsh` and `cswh`, like `swsh 2` and `cswh 2`.
`ornaments()`
    
This function enables ornaments, like fleurons and other dingbat glyphs. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value `ornm`, like `ornm 2`.
Note: In order to preserve text semantics, font designers should include ornaments that don't match Unicode dingbat characters as ornamental variants of the bullet character (U+2022). Be aware that some existing fonts don't follow this advice.
`annotation()`
    
This function enables annotations, like circled digits or inverted characters. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value `nalt`, like `nalt 2`.
## Examples
>
### Enabling swash glyphs
In this example, we use the `@font-feature-values` at-rule to define a name for the `swash` feature of the MonteCarlo font. The rule maps the name `"fancy"` to the index value `1`.
We can then use that name inside `font-variant-alternates` to switch on swashes for that font. This is the equivalent of a line like `font-feature-settings: "swsh" 1`, except that the CSS applying the feature does not need to include, or even know, the index value needed for this particular font.
#### HTML
    
    <p>A Fancy Swash</p>
    <p class="variant">A Fancy Swash</p>
    
#### CSS
    
    @font-face {
      font-family: MonteCarlo;
      src: url("/shared-assets/fonts/monte-carlo/monte-carlo-regular.woff2");
    }
    
    @font-feature-values "MonteCarlo" {
      @swash {
        fancy: 1;
      }
    }
    
    p {
      font-family: "MonteCarlo", cursive;
      font-size: 3rem;
      margin: 0.7rem 3rem;
    }
    
    .variant {
      font-variant-alternates: swash(fancy);
    }
    
#### Result
# <easing-function>
The `<easing-function>` CSS data type represents a mathematical function that describes the rate at which a value changes.
This transition between two values may be applied in different situations. It may be used to describe how fast values change during animations. This lets you vary the animation's speed over the course of its duration. You can specify an easing function for CSS transition and animation properties.
## Syntax
    
    /* Keyword linear easing function */
    linear                /* linear(0, 1) */
    
    /* Custom linear easing functions */
    linear(0, 0.25, 1)
    linear(0, 0.25 75%, 1)
    
    /* Keyword cubic Bézier easing functions */
    ease                  /* cubic-bezier(0.25, 0.1, 0.25, 1) */
    ease-in               /* cubic-bezier(0.42, 0, 1, 1) */
    ease-out              /* cubic-bezier(0, 0, 0.58, 1) */
    ease-in-out           /* cubic-bezier(0.42, 0, 0.58, 1) */
    
    /* Custom cubic Bézier easing function */
    cubic-bezier(0.25, 0.1, 0.25, 1)
    
    /* Keyword step easing functions */
    step-start            /* steps(1, jump-start) */
    step-end              /* steps(1, jump-end) */
    
    /* Custom step easing functions */
    steps(4, end)
    steps(10, jump-both)
    
### Values
An `<easing-function>` can be one of the following types:
`<linear-easing-function>`
    
Creates transitions that progress at a constant rate. This function can be specified using one of the following:
`linear`
    
Specifies a constant rate of interpolation, with no change in the rate of progress throughout the duration (that is, no acceleration or deceleration). This keyword value is equivalent to `linear(0, 1)`. It can also be represented as `cubic-bezier(0, 0, 1, 1)`.
Note: The `linear` keyword is always interpreted as `linear(0, 1)`, whereas the function `linear(0, 1)` is interpreted as `linear(0 0%, 1 100%)`.
`linear()`
    
Defines multiple points of progress using `<number>` values, with optional `<percentage>` values to control their timing.
`<cubic-bezier-easing-function>`
    
Creates smooth transitions with variable rates of change. This function can be specified using one of the following:
`ease`
    
Represents the easing function `cubic-bezier(0.25, 0.1, 0.25, 1)`. It indicates that the interpolation starts slowly, accelerates sharply, and then slows gradually towards the end. It is similar to the `ease-in-out` keyword, though it accelerates more sharply at the beginning.
`ease-in`
    
Represents the easing function `cubic-bezier(0.42, 0, 1, 1)`. It indicates that the interpolation starts slowly, then progressively speeds up until the end, at which point it stops abruptly.
`ease-out`
    
Represents the easing function `cubic-bezier(0, 0, 0.58, 1)`. It indicates that the interpolation starts abruptly and then progressively slows down towards the end.
`ease-in-out`
    
Represents the easing function `cubic-bezier(0.42, 0, 0.58, 1)`. It indicates that the interpolation starts slowly, speeds up, and then slows down towards the end. At the beginning, it behaves like the `ease-in` keyword; at the end, it is like the `ease-out` keyword.
`cubic-bezier()`
    
Defines a custom curve using four `<number>` values that specify the coordinates of two control points. The x-coordinates must be in the range `[0, 1]`.
`<step-easing-function>`
    
Creates stepped transitions that divides the animation into a set number of equal-length intervals, causing the animation to jump from one step to the next rather than transitioning smoothly. This function can be specified using one of the following:
`step-start`
    
Represents the easing function `steps(1, jump-start)` or `steps(1, start)`. It indicates that the interpolation jumps immediately to its final state, where it stays until the end.
`step-end`
    
Represents the easing function `steps(1, jump-end)` or `steps(1, end)`. It indicates that the interpolation stays in its initial state until the end, at which point it jumps directly to its final state.
`steps()`
    
Creates a stair-shaped curve using an `<integer>` to specify the number of intervals and an optional keyword to control the timing of jumps.
## Examples
>
### Comparing the easing functions
This example provides an easy comparison between the different easing functions using an animation. From the drop-down menu, you can select an easing function – there are a couple of keywords and some `cubic-bezier()` and `steps()` options. After selecting an option, you can start and stop the animation using the provided button.
#### HTML
    
    <div>
      <div></div>
    </div>
    <ul>
      <li>
        <button class="animation-button">Start animation</button>
      </li>
      <li>
        <label for="easing-select">Choose an easing function:</label>
        <select id="easing-select">
          <option selected>linear</option>
          <option>linear(0, 0.5 50%, 1)</option>
          <option>ease</option>
          <option>ease-in</option>
          <option>ease-in-out</option>
          <option>ease-out</option>
          <option>cubic-bezier(0.1, -0.6, 0.2, 0)</option>
          <option>cubic-bezier(0, 1.1, 0.8, 4)</option>
          <option>steps(5, end)</option>
          <option>steps(3, start)</option>
          <option>steps(4)</option>
        </select>
      </li>
    </ul>
    
#### CSS
    
    body > div {
      position: relative;
      height: 100px;
    }
    
    div > div {
      position: absolute;
      width: 50px;
      height: 50px;
      background-color: blue;
      background-image: radial-gradient(
        circle at 10px 10px,
        rgb(25 255 255 / 80%),
        rgb(25 255 255 / 40%)
      );
      border-radius: 50%;
      top: 25px;
      animation: 1.5s infinite alternate;
    }
    
    @keyframes move-right {
      from {
        left: 10%;
      }
    
      to {
        left: 90%;
      }
    }
    
    li {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
    }
    
#### JavaScript
    
    const selectElem = document.querySelector("select");
    const startBtn = document.querySelector("button");
    const divElem = document.querySelector("div > div");
    
    startBtn.addEventListener("click", () => {
      if (startBtn.textContent === "Start animation") {
        divElem.style.animationName = "move-right";
        startBtn.textContent = "Stop animation";
        divElem.style.animationTimingFunction = selectElem.value;
      } else {
        divElem.style.animationName = "unset";
        startBtn.textContent = "Start animation";
      }
    });
    
    selectElem.addEventListener("change", () => {
      divElem.style.animationTimingFunction = selectElem.value;
    });
    
#### Result
# animation-composition
The `animation-composition` CSS property specifies the composite operation to use when multiple animations affect the same property simultaneously.
## Syntax
    
    /* Single animation */
    animation-composition: replace;
    animation-composition: add;
    animation-composition: accumulate;
    
    /* Multiple animations */
    animation-composition: replace, add;
    animation-composition: add, accumulate;
    animation-composition: replace, add, accumulate;
    
    /* Global values */
    animation-composition: inherit;
    animation-composition: initial;
    animation-composition: revert;
    animation-composition: revert-layer;
    animation-composition: unset;
    
Note: When you specify multiple comma-separated values on an `animation-*` property, they will be applied to the animations in the order in which the `animation-name`s appear. If the number of animations and compositions differ, the values listed in the `animation-composition` property will cycle from the first to the last `animation-name`, looping until all the animations have an assigned `animation-composition` value. For more information, see Setting multiple animation property values.
### Values
`replace`
    
The effect value overrides the underlying value of the property. This is the default value.
`add`
    
The effect value builds on the underlying value of the property. This operation produces an additive effect. For animation types where the addition operation is not commutative, the order of the operands is the underlying value followed by the effect value.
`accumulate`
    
The effect and underlying values are combined. For animation types where the addition operation is not commutative, the order of the operands is the underlying value followed by the effect value.
## Description
Each property that is targeted by the @keyframes at-rule is associated with an effect stack. The value of the effect stack is calculated by combining the underlying value of a property in a CSS style rule with the effect value of that property in the keyframe. The `animation-composition` property helps to specify how to combine the underlying value with the effect value.
For example, in the CSS below, `blur(5px)` is the underlying value, and `blur(10px)` is the effect value. The `animation-composition` property specifies the operation to perform to produce the final effect value after compositing the effect of the underlying value and the effect value.
    
    .icon:hover {
      filter: blur(5px);
      animation: 3s infinite pulse;
      animation-composition: add;
    }
    
    @keyframes pulse {
      0% {
        filter: blur(10px);
      }
      100% {
        filter: blur(20px);
      }
    }
    
Consider different values for the `animation-composition` property in the above example. The final effect value in each of those cases will be calculated as explained below:
  * With `replace`, `blur(10px)` will replace `blur(5px)` in the `0%` keyframe. This is the default behavior of the property.
  * With `add`, the composite effect value in the `0%` keyframe will be `blur(5px) blur(10px)`.
  * With `accumulate`, the composite effect value in `0%` keyframe will be `blur(15px)`.


Note: A composite operation can also be specified in a keyframe. In that case, the specified composite operation is used for each property first within that keyframe and then on each property in the next keyframe.
## Examples
>
### Understanding the animation-composition values
The example below shows the effect of different `animation-composition` values side-by-side.
#### HTML
    
    <div class="container">
      replace
      <div id="replace" class="target"></div>
    </div>
    <div class="container">
      add
      <div id="add" class="target"></div>
    </div>
    <div class="container">
      accumulate
      <div id="accumulate" class="target"></div>
    </div>
    
#### CSS
Here the underlying value is `translateX(50px) rotate(45deg)`.
    
    @keyframes slide {
      20%,
      40% {
        transform: translateX(100px);
        background: yellow;
      }
      80%,
      100% {
        transform: translateX(150px);
        background: orange;
      }
    }
    
    .target {
      transform: translateX(30px) rotate(45deg);
      animation: slide 5s linear infinite;
    }
    .target:hover {
      animation-play-state: paused;
    }
    #replace {
      animation-composition: replace;
    }
    #add {
      animation-composition: add;
    }
    #accumulate {
      animation-composition: accumulate;
    }
    
#### Result
  * With `replace`, the final effect value for the `transform` property in the `20%, 40%` keyframe is `translateX(100px)` (completely replacing the underlying value `translateX(30px) rotate(45deg)`). In this case, the element rotates from 45deg to 0deg as it animates from the default value set on the element itself to the non-rotated value set at the 20% mark. This is the default behavior.
  * With `add`, the final effect value for the `transform` property in the `20%, 40%` keyframe is `translateX(30px) rotate(45deg) translateX(100px)`. So the element is first moved 100px to the right, rotated 45deg around the origin, then moved to the right by 30px.
  * With `accumulate`, the final effect value in the `20%, 40%` keyframe is `translateX(130px) rotate(45deg)`. This means that the two X-axis translation values of `30px` and `100px` are combined or "accumulated".


# scrollbar-width
The `scrollbar-width` property allows the author to set the desired thickness of an element's scrollbars when they are shown.
The purpose of the `scrollbar-width` is to optimize the space occupied by the scrollbar on a page or element; the purpose is not related to scrollbar aesthetics. The `scrollbar-width` predefined keyword values indicate to the user agent whether a normal or smaller scrollbar should be rendered. Avoid using `none`, as hiding a scrollbar negatively impacts accessibility.
Note: For elements that are scrollable only via programmatic means and not by direct user interaction, use the `overflow` property with a value of `hidden` rather than `scrollbar-width: none`.
## Syntax
    
    /* Keyword values */
    scrollbar-width: auto;
    scrollbar-width: thin;
    scrollbar-width: none;
    
    /* Global values */
    scrollbar-width: inherit;
    scrollbar-width: initial;
    scrollbar-width: revert;
    scrollbar-width: revert-layer;
    scrollbar-width: unset;
    
### Values
`auto`
    
The default scrollbar width for the platform.
`thin`
    
A thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width.
`none`
    
No scrollbar shown, however the element will still be scrollable.
Note: User Agents must apply any `scrollbar-width` value set on the root element to the viewport.
## Accessibility
Use this property with caution — setting `scrollbar-width` to `thin` or `none` can make content hard or impossible to scroll if the author does not provide an alternative scrolling mechanism. While swiping gestures or mouse wheels can enable scrolling on such content, some devices have no scroll alternative.
WCAG criterion 2.1.1 (Keyboard) has been in place for a long time to advise on basic keyboard accessibility, and this should include scrolling of content areas. And introduced in WCAG 2.1, criterion 2.5.5 (Target Size) advises that touch targets should be at least 44px in width and height (although the problem is compounded on high-resolution screens; thorough testing is advised).
  * MDN Understanding WCAG, Guideline 2.1 explanations
  * MDN Understanding WCAG, Guideline 2.5 explanations
  * Understanding Success Criterion 2.1.1 | W3C Understanding WCAG 2.1
  * Understanding Success Criterion 2.5.5 | W3C Understanding WCAG 2.1


## Examples
>
### Sizing overflow scrollbars
#### CSS
    
    .scroller {
      width: 300px;
      height: 100px;
      overflow-y: scroll;
      scrollbar-width: thin;
    }
    
#### HTML
    
    <div class="scroller">
      Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion
      daikon amaranth tatsoi tomatillo melon azuki bean garlic. Gumbo beet greens
      corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts
      fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber
      earthnut pea peanut soko zucchini.
    </div>
    
#### Result
# bottom
The `bottom` CSS property participates in setting the vertical position of a positioned element. This inset property has no effect on non-positioned elements.
## Try it
    
    bottom: 0;
    
    
    bottom: 4em;
    
    
    bottom: 10%;
    
    
    bottom: 20px;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #264653;
      border: 4px solid #ffb500;
      color: white;
      position: absolute;
      width: 140px;
      height: 60px;
    }
    
The effect of `bottom` depends on how the element is positioned (i.e., the value of the `position` property):
  * When `position` is set to `absolute` or `fixed`, the `bottom` property specifies the distance between the outer edge of the element's bottom margin and the outer edge of the containing block's bottom padding, or, in the case of anchor positioned elements when the `anchor()` function is used within the value, relative to the position of the specified `<anchor-side>` edge. The `bottom` property is compatible with the `top`, `bottom`, `start`, `end`, `self-start`, `self-end`, `center`, and `<percentage>` values.
  * When `position` is set to `relative`, the `bottom` property specifies the distance the element's bottom edge is moved above its normal position.
  * When `position` is set to `sticky`, the `bottom` property is used to compute the sticky-constraint rectangle.
  * When `position` is set to `static`, the `bottom` property has no effect.


When both `top` and `bottom` are specified, `position` is set to `absolute` or `fixed`, and `height` is unspecified (either `auto` or `100%`) both the `top` and `bottom` distances are respected. In all other situations, if `height` is constrained in any way or `position` is set to `relative`, the `top` property takes precedence and the `bottom` property is ignored.
## Syntax
    
    /* <length> values */
    bottom: 3px;
    bottom: 2.4em;
    bottom: calc(anchor(--my-anchor 50%) + 5px);
    bottom: anchor-size(width);
    
    /* <percentage>s of the height of the containing block */
    bottom: 10%;
    
    /* Keyword value */
    bottom: auto;
    
    /* Global values */
    bottom: inherit;
    bottom: initial;
    bottom: revert;
    bottom: revert-layer;
    bottom: unset;
    
### Values
`<length>`
    
A negative, null, or positive `<length>`:
  * for absolutely positioned elements, it represents the distance to the bottom edge of the containing block.
  * for relatively positioned elements, it represents the distance that the element is moved above its normal position.
  * for anchor-positioned elements, the `anchor()` function resolves to a `<length>` value relative to the position of the associated anchor element's top or bottom edge (see Using inset properties with `anchor()` function values), and the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element position based on anchor size).


`<percentage>`
    
A `<percentage>` of the containing block's height.
`auto`
    
Specifies that:
  * for absolutely positioned elements, the position of the element is based on the `top` property, while `height: auto` is treated as a height based on the content; or if `top` is also `auto`, the element is positioned where it should vertically be positioned if it were a static element.
  * for relatively positioned elements, the distance of the element from its normal position is based on the `top` property; or if `top` is also `auto`, the element is not moved vertically at all.


## Examples
>
### Absolute and fixed positioning
This example demonstrates the difference in behavior of the `bottom` property, when `position` is `absolute` versus `fixed`.
#### HTML
    
    <p>
      This<br />is<br />some<br />tall,<br />tall,<br />tall,<br />tall,<br />tall<br />content.
    </p>
    <div class="fixed"><p>Fixed</p></div>
    <div class="absolute"><p>Absolute</p></div>
    
#### CSS
    
    p {
      font-size: 30px;
      line-height: 2em;
    }
    
    div {
      width: 48%;
      text-align: center;
      background: rgb(55 55 55 / 20%);
      border: 1px solid blue;
    }
    
    .absolute {
      position: absolute;
      bottom: 0;
      left: 0;
    }
    
    .fixed {
      position: fixed;
      bottom: 0;
      right: 0;
    }
    
#### Result
# <color>
The `<color>` CSS data type represents a color. A `<color>` may also include an alpha-channel transparency value, indicating how the color should composite with its background.
Note: Although `<color>` values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device. This is because most devices are not calibrated, and some browsers do not support output devices' color profiles.
## Syntax
    
    /* Named colors */
    rebeccapurple
    aliceblue
    
    /* RGB Hexadecimal */
    #f09
    #ff0099
    
    /* RGB (Red, Green, Blue) */
    rgb(255 0 153)
    rgb(255 0 153 / 80%)
    
    /* HSL (Hue, Saturation, Lightness) */
    hsl(150 30% 60%)
    hsl(150 30% 60% / 80%)
    
    /* HWB (Hue, Whiteness, Blackness) */
    hwb(12 50% 0%)
    hwb(194 0% 0% / 0.5)
    
    /* LAB (Lightness, A-axis, B-axis) */
    lab(50% 40 59.5)
    lab(50% 40 59.5 / 0.5)
    
    /* LCH (Lightness, Chroma, Hue) */
    lch(52.2% 72.2 50)
    lch(52.2% 72.2 50 / 0.5)
    
    /* Oklab (Lightness, A-axis, B-axis) */
    oklab(59% 0.1 0.1)
    oklab(59% 0.1 0.1 / 0.5)
    
    /* Oklch (Lightness, Chroma, Hue) */
    oklch(60% 0.15 50)
    oklch(60% 0.15 50 / 0.5)
    
    /* Relative CSS colors */
    /* HSL hue change */
    hsl(from red 240deg s l)
    /* HWB alpha channel change */
    hwb(from green h w b / 0.5)
    /* LCH lightness change */
    lch(from blue calc(l + 20) c h)
    
    /* light-dark */
    light-dark(white, black)
    light-dark(rgb(255 255 255), rgb(0 0 0))
    
A `<color>` value can be specified using one of the methods listed below:
  * By keywords: `<named-color>` (such as `blue` or `pink`), `<system-color>`, and `currentColor`.
  * By hexadecimal notations: `<hex-color>` (such as `#ff0000`).
  * By `<color-function>`, with parameters in a color space using functional notations: 
    * sRGB color space: `hsl()`, `hwb()`, and `rgb()`.
    * CIELAB color space: `lab()` and `lch()`.
    * Oklab color space: `oklab()` and `oklch()`.
    * Other color spaces: `color()`, `device-cmyk()`.
  * By using relative color syntax to output a new color based on an existing color. Any of the above color functions can take an origin color preceded by the `from` keyword and followed by definitions of the channel values for the new output color.
  * By mixing two colors: `color-mix()`.
  * By specifying a color that you want a contrasting color returned for: `contrast-color()`.
  * By specifying two colors, using the first for light color-schemes and the second for dark color-schemes: `light-dark()`.


###  `currentColor` keyword
The `currentColor` keyword represents the value of an element's `color` property. This lets you use the `color` value on properties that do not receive it by default.
If `currentColor` is used as the value of the `color` property, it instead takes its value from the inherited value of the `color` property.
    
    <div class="container">
      The color of this text is blue.
      <div class="child"></div>
      This block is surrounded by a blue border.
    </div>
    
    
    .container {
      color: blue;
      border: 1px dashed currentColor;
    }
    .child {
      background: currentColor;
      height: 9px;
    }
    
### Missing color components
Each component of any CSS color functions - except for those using the legacy comma-separated syntax - can be specified as the keyword `none` to be a missing component.
Explicitly specifying missing components in color interpolation is useful for cases where you would like to interpolate some color components but not others. For all other purposes, a missing component will effectively have a zero value in an appropriate unit: `0`, `0%`, or `0deg`. For example, the following colors are equivalent when used outside of interpolation:
    
    /* These are equivalent */
    color: oklab(50% none -0.25);
    color: oklab(50% 0 -0.25);
    
    /* These are equivalent */
    background-color: hsl(none 100% 50%);
    background-color: hsl(0deg 100% 50%);
    
## Interpolation
Color interpolation happens with gradients, transitions, and animations.
When interpolating `<color>` values, they are first converted to a given color space, and then each component of the computed values are interpolated linearly, with interpolation's speed being determined by the easing function in transitions and animations. The interpolation color space defaults to Oklab, but can be overridden through `<color-interpolation-method>` in some color-related functional notations.
### Interpolation with missing components
#### Interpolating colors in the same space
When interpolating colors that are exactly in the interpolation color space, missing components from one color are replaced with existing values of the same components from the other color. For example, the following two expressions are equivalent:
    
    color-mix(in oklch, oklch(none 0.2 10), oklch(60% none 30))
    color-mix(in oklch, oklch(60% 0.2 10), oklch(60% 0.2 30))
    
Note: If a component is missing from both colors, this component will be missing after the interpolation.
#### Interpolating colors from different spaces: analogous components
If any color to be interpolated is not in the interpolation color space, its missing components are transferred into the converted color based on analogous components of the same category as described in the following table:
Category Analogous components  
Reds `R`, `X`  
Greens `G`, `Y`  
Blues `B`, `Z`  
Lightness `L`  
Colorfulness `C`, `S`  
Hue `H`  
a `a`  
b `b`  
For example:
  * `X` (`0.2`) in `color(xyz 0.2 0.1 0.6)` is analogous to `R` (`50%`) in `rgb(50% 70% 30%)`.
  * `H` (`0deg`) in `hsl(0deg 100% 80%)` is analogous to `H` (`140`) in `oklch(80% 0.1 140)`.


Using Oklch as the interpolation color space and the two colors below as an example:
    
    lch(80% 30 none)
    color(display-p3 0.7 0.5 none)
    
The preprocessing procedure is:
  1. Replace the missing components in both colors with a zero value:
         lch(80% 30 0)
         color(display-p3 0.7 0.5 0)
         
  2. Convert both colors into the interpolation color space:
         oklch(83.915% 0.0902 0.28)
         oklch(63.612% 0.1522 78.748)
         
  3. If any component of the converted colors is analogous to a missing component in the corresponding original color, reset it as a missing component:
         oklch(83.915% 0.0902 none)
         oklch(63.612% 0.1522 78.748)
         
  4. Replace any missing component with the same component from the other converted color:
         oklch(83.915% 0.0902 78.748)
         oklch(63.612% 0.1522 78.748)
         


## Accessibility
Some people have difficulty distinguishing colors. The WCAG 2.2 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. See color and color contrast for more information.
## Examples
>
### Exploring color values
In this example, we provide a `<div>` and a text input. Entering a valid color into the input causes the `<div>` to adopt that color, allowing you to test our color values.
#### HTML
    
    <div></div>
    <hr />
    <label for="color">Enter a valid color value:</label>
    <input type="text" id="color" />
    
#### Result
### Generating fully saturated sRGB colors
This example shows fully saturated sRGB colors in the sRGB color space.
#### HTML
    
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    
#### CSS
    
    div:nth-child(1) {
      background-color: hsl(0 100% 50%);
    }
    div:nth-child(2) {
      background-color: hsl(30 100% 50%);
    }
    div:nth-child(3) {
      background-color: hsl(60 100% 50%);
    }
    div:nth-child(4) {
      background-color: hsl(90 100% 50%);
    }
    div:nth-child(5) {
      background-color: hsl(120 100% 50%);
    }
    div:nth-child(6) {
      background-color: hsl(150 100% 50%);
    }
    div:nth-child(7) {
      background-color: hsl(180 100% 50%);
    }
    div:nth-child(8) {
      background-color: hsl(210 100% 50%);
    }
    div:nth-child(9) {
      background-color: hsl(240 100% 50%);
    }
    div:nth-child(10) {
      background-color: hsl(270 100% 50%);
    }
    div:nth-child(11) {
      background-color: hsl(300 100% 50%);
    }
    div:nth-child(12) {
      background-color: hsl(330 100% 50%);
    }
    
#### Result
### Creating different shades of red
This example shows reds of different shades in the sRGB color space.
#### HTML
    
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    
#### CSS
    
    div:nth-child(1) {
      background-color: hsl(0 100% 0%);
    }
    div:nth-child(2) {
      background-color: hsl(0 100% 20%);
    }
    div:nth-child(3) {
      background-color: hsl(0 100% 40%);
    }
    div:nth-child(4) {
      background-color: hsl(0 100% 60%);
    }
    div:nth-child(5) {
      background-color: hsl(0 100% 80%);
    }
    div:nth-child(6) {
      background-color: hsl(0 100% 100%);
      border: solid;
    }
    
#### Result
### Creating reds of different saturation
This example shows reds of different saturations in the sRGB color space.
#### HTML
    
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    
#### CSS
    
    div:nth-child(1) {
      background-color: hsl(0 0% 50%);
    }
    div:nth-child(2) {
      background-color: hsl(0 20% 50%);
    }
    div:nth-child(3) {
      background-color: hsl(0 40% 50%);
    }
    div:nth-child(4) {
      background-color: hsl(0 60% 50%);
    }
    div:nth-child(5) {
      background-color: hsl(0 80% 50%);
    }
    div:nth-child(6) {
      background-color: hsl(0 100% 50%);
    }
    
#### Result
# forced-color-adjust
The `forced-color-adjust` CSS property allows authors to opt certain elements out of forced colors mode. This then restores the control of those values to CSS.
## Syntax
    
    forced-color-adjust: auto;
    forced-color-adjust: none;
    forced-color-adjust: preserve-parent-color;
    
    /* Global values */
    forced-color-adjust: inherit;
    forced-color-adjust: initial;
    forced-color-adjust: revert;
    forced-color-adjust: revert-layer;
    forced-color-adjust: unset;
    
The `forced-color-adjust` property's value must be one of the following keywords.
### Values
`auto`
    
The element's colors are adjusted by the user agent in forced colors mode. This is the default value.
`none`
    
The element's colors are not automatically adjusted by the user agent in forced colors mode.
`preserve-parent-color`
    
In forced colors mode, if the `color` property inherits from its parent (i.e., there is no cascaded value or the cascaded value is `currentColor`, `inherit`, or another keyword that inherits from the parent), then it computes to the used color of its parent's `color` property. In all other cases, it behaves the same as `none`.
## Usage notes
This property should only be used to makes changes that will support a user's color and contrast requirements. For example, if you become aware that the color optimizations made by the user agent result in a poor experience when in a high contrast or dark mode. Using this property would enable tweaking of the result in that mode to provide a better experience. It should not be used to prevent user choices being respected.
## Examples
>
### Preserving colors
In the example below the first box will use the color scheme that the user has set. For example in Windows High Contrast mode black scheme it will have a black background and white text. The second box will preserve the site colors set on the `.box` class.
By using the `forced-colors` media feature, you could add any other optimizations for forced color mode alongside the `forced-color-adjust` property.
#### CSS
    
    .box {
      border: 5px solid grey;
      background-color: #cccccc;
      width: 300px;
      margin: 20px;
      padding: 10px;
    }
    
    @media (forced-colors: active) {
      .forced {
        forced-color-adjust: none;
      }
    }
    
#### HTML
    
    <div class="box">
      <p>This is a box which should use your color preferences.</p>
    </div>
    
    <div class="box forced">
      <p>This is a box which should stay the colors set by the site.</p>
    </div>
    
#### Result
The following screenshot shows the image above in Windows High Contrast Mode:
# <display-box>
These keywords define whether an element generates display boxes at all.
## Syntax
Valid `<display-box>` values:
`contents`
    
These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child boxes. Please note that the CSS Display Level 3 spec defines how the `contents` value should affect "unusual elements" — elements that aren't rendered purely by CSS box concepts such as replaced elements. See Appendix B: Effects of display: contents on Unusual Elements for more details.
Due to a bug in browsers this will currently remove the element from the accessibility tree — screen readers will not look at what's inside. See the Accessibility section below for more details.
`none`
    
Turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). All descendant elements also have their display turned off. To have an element take up the space that it would normally take, but without actually rendering anything, use the `visibility` property instead.
## Accessibility
Current implementations in most browsers will remove from the accessibility tree any element with a `display` value of `contents`. This will cause the element — and in some browser versions, its descendant elements — to no longer be announced by screen reading technology. This is incorrect behavior according to the CSSWG specification.
  * More accessible markup with display: contents | Hidde de Vries
  * Display: Contents Is Not a CSS Reset | Adrian Roselli


## Examples
In this first example, the paragraph with a class of secret is set to `display: none`; the box and any content is now not rendered.
### display: none
#### HTML
    
    <p>Visible text</p>
    <p class="secret">Invisible text</p>
    
#### CSS
    
    p.secret {
      display: none;
    }
    
#### Result
### display: contents
In this example the outer `<div>` has a 2-pixel red border and a width of 300px. However it also has `display: contents` specified therefore this `<div>` will not be rendered, the border and width will no longer apply, and the child element will be displayed as if the parent had never existed.
#### HTML
    
    <div class="outer">
      <div>Inner div.</div>
    </div>
    
#### CSS
    
    .outer {
      border: 2px solid red;
      width: 300px;
      display: contents;
    }
    
    .outer > div {
      border: 1px solid green;
    }
    
#### Result
# margin-block
The `margin-block` CSS shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    margin-block: 10px 20px;
    writing-mode: horizontal-tb;
    
    
    margin-block: 20px 40px;
    writing-mode: vertical-rl;
    
    
    margin-block: 5% 20%;
    writing-mode: horizontal-tb;
    
    
    margin-block: 1rem auto;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row">One</div>
        <div class="row transition-all" id="example-element">Two</div>
        <div class="row">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `margin-block-start`
  * `margin-block-end`


## Syntax
    
    /* <length> values */
    margin-block: 10px 20px; /* An absolute length */
    margin-block: 1em 2em; /* relative to the text size */
    margin-block: 5% 2%; /* relative to the nearest block container's width */
    margin-block: 10px; /* sets both start and end values */
    margin-block: anchor-size(inline);
    margin-block: calc(anchor-size(width) / 4) 1em;
    
    /* Keyword values */
    margin-block: auto;
    
    /* Global values */
    margin-block: inherit;
    margin-block: initial;
    margin-block: revert;
    margin-block: revert-layer;
    margin-block: unset;
    
This property corresponds to the `margin-top` and `margin-bottom`, or the `margin-right` and `margin-left` properties, depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
The `margin-block` property may be specified using one or two values.
  * When one value is specified, it applies the same margin to both start and end.
  * When two values are specified, the first margin applies to the start, the second to the end.


### Values
The `margin-block` property takes the same values as the `margin` property.
## Examples
>
### Setting block start and end margins
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: auto;
      border: 1px solid green;
    }
    
    p {
      margin: 0;
      margin-block: 20px 40px;
      background-color: tan;
    }
    
    .verticalExample {
      writing-mode: vertical-rl;
    }
    
#### HTML
    
    <div>
      <p>Example text</p>
    </div>
    <div class="verticalExample">
      <p>Example text</p>
    </div>
    
#### Result
# print-color-adjust
The `print-color-adjust` CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device.
## Syntax
    
    print-color-adjust: economy;
    print-color-adjust: exact;
    
    /* Global values */
    print-color-adjust: inherit;
    print-color-adjust: initial;
    print-color-adjust: revert;
    print-color-adjust: revert-layer;
    print-color-adjust: unset;
    
The `print-color-adjust` property's value must be one of the following keywords.
### Values
`economy`
    
The user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to optimize the output for the device it's being rendered for. For example, when printing, a browser might opt to leave out all background images and to adjust text colors to be sure the contrast is optimized for reading on white paper. This is the default.
`exact`
    
The element's content has been specifically and carefully crafted to use colors, images, and styles in a thoughtful and/or important way, such that being altered by the browser might actually make things worse rather than better. The appearance of the content should not be changed except by the user's request. For example, a page might include a list of information with rows whose background colors alternate between white and a light grey. Removing the background color would decrease the legibility of the content.
## Usage notes
There are a number of reasons a browser might wish to deviate from the specified appearance, such as:
  * The content uses text and background colors that will be too similar on the output device for legibility purposes.
  * If the output device is a printer, and to save ink, dark or extremely dense background images might be removed.
  * When printing a page, the browser might want to replace light-colored text on a dark background with dark text on a white background.


Any options the user agent offers the user to allow them to control the use of color and images will take priority over the value of `print-color-adjust`. In other words, there isn't any guarantee that `print-color-adjust` will do anything. Not only can the user override the behavior, but each user agent is allowed to decide for itself how to handle `print-color-adjust` in any given situation.
## Examples
>
### Preserving low contrast
In this example, a box is shown which uses a `background-image` and a translucent `linear-gradient()` function atop a black background color to have a dark blue gradient behind medium red text. For whatever reason, this is the desired appearance in any rendering environment, including on paper, so we also use `print-color-adjust: exact` to tell the browser not to make color or style adjustments to the box when rendering it.
#### CSS
    
    .my-box {
      background-color: black;
      background-image: linear-gradient(rgb(0 0 180 / 50%), rgb(70 140 220 / 50%));
      color: #990000;
      width: 15rem;
      height: 6rem;
      text-align: center;
      font:
        24px "Helvetica",
        sans-serif;
      display: flex;
      align-items: center;
      justify-content: center;
      print-color-adjust: exact;
    }
    
#### HTML
    
    <div class="my-box">
      <p>Need more contrast!</p>
    </div>
    
#### Result
# display
The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex.
Formally, the `display` property sets an element's inner and outer display types. The outer type sets an element's participation in flow layout; the inner type sets the layout of children. Some values of `display` are fully defined in their own individual specifications; for example the detail of what happens when `display: flex` is declared is defined in the CSS Flexible Box Model specification.
## Try it
    
    display: block;
    
    
    display: inline-block;
    
    
    display: none;
    
    
    display: flex;
    
    
    display: grid;
    
    
    <p>
      Apply different <code>display</code> values on the dashed orange-bordered
      <code>div</code>, which contains three child elements.
    </p>
    <section class="default-example" id="default-example">
      <div class="example-container">
        Some text A.
        <div id="example-element">
          <div class="child">Child 1</div>
          <div class="child">Child 2</div>
          <div class="child">Child 3</div>
        </div>
        Some text B.
      </div>
    </section>
    
    
    .example-container {
      width: 100%;
      height: 100%;
    }
    
    code {
      background: #88888888;
    }
    
    #example-element {
      border: 3px dashed orange;
    }
    
    .child {
      display: inline-block;
      padding: 0.5em 1em;
      background-color: #ccccff;
      border: 1px solid #ababab;
      color: black;
    }
    
## Syntax
    
    /* precomposed values */
    display: block;
    display: inline;
    display: inline-block;
    display: flex;
    display: inline-flex;
    display: grid;
    display: inline-grid;
    display: flow-root;
    
    /* Box suppression */
    display: none;
    display: contents;
    
    /* multi-keyword syntax */
    display: block flex;
    display: block flow;
    display: block flow-root;
    display: block grid;
    display: inline flex;
    display: inline flow;
    display: inline flow-root;
    display: inline grid;
    
    /* other values */
    display: table;
    display: table-row; /* all table elements have an equivalent CSS display value */
    display: list-item;
    
    /* Global values */
    display: inherit;
    display: initial;
    display: revert;
    display: revert-layer;
    display: unset;
    
The CSS `display` property is specified using keyword values.
## Grouped values
The keyword values can be grouped into six value categories.
### Outside
`<display-outside>`
    
These keywords specify the element's outer display type, which is essentially its role in flow layout:
`block`
    
The element generates a block box, generating line breaks both before and after the element when in the normal flow.
`inline`
    
The element generates one or more inline boxes that do not generate line breaks before or after themselves. In normal flow, the next element will be on the same line if there is space.
Note: When browsers that support multi-keyword syntax encounter a display property that only has an outer value (e.g., `display: block` or `display: inline`), the inner value is set to `flow` (e.g., `display: block flow` and `display: inline flow`).
Note: To be sure layouts work on older browsers, you may use single-value syntax, for example `display: inline flex` could have the following fallback
    
    .container {
      display: inline-flex;
      display: inline flex;
    }
    
See Using the multi-keyword syntax with CSS display for more information.
### Inside
`<display-inside>`
    
These keywords specify the element's inner display type, which defines the type of formatting context that its contents are laid out in (assuming it is a non-replaced element):
`flow`
    
The element lays out its contents using flow layout (block-and-inline layout).
If its outer display type is `inline`, and it is participating in a block or inline formatting context, then it generates an inline box. Otherwise it generates a block box.
Depending on the value of other properties (such as `position`, `float`, or `overflow`) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (BFC) for its contents or integrates its contents into its parent formatting context.
`flow-root`
    
The element generates a block box that establishes a new block formatting context, defining where the formatting root lies.
`table`
    
These elements behave like HTML `<table>` elements. It defines a block-level box.
`flex`
    
The element behaves like a block-level element and lays out its content according to the flexbox model.
`grid`
    
The element behaves like a block-level element and lays out its content according to the grid model.
`ruby`
    
The element behaves like an inline-level element and lays out its content according to the ruby formatting model. It behaves like the corresponding HTML `<ruby>` elements.
Note: When browsers that support multi-keyword syntax encounter a display property that only has an inner value (e.g., `display: flex` or `display: grid`), the outer value is set to `block` (e.g., `display: block flex` and `display: block grid`).
### List Item
`<display-listitem>`
    
The element generates a block box for the content and a separate list-item inline box.
A single value of `list-item` will cause the element to behave like a list item. This can be used together with `list-style-type` and `list-style-position`.
`list-item` can also be combined with any `<display-outside>` keyword and the `flow` or `flow-root` `<display-inside>` keyword.
Note: In browsers that support the multi-keyword syntax, if no inner value is specified, it will default to `flow`. If no outer value is specified, the principal box will have an outer display type of `block`.
### Internal
`<display-internal>`
    
Some layout models such as `table` and `ruby` have a complex internal structure, with several different roles that their children and descendants can fill. This section defines those "internal" display values, which only have meaning within that particular layout mode.
`table-row-group`
    
These elements behave like `<tbody>` HTML elements.
`table-header-group`
    
These elements behave like `<thead>` HTML elements.
`table-footer-group`
    
These elements behave like `<tfoot>` HTML elements.
`table-row`
    
These elements behave like `<tr>` HTML elements.
`table-cell`
    
These elements behave like `<td>` HTML elements.
`table-column-group`
    
These elements behave like `<colgroup>` HTML elements.
`table-column`
    
These elements behave like `<col>` HTML elements.
`table-caption`
    
These elements behave like `<caption>` HTML elements.
`ruby-base`
    
These elements behave like `<rb>` HTML elements.
`ruby-text`
    
These elements behave like `<rt>` HTML elements.
`ruby-base-container`
    
These elements are generated as anonymous boxes.
`ruby-text-container`
    
These elements behave like `<rtc>` HTML elements.
### Box
`<display-box>`
    
These values define whether an element generates display boxes at all.
`contents`
    
These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child boxes. Please note that the CSS Display Level 3 spec defines how the `contents` value should affect "unusual elements" — elements that aren't rendered purely by CSS box concepts such as replaced elements. See Appendix B: Effects of display: contents on Unusual Elements for more details.
`none`
    
Turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). All descendant elements also have their display turned off. To have an element take up the space that it would normally take, but without actually rendering anything, use the `visibility` property instead.
### Precomposed
`<display-legacy>`
    
CSS 2 used a single-keyword, precomposed syntax for the `display` property, requiring separate keywords for block-level and inline-level variants of the same layout mode.
`inline-block`
    
The element generates a block box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would).
It is equivalent to `inline flow-root`.
`inline-table`
    
The `inline-table` value does not have a direct mapping in HTML. It behaves like an HTML `<table>` element, but as an inline box, rather than a block-level box. Inside the table box is a block-level context.
It is equivalent to `inline table`.
`inline-flex`
    
The element behaves like an inline-level element and lays out its content according to the flexbox model.
It is equivalent to `inline flex`.
`inline-grid`
    
The element behaves like an inline-level element and lays out its content according to the grid model.
It is equivalent to `inline grid`.
### Which syntax should you use?
The CSS display module describes a multi-keyword syntax for values you can use with the `display` property to explicitly define outer and inner display. The single keyword values (precomposed `<display-legacy>` values) are supported for backward-compatibility.
For example, using two values you can specify an inline flex container as follows:
    
    .container {
      display: inline flex;
    }
    
This can also be specified using the legacy single value:
    
    .container {
      display: inline-flex;
    }
    
For more information on these changes, see the Using the multi-keyword syntax with CSS display guide.
## Description
The individual pages for the different types of value that `display` can have set on it feature multiple examples of those values in action — see the Syntax section. In addition, see the following material, which covers the various values of display in depth.
### Multi-keyword values
  * Using the multi-keyword syntax with CSS display


### CSS Flow Layout (display: block, display: inline)
  * Block and inline layout in normal flow
  * Flow layout and overflow
  * Flow layout and writing modes
  * Introduction to formatting contexts
  * In flow and out of flow


### display: flex
  * Basic concepts of flexbox
  * Aligning items in a flex container
  * Controlling ratios of flex items along the main axis
  * Mastering wrapping of flex items
  * Ordering flex items
  * Relationship of flexbox to other layout methods
  * Typical use cases of flexbox


### display: grid
  * Basic concepts of grid layout
  * Relationship to other layout methods
  * Line-based placement
  * Grid template areas
  * Layout using named grid lines
  * Auto-placement in grid layout
  * Aligning items in CSS grid layout
  * Grids, logical values and writing modes
  * CSS grid layout and accessibility
  * Realizing common layouts using grids


### Animating display
Supporting browsers animate `display` with a discrete animation type. This generally means that the property will flip between two values 50% through animating between the two.
There is one exception, which is when animating to or from `display: none`. In this case, the browser will flip between the two values so that the animated content is shown for the entire animation duration. So for example:
  * When animating `display` from `none` to `block` (or another visible `display` value), the value will flip to `block` at `0%` of the animation duration so it is visible throughout.
  * When animating `display` from `block` (or another visible `display` value) to `none`, the value will flip to `none` at `100%` of the animation duration so it is visible throughout.


This behavior is useful for creating entry/exit animations where you want to for example remove a container from the DOM with `display: none`, but have it fade out with `opacity` rather than disappearing immediately.
When animating `display` with CSS animations, you need to provide the starting `display` value in an explicit keyframe (for example using `0%` or `from`). See Using CSS animations for an example.
When animating `display` with CSS transitions, two additional features are needed:
  * `@starting-style` provides starting values for properties you want to transition from when the animated element is first shown. This is needed to avoid unexpected behavior. By default, CSS transitions are not triggered on an element's first style update or when the `display` type changes from `none` to another type.
  * `transition-behavior: allow-discrete` needs to be set on the `transition-property` declaration (or the `transition` shorthand) to enable `display` transitions.


For examples of transitioning the `display` property, see the `@starting-style` and `transition-behavior` pages.
## Accessibility
>
### display: none
Using a `display` value of `none` on an element will remove it from the accessibility tree. This will cause the element and all its descendant elements to no longer be announced by screen reading technology.
If you want to visually hide the element, a more accessible alternative is to use a combination of properties to remove it visually from the screen but still make it available to assistive technology such as screen readers.
While `display: none` hides content from the accessibility tree, elements that are hidden but are referenced from visible elements' `aria-describedby` or `aria-labelledby` attributes are exposed to assistive technologies.
### display: contents
Current implementations in some browsers will remove from the accessibility tree any element with a `display` value of `contents` (but descendants will remain). This will cause the element itself to no longer be announced by screen reading technology. This is incorrect behavior according to the CSS specification.
  * More accessible markup with display: contents | Hidde de Vries
  * Display: Contents Is Not a CSS Reset | Adrian Roselli


### Tables
In some browsers, changing the `display` value of a `<table>` element to `block`, `grid`, or `flex` will alter its representation in the accessibility tree. This will cause the table to no longer be announced properly by screen reading technology.
  * Short note on what CSS display properties do to table semantics — The Paciello Group
  * Hidden content for better a11y | Go Make Things
  * MDN Understanding WCAG, Guideline 1.3 explanations
  * Understanding Success Criterion 1.3.1 | W3C Understanding WCAG 2.0


## Examples
>
### display value comparison
In this example we have two block-level container elements, each one with three inline children. Below that, we have a select menu that allows you to apply different `display` values to the containers, allowing you to compare and contrast how the different values affect the element's layout, and that of their children.
We have included `padding` and `background-color` on the containers and their children, so that it is easier to see the effect the display values are having.
#### HTML
    
    <article class="container">
      <span>First</span>
      <span>Second</span>
      <span>Third</span>
    </article>
    
    <article class="container">
      <span>First</span>
      <span>Second</span>
      <span>Third</span>
    </article>
    
    <div>
      <label for="display">Choose a display value:</label>
      <select id="display">
        <option selected>block</option>
        <option>block flow</option>
        <option>inline</option>
        <option>inline flow</option>
        <option>flow</option>
        <option>flow-root</option>
        <option>block flow-root</option>
        <option>table</option>
        <option>block table</option>
        <option>flex</option>
        <option>block flex</option>
        <option>grid</option>
        <option>block grid</option>
        <option>list-item</option>
        <option>block flow list-item</option>
        <option>inline flow list-item</option>
        <option>block flow-root list-item</option>
        <option>inline flow-root list-item</option>
        <option>contents</option>
        <option>none</option>
        <option>inline-block</option>
        <option>inline flow-root</option>
        <option>inline-table</option>
        <option>inline table</option>
        <option>inline-flex</option>
        <option>inline flex</option>
        <option>inline-grid</option>
        <option>inline grid</option>
      </select>
    </div>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
      letter-spacing: 1px;
      padding-top: 10px;
    }
    
    article {
      background-color: red;
    }
    
    article span {
      background-color: black;
      color: white;
      margin: 1px;
    }
    
    article,
    span {
      padding: 10px;
      border-radius: 7px;
    }
    
    article,
    div {
      margin: 20px;
    }
    
#### JavaScript
    
    const articles = document.querySelectorAll(".container");
    const select = document.querySelector("select");
    
    function updateDisplay() {
      articles.forEach((article) => {
        article.style.display = select.value;
      });
    }
    
    select.addEventListener("change", updateDisplay);
    
    updateDisplay();
    
#### Result
Note that some multi-keyword values are added for illustration which have the following equivalents:
  * `block` = `block flow`
  * `inline` = `inline flow`
  * `flow` = `block flow`
  * `flow-root` = `block flow-root`
  * `table` = `block table`
  * `flex` = `block flex`
  * `grid` = `block grid`
  * `list-item` = `block flow list-item`
  * `inline-block` = `inline flow-root`
  * `inline-table` = `inline table`
  * `inline-flex` = `inline flex`
  * `inline-grid` = `inline grid`


You can find more examples in the pages for each separate display type under Grouped values.
# :nth-last-of-type()
The `:nth-last-of-type()` CSS pseudo-class matches elements based on their position among siblings of the same type (tag name), counting from the end.
## Try it
    
    dt {
      font-weight: bold;
    }
    
    dd {
      margin: 3px;
    }
    
    dd:nth-last-of-type(3n) {
      border: 2px solid orange;
    }
    
    
    <dl>
      <dt>Vegetables:</dt>
      <dd>1. Tomatoes</dd>
      <dd>2. Cucumbers</dd>
      <dd>3. Mushrooms</dd>
      <dt>Fruits:</dt>
      <dd>4. Apples</dd>
      <dd>5. Mangos</dd>
      <dd>6. Pears</dd>
      <dd>7. Oranges</dd>
    </dl>
    
## Syntax
    
    :nth-last-of-type(<An+B> | even | odd) {
      /* ... */
    }
    
### Parameters
The `:nth-last-of-type()` pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end.
See `:nth-last-child` for a more detailed explanation of its syntax.
## Examples
>
### HTML
    
    <div>
      <span>This is a span.</span>
      <span>This is another span.</span>
      <em>This is emphasized.</em>
      <span>Wow, this span gets limed!!!</span>
      <del>This is struck through.</del>
      <span>Here is one last span.</span>
    </div>
    
### CSS
    
    span:nth-last-of-type(2) {
      background-color: lime;
    }
    
### Result
# <number>
The `<number>` CSS data type represents a number, being either an integer, a number with a fractional component, or a base-ten exponent in scientific notation.
## Syntax
The syntax of `<number>` extends the syntax of `<integer>`. A fractional value is represented by a `.` followed by one or more decimal digits, and may be appended to an integer. A `<number>` can also end with the letter `e` or `E` followed by an integer, which indicates a base-ten exponent in scientific notation. There is no unit associated with numbers.
As with integers, the first character of the number can be immediately preceded by - or + to indicate the number's sign: whether the number is positive or negative.
## Interpolation
When animated, values of the `<number>` CSS data type are interpolated as real, floating-point numbers. The speed of the interpolation is determined by the easing function associated with the animation.
## Examples
>
### Valid numbers
    
    12          A raw <integer> is also a <number>.
    4.01        Positive fraction
    -456.8      Negative fraction
    0.0         Zero
    +0.0        Zero, with a leading +
    -0.0        Zero, with a leading -
    .60         Fractional number without a leading zero
    10e3        Scientific notation
    -3.4e-2     Complicated scientific notation
    
### Invalid numbers
    
    12.         Decimal points must be followed by at least one digit.
    +-12.2      Only one leading +/- is allowed.
    12.1.1      Only one decimal point is allowed.
    
# grid-row
The `grid-row` CSS shorthand property specifies a grid item's size and location within a grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
## Try it
    
    grid-row: 1;
    
    
    grid-row: 1 / 3;
    
    
    grid-row: 2 / -1;
    
    
    grid-row: 1 / span 2;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `grid-row-end`
  * `grid-row-start`


## Syntax
    
    /* Keyword values */
    grid-row: auto;
    grid-row: auto / auto;
    
    /* <custom-ident> values */
    grid-row: some-grid-area;
    grid-row: some-grid-area / some-other-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-row: some-grid-area 4;
    grid-row: 4 some-grid-area / 6;
    
    /* span + <integer> + <custom-ident> values */
    grid-row: span 3;
    grid-row: span some-grid-area;
    grid-row: 5 some-grid-area span;
    grid-row: span 3 / 6;
    grid-row: span some-grid-area / span some-other-grid-area;
    grid-row: 5 some-grid-area span / 2 span;
    
    /* Global values */
    grid-row: inherit;
    grid-row: initial;
    grid-row: revert;
    grid-row: revert-layer;
    grid-row: unset;
    
This property is specified as one or two `<grid-line>` values.
If two `<grid-line>` values are given, they are separated by `/`. The `grid-row-start` longhand is set to the value before the slash, and the `grid-row-end` longhand is set to the value after the slash.
Each `<grid-line>` value can be specified as:
  * either the `auto` keyword
  * or a `<custom-ident>` value
  * or an `<integer>` value
  * or both `<custom-ident>` and `<integer>`, separated by a space
  * or the keyword `span` together with either a `<custom-ident>` or an `<integer>` or both.


### Values
`auto`
    
Is a keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name `<custom-ident>-start`/`<custom-ident>-end`, it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-row: foo;` will choose the start/end edge of that named grid area (unless another line named `foo-start`/`foo-end` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement such that the corresponding edge of the grid item's grid area is n lines from the opposite edge.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the `<integer>` is omitted, it defaults to `1`. Negative integers or 0 are invalid.
## Examples
>
### Setting grid row size and location
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 200px;
      grid-template-columns: 200px;
      grid-template-rows: repeat(6, 1fr);
    }
    
    #item1 {
      background-color: lime;
    }
    
    #item2 {
      background-color: yellow;
      grid-row: 2 / 4;
    }
    
    #item3 {
      background-color: blue;
      grid-row: span 2 / 7;
    }
    
#### Result
# background-position-y
The `background-position-y` CSS property sets the initial vertical position for each background image. The position is relative to the position layer set by `background-origin`.
## Try it
    
    background-position-y: top;
    
    
    background-position-y: center;
    
    
    background-position-y: 25%;
    
    
    background-position-y: 2rem;
    
    
    background-position-y: bottom 32px;
    
    
    <section class="display-block" id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      background-color: navajowhite;
      background-image: url("/shared-assets/images/examples/star.png");
      background-repeat: no-repeat;
      height: 100%;
    }
    
The value of this property is overridden by any declaration of the `background` or `background-position` shorthand properties applied to the element after it.
## Syntax
    
    /* Keyword values */
    background-position-y: top;
    background-position-y: center;
    background-position-y: bottom;
    
    /* <percentage> values */
    background-position-y: 25%;
    
    /* <length> values */
    background-position-y: 0px;
    background-position-y: 1cm;
    background-position-y: 8em;
    
    /* Side-relative values */
    background-position-y: bottom 3px;
    background-position-y: bottom 10%;
    
    /* Multiple values */
    background-position-y: 0px, center;
    
    /* Global values */
    background-position-y: inherit;
    background-position-y: initial;
    background-position-y: revert;
    background-position-y: revert-layer;
    background-position-y: unset;
    
The `background-position-y` property is specified as one or more values, separated by commas.
### Values
`top`
    
Aligns the top edge of the background image with the top edge of the background position layer.
`center`
    
Aligns the vertical center of the background image with the vertical center of the background position layer.
`bottom`
    
Aligns the bottom edge of the background image with the bottom edge of the background position layer.
`<length>`
    
The offset of the given background image's horizontal edge from the corresponding background position layer's top horizontal edge. (Some browsers allow assigning the bottom edge for offset).
`<percentage>`
    
The offset of the given background image's vertical position relative to the container. A value of 0% means that the top edge of the background image is aligned with the top edge of the container, and a value of 100% means that the bottom edge of the background image is aligned with the bottom edge of the container, thus a value of 50% vertically centers the background image.
## Examples
>
### Basic example
The following example shows a background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately.
#### HTML
    
    <div></div>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background-color: skyblue;
      background-image: url("https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png");
      background-repeat: no-repeat;
      background-position-x: center;
      background-position-y: bottom;
    }
    
#### Result
### Side-relative values
The following example shows support for side-relative offset syntax, which allows the developer to offset the background from any edge.
#### HTML
    
    <div></div>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background-color: seagreen;
      background-image: url("https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png");
      background-repeat: no-repeat;
      background-position-x: right 20px;
      background-position-y: bottom 10px;
    }
    
#### Result
# offset-rotate
The `offset-rotate` CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`.
## Try it
    
    offset-rotate: auto;
    
    
    offset-rotate: 90deg;
    
    
    offset-rotate: auto 90deg;
    
    
    offset-rotate: reverse;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element"></div>
      <button id="playback" type="button">Play</button>
    </section>
    
    
    #example-element {
      width: 24px;
      height: 24px;
      background: #2bc4a2;
      offset-path: path("M-70,-40 C-70,70 70,70 70,-40");
      animation: distance 8000ms infinite linear;
      animation-play-state: paused;
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    #playback {
      position: absolute;
      top: 0;
      left: 0;
      font-size: 1em;
    }
    
    @keyframes distance {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
    /* Provides a reference image of what path the element is following */
    #default-example {
      position: relative;
      background-position: calc(50% - 12px) calc(50% + 14px);
      background-repeat: no-repeat;
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-75 -45 150 140" width="150" height="140"><path d="M-70,-40 C-70,70 70,70 70,-40" fill="none" stroke="lightgrey" stroke-width="2" stroke-dasharray="4.5"/></svg>');
    }
    
    
    const example = document.getElementById("example-element");
    const button = document.getElementById("playback");
    
    button.addEventListener("click", () => {
      if (example.classList.contains("running")) {
        example.classList.remove("running");
        button.textContent = "Play";
      } else {
        example.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
Note: Early versions of the spec called this property `motion-rotation`.
## Syntax
    
    /* Follow the path direction, with optional additional angle */
    offset-rotate: auto;
    offset-rotate: auto 45deg;
    
    /* Follow the path direction but facing the opposite direction of `auto` */
    offset-rotate: reverse;
    
    /* Keep a constant rotation regardless the position on the path */
    offset-rotate: 90deg;
    offset-rotate: 0.5turn;
    
    /* Global values */
    offset-rotate: inherit;
    offset-rotate: initial;
    offset-rotate: revert;
    offset-rotate: revert-layer;
    offset-rotate: unset;
    
`auto`
    
The element is rotated by the angle of the direction of the `offset-path`, relative to the positive x-axis. This is the default value.
`<angle>`
    
The element has a constant clockwise rotation transformation applied to it by the specified rotation angle.
`auto <angle>`
    
If `auto` is followed by an `<angle>`, the computed value of the angle is added to the computed value of `auto`.
`reverse`
    
The element is rotated similar to `auto`, except it faces the opposite direction. It is the same as specifying a value of `auto 180deg`.
## Examples
>
### Setting element orientation along its offset path
#### HTML
    
    <div></div>
    <div></div>
    <div></div>
    
#### CSS
    
    div {
      width: 40px;
      height: 40px;
      background: #2bc4a2;
      margin: 20px;
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
      animation: move 5000ms infinite alternate ease-in-out;
    
      offset-path: path("M20,20 C20,50 180,-10 180,20");
    }
    div:nth-child(1) {
      offset-rotate: auto;
    }
    div:nth-child(2) {
      offset-rotate: auto 90deg;
    }
    div:nth-child(3) {
      offset-rotate: 30deg;
    }
    
    @keyframes move {
      100% {
        offset-distance: 100%;
      }
    }
    
#### Result
# position
The `position` CSS property sets how an element is positioned in a document. The `top`, `right`, `bottom`, and `left` physical properties and the `inset-block-start`, `inset-block-end`, `inset-inline-start`, and `inset-inline-end` flow-relative logical properties can be used to determine the final location of positioned elements.
## Try it
    
    position: static;
    
    
    position: relative;
    top: 40px;
    left: 40px;
    
    
    position: absolute;
    inset-inline-start: 40px;
    inset-block-start: 40px;
    
    
    position: sticky;
    top: 20px;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element-container">
        <p>
          In this demo you can control the <code>position</code> property for the
          yellow box.
        </p>
        <div class="box"></div>
        <div class="box" id="example-element"></div>
        <div class="box"></div>
        <p class="clear">
          To see the effect of <code>sticky</code> positioning, select the
          <code>position: sticky</code> option and scroll this container.
        </p>
        <p>
          The element will scroll along with its container, until it is at the top
          of the container (or reaches the offset specified in <code>top</code>),
          and will then stop scrolling, so it stays visible.
        </p>
        <p>
          The rest of this text is only supplied to make sure the container
          overflows, so as to enable you to scroll it and see the effect.
        </p>
        <hr />
        <p>
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
          Orbiting this at a distance of roughly ninety-two million miles is an
          utterly insignificant little blue green planet whose ape-descended life
          forms are so amazingly primitive that they still think digital watches are
          a pretty neat idea.
        </p>
      </div>
    </section>
    
    
    section {
      align-items: flex-start;
      overflow: auto;
    }
    
    .box {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      float: left;
      width: 65px;
      height: 65px;
    }
    
    .box + .box {
      margin-left: 10px;
    }
    
    .clear {
      clear: both;
      padding-top: 1em;
    }
    
    #example-element-container {
      position: relative;
      text-align: left;
    }
    
    #example-element {
      background-color: yellow;
      border: 3px solid red;
      z-index: 1;
    }
    
## Syntax
    
    position: static;
    position: relative;
    position: absolute;
    position: fixed;
    position: sticky;
    
    /* Global values */
    position: inherit;
    position: initial;
    position: revert;
    position: revert-layer;
    position: unset;
    
### Values
`static`
    
The element is positioned according to the Normal Flow of the document. The `top`, `right`, `bottom`, `left`, and `z-index` properties have no effect. This is the default value.
`relative`
    
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of `top`, `right`, `bottom`, and `left`. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were `static`.
This value creates a new stacking context when the value of `z-index` is not `auto`. Its effect on `table-*-group`, `table-row`, `table-column`, `table-cell`, and `table-caption` elements is undefined.
`absolute`
    
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its closest positioned ancestor (if any) or to the initial containing block. Its final position is determined by the values of `top`, `right`, `bottom`, and `left`.
This value creates a new stacking context when the value of `z-index` is not `auto`. The margins of absolutely positioned boxes do not collapse with other margins.
`fixed`
    
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its initial containing block, which is the viewport in the case of visual media. Its final position is determined by the values of `top`, `right`, `bottom`, and `left`.
This value always creates a new stacking context. In printed documents, the element is placed in the same position on every page.
`sticky`
    
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values of `top`, `right`, `bottom`, and `left`. The offset does not affect the position of any other elements.
This value always creates a new stacking context. Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when `overflow` is `hidden`, `scroll`, `auto`, or `overlay`), even if that ancestor isn't the nearest actually scrolling ancestor.
Note: At least one inset property (`top`, `inset-block-start`, `right`, `inset-inline-end`, etc.) needs to be set to a non-`auto` value for the axis on which the element needs to be made sticky. If both `inset` properties for an axis are set to `auto`, on that axis the `sticky` value will behave as `relative`.
## Description
>
### Types of positioning
  * A positioned element is an element whose computed `position` value is either `relative`, `absolute`, `fixed`, or `sticky`. (In other words, it's anything except `static`.)
  * A relatively positioned element is an element whose computed `position` value is `relative`. The `top` and `bottom` properties specify the vertical offset from its normal position; the `left` and `right` properties specify the horizontal offset.
  * An absolutely positioned element is an element whose computed `position` value is `absolute` or `fixed`. The `top`, `right`, `bottom`, and `left` properties specify offsets from the edges of the element's containing block. (The containing block is the ancestor relative to which the element is positioned.) If the element has margins, they are added to the offset. The element establishes a new block formatting context (BFC) for its contents.
  * A stickily positioned element is an element whose computed `position` value is `sticky`. It's treated as relatively positioned until its containing block crosses a specified threshold (such as setting `top` to value other than auto) within its flow root (or the container it scrolls within), at which point it is treated as "stuck" until meeting the opposite edge of its containing block.


Most of the time, absolutely positioned elements that have `height` and `width` set to `auto` are sized so as to fit their contents. However, non-replaced, absolutely positioned elements can be made to fill the available vertical space by specifying both `top` and `bottom` and leaving `height` unspecified (that is, `auto`). They can likewise be made to fill the available horizontal space by specifying both `left` and `right` and leaving `width` as `auto`.
Except for the case just described (of absolutely positioned elements filling the available space):
  * If both `top` and `bottom` are specified (technically, not `auto`), `top` wins.
  * If both `left` and `right` are specified, `left` wins when `direction` is `ltr` (English, horizontal Japanese, etc.) and `right` wins when `direction` is `rtl` (Persian, Arabic, Hebrew, etc.).


## Accessibility
Ensure that elements positioned with an `absolute` or `fixed` value do not obscure other content when the page is zoomed to increase text size.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Visual Presentation: Understanding SC 1.4.8 | Understanding WCAG 2.0


### Performance & Accessibility
Scrolling elements containing `fixed` or `sticky` content can cause performance and accessibility issues. As a user scrolls, the browser must repaint the sticky or fixed content in a new location. Depending on the content needing to be repainted, the browser performance, and the device's processing speed, the browser may not be able to manage repaints at 60 fps. Such a scenario can lead to jank and, more importantly, accessibility concerns for people with sensitivities. One solution is to add `will-change: transform` to the positioned elements to render the element in its own layer, improving repaint speed and therefore improving performance and accessibility.
## Examples
>
### Relative positioning
Relatively positioned elements are offset a given amount from their normal position within the document, but without the offset affecting other elements. In the example below, note how the other elements are placed as if "Two" were taking up the space of its normal location.
#### HTML
    
    <div class="box" id="one">One</div>
    <div class="box" id="two">Two</div>
    <div class="box" id="three">Three</div>
    <div class="box" id="four">Four</div>
    
#### CSS
    
    * {
      box-sizing: border-box;
    }
    
    .box {
      display: inline-block;
      width: 100px;
      height: 100px;
      background: red;
      color: white;
    }
    
    #two {
      position: relative;
      top: 20px;
      left: 20px;
      background: blue;
    }
    
### Absolute positioning
Elements that are relatively positioned remain in the normal flow of the document. In contrast, an element that is absolutely positioned is taken out of the flow; thus, other elements are positioned as if it did not exist. The absolutely positioned element is positioned relative to its nearest positioned ancestor (i.e., the nearest ancestor that is not `static`). If a positioned ancestor doesn't exist, it is positioned relative to the ICB (initial containing block), which is the containing block of the document's root element.
#### HTML
    
    <h1>Absolute positioning</h1>
    
    <p>
      I am a basic block level element. My adjacent block level elements sit on new
      lines below me.
    </p>
    
    <p class="positioned">
      By default we span 100% of the width of our parent element, and we are as tall
      as our child content. Our total width and height is our content + padding +
      border width/height.
    </p>
    
    <p>
      We are separated by our margins. Because of margin collapsing, we are
      separated by the width of one of our margins, not both.
    </p>
    
    <p>
      inline elements <span>like this one</span> and <span>this one</span> sit on
      the same line as one another, and adjacent text nodes, if there is space on
      the same line. Overflowing inline elements
      <span>wrap onto a new line if possible — like this one containing text</span>,
      or just go on to a new line if not, much like this image will do:
      <img src="https://mdn.github.io/shared-assets/images/examples/long.jpg" />
    </p>
    
#### CSS
    
    * {
      box-sizing: border-box;
    }
    
    body {
      width: 500px;
      margin: 0 auto;
    }
    
    p {
      background: aqua;
      border: 3px solid blue;
      padding: 10px;
      margin: 10px;
    }
    
    span {
      background: red;
      border: 1px solid black;
    }
    
    .positioned {
      position: absolute;
      background: yellow;
      inset-block-start: 30px;
      inset-inline-start: 30px;
    }
    
#### Result
### Fixed positioning
Fixed positioning is similar to absolute positioning, with the exception that the element's containing block is the initial containing block established by the viewport, unless any ancestor has `transform`, `perspective`, or `filter` property set to something other than `none` (see fixed positioning containing block), which then causes that ancestor to take the place of the elements containing block. This can be used to create a "floating" element that stays in the same position regardless of scrolling. In the example below, box "One" is fixed at 80 pixels from the top of the page and 10 pixels from the left. Even after scrolling, it remains in the same place relative to the viewport. Also, when the `will-change` property is set to `transform`, a new containing block is established.
#### HTML
    
    <div class="outer">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor
        eget pulvinar lobortis. Vestibulum ante ipsum primis in faucibus orci luctus
        et ultrices posuere cubilia Curae; Nam ac dolor augue. Pellentesque mi mi,
        laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
        Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut
        arcu aliquam purus viverra dictum vel sit amet mi. Duis nisl mauris, aliquam
        sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem
        aliquam, congue porttitor tortor. Sed tempor nisl a lorem consequat, id
        maximus erat aliquet. Sed sagittis porta libero sed condimentum. Aliquam
        finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id
        ultrices ultrices, tempor et tellus.
      </p>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue tortor
        eget pulvinar lobortis. Vestibulum ante ipsum primis in faucibus orci luctus
        et ultrices posuere cubilia Curae; Nam ac dolor augue. Pellentesque mi mi,
        laoreet et dolor sit amet, ultrices varius risus. Nam vitae iaculis elit.
        Aliquam mollis interdum libero. Sed sodales placerat egestas. Vestibulum ut
        arcu aliquam purus viverra dictum vel sit amet mi. Duis nisl mauris, aliquam
        sit amet luctus eget, dapibus in enim. Sed velit augue, pretium a sem
        aliquam, congue porttitor tortor. Sed tempor nisl a lorem consequat, id
        maximus erat aliquet. Sed sagittis porta libero sed condimentum. Aliquam
        finibus lectus nec ante congue rutrum. Curabitur quam quam, accumsan id
        ultrices ultrices, tempor et tellus.
      </p>
      <div class="box" id="one">One</div>
    </div>
    
#### CSS
    
    * {
      box-sizing: border-box;
    }
    
    .box {
      width: 100px;
      height: 100px;
      background: red;
      color: white;
    }
    
    #one {
      position: fixed;
      top: 80px;
      left: 10px;
      background: blue;
    }
    
    .outer {
      width: 500px;
      height: 300px;
      overflow: scroll;
      padding-left: 150px;
    }
    
#### Result
### Sticky positioning
The following CSS rule positions the element with id `one` relatively until the viewport is scrolled such that the element is 10 pixels from the top. Beyond that threshold, the element is fixed to 10 pixels from the top.
    
    #one {
      position: sticky;
      top: 10px;
    }
    
#### List with sticky headings
A common use for sticky positioning is for the headings in an alphabetized list. The "B" heading will appear just below the items that begin with "A" until they are scrolled offscreen. Rather than sliding offscreen with the rest of the content, the "B" heading will then remain fixed to the top of the viewport until all the "B" items have scrolled offscreen, at which point it will be covered up by the "C" heading, and so on.
You must specify a threshold with at least one of `top`, `right`, `bottom`, or `left` for sticky positioning to behave as expected. Otherwise, it will be indistinguishable from relative positioning.
##### HTML
    
    <dl>
      <div>
        <dt>A</dt>
        <dd>Andrew W.K.</dd>
        <dd>Apparat</dd>
        <dd>Arcade Fire</dd>
        <dd>At The Drive-In</dd>
        <dd>Aziz Ansari</dd>
      </div>
      <div>
        <dt>C</dt>
        <dd>Chromeo</dd>
        <dd>Common</dd>
        <dd>Converge</dd>
        <dd>Crystal Castles</dd>
        <dd>Cursive</dd>
      </div>
      <div>
        <dt>E</dt>
        <dd>Explosions In The Sky</dd>
      </div>
      <div>
        <dt>T</dt>
        <dd>Ted Leo &amp; The Pharmacists</dd>
        <dd>T-Pain</dd>
        <dd>Thrice</dd>
        <dd>TV On The Radio</dd>
        <dd>Two Gallants</dd>
      </div>
    </dl>
    
##### CSS
    
    * {
      box-sizing: border-box;
    }
    
    dl > div {
      background: white;
      padding-top: 24px;
    }
    
    dt {
      background: #b8c1c8;
      border-bottom: 1px solid #989ea4;
      border-top: 1px solid #717d85;
      color: white;
      font:
        bold 18px/21px Helvetica,
        Arial,
        sans-serif;
      margin: 0;
      padding: 2px 0 0 12px;
      position: -webkit-sticky;
      position: sticky;
      top: -1px;
    }
    
    dd {
      font:
        bold 20px/45px Helvetica,
        Arial,
        sans-serif;
      margin: 0;
      padding-left: 12px;
      white-space: nowrap;
    }
    
    dd + dd {
      border-top: 1px solid #cccccc;
    }
    
##### Result
#### Sticky position with all the inset boundaries set
The following example demonstrates an element's behavior when all inset boundaries are set. Here, we have two light bulb emojis in a paragraph. The light bulbs use sticky positioning, and the inset boundaries are specified as 50px from the top, 100px from the right, 50px from the bottom, and 50px from the left. A gray background on the parent div element marks the inset area.
##### HTML
    
    Use scrollbars to put the light bulbs(💡) in the right place in the following
    text:
    <div>
      <p>
        The representation of an idea by a light bulb(<span class="bulb">💡</span>)
        is a commonly used metaphor that symbolizes the moment of inspiration or the
        birth of a new idea. The association between a light bulb and an idea can be
        traced back to the invention of the incandescent light bulb(<span
          class="bulb"
          >💡</span
        >) by Thomas Edison in the late 19th century. The light bulb is a powerful
        symbol because it represents illumination, clarity, and the sudden
        brightening of one's thoughts or understanding. When someone has an idea, it
        is often described as a light bulb turning on in their mind, signifying a
        moment of insight or creativity. The image of a light bulb also suggests the
        idea of energy, power, and the potential for growth and development.
      </p>
    </div>
    
##### CSS
    
    .bulb {
      position: sticky;
      inset: 50px 100px;
    }
    
    div {
      /* mark area defined by the inset boundaries using gray color */
      background: linear-gradient(#99999999, #99999999) 100px 50px / 192px 100px
        no-repeat;
    }
    
##### Result
When you put both bulbs in their proper place, you'll notice that they are relatively positioned inside the inset area. When you move them out of the inset area, they are fixed (sticky) to the inset boundary in that direction.
# white-space
The `white-space` CSS property sets how white space inside an element is handled.
## Try it
    
    white-space: normal;
    
    
    white-space: pre;
    
    
    white-space: pre-wrap;
    
    
    white-space: pre-line;
    
    
    white-space: wrap;
    
    
    white-space: collapse;
    
    
    white-space: preserve nowrap;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">
        <p>
          But ere she from the church-door stepped She smiled and told us why: 'It
          was a wicked woman's curse,' Quoth she, 'and what care I?' She smiled, and
          smiled, and passed it off Ere from the door she stept—
        </p>
      </div>
    </section>
    
    
    #example-element {
      width: 16rem;
    }
    
    #example-element p {
      border: 1px solid #c5c5c5;
      padding: 0.75rem;
      text-align: left;
    }
    
The property specifies two things:
  * Whether and how white space is collapsed.
  * Whether and how lines wrap.


Note: To make words break within themselves, use `overflow-wrap`, `word-break`, or `hyphens` instead.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `white-space-collapse`
  * `text-wrap-mode`


Note: The spec defines a third constituent property: `white-space-trim`, which is not implemented in any browser yet.
## Syntax
    
    /* Single keyword values */
    white-space: normal;
    white-space: pre;
    white-space: pre-wrap;
    white-space: pre-line;
    
    /* white-space-collapse and text-wrap-mode shorthand values */
    white-space: nowrap;
    white-space: wrap;
    white-space: break-spaces;
    white-space: collapse;
    white-space: preserve nowrap;
    
    /* Global values */
    white-space: inherit;
    white-space: initial;
    white-space: revert;
    white-space: revert-layer;
    white-space: unset;
    
### Values
The `white-space` property values can be specified as one or two keywords representing the values for the `white-space-collapse` and `text-wrap-mode` properties, or the following special keywords:
`normal`
    
Sequences of white space are collapsed. Newline characters in the source are handled the same as other white spaces. Lines are broken as necessary to fill line boxes. Equivalent to `collapse wrap`.
`pre`
    
Sequences of white space are preserved. Lines are only broken at newline characters in the source and at `<br>` elements. Equivalent to `preserve nowrap`.
`pre-wrap`
    
Sequences of white space are preserved. Lines are broken at newline characters, at `<br>`, and as necessary to fill line boxes. Equivalent to `preserve wrap`.
`pre-line`
    
Sequences of white space are collapsed. Lines are broken at newline characters, at `<br>`, and as necessary to fill line boxes. Equivalent to `preserve-breaks wrap`.
Note: The `white-space` property as a shorthand is a relatively new feature (see browser compatibility). Originally, it had six keyword values; now, the value `nowrap` is instead interpreted as a value for `text-wrap-mode`, while the value `break-spaces` is interpreted as a value for `white-space-collapse`. The above four keywords are still specific to `white-space`, but they have longhand equivalents. The change to make `white-space` a shorthand expands acceptable values to even more keywords and combinations, such as `wrap` and `collapse`.
The following table summarizes the behavior of these four `white-space` keyword values:
New lines Spaces and tabs Text wrapping End-of-line spaces End-of-line other space separators  
`normal` Collapse Collapse Wrap Remove Hang  
`pre` Preserve Preserve No wrap Preserve No wrap  
`pre-wrap` Preserve Preserve Wrap Hang Hang  
`pre-line` Preserve Collapse Wrap Remove Hang  
A tab defaults to 8 spaces and can be configured using the `tab-size` property. In the case of `normal`, `nowrap`, and `pre-line` values, every tab is converted to a space (U+0020) character.
Note: There is a distinction made between spaces and other space separators. These are defined as follows:
spaces
    
Spaces (U+0020), tabs (U+0009), and segment breaks (such as newlines).
other space separators
    
All other space separators defined in Unicode, other than those already defined as spaces.
Where white space is said to hang, this can affect the size of the box when measured for intrinsic sizing.
## Examples
>
### Basic example
    
    code {
      white-space: pre;
    }
    
### Line breaks inside <pre> elements
    
    pre {
      white-space: pre-wrap;
    }
    
### In action
### Controlling line wrapping in tables
#### HTML
    
    <table>
      <tr>
        <td></td>
        <td>Very long content that splits</td>
        <td class="nw">Very long content that don't split</td>
      </tr>
      <tr>
        <td class="nw">white-space:</td>
        <td>normal</td>
        <td>nowrap</td>
      </tr>
    </table>
    
#### CSS
    
    table {
      border-collapse: collapse;
      border: solid black 1px;
      width: 250px;
      height: 150px;
    }
    td {
      border: solid 1px black;
      text-align: center;
    }
    .nw {
      white-space: nowrap;
    }
    
#### Result
### Multiple lines in SVG text element
The `white-space` CSS property can be used to create multiple lines in a `<text>` element, which does not wrap by default.
#### HTML
The text inside the `<text>` element needs to be split into multiple lines for the new lines to be detected. After the first line the rest need to have their whitespace removed.
    
    <svg viewBox="0 0 320 150">
      <text y="20" x="10">Here is an English paragraph
    that is broken into multiple lines
    in the source code so that it can
    be more easily read and edited
    in a text editor.
      </text>
    </svg>
    
#### CSS
    
    text {
      white-space: break-spaces;
    }
    
#### Result
# ::selection
The `::selection` CSS pseudo-element applies styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text).
The `::selection` pseudo-element follows a special inheritance model common to all highlight pseudo-elements. For more details on how this inheritance works, see the Highlight pseudo-elements inheritance section.
## Try it
    
    p::selection {
      color: red;
      background-color: yellow;
    }
    
    
    <p>
      Select a fragment of this paragraph, to see how its appearance is affected.
    </p>
    
## Allowable properties
Only certain CSS properties can be used with `::selection`:
  * `color`
  * `background-color`
  * `text-decoration` and its associated properties
  * `text-shadow`
  * `-webkit-text-stroke-color`, `-webkit-text-fill-color` and `-webkit-text-stroke-width`


In particular, `background-image` is ignored.
## Syntax
    
    ::selection {
      /* ... */
    }
    
## Accessibility
Don't override selected text styles for purely aesthetic reasons — users can customize them to suit their needs. For people experiencing cognitive concerns or who are less technologically literate, unexpected changes to selection styles may hurt their understanding of the functionality.
If overridden, it is important to ensure that the contrast ratio between the text and background colors of the selection is high enough that people experiencing low vision conditions can read it.
Color contrast ratio is found by comparing the luminosity of the selected text and the selected text background colors. To meet current Web Content Accessibility Guidelines (WCAG), text content must have a contrast ratio of 4.5:1, or 3:1 for larger text such as headings. (WCAG defines large text as between `18.66px` and `24px` and bold, or `24px` or larger.)
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


## Examples
>
### HTML
    
    This text has special styles when you highlight it.
    <p>Also try selecting text in this paragraph.</p>
    
### CSS
    
    /* Make selected text gold on a red background */
    ::selection {
      color: gold;
      background-color: red;
    }
    
    /* Make selected text in a paragraph white on a blue background */
    p::selection {
      color: white;
      background-color: blue;
    }
    
### Result
# transition-behavior
The `transition-behavior` CSS property specifies whether transitions will be started for properties whose animation behavior is discrete.
## Syntax
    
    /* Keyword values */
    transition-behavior: allow-discrete;
    transition-behavior: normal;
    
    /* Global values */
    transition-behavior: inherit;
    transition-behavior: initial;
    transition-behavior: revert;
    transition-behavior: revert-layer;
    transition-behavior: unset;
    
### Values
`allow-discrete`
    
Transitions will be started on the element for discrete animated properties.
`normal`
    
Transitions will not be started on the element for discrete animated properties.
## Description
The `transition-behavior` property is only relevant when used in conjunction with other transition properties, notably `transition-property` and `transition-duration`, as no transition occurs if no properties are animated over a non-zero duration of time.
    
    .card {
      transition-property: opacity, display;
      transition-duration: 0.25s;
      transition-behavior: allow-discrete;
    }
    
    .card.fade-out {
      opacity: 0;
      display: none;
    }
    
The `transition-behavior` value can be included as part of a shorthand `transition` declaration. When included in the shorthand, when using or defaulting to all properties, the `allow-discrete` value has no impact on regular animatable properties. The following CSS is equivalent to the longhand declarations above:
    
    .card {
      transition: all 0.25s;
      transition: all 0.25s allow-discrete;
    }
    
    .card.fade-out {
      opacity: 0;
      display: none;
    }
    
In the above snippet we include the `transition` property twice. The first instance does not include the `allow-discrete` value — this provides cross-browser support, ensuring the card's other properties still transition in browsers that don't support `transition-behavior`.
### Discrete animation behavior
Discrete-animated properties generally flip between two values 50% through animating between the two.
There is an exception, however, which is when animating to or from `display: none` or `content-visibility: hidden`. In this case, the browser will flip between the two values so that the transitioned content is shown for the entire animation duration.
So for example:
  * When animating `display` from `none` to `block` (or another visible `display` value), the value will flip to `block` at `0%` of the animation duration so it is visible throughout.
  * When animating `display` from `block` (or another visible `display` value) to `none`, the value will flip to `none` at `100%` of the animation duration so it is visible throughout.


## Examples
>
### Transitioning a popover
In this example, a popover is animated as it transitions from hidden to shown and back again.
#### HTML
The HTML contains a `<div>` element declared as a popover using the popover attribute, and a `<button>` element designated as the popover's display control using its popovertarget attribute.
    
    <button popovertarget="mypopover">Show the popover</button>
    <div popover="auto" id="mypopover">I'm a Popover! I should animate.</div>
    
#### CSS
    
    [popover]:popover-open {
      opacity: 1;
      transform: scaleX(1);
    }
    
    [popover] {
      /* Final state of the exit animation */
      opacity: 0;
      transform: scaleX(0);
    
      transition-property: opacity, transform, overlay, display;
      transition-duration: 0.7s;
      transition-behavior: allow-discrete;
      /* Using the shorthand transition property, we could write:
        transition: 
          opacity 0.7s,
          transform 0.7s,
          overlay 0.7s allow-discrete,
          display 0.7s allow-discrete;
    
        or even:
        transition: all 0.7s allow-discrete;
      */
    }
    
    /* Needs to be included after the previous [popover]:popover-open 
       rule to take effect, as the specificity is the same */
    @starting-style {
      [popover]:popover-open {
        opacity: 0;
        transform: scaleX(0);
      }
    }
    
The two properties we want to animate are `opacity` and `transform`: we want the popover to fade in and out while growing and shrinking in the horizontal direction. We set a starting state for these properties on the default hidden state of the popover element (selected via `[popover]`), and an end state on the open state of the popover (selected via the `:popover-open` pseudo-class). We then set a `transition` property to animate between the two.
Because the animated element is being promoted to the top layer when shown and removed from the top layer when hidden — which also means that its hidden state has `display: none` set on it — the following properties are added to the list of transitioned elements to get the animation working in both directions. In both cases, `transition-behavior: allow-discrete` is set in the shorthand to enable discrete animation.
  * `display`: Required so that the animated element is visible (set to `display: block`) throughout both the entry and exit animation. Without this, the exit animation would not be visible; in effect, the popover would just disappear.
  * `overlay`: Required to make sure that the removal of the element from the top layer is deferred until the animation has been completed. This doesn't make a huge difference for basic animations such as this one, but in more complex cases not doing this can result in the element being removed from the overlay too quickly, meaning the animation is not smooth or effective.


In addition, a starting state for the animation is set inside the `@starting-style` at-rule. This is needed to avoid unexpected behavior. By default transitions are not triggered on elements' first style updates, or when the `display` type changes from `none` to another type. `@starting-style` allows you to override that default in a specific controlled fashion. Without this, the entry animation would not occur and the popover would just appear.
#### Result
The code renders as follows:
Note: Because popovers change from `display: none` to `display: block` each time they are shown, the popover transitions from its `@starting-style` styles to its `[popover]:popover-open` styles every time the entry transition occurs. When the popover closes, it transitions from its `[popover]:popover-open` state to the default `[popover]` state.
It is possible for the style transition on entry and exit to be different in such cases. See our Demonstration of when starting styles are used example for a proof of this.
# animation
The `animation` shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, `animation-play-state`, and `animation-timeline`.
## Try it
    
    animation: 3s ease-in 1s infinite reverse both running slide-in;
    
    
    animation: 3s linear 1s infinite running slide-in;
    
    
    animation: 3s linear 1s infinite alternate slide-in;
    
    
    animation: 0.5s linear 1s infinite alternate slide-in;
    
    
    <section class="flex-column" id="default-example">
      <div id="example-element"></div>
    </section>
    
    
    #example-element {
      background-color: #1766aa;
      margin: 20px;
      border: 5px solid #333333;
      width: 150px;
      height: 150px;
      border-radius: 50%;
    }
    
    @keyframes slide-in {
      from {
        margin-left: -20%;
      }
      to {
        margin-left: 100%;
      }
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `animation-delay`
  * `animation-direction`
  * `animation-duration`
  * `animation-fill-mode`
  * `animation-iteration-count`
  * `animation-name`
  * `animation-play-state`
  * `animation-timeline`
  * `animation-timing-function`


## Syntax
    
    /* @keyframes duration | easing-function | delay |
    iteration-count | direction | fill-mode | play-state | name */
    animation: 3s ease-in 1s 2 reverse both paused slide-in;
    
    /* @keyframes duration | easing-function | delay | name */
    animation: 3s linear 1s slide-in;
    
    /* two animations */
    animation:
      3s linear slide-in,
      3s ease-out 5s slide-out;
    
The `animation` property is specified as one or more single animations, separated by commas.
Each individual animation is specified as:
  * zero, one, or two occurrences of the `<time>` value
  * zero or one occurrences of the following values:
    * `<single-easing-function>`
    * `<single-animation-iteration-count>`
    * `<single-animation-direction>`
    * `<single-animation-fill-mode>`
    * `<single-animation-play-state>`
  * an optional name for the animation, which may be `none`, a `<custom-ident>`, or a `<string>`


Note: `animation-timeline`, `animation-range-start`, and `animation-range-end` are not currently included in this list, as current implementations are reset-only. This means that including `animation` resets a previously-declared `animation-timeline` value to `auto` and previously-declared `animation-range-start` and `animation-range-end` values to `normal`, but these properties cannot be set via `animation`. When creating CSS scroll-driven animations, you need to declare these properties after declaring any `animation` shorthand for it to take effect.
### Values
`<single-easing-function>`
    
Determines the type of transition. The value must be one of those available in `<easing-function>`.
`<single-animation-iteration-count>`
    
The number of times the animation is played. The value must be one of those available in `animation-iteration-count`.
`<single-animation-direction>`
    
The direction in which the animation is played. The value must be one of those available in `animation-direction`.
`<single-animation-fill-mode>`
    
Determines how styles should be applied to the animation's target before and after its execution. The value must be one of those available in `animation-fill-mode`.
`<single-animation-play-state>`
    
Determines whether the animation is playing or not. The value must be one of those available in `animation-play-state`.
## Description
The order of time values within each animation definition is important: the first value that can be parsed as a `<time>` is assigned to the `animation-duration`, and the second one is assigned to `animation-delay`.
The order of other values within each animation definition is also important for distinguishing an `animation-name` value from other values. If a value in the `animation` shorthand can be parsed as a value for an animation property other than `animation-name`, then the value will be applied to that property first and not to `animation-name`. For this reason, the recommended practice is to specify a value for `animation-name` as the last value in a list of values when using the `animation` shorthand; this holds true even when you specify multiple, comma-separated animations using the `animation` shorthand.
While an animation name must be set for an animation to be applied, all values of the `animation` shorthand are optional, and default to the initial value for each long-hand `animation` component. The initial value of `animation-name` is `none`, meaning if no `animation-name` value is declared in the `animation` shorthand property, there is no animation to apply on any of the properties.
When the `animation-duration` value is omitted from the `animation` shorthand property, the value for this property defaults to `0s`. In this case, the animation will still occur (the `animationStart` and `animationEnd` events will be fired) but no animation will be visible.
In the case of the `animation-fill-mode` forwards value, animated properties behave as if included in a set `will-change` property value. If a new stacking context is created during the animation, the target element retains the stacking context after the animation has finished.
## Accessibility
Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity.
Consider providing a mechanism for pausing or disabling animation as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for reduced animated experiences.
  * Designing Safer Web Animation For Motion Sensitivity · An A List Apart Article
  * An Introduction to the Reduced Motion Media Query | CSS-Tricks
  * Responsive Design for Motion | WebKit
  * MDN Understanding WCAG, Guideline 2.2 explanations
  * Understanding Success Criterion 2.2.2 | W3C Understanding WCAG 2.0


## Examples
Note: Animating CSS Box Model properties is discouraged. Animating any box model property is inherently CPU intensive; consider animating the transform property instead.
### Sun Rise
Here we animate a yellow sun across a light blue sky. The sun rises to the center of the viewport and then falls out of sight.
    
    <div class="sun"></div>
    
    
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
### Animating Multiple Properties
Adding onto the sun animation in the previous example, we add a second animation changing the color of the sun as it rises and sets. The sun starts off dark red when it is below the horizon and changes to a bright orange as it reaches the top.
    
    <div class="sun"></div>
    
    
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate animating-multiple-properties;
    }
    
    /* it is possible to animate multiple properties in a single animation */
    @keyframes animating-multiple-properties {
      from {
        transform: translateY(110vh);
        background-color: red;
        filter: brightness(75%);
      }
      to {
        transform: translateY(0);
        background-color: orange;
        /* unset properties i.e. 'filter' will revert to default values */
      }
    }
    
### Applying Multiple Animations
Here is a sun that rises and falls on a lightblue background. The sun gradually rotates through a rainbow of colors. The timing of the sun's position and color are independent.
    
    <div class="sun"></div>
    
    
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      /* multiple animations are separated by commas, each animation's parameters are set independently */
      animation:
        4s linear 0s infinite alternate rise,
        24s linear 0s infinite psychedelic;
    }
    
    @keyframes rise {
      from {
        transform: translateY(110vh);
      }
      to {
        transform: translateY(0);
      }
    }
    
    @keyframes psychedelic {
      from {
        filter: hue-rotate(0deg);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }
    
### Cascading Multiple Animations
Here is a yellow sun on a lightblue background. The sun bounces between the left and right sides of the viewport. The sun remains in the viewport even though a rise animation is defined. The rise animation's transform property is 'overwritten' by the bounce animation.
    
    <div class="sun"></div>
    
    
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      /*
        animations declared later in the cascade will override the
        properties of previously declared animations
      */
      /* bounce 'overwrites' the transform set by rise, hence the sun only moves horizontally */
      animation:
        4s linear 0s infinite alternate rise,
        4s linear 0s infinite alternate bounce;
    }
    
    @keyframes rise {
      from {
        transform: translateY(110vh);
      }
      to {
        transform: translateY(0);
      }
    }
    
    @keyframes bounce {
      from {
        transform: translateX(-50vw);
      }
      to {
        transform: translateX(50vw);
      }
    }
    
See Using CSS animations for additional examples.
# :target
The `:target` CSS pseudo-class selects the target element of the document. When the document is loaded, the target element is derived using the document's URL fragment identifier.
    
    /* Selects document's target element */
    :target {
      border: 2px solid black;
    }
    
For example, the following URL has a fragment identifier (denoted by the # sign) that marks the element with the `id` of `setup` as the document's target element:
    
    http://www.example.com/help/#setup
    
The following element would be selected by a `:target` selector when the current URL is equal to the above:
    
    <section id="setup">Installation instructions</section>
    
## Syntax
    
    :target {
      /* ... */
    }
    
## Description
When an HTML document loads, the browser sets its target element. The element is identified using the URL fragment identifier. Without the URL fragment identifier, the document has no target element. The `:target` pseudo-class allows styling the document's target element. The element could be focused, highlighted, animated, etc.
The target element is set at document load and `history.back()`, `history.forward()`, and `history.go()` method calls. But it is not changed when `history.pushState()` and `history.replaceState()` methods are called.
Note: Due to a possible bug in the CSS specification, `:target` doesn't work within a web component because the shadow root doesn't pass the target element down to the shadow tree.
## Examples
>
### A table of contents
The `:target` pseudo-class can be used to highlight the portion of a page that has been linked to from a table of contents.
#### HTML
    
    <h3>Table of Contents</h3>
    <ol>
      <li><a href="#p1">Jump to the first paragraph!</a></li>
      <li><a href="#p2">Jump to the second paragraph!</a></li>
      <li>
        <a href="#nowhere">
          This link goes nowhere, because the target doesn't exist.
        </a>
      </li>
    </ol>
    
    <h3>My Fun Article</h3>
    <p id="p1">
      You can target <i>this paragraph</i> using a URL fragment. Click on the first
      link above to try out!
    </p>
    <p id="p2">
      This is <i>another paragraph</i>, also accessible from the second link above.
      Isn't that delightful?
    </p>
    
#### CSS
    
    p:target {
      background-color: gold;
    }
    
    /* Add a pseudo-element inside the target element */
    p:target::before {
      font: 70% sans-serif;
      content: "►";
      color: limegreen;
      margin-right: 0.25em;
    }
    
    /* Style italic elements within the target element */
    p:target i {
      color: red;
    }
    
#### Result
# container-name
The container-name CSS property specifies a list of query container names used by the @container at-rule in a container query. A container query will apply styles to elements based on the size or scroll-state of the nearest ancestor with a containment context. When a containment context is given a name, it can be specifically targeted using the `@container` at-rule instead of the nearest ancestor with containment.
Note: When using the `container-type` and `container-name` properties, the `style` and `layout` values of the `contain` property are automatically applied.
## Syntax
    
    container-name: none;
    
    /* A single name */
    container-name: my-layout;
    
    /* Multiple names */
    container-name: my-page-layout my-component-library;
    
    /* Global Values */
    container-name: inherit;
    container-name: initial;
    container-name: revert;
    container-name: revert-layer;
    container-name: unset;
    
### Values
`none`
    
Default value. The query container has no name.
`<custom-ident>`
    
A case-sensitive string that is used to identify the container. The following conditions apply:
  * The name must not equal `or`, `and`, `not`, or `default`.
  * The name value must not be in quotes.
  * The dashed ident intended to denote author-defined identifiers (e.g., `--container-name`) is permitted.
  * A list of multiple names separated by a space is allowed.


## Examples
>
### Using a container name
Given the following HTML example which is a card component with a title and some text:
    
    <div class="card">
      <div class="post-meta">
        <h2>Card title</h2>
        <p>My post details.</p>
      </div>
      <div class="post-excerpt">
        <p>
          A preview of my <a href="https://example.com">blog post</a> about cats.
        </p>
      </div>
    </div>
    
To create a containment context, add the `container-type` property to an element in CSS. The following example creates two containment contexts, one for the card meta information and one for the post excerpt:
Note: A shorthand syntax for these declarations are described in the `container` page.
    
    .post-meta {
      container-type: inline-size;
    }
    
    .post-excerpt {
      container-type: inline-size;
      container-name: excerpt;
    }
    
Writing a container query via the `@container` at-rule will apply styles to the elements of the container when the query evaluates to true. The following example has two container queries, one that will apply only to the contents of the `.post-excerpt` element and one that will apply to both the `.post-meta` and `.post-excerpt` contents:
    
    @container excerpt (width >= 400px) {
      p {
        visibility: hidden;
      }
    }
    
    @container (width >= 400px) {
      p {
        font-size: 2rem;
      }
    }
    
For more information on writing container queries, see the CSS Container Queries page.
### Using multiple container names
You can also provide multiple names to a container context separated by a space:
    
    .post-meta {
      container-type: inline-size;
      container-name: meta card;
    }
    
This will allow you to target the container using either name in the `@container` at-rule. This is useful if you want to target the same container with multiple container queries where either condition could be true:
    
    @container meta (width <= 500px) {
      p {
        visibility: hidden;
      }
    }
    
    @container card (width <= 200px) {
      h2 {
        font-size: 1.5em;
      }
    }
    
# will-change
The `will-change` CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is actually changed. These kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required.
Warning: `will-change` is intended to be used as a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems.
Proper usage of this property can be a bit tricky:
  * Don't apply will-change to too many elements. The browser already tries as hard as it can to optimize everything. Some of the stronger optimizations that are likely to be tied to `will-change` end up using a lot of a machine's resources, and when overused like this can cause the page to slow down or consume a lot of resources.
  * Use sparingly. The normal behavior for optimizations that the browser make is to remove the optimizations as soon as it can and revert back to normal. But adding `will-change` directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise. So it is a good practice to switch `will-change` on and off using script code before and after the change occurs.
  * Don't apply will-change to elements to perform premature optimization. If your page is performing well, don't add the `will-change` property to elements just to wring out a little more speed. `will-change` is intended to be used as something of a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems. Excessive use of `will-change` will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. This will lead to worse performance.
  * Give it sufficient time to work. This property is intended as a method for authors to let the user-agent know about properties that are likely to change ahead of time. Then the browser can choose to apply any ahead-of-time optimizations required for the property change before the property change actually happens. So it is important to give the browser some time to actually do the optimizations. Find some way to predict at least slightly ahead of time that something will change, and set `will-change` then.
  * Be aware, that will-change may actually influence the visual appearance of elements, when used with property values, that create a stacking context (e.g., will-change: opacity), as the stacking context is created up front.


## Syntax
    
    /* Keyword values */
    will-change: auto;
    will-change: scroll-position;
    will-change: contents;
    will-change: transform; /* Example of <custom-ident> */
    will-change: opacity; /* Example of <custom-ident> */
    will-change: left, top; /* Example of two <animatable-feature> */
    
    /* Global values */
    will-change: inherit;
    will-change: initial;
    will-change: revert;
    will-change: revert-layer;
    will-change: unset;
    
### Values
`auto`
    
This keyword expresses no particular intent; the user agent should apply whatever heuristics and optimizations it normally does.
The `<animatable-feature>` can be one of the following values:
`scroll-position`
    
Indicates that the author expects to animate or change the scroll position of the element in the near future.
`contents`
    
Indicates that the author expects to animate or change something about the element's contents in the near future.
`<custom-ident>`
    
Indicates that the author expects to animate or change the property with the given name on the element in the near future. If the property given is a shorthand, it indicates the expectation for all the longhands the shorthand expands to. It cannot be one of the following values: `unset`, `initial`, `inherit`, `will-change`, `auto`, `scroll-position`, or `contents`. The spec doesn't define the behavior of particular value, but it is common for `transform` to be a compositing layer hint. Chrome currently takes two actions, given particular CSS property idents: establish a new compositing layer or a new stacking context.
### Via stylesheet
It may be appropriate to include `will-change` in your style sheet for an application that does page flips on key presses like an album or a slide deck presentation where the pages are large and complex. This will let browser prepare the transition ahead of time and allow for snappy transitions between the pages as soon as the key is pressed. But use caution with the `will-change` property directly in stylesheets. It may cause the browser to keep the optimization in memory for much longer than it is needed.
    
    .slide {
      will-change: transform;
    }
    
## Examples
>
### Via script
This is an example showing how to apply the `will-change` property through scripting, which is probably what you should be doing in most cases.
    
    const el = document.getElementById("element");
    
    // Set will-change when the element is hovered
    el.addEventListener("mouseenter", hintBrowser);
    el.addEventListener("animationEnd", removeHint);
    
    function hintBrowser() {
      // The optimizable properties that are going to change
      // in the animation's keyframes block
      this.style.willChange = "transform, opacity";
    }
    
    function removeHint() {
      this.style.willChange = "auto";
    }
    
# overflow-y
The `overflow-y` CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the `overflow` shorthand property.
## Try it
    
    overflow-y: visible;
    
    
    overflow-y: hidden;
    
    
    overflow-y: clip;
    
    
    overflow-y: scroll;
    
    
    overflow-y: auto;
    
    
    <section class="default-example" id="default-example">
      <p id="example-element">
        Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's
        Inn Hall. Implacable November weather. As much mud in the streets as if the
        waters had but newly retired from the face of the earth.
      </p>
    </section>
    
    
    #example-element {
      width: 15em;
      height: 9em;
      border: medium dotted;
      padding: 0.75em;
      text-align: left;
    }
    
## Syntax
    
    /* Keyword values */
    overflow-y: visible;
    overflow-y: hidden;
    overflow-y: clip;
    overflow-y: scroll;
    overflow-y: auto;
    
    /* Global values */
    overflow-y: inherit;
    overflow-y: initial;
    overflow-y: revert;
    overflow-y: revert-layer;
    overflow-y: unset;
    
The `overflow-y` property is specified as a single `<overflow>` keyword value.
If `overflow-x` is `hidden`, `scroll`, or `auto` and the `overflow-y` property is `visible` (default), the value will be implicitly computed as `auto`.
### Values
`visible`
    
Overflow content is not clipped and may be visible outside the element's padding box at the top and bottom edges. The element box is not a scroll container.
`hidden`
    
Overflow content is clipped if necessary to fit vertically in the elements' padding box. No scroll bars are provided.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property. As a result, content overflows the element's padding box by the `<length>` value of `overflow-clip-margin` or by `0px` if not set. The difference between `clip` and `hidden` is that the `clip` keyword also forbids all scrolling, including programmatic scrolling. No new formatting context is created. To establish a formatting context, use `overflow: clip` along with `display: flow-root`. The element box is not a scroll container.
`scroll`
    
Overflow content is clipped if necessary to fit vertically inside the element's padding box. Browsers display scroll bars in the vertical direction whether or not any content is actually clipped. (This prevents scroll bars from appearing or disappearing when the content changes.) Printers may still print overflowing content.
`auto`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view. Unlike `scroll`, user agents display scroll bars only if the content is overflowing, hiding scroll bars by default. If content fits inside the element's padding box, it looks the same as with `visible`, but still establishes a new block-formatting context.
Note: The keyword value `overlay` is a legacy value alias for `auto`. With `overlay`, the scroll bars are drawn on top of the content instead of taking up space.
## Examples
>
### Setting overflow-y behavior
#### HTML
    
    <ul>
      <li>
        <code>overflow-y:hidden</code> — hides the text outside the box
        <div id="div1">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-y:scroll</code> — always adds a scrollbar
        <div id="div2">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-y:visible</code> — displays the text outside the box if
        needed
        <div id="div3">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-y:auto</code> — equivalent to <code>scroll</code>
        on most browsers
        <div id="div4">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    </ul>
    
#### CSS
    
    div {
      border: 1px solid black;
      width: 250px;
      height: 100px;
    }
    
    #div1 {
      overflow-y: hidden;
      margin-bottom: 12px;
    }
    #div2 {
      overflow-y: scroll;
      margin-bottom: 12px;
    }
    #div3 {
      overflow-y: visible;
      margin-bottom: 120px;
    }
    #div4 {
      overflow-y: auto;
      margin-bottom: 120px;
    }
    
#### Result
# hypot()
The `hypot()` CSS function is an exponential function that returns the square root of the sum of squares of its parameters.
While `pow()` and `sqrt()` only work on unitless numbers, `hypot()` accepts values with units, but they all must have the same type.
## Syntax
    
    /* A <number> value */
    width: hypot(2em); /* 2em */
    width: hypot(3em, 4em); /* 5em */
    width: hypot(30px, 40px); /* 50px */
    width: hypot(48px, 64px); /* 80px */
    width: hypot(3px, 4px, 5px); /* 7.0710678118654755px */
    
### Parameters
The `hypot(x [, ...]#)` function accepts one or more comma-separated calculations as its parameters.
`x`, `x2`, ..., `xN`
    
A calculation that resolves to a `<number>`, `<dimension>`, or `<percentage>`.
### Return value
Returns a `<number>`, `<dimension>`, or `<percentage>` (based on the inputs), which is the square root of the sum of squares of its parameters.
  * If any of the inputs is `infinite`, the result is `+∞`.
  * If a single parameter is provided, the result is the absolute value of its input. `hypot(2em)` and `hypot(-2em)` both resolve to `2em`.


## Examples
>
### Sizes based on hypot function
This example shows how you can use the `hypot()` function to calculate sizes.
#### HTML
    
    <div class="boxes">
      <div class="box">100px</div>
      <div class="box one">100px</div>
      <div class="box two">141.42px</div>
      <div class="box three">250px</div>
    </div>
    
#### CSS
Here we are using CSS custom properties to define the sizes to be used. First we declare the first size (`--size-0`) which is then used to calculate the other sizes.
  * `--size-1` is calculated with the hypotenuse of `--size-0` (100px). This takes the square value and, as there is no other value, returns the square root of the value, which results in 100px.
  * `--size-2` is calculated with the hypotenuse of `--size-0` (100px), twice. This takes the square of the value (100px * 100px = 10000px2) and adds it to the square of `--size-0` again (10000px2 \+ 10000px2 = 20000px2) and returns the square root of the sum (√(20000px2)), which results in 141.42px.
  * `--size-3` is calculated with the hypotenuse `--size-0` * 1.5 (150px) and `--size-0` * 2 (200px). The result is the square root of the sum of their squares: The values are squared (22500px2 and 40000px2) and added together (62500px2), with the sum square-rooted (√(62500px2)) being 250px.


    
    :root {
      --size-0: 100px;
      --size-1: hypot(var(--size-0)); /*  100px */
      --size-2: hypot(var(--size-0), var(--size-0)); /*  141.42px */
      --size-3: hypot(
        calc(var(--size-0) * 1.5),
        calc(var(--size-0) * 2)
      ); /*  250px */
    }
    
The sizes are then applied as the `width` and `height` values of the selectors.
    
    .one {
      width: var(--size-1);
      height: var(--size-1);
    }
    .two {
      width: var(--size-2);
      height: var(--size-2);
    }
    .three {
      width: var(--size-3);
      height: var(--size-3);
    }
    
#### Result
# font-family
The `font-family` CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.
## Try it
    
    font-family: Georgia, serif;
    
    
    font-family: "Gill Sans", sans-serif;
    
    
    font-family: sans-serif;
    
    
    font-family: serif;
    
    
    font-family: cursive;
    
    
    font-family: system-ui;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    section {
      font-size: 1.2em;
    }
    
Values are separated by commas to indicate that they are alternatives. The browser will select the first font in the list that is installed or that can be downloaded using a `@font-face` at-rule.
It is often convenient to use the shorthand property `font` to set `font-size` and other font related properties all at once.
You should always include at least one generic family name in a `font-family` list, since there's no guarantee that any given font is available. This lets the browser select an acceptable fallback font when necessary.
The `font-family` property specifies a list of fonts, from highest priority to lowest. Font selection does not stop at the first font in the list that is on the user's system. Rather, font selection is done one character at a time, so that if an available font does not have a glyph for a needed character, the latter fonts are tried. When a font is only available in some styles, variants, or sizes, those properties may also influence which font family is chosen.
## Syntax
    
    /* A font family name and a generic family name */
    font-family: "Gill Sans Extrabold", sans-serif;
    font-family: "Goudy Bookletter 1911", sans-serif;
    
    /* A generic family name only */
    font-family: serif;
    font-family: sans-serif;
    font-family: monospace;
    font-family: cursive;
    font-family: fantasy;
    font-family: system-ui;
    font-family: ui-serif;
    font-family: ui-sans-serif;
    font-family: ui-monospace;
    font-family: ui-rounded;
    font-family: emoji;
    font-family: math;
    font-family: fangsong;
    
    /* Global values */
    font-family: inherit;
    font-family: initial;
    font-family: revert;
    font-family: revert-layer;
    font-family: unset;
    
The `font-family` property lists one or more font families, separated by commas. Each font family is specified as either a `<family-name>` or a `<generic-name>` value.
The example below lists two font families, the first with a `<family-name>` and the second with a `<generic-name>`:
    
    font-family: "Gill Sans Extrabold", sans-serif;
    
### Values
`<family-name>`
    
The name of a font family. This must be either a single `<string>` value or a space-separated sequence of `<custom-ident>` values. String values must be quoted but may contain any Unicode character. Custom identifiers are not quoted, but certain characters must be escaped.
It is good practice to quote font family names that contain white space, digits, or punctuation characters other than hyphens.
See also Valid family names.
`<generic-name>`
    
Generic font families are a fallback mechanism, a means of preserving some of the style sheet author's intent when none of the specified fonts are available. Generic family names are keywords and must not be quoted. A generic font family should be the last item in the list of font family names. The following keywords are defined:
`serif`
    
Glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings.
For example: Lucida Bright, Lucida Fax, Palatino, Palatino Linotype, Palladio, URW Palladio, serif.
`sans-serif`
    
Glyphs have stroke endings that are plain.
For example: Open Sans, Fira Sans, Lucida Sans, Lucida Sans Unicode, Trebuchet MS, Liberation Sans, Nimbus Sans L, sans-serif.
`monospace`
    
All glyphs have the same fixed width.
For example: Fira Mono, DejaVu Sans Mono, Menlo, Consolas, Liberation Mono, Monaco, Lucida Console, monospace.
`cursive`
    
Glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. The glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letter work.
For example: Brush Script MT, Brush Script Std, Lucida Calligraphy, Lucida Handwriting, Apple Chancery, cursive.
`fantasy`
    
Fantasy fonts are primarily decorative fonts that contain playful representations of characters.
For example: Papyrus, Herculanum, Party LET, Curlz MT, Harrington, fantasy.
`system-ui`
    
Glyphs are taken from the default user interface font on a given platform. Because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics.
`ui-serif`
    
The default user interface serif font.
`ui-sans-serif`
    
The default user interface sans-serif font.
`ui-monospace`
    
The default user interface monospace font.
`ui-rounded`
    
The default user interface font that has rounded features.
`math`
    
This is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings.
`emoji`
    
Fonts that are specifically designed to render emoji.
`fangsong`
    
A particular style of Chinese characters that are between serif-style Song and cursive-style Kai forms. This style is often used for government documents.
## Examples
>
### Some common font families
    
    .serif {
      font-family: Times, "Times New Roman", Georgia, serif;
    }
    
    .sansserif {
      font-family: Verdana, Arial, Helvetica, sans-serif;
    }
    
    .monospace {
      font-family: "Lucida Console", Courier, monospace;
    }
    
    .cursive {
      font-family: cursive;
    }
    
    .fantasy {
      font-family: fantasy;
    }
    
    .emoji {
      font-family: emoji;
    }
    
    .math {
      font-family: math;
    }
    
    .fangsong {
      font-family: fangsong;
    }
    
### Valid family names
The following declarations are valid:
    
    font-family: "Goudy Bookletter 1911", sans-serif;
    
The following declarations are invalid:
    
    font-family: Goudy Bookletter 1911, sans-serif;
    font-family: Red/Black, sans-serif;
    font-family: "Lucida" Grande, sans-serif;
    font-family: Ahem!, sans-serif;
    font-family: test@foo, sans-serif;
    font-family: #POUND, sans-serif;
    font-family: Hawaii 5-0, sans-serif;
    
The following example is technically valid but is not recommended:
    
    font-family:
      Gill Sans Extrabold,
      sans-serif;
    
# fill-opacity
The `fill-opacity` CSS property defines the opacity of the painting operation (color, gradient, pattern, etc.) applied to SVG shapes or text content elements to fill the element. The property defines the opacity of the element's `fill` only; it does not affect the stroke. If present, it overrides the element's `fill-opacity` attribute.
Note: The `fill-opacity` property only applies to `<circle>`, `<ellipse>`, `<path>`, `<polygon>`, `<polyline>`, `<rect>`, `<text>`, `<textPath>`, and `<tspan>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* numeric and percentage values */
    fill-opacity: 0.2;
    fill-opacity: 20%;
    
    /* Global values */
    fill-opacity: inherit;
    fill-opacity: initial;
    fill-opacity: revert;
    fill-opacity: revert-layer;
    fill-opacity: unset;
    
### Values
The `<number>` and `<percentage>` values denote the opacity of the `fill` of the element.
`<number>`
    
A numeric value between `0` and `1`, inclusive.
`<percentage>`
    
A percentage value between `0%` and `100%`, inclusive.
With `0` or `0%`, the element is fully transparent. With `1` or `100%`, the element is fully opaque. With values in between, the element is semi-transparent, with content behind the element being visible.
## Examples
>
### Defining the fill opacity of SVG elements
This example demonstrates the basic use case of `fill-opacity`, and how the CSS `fill-opacity` property takes precedence over the `fill-opacity` attribute and has no effect on any `stroke` applied to a shape.
#### HTML
We include several different SVG graphic elements and set the `fill-opacity` attribute of each one to `1` (except `line`), meaning the fill of each element is opaque. The `fill-opacity` SVG attribute does not apply to `<line>`.
    
    <svg viewBox="0 0 100 150" xmlns="http://www.w3.org/2000/svg">
      <rect x="10" y="10" width="30" height="30" fill-opacity="1" />
      <rect x="60" y="10" rx="10" ry="10" width="30" height="30" fill-opacity="1" />
      <circle cx="25" cy="75" r="20" fill-opacity="1" />
      <ellipse cx="75" cy="75" rx="20" ry="10" fill-opacity="1" />
      <line x1="50" x2="90" y1="40" y2="60" stroke="black" stroke-width="5" />
      <polyline
        points="60 90 65 100 70 95 75 110 80 105 85 120 90 115 95 130 100 125"
        fill-opacity="1" />
      <path d="M20,130 Q40,105 50,130 T90,130" fill-opacity="1" />
    </svg>
    
#### CSS
With CSS, we use the `fill-opacity` property to override the value of the SVG `fill-opacity` attribute, giving each SVG element a different value.
We add a `stroke` to the circle and ellipse, to demonstrate that the opacity of the stroke is not impacted by the `fill-opacity` property.
Other SVG styles are set, including a background image to allow the opacity of each element to be more easily seen. These are not shown for the sake of brevity.
    
    svg > * {
      fill: black;
    }
    rect:last-of-type {
      fill-opacity: 0.1;
    }
    circle {
      fill-opacity: 0.6;
    }
    ellipse {
      fill-opacity: 40%;
    }
    line {
      fill-opacity: 10%;
    }
    polyline {
      fill-opacity: 50%;
    }
    path {
      fill-opacity: 0.5;
    }
    
    circle,
    ellipse {
      stroke: black;
      stroke-width: 3px;
    }
    
#### Results
Only two elements are fully opaque: the first rectangle and the line. The first rectangle is not matched by any of the selectors, therefore no CSS is applied and the `fill` is fully opaque. The `line` is matched, with `fill-opacity: 10%` set. However, the line has no `fill` paint operation — only the `stroke` is visible — therefore the declaration has no effect.
# & nesting selector
The CSS `&` explicitly states the relationship between parent and child rules when using CSS nesting. It makes the nested child rule selectors relative to the parent element. Without the `&` nesting selector, the child rule selector selects child elements. The child rule selectors have the same specificity weight as if they were within `:is()`.
Note: Child rule does not mean child element selector. A child rule can target parent element or child elements depending on use of the `&` nesting selector.
If not used in nested style rule, the `&` nesting selector represents the scoping root.
## Syntax
    
    parentRule {
      /* parent rule style properties */
      & childRule {
        /* child rule style properties */
      }
    }
    
###  `&` nesting selector and whitespace
Consider the following code where nesting is done without the `&` nesting selector.
    
    .parent-rule {
      /* parent rule properties */
      .child-rule {
        /* child rule properties */
      }
    }
    
When the browser parses the nested selectors, it automatically adds whitespace between the selectors to create a new CSS selector rule. The following code shows the equivalent non-nested rules:
    
    .parent-rule {
      /* parent rule style properties */
    }
    
    .parent-rule .child-rule {
      /* style properties for .child-rule descendants for .parent-rule ancestors */
    }
    
When the nested rule needs to be attached (with no whitespace) to the parent rule, such as when using a `pseudo-class` or creating compound selectors, the `&` nesting selector must be immediately prepended to achieve the desired effect.
Consider an example where we want to style an element, providing styles to be applied at all times, and also nesting some styles to be applied only on hover. If the `&` nesting selector is not included, whitespace is added and we end up with a ruleset that applies the nested styles to any hovered descendant of the parent rule selector. This is, however, not what we want.
    
    .parent-rule {
      /* parent rule properties */
      :hover {
        /* child rule properties */
      }
    }
    
    /* the browser parses the above nested rules as shown below */
    .parent-rule {
      /* parent rule properties */
    }
    
    .parent-rule *:hover {
      /* child rule properties */
    }
    
With the `&` nesting selector added with no whitespace, the elements matched by the parent rule will be styled when hovered.
    
    .parent-rule {
      /* parent rule properties */
      &:hover {
        /* child rule properties */
      }
    }
    
    /* the browser parses the above nested rules as shown below */
    .parent-rule {
      /* parent rule properties */
    }
    
    .parent-rule:hover {
      /* child rule properties */
    }
    
### Appending the `&` nesting selector
The `&` nesting selector can also be appended to reverse the context of the rules.
    
    .card {
      /* .card styles */
      .featured & {
        /* .featured .card styles */
      }
    }
    
    /* the browser parses above nested rules as */
    
    .card {
      /* .card styles */
    }
    
    .featured .card {
      /* .featured .card styles */
    }
    
The `&` nesting selector can be placed multiple times:
    
    .card {
      /* .card styles */
      .featured & & & {
        /* .featured .card .card .card styles */
      }
    }
    
    /* the browser parses above nested rules as */
    
    .card {
      /* .card styles */
    }
    
    .featured .card .card .card {
      /* .featured .card .card .card styles */
    }
    
### Cannot represent pseudo-elements
The `&` selector is equivalent to the `:is()` selector, and has the same limitation that it cannot represent pseudo-elements.
For example, with the following style rule, no generated content will be styled red, even when nested in `<div class="important">`, because `.important :is(.foo::before)` cannot match anything.
    
    .foo::before {
      content: "Hello";
    
      .important & {
        color: red;
      }
    }
    
This limitation also applies to nested at-rules, whose properties are implicitly wrapped in an `&` selector. For example, with the following rule, no generated content will be styled red, even on a small screen, because the `color: red` property is implicitly wrapped in an `&` selector, which in this case is `:is(.foo::before)`.
    
    .foo::before {
      content: "Hello";
    
      @media (width < 600px) {
        color: red;
      }
    }
    
## Examples
Both of the following examples produce the same output. The first one uses normal CSS styles and the second one uses the `&` nesting selector.
### Using normal CSS styles
This example uses normal CSS styling.
#### HTML
    
    <p class="example">
      This paragraph <a href="#">contains a link</a>, try hovering or focusing it.
    </p>
    
#### CSS
    
    .example {
      font-family: system-ui;
      font-size: 1.2rem;
    }
    
    .example > a {
      color: tomato;
    }
    
    .example > a:hover,
    .example > a:focus {
      color: ivory;
      background-color: tomato;
    }
    
#### Result
### Using `&` in nested CSS styles
This example uses nested CSS styling.
#### HTML
    
    <p class="example">
      This paragraph <a href="#">contains a link</a>, try hovering or focusing it.
    </p>
    
#### CSS
    
    .example {
      font-family: system-ui;
      font-size: 1.2rem;
      & > a {
        color: tomato;
        &:hover,
        &:focus {
          color: ivory;
          background-color: tomato;
        }
      }
    }
    
#### Result
### Using `&` outside nested rule
If not used in nested style rule, the `&` nesting selector represents the scoping root.
    
    <p>Hover over the output box to change document's background color.</p>
    
    
    & {
      color: blue;
      font-weight: bold;
    }
    
    &:hover {
      background-color: wheat;
    }
    
#### Result
In this case, all the styles apply to document.
# animation-play-state
The `animation-play-state` CSS property sets whether an animation is running or paused.
## Try it
    
    animation-play-state: paused;
    
    
    animation-play-state: running;
    
    
    <section class="flex-column" id="default-example">
      <div class="animating" id="example-element"></div>
    </section>
    
    
    #example-element {
      background-color: #1766aa;
      color: white;
      margin: auto;
      margin-left: 0;
      border: 5px solid #333333;
      width: 150px;
      height: 150px;
      border-radius: 50%;
    }
    
    .animating {
      animation-name: slide;
      animation-duration: 3s;
      animation-timing-function: ease-in;
      animation-iteration-count: infinite;
      animation-direction: alternate;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence.
## Syntax
    
    /* Single animation */
    animation-play-state: running;
    animation-play-state: paused;
    
    /* Multiple animations */
    animation-play-state: paused, running, running;
    
    /* Global values */
    animation-play-state: inherit;
    animation-play-state: initial;
    animation-play-state: revert;
    animation-play-state: revert-layer;
    animation-play-state: unset;
    
### Values
`running`
    
The animation is currently playing.
`paused`
    
The animation is currently paused.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
## Examples
>
### Pausing an animation
This animation is paused, but runs when you hover over it.
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
      animation-name: rotate;
      animation-duration: 0.7s;
      animation-iteration-count: infinite;
      animation-play-state: paused;
    }
    
    .box:hover {
      animation-play-state: running;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
Hover over the rectangle to play the animation.
See CSS animations for examples.
# color-scheme
The `color-scheme` CSS property allows an element to indicate which color schemes it can comfortably be rendered in. User agents change the following aspects of the UI chrome to match the used color scheme:
  * The color of the canvas surface.
  * The default colors of scrollbars and other interaction UI.
  * The default colors of form controls.
  * The default colors of other browser-provided UI, such as "spellcheck" underlines.


Component authors must use the `prefers-color-scheme` media feature to support the color schemes on the rest of the elements.
Common choices for operating system color schemes are "light" and "dark", or "day mode" and "night mode". When a user selects one of these color schemes, the operating system makes adjustments to the user interface. This includes form controls, scrollbars, and the used values of CSS system colors.
## Try it
    
    color-scheme: normal;
    
    
    color-scheme: dark;
    
    
    color-scheme: light;
    
    
    <section class="default-example container" id="default-example">
      <textarea id="example-element">Text Area</textarea>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 50%;
    }
    
## Syntax
    
    color-scheme: normal;
    color-scheme: light;
    color-scheme: dark;
    color-scheme: light dark;
    color-scheme: only light;
    
    /* Global values */
    color-scheme: inherit;
    color-scheme: initial;
    color-scheme: revert;
    color-scheme: revert-layer;
    color-scheme: unset;
    
The `color-scheme` property's value must be one of the following keywords.
### Values
`normal`
    
Indicates that the element can be rendered using the page's color scheme settings. If the page does not have a color scheme set, the element is rendered using the page's default color settings.
`light`
    
Indicates that the element can be rendered using the operating system light color scheme.
`dark`
    
Indicates that the element can be rendered using the operating system dark color scheme.
`only`
    
Forbids the user agent from overriding the color scheme for the element.
Can be used to turn off color overrides caused by Chrome's Auto Dark Theme, by applying `color-scheme: only light;` on a specific element or `:root`.
## Examples
>
### Declaring color scheme preferences
To opt the entire page into the user's color scheme preferences, declare `color-scheme` on the `:root` element.
    
    :root {
      color-scheme: light dark;
    }
    
To opt in specific elements to the user's color scheme preferences, declare `color-scheme` on those elements.
    
    header {
      color-scheme: only light;
    }
    main {
      color-scheme: light dark;
    }
    footer {
      color-scheme: only dark;
    }
    
Along with the above CSS, also include the `<meta name="color-scheme">` HTML `<meta>` tag in the `<head>`, before any CSS style information, to inform user agents about the preferred color scheme, helping prevent unwanted screen flashes during the page load.
### Styling based on color schemes
To style elements based on color scheme preferences, use the `prefers-color-scheme` media query. The example below opts in the entire page to using both light and dark operating system color schemes via the `color-scheme` property, and then uses `prefers-color-scheme` to specify the desired foreground and background colors for individual elements in those color schemes.
    
    :root {
      color-scheme: light dark;
    }
    
    @media (prefers-color-scheme: light) {
      .element {
        color: black;
        background-color: white;
      }
    }
    
    @media (prefers-color-scheme: dark) {
      .element {
        color: white;
        background-color: black;
      }
    }
    
Alternatively, use the `light-dark()` `<color>` function to set the foreground and background colors for the different color schemes using a more compact code structure:
    
    :root {
      color-scheme: light dark;
    }
    
    .element {
      color: light-dark(black, white);
      background-color: light-dark(white, black);
    }
    
# place-content
The `place-content` CSS shorthand property allows you to align content along both the block and inline directions at once (i.e., the `align-content` and `justify-content` properties) in a relevant layout system such as Grid or Flexbox.
## Try it
    
    place-content: end space-between;
    
    
    place-content: space-around start;
    
    
    place-content: start space-evenly;
    
    
    place-content: end center;
    
    
    place-content: end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 60px 60px;
      grid-auto-rows: 40px;
      height: 180px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `align-content`
  * `justify-content`


## Syntax
    
    /* Positional alignment */
    /* align-content does not take left and right values */
    place-content: center start;
    place-content: start center;
    place-content: end left;
    place-content: flex-start center;
    place-content: flex-end center;
    
    /* Baseline alignment */
    /* justify-content does not take baseline values */
    place-content: baseline center;
    place-content: first baseline space-evenly;
    place-content: last baseline right;
    
    /* Distributed alignment */
    place-content: space-between space-evenly;
    place-content: space-around space-evenly;
    place-content: space-evenly stretch;
    place-content: stretch space-evenly;
    
    /* Global values */
    place-content: inherit;
    place-content: initial;
    place-content: revert;
    place-content: revert-layer;
    place-content: unset;
    
The first value is the `align-content` property value, the second the `justify-content` one.
Note: If the second value is not present, the first value is used for both, provided it is a valid value for both. If it is invalid for one or the other, the whole value will be invalid.
### Values
`start`
    
The items are packed flush to each other toward the start edge of the alignment container in the appropriate axis.
`end`
    
The items are packed flush to each other toward the end edge of the alignment container in the appropriate axis.
`flex-start`
    
The items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `start`.
`flex-end`
    
The items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end or cross-end side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `end`.
`center`
    
The items are packed flush to each other toward the center of the alignment container.
`left`
    
The items are packed flush to each other toward the left edge of the alignment container. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`right`
    
The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`space-between`
    
The items are evenly distributed within the alignment container. The spacing between each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge.
`baseline`, `first baseline`, `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group. The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`space-around`
    
The items are evenly distributed within the alignment container. The spacing between each pair of adjacent items is the same. The empty space before the first and after the last item equals half of the space between each pair of adjacent items.
`space-evenly`
    
The items are evenly distributed within the alignment container. The spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same.
`stretch`
    
If the combined size of the items is less than the size of the alignment container, any `auto`-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size exactly fills the alignment container
`safe`
    
Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored.
## Examples
>
### Placing content in a flex container
#### HTML
    
    <div id="container">
      <div class="small">Lorem</div>
      <div class="small">Lorem<br />ipsum</div>
      <div class="large">Lorem</div>
      <div class="large">Lorem<br />ipsum</div>
      <div class="large"></div>
      <div class="large"></div>
    </div>
    
#### CSS
    
    #container {
      display: flex;
      height: 240px;
      width: 240px;
      flex-wrap: wrap;
      background-color: #8c8c8c;
      writing-mode: horizontal-tb; /* Can be changed in the live sample */
      direction: ltr; /* Can be changed in the live sample */
      place-content: flex-end center; /* Can be changed in the live sample */
    }
    
    div > div {
      border: 2px solid #8c8c8c;
      width: 50px;
      background-color: #a0c8ff;
    }
    
    .small {
      font-size: 12px;
      height: 40px;
    }
    
    .large {
      font-size: 14px;
      height: 50px;
    }
    
#### Result
# page-break-inside
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This property has been replaced by the `break-inside` property.
The `page-break-inside` CSS property adjusts page breaks inside the current element.
## Try it
    
    page-break-inside: auto;
    
    
    page-break-inside: avoid;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'page-break-inside'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    @media print {
      #example-element {
        height: 25cm;
      }
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Keyword values */
    page-break-inside: auto;
    page-break-inside: avoid;
    
    /* Global values */
    page-break-inside: inherit;
    page-break-inside: initial;
    page-break-inside: revert;
    page-break-inside: revert-layer;
    page-break-inside: unset;
    
### Values
`auto`
    
Initial value. Automatic page breaks (neither forced nor forbidden).
`avoid`
    
Avoid page breaks inside the element.
## Page break aliases
The `page-break-inside` property is now a legacy property, replaced by `break-inside`.
For compatibility reasons, `page-break-inside` should be treated by browsers as an alias of `break-inside`. This ensures that sites using `page-break-inside` continue to work as designed. A subset of values should be aliased as follows:
page-break-inside break-inside  
`auto` `auto`  
`avoid` `avoid`  
## Examples
>
### Avoiding page breaks inside elements
#### HTML
    
    <div class="page">
      <p>This is the first paragraph.</p>
      <section class="list">
        <span>A list</span>
        <ol>
          <li>one</li>
          <!-- <li>two</li> -->
        </ol>
      </section>
      <ul>
        <li>one</li>
        <!-- <li>two</li> -->
      </ul>
      <p>This is the second paragraph.</p>
      <p>This is the third paragraph, it contains more text.</p>
      <p>
        This is the fourth paragraph. It has a little bit more text than the third
        one.
      </p>
    </div>
    
#### CSS
    
    .page {
      background-color: #8cffa0;
      height: 90px;
      width: 200px;
      columns: 1;
      column-width: 100px;
    }
    
    .list,
    ol,
    ul,
    p {
      break-inside: avoid;
    }
    
    p {
      background-color: #8ca0ff;
    }
    
    ol,
    ul,
    .list {
      margin: 0.5em 0;
      display: block;
      background-color: orange;
    }
    
    p:first-child {
      margin-top: 0;
    }
    
#### Result
# stroke
The `stroke` CSS property defines the color or SVG paint server used to draw an element's stroke. As such, `stroke` only has an effect on elements that can be given a stroke (for example, `<rect>` or `<ellipse>`); see the page on the SVG `stroke` attribute for a complete list. When declared, the CSS value overrides any value of the element's `stroke` SVG attribute.
Note: According to the 4 April 2017 draft of the CSS Fill and Stroke Module Level 3 specification, the `stroke` property is a shorthand for a number of other stroke properties. In practice, as of August 2024, browsers do not support the setting of other stroke-related values such as width or dash patterns via the `stroke` property, treating it instead as a direct analogue of the SVG `stroke` attribute.
## Syntax
    
    /* assorted color values */
    stroke: rgb(153 51 102 / 1);
    stroke: color-mix(in lch, var(--primaryColor) 35%, gray 15%));
    stroke: dodgerblue;
    stroke: currentColor;
    stroke: transparent;
    stroke: context-stroke;
    
    /* Global values */
    stroke: inherit;
    stroke: initial;
    stroke: revert;
    stroke: revert-layer;
    stroke: unset;
    
### Values
`<color>`
    
Sets the painting of the stroke with any valid CSS color value.
`<image>`
    
Sets the painting of the stroke with what SVG calls a paint server, which in this context is an SVG gradient or pattern. CSS gradients cannot be used with the `stroke` property.
`context-stroke`
    
Causes an element to "inherit" its stroke definition from its context element. If there is no valid context element, then this value will result in no paint being used for the stroke.
## Examples
>
### Basic color stroking
In this example, we create two different shapes, a circle and a rectangle, which are part of a `<g>` (group) that has a gray stroke color as a default for the two shapes.
    
    <svg>
      <g fill="none" stroke="gray" stroke-width="10">
        <circle cx="100" cy="100" r="40" />
        <rect x="20" y="20" width="80" height="80" />
      </g>
    </svg>
    
Via CSS, we then apply a dusky purple color to the rectangle and a red to the circle.
    
    rect {
      stroke: rebeccapurple;
    }
    circle {
      stroke: red;
    }
    
### Pattern stroking
This example uses the same group and shapes (with the circle moved over a bit) as seen in the previous example, but also has an SVG pattern defined.
    
    <svg>
      <g fill="none" stroke="gray" stroke-width="23">
        <circle cx="150" cy="90" r="40" />
        <rect x="20" y="20" width="80" height="80" />
      </g>
      <defs>
        <pattern id="star" viewBox="0,0,10,10" width="10%" height="10%">
          <polygon points="0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2" />
        </pattern>
      </defs>
    </svg>
    
The pattern is then referenced in the CSS with a URL value pointing to the ID of the pattern. This pattern is applied to both shapes as a stroking paint, with the result shown.
    
    rect,
    circle {
      stroke: url("#star");
    }
    
The pattern is drawn relative to the shapes' bounding boxes, which can lead to visual interference where they overlap, because parts of the pattern are transparent.
### SVG versus CSS gradients
Here, we once again use the same group-and-shapes markup as the first example, but also add a definition for an SVG gradient.
    
    <svg>
      <g fill="none" stroke="gray" stroke-width="10">
        <circle cx="100" cy="100" r="40" />
        <rect x="20" y="20" width="80" height="80" />
      </g>
      <defs>
        <linearGradient id="greenwhite">
          <stop offset="0%" stop-color="green" />
          <stop offset="100%" stop-color="white" />
        </linearGradient>
      </defs>
    </svg>
    
In the CSS, we apply that SVG gradient to the rectangle using a URL value pointing to the ID of the linear gradient. To the circle, we apply a CSS linear gradient that is equivalent in intent to the SVG gradient.
    
    rect {
      stroke: url("#greenwhite");
    }
    circle {
      stroke: linear-gradient(90deg, green, white);
    }
    
Only the rectangle receives a gradient stroke, whereas the circle falls back to the gray stroke set by the group element. This happens because CSS gradients are not valid values for the `stroke` property, whereas URL references to SVG gradients are permitted.
### Contextual stroking
In this case, we again start with a group element, inside of which two rectangle-shaped paths are defined. After that, a linear gradient and an SVG marker are defined.
    
    <svg>
      <g fill="none" stroke="gray" stroke-width="4">
        <path d="M 20,20 l 180,0 0,100 -180,0 z" />
        <path d="M 100,40 l 180,0 0,100 -180,0 z" />
      </g>
      <defs>
        <linearGradient id="orangered">
          <stop offset="0%" stop-color="orange" />
          <stop offset="100%" stop-color="red" />
        </linearGradient>
        <marker
          id="circle"
          markerWidth="20"
          markerHeight="20"
          refX="10"
          refY="10"
          markerUnits="userSpaceOnUse">
          <circle
            cx="10"
            cy="10"
            r="8"
            stroke-width="4"
            stroke="none"
            fill="none" />
        </marker>
      </defs>
    </svg>
    
We then write CSS to add a marker to both paths, and also to have a dusky purple stroke color. This is overridden for the second path, which is given a URL value to apply the orange-to-red gradient as its stroke. Finally, we set the circle element in the marker element to have a stroke value of `context-stroke`.
    
    path {
      stroke: rebeccapurple;
      marker: url("#circle");
    }
    path:nth-of-type(2) {
      stroke: url("#orangered");
    }
    marker circle {
      stroke: context-stroke;
    }
    
Because `stroke-context` is being applied to an element that descends from a `<marker>` element, the context element for every circle is the element that called the `<marker>` element; that is, the `<path>` elements. The result is that the markers on the first path use the color of the calling path, and are purple. The markers on the second path, by contrast, use the same orange-to-red SVG gradient the path uses. This latter case illustrates how SVG gradients are applied as a single gradient to the entire shape, rather than being applied independently to each individual part of the shape.
# ::view-transition-group()
The `::view-transition-group()` CSS pseudo-element represents a single view transition snapshot group.
During a view transition, `::view-transition-group()` is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree. It is only ever a child of `::view-transition`, and has a `::view-transition-image-pair()` as a child.
`::view-transition-group()` is given the following default styling in the UA stylesheet:
    
    :root::view-transition-group(*) {
      position: absolute;
      top: 0;
      left: 0;
    
      animation-duration: 0.25s;
      animation-fill-mode: both;
    }
    
By default, selected elements initially mirror the size and position of the `::view-transition-old()` pseudo-element representing the "old" view state, or the `::view-transition-new()` pseudo-element representing the "new" view state if there isn't an "old" view state.
If there's both an "old" and "new" view state, styles in the view transition style sheet animate this pseudo-element's `width` and `height` from the size of the "old" view state's border box to that of the "new" view state's border box.
Note: View transition styles are dynamically generated during the view transition; see the specification setup transition pseudo-elements and update pseudo-element styles sections for more details.
In addition, the element's transform is animated from the "old" view state's screen space transform to the new view state's screen space transform. This style is generated dynamically since the values of animated properties are determined at the time that the transition begins.
## Syntax
    
    ::view-transition-group([ <pt-name-selector> <pt-class-selector>? ] | <pt-class-selector>) {
      /* ... */
    }
    
### Parameters
`*`
    
The universal selector (`*`); selects all view transition groups on a page.
`root`
    
The `view-transition-name` applied to `:root` causes the pseudo-element to match the default `root` view transition group. This is the snapshot group created by the user agent to contain the view transition for the overall page. This group includes any element not assigned to its own specific view transition snapshot group via the `view-transition-name` property.
`<pt-name-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-name` property.
`<pt-class-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-class` property, preceded by a period (`.`).
The `specificity` of the named view transition pseudo-element is equal to the specificity of the type selector, unless the parameter used is the universal selector is used, in which case the specificity is zero.
## Examples
    
    ::view-transition-group(embed-container) {
      animation-duration: 0.3s;
      animation-timing-function: ease;
      z-index: 1;
    }
    
    ::view-transition-group(.card) {
      animation-duration: 1s;
    }
    
# CSS counter styles
The CSS counter styles module lets you define your own counter styles to manage the appearance of markers in lists and counters in generated content. It also enables you to extend native browser list styles with your own customizations.
While we think of counters as numbers, they are actually strings with components that can be incremented. The counter styles module defines the `@counter-style` rule with ten descriptors, which enable developers to precisely define how counters are converted into strings. This module enables defining which characters to use for the counter bullets, the prefix to put before the counter and postfix that comes after, along with how to handle negative values. The descriptors can also set a range to limit the values a counter style can handle, while also providing fallback styles for when the counter value falls outside the defined range or otherwise can't render the counter value. The module also enables defining how the counter is read out loud by speech synthesizers.
## Reference
>
### Properties
No properties are defined in this module
### Functions
  * `symbols()`


### Data types
  * `<counter-style-name>`
  * `<symbol>`
  * `<symbols-type>`


### At-rules and descriptors
  * `@counter-style`
    * `system`
    * `symbols`
    * `additive-symbols`
    * `negative`
    * `prefix`
    * `suffix`
    * `range`
    * `pad`
    * `speak-as`
    * `fallback`


### Interfaces
  * `CSSCounterStyleRule` interface


## Guides
Using CSS counters
    
Describes how to use counters to number any HTML element or to perform complex counting.
## Related concepts
CSS lists and counters module:
  * `counter-increment` property
  * `counter-reset` property
  * `counter-set` property
  * `list-style-type` property
  * `list-style` shorthand property
  * `counter()` function
  * `counters()` function


CSS pseudo-elements module:
  * `::after` pseudo-element
  * `::before` pseudo-element
  * `::marker` pseudo-element


CSS generated content module:
  * `content` property


# calc-size()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `calc-size()` CSS function allows you to perform calculations on intrinsic size values such as `auto`, `fit-content`, and `max-content`; this is not supported by the regular `calc()` function.
`calc-size()` return values can also be interpolated, enabling size keyword values to be used in animations and transitions. In effect, including `calc-size()` in a property value automatically applies `interpolate-size: allow-keywords` to the selection.
Note however that `interpolate-size` is inherited, therefore applying it to an element enables interpolation of intrinsic size keywords for every property applied to that element and its children. As a result, `interpolate-size` is the preferred solution for enabling intrinsic size animations. You should only use `calc-size()` to enable intrinsic size animations if they also require calculations.
## Syntax
    
    /* Pass a value through calc-size() */
    calc-size(auto, size)
    calc-size(fit-content, size)
    
    /* Perform a calculation */
    calc-size(min-content, size + 100px)
    calc-size(fit-content, size / 2)
    
    /* Calculation including a function */
    calc-size(auto, round(up, size, 50px))
    
### Parameters
The `calc-size()` function's syntax is as follows:
    
    calc-size(<calc-size-basis>, <calc-sum>)
    
The parameters are:
`<calc-size-basis>`
    
The value (most commonly an intrinsic size) that you want to perform a calculation on.
`<calc-sum>`
    
An expression that defines the calculation to be performed on the `<calc-size-basis>`.
### Return value
Returns a value equal to the `<calc-size-basis>` modified by the `<calc-sum>` expression. As the `<calc-size-basis>` value is an intrinsic size value, the return value is a modified intrinsic size value that behaves like the intrinsic size value input into the function.
## Description
Certain browser layout algorithms have special behaviors for intrinsic sizing keywords. The `calc-size()` function is explicitly defined to represent an intrinsic size rather than a `<length-percentage>`, thereby enforcing correctness. `calc-size()` enables calculations to be performed on intrinsic size values in a safe, well-defined manner.
### Valid values for the first argument (`<calc-size-basis>`)
The first `calc-size()` argument can be one of the following intrinsic values:
  * `auto`
  * `min-content`
  * `max-content`
  * `fit-content`
  * `content` (for containers sized using `flex-basis`).


There are also a few special values that this argument can take:
  * A nested `calc-size()` value. This isn't something you'd be likely to do very often, but it is available ensuring using a CSS variable as the `<calc-size-basis>` will always work, provided the variable is a valid value for the property `calc-size()` is being set on. So for example, this will work:
        section {
          height: calc-size(calc-size(max-content, size), size + 2rem);
        }
        
As will this:
        :root {
          --intrinsic-size: calc-size(max-content, size);
        }
        
        section {
          height: calc-size(var(--intrinsic-size), size + 2rem);
        }
        
  * Another `<calc-sum>`, with the same restrictions as the `<calc-sum>` specified for the second argument, except that the `size` keyword cannot be included. You likely will not do this, as you are no longer doing a calculation on an intrinsic size value, but if a custom property value is a `<calc-sum>`, the function will still work. For example, this will work directly or if you use a custom property with a value of `300px + 2rem`:
        section {
          height: calc-size(300px + 2rem, size / 2);
        }
        
  * The keyword `any`, which represents an unspecified definite size. In this case, the `size` keyword cannot be included in the second argument, and the `calc-size()` returns the result of the second argument calculation. For example:
        section {
          height: calc-size(any, 300px * 1.5); /* Returns 450px */
        }
        


Mixing different intrinsic sizes together in the same calculation doesn't work. For example, `max-content - min-content` doesn't make sense. `calc-size()` only allows a single intrinsic size value in each calculation, avoiding this problem.
### Valid values for the second argument (`<calc-sum>`)
The second `calc-size()` argument is a `<calc-sum>` expression.
In this expression:
  * The keyword `size` represents the `<calc-size-basis>` specified as the first argument.
  * Operands can include `size`, and any value types that make sense in the context.
  * The `+`, `-`, `*`, and `/` operators can be included.
  * Other mathematical functions can be included such as `round()`, `max()`, or even a nested `calc-size()`.
  * The overall expression must match `<length-percentage>`, and resolve to a `<length>`.


### Enabling animation of intrinsic size values
`calc-size()` return values can be interpolated, enabling animations between a `<length-percentage>` value and a `calc-size()` intrinsic size return value.
Note: You should avoid animating box model properties if possible, to cut down on layout events and mitigate the resulting impact on performance (see Critical rendering path > Layout).
For example, you could use a transition to animate a container `width` between `0` and `auto` like so:
    
    section {
      width: 0;
      transition: width ease 1s;
    }
    
    section:hover,
    section:focus {
      width: calc-size(auto, size);
    }
    
In the above case, we are not calculating anything — we are putting `auto` into `calc-size()` and returning it unchanged. The `interpolate-size` property makes animations like the above simpler to implement in most cases, especially when there are multiple animations to consider. It is inherited and therefore only needs to be declared once on an ancestor property, meaning we could have transitioned between `0` and `auto` without using `calc-size()`.
The `calc-size()` function should only be used to enable intrinsic size animations if they also require calculations. For example, in the following case we are animating the `width` and applying a calculation to the intrinsic size end state:
    
    section {
      width: 0;
      transition: width ease 1s;
    }
    
    section:hover,
    section:focus {
      width: calc-size(auto, size + 2rem);
    }
    
One case in which `calc-size()` is useful is when you want to animate between an intrinsic size and a modified version of the same intrinsic size. This is not possible with `interpolate-size` and `calc()`. For example, the following `@keyframes` definition animates a container `width` between `fit-content` and 70% of the `fit-content`.
    
    @keyframes narrower {
      from {
        width: fit-content;
      }
    
      to {
        width: calc-size(fit-content, size * 0.7);
      }
    }
    
Note: Note that `calc-size()` does not enable animating between two different intrinsic size values.
## Examples
>
### Basic `calc-size` usage
This example shows basic dimension sizing of a container using `calc-size()`
#### HTML
The HTML contains a single `<section>` element that contains some child content.
    
    <section>
      <h2>Favorite quote</h2>
    
      <p>
        Fashion is something so ugly it has to be changed every fifteen minutes.
      </p>
    </section>
    
#### CSS
In the CSS, we use flexbox to center the child elements inside the `<section>`, and set the `width` and `height` of the `<section>` to `calc-size()` functions. The `width` is set equal to `fit-content` plus `6rem`. The `height` is set to `auto` multiplied by two.
    
    section {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    
      width: calc-size(fit-content, size + 6rem);
      height: calc-size(auto, size * 2);
    }
    
The rest of the CSS has been hidden for brevity.
#### Result
We've created some horizontal and vertical space for the text to be centered in, without the use of padding.
### Basic `calc-size` animations
This example demonstrates how to use `calc-size()` to animate between a specific size and an intrinsic size. The demo features a character badge/"name tag", which can be hovered or focused to reveal information about the character. The reveal is handled by a `height` transition between a set length and `max-content`.
#### HTML
The HTML contains a single `<section>` element with `tabindex="0"` set on it so it can receive keyboard focus. The `<section>` contains `<header>` and `<main>` elements, each with their own child content.
    
    <section tabindex="0">
      <header>
        <h2>Chris Mills</h2>
      </header>
      <main>
        <p>Chris is the silent phantom of MDN.</p>
        <ul>
          <li><strong>Height</strong>: 3.03m</li>
          <li><strong>Weight</strong>: 160kg</li>
          <li><strong>Tech Fu</strong>: 7</li>
          <li><strong>Bad Jokes</strong>: 9</li>
        </ul>
      </main>
    </section>
    
#### CSS
In the CSS, we set the `<section>`'s `height` to `2.5rem` and `overflow` to `hidden` so only the `<header>` is shown by default, then specify a `transition` that animates the `<section>` `height` over 1 second during state changes. Finally, we set the `<section>` `height` to a `calc-size()` function call on `:hover` and `:focus`. The function return value is the equivalent of `max-content` \+ `2rem`.
    
    section {
      height: 2.5rem;
      overflow: hidden;
      transition: height ease 1s;
    }
    
    section:hover,
    section:focus {
      height: calc-size(max-content, size + 2rem);
    }
    
The rest of the CSS has been hidden for brevity.
#### Result
Try hovering over the `<section>` or focusing it via the keyboard — it will animate to its full height + 2rem, revealing all the content with 2rems of extra space at the bottom.
### Adjusting reading width based on `fit-content`
This example shows a container with text inside it, and a button that can be clicked to make the container width narrower or wider depending on reading preference.
#### HTML
The HTML contains a single `<section>` element containing child text content, plus a `<button>` to change the `<section>` width.
    
    <section class="easy-reader">
      <h2>Easy reader</h2>
    
      <p>
        Eius velit aperiam ipsa. Deleniti eum excepturi ut magni maxime maxime
        beatae. Dicta aperiam est laudantium ut illum facere qui officiis. Sunt
        deleniti quam id. Quis sunt voluptatem praesentium minima dolorum autem
        consequatur velit.
      </p>
    
      <p>
        Vitae ab incidunt velit aspernatur deleniti distinctio rerum. Et natus sed
        et quos mollitia quia quod. Quae officia ex ea. Ducimus ut voluptatem et et
        debitis. Quidem provident laboriosam exercitationem similique deleniti.
        Temporibus vel veniam mollitia magni unde a nostrum.
      </p>
    
      <button class="width-adjust">Narrower</button>
    </section>
    
#### CSS
In the CSS, we set the `<section>`'s `width` to a default of `fit-content`. We then define two sets of `@keyframes`, `narrower`, which animates from `fit-content` to 70% of `fit-content` (calculated using `calc-size()`), and `wider`, which animates the same values but in the opposite direction. Finally, we attach those animations to two classes — `.narrower` and `.wider`. Each animation is defined to last one second and to keep the final state applied once finished.
    
    section {
      width: fit-content;
    }
    
    @keyframes narrower {
      from {
        width: fit-content;
      }
    
      to {
        width: calc-size(fit-content, size * 0.7);
      }
    }
    
    @keyframes wider {
      from {
        width: calc-size(fit-content, size * 0.7);
      }
    
      to {
        width: fit-content;
      }
    }
    
    .narrower {
      animation: narrower 1s ease forwards;
    }
    
    .wider {
      animation: wider 1s ease forwards;
    }
    
The rest of the CSS has been hidden for brevity.
#### JavaScript
The JavaScript provides a narrower/wider toggle that applies the relevant class to the `<section>` when the button is clicked:
    
    const widthAdjustBtn = document.querySelector(".width-adjust");
    const easyReader = document.querySelector(".easy-reader");
    
    widthAdjustBtn.addEventListener("click", () => {
      if (easyReader.classList.length === 1) {
        easyReader.classList.add("narrower");
        widthAdjustBtn.textContent = "Wider";
      } else if (easyReader.classList.contains("wider")) {
        easyReader.classList.replace("wider", "narrower");
        widthAdjustBtn.textContent = "Wider";
      } else if (easyReader.classList.contains("narrower")) {
        easyReader.classList.replace("narrower", "wider");
        widthAdjustBtn.textContent = "Narrower";
      }
    });
    
#### Result
Try clicking the `<button>` a few times to adjust the `<section>` between the wide and narrow reading width, achieved by manipulating the `width` based on the `fit-content` value.
### Using a function inside the `calc-size()` function
As mentioned earlier, it is possible to use another function inside `calc-size()`. This example sets `field-sizing: content` on `<input>` elements to make them as wide as the entered content, and then uses a `max()` function inside `calc-size()` to ensure that the `<input>`s are at least a minimum size, and only start to grow when the entered text becomes wider than that size — by being set to `fit-content` plus `20px`.
#### HTML
The HTML contains a `<form>` element containing three textual `<input>` types. Each `<input>` has a `<label>` associated with it to make the form accessible, and a `maxlength` applied to stop entered values getting long enough to break the form layout.
    
    <form>
      <div>
        <label for="name">Name:</label>
        <input type="text" id="name" name="name" maxlength="48" />
      </div>
      <div>
        <label for="email">Email:</label>
        <input type="email" id="email" name="email" maxlength="48" />
      </div>
      <div>
        <label for="address">Address:</label>
        <input type="text" id="address" name="address" maxlength="60" />
      </div>
    </form>
    
#### CSS
In the CSS, we set the `width` of the `<label>` elements to `100px`. We set `field-sizing: content` on the `<input>` elements to make them as wide as the entered content — by default they would no width because nothing would be entered into them. To counteract this, we set their `width` values to `calc-size(fit-content, max(100px, size + 20px))`. This means that they are a minimum of `100px` wide, even with no value entered. When an entered value becomes wider than `100px`, their `width` changes to `fit-content` plus `20px`, which means they start to grow with the content size but keep a `20px` gap on the right-hand side.
    
    label {
      width: 100px;
    }
    
    input {
      field-sizing: content;
      width: calc-size(fit-content, max(100px, size + 20px));
    }
    
The rest of the CSS has been hidden for brevity.
#### Result
Try entering some text inside the form inputs, and see how they grow when the values start to become as wide as the minimum width enforced by the `max()` function.
# ID selectors
The CSS ID selector matches an element based on the value of the element's `id` attribute. In order for the element to be selected, its `id` attribute must match exactly the value given in the selector.
    
    /* The element with id="demo" */
    #demo {
      border: red 2px solid;
    }
    
## Syntax
    
    #id_value {
      /* … */
    }
    
Note that syntactically (but not specificity-wise), this is equivalent to the following attribute selector:
    
    [id="id_value"] {
      /* … */
    }
    
The `id_value` value must be a valid CSS identifier. HTML `id` attributes which are not valid CSS identifiers must be escaped before they can be used in ID selectors.
## Examples
>
### Valid ID selectors
#### HTML
    
    <p id="blue">This paragraph has a blue background.</p>
    <p>This is just a regular paragraph.</p>
    
    
    <!-- The next two paragraphs have id attributes
    that contain characters which must be escaped in CSS -->
    
    <p id="item?one">This paragraph has a pink background.</p>
    <p id="123item">This paragraph has a yellow background.</p>
    
#### CSS
    
    #blue {
      background-color: skyblue;
    }
    
    
    /* In the next two rules, the id attributes must be escaped */
    
    #item\?one {
      background-color: pink;
    }
    
    #\00003123item {
      background-color: yellow;
    }
    
#### Result
### Invalid ID selectors
The ID selectors in the following rules are not valid CSS identifiers, and will be ignored.
    
    #item?one {
      background-color: green;
    }
    
    #123item {
      background-color: green;
    }
    
# counter()
The `counter()` CSS function returns a string representing the current value of the named counter, if there is one.
The `counter()` function is generally used within pseudo-element through the `content` property but, theoretically, it can be used wherever a `<string>` value is supported.
## Try it
    
    .double-list {
      counter-reset: count -1;
    }
    
    .double-list li {
      counter-increment: count 2;
    }
    
    .double-list li::marker {
      content: counter(count, decimal) ") ";
    }
    
    
    <p>Best Dynamic Duos in Sports:</p>
    <ol class="double-list">
      <li>Simone Biles + Jonathan Owens</li>
      <li>Serena Williams + Venus Williams</li>
      <li>Aaron Judge + Giancarlo Stanton</li>
      <li>LeBron James + Dwyane Wade</li>
      <li>Xavi Hernandez + Andres Iniesta</li>
    </ol>
    
## Syntax
    
    /* Basic usage */
    counter(counter-name);
    
    /* changing the counter display */
    counter(counter-name, upper-roman)
    
Counters have no visible effect by themselves. The `counter()` and `counters()` functions are what make counters useful by returning developer-defined strings (or images).
### Values
The `counter()` function accepts up to two parameters. The first parameter is the `<counter-name>`. The optional second parameter is the `<counter-style>`.
`<counter-name>`
    
A `<custom-ident>` identifying the counter, which is the same case-sensitive name used with the `counter-reset` and `counter-increment` property values. The counter name cannot start with two dashes and can't be `none`, `unset`, `initial`, or `inherit`.
`<counter-style>`
    
A `<list-style-type>` name, `<@counter-style>` name or `symbols()` function, where a counter style name is a `numeric`, `alphabetic`, or `symbolic` predefined counter style, a complex longhand east Asian or Ethiopic predefined counter style, or other predefined counter style. If omitted, the counter-style defaults to `decimal`.
Note: To join the counter values when nesting counters, use the `counters()` function, which provides an additional `<string>` parameter.
## Examples
>
### lower-roman compared to lower-alpha
In this example, we display a counter using `lower-roman` and `lower-alpha` list styles.
#### HTML
    
    <ol>
      <li></li>
      <li></li>
      <li></li>
    </ol>
    
#### CSS
    
    ol {
      counter-reset: count;
    }
    li {
      counter-increment: count;
    }
    li::after {
      content:
        "[" counter(count, lower-roman) "] == ["
        counter(count, lower-alpha) "]";
    }
    
#### Result
### Displaying a counter using three styles
In this example, we use the `counter()` function three times.
#### HTML
    
    <ol>
      <li></li>
      <li></li>
      <li></li>
    </ol>
    
#### CSS
We include the `counter()` function with three different counter styles, including the default decimal value. We've added padding to the list to provide space for the long `::marker` string.
    
    ol {
      counter-reset: listCounter;
      padding-left: 5em;
    }
    li {
      counter-increment: listCounter;
    }
    li::marker {
      content:
        "Item #" counter(listCounter) " is: ";
    }
    li::after {
      content:
        "[" counter(listCounter, decimal-leading-zero) "] == ["
        counter(listCounter, upper-roman) "]";
    }
    
#### Result
# content-visibility
The `content-visibility` CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed. It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster.
Note: The `contentvisibilityautostatechange` event fires on any element with `content-visibility: auto` set on it when its rendering work starts or stops being skipped. This provides a convenient way for an app's code to start or stop rendering processes (e.g., drawing on a `<canvas>`) when they are not needed, thereby conserving processing power.
## Try it
    
    content-visibility: visible;
    
    
    content-visibility: hidden;
    
    
    <section class="default-example" id="default-example">
      <div class="container" id="example-element">
        <div class="child">
          <span>This is an inner div</span>
        </div>
      </div>
    </section>
    
    
    .container {
      width: 140px;
      height: 140px;
      border: 3px solid rgb(64 28 163);
      background-color: rgb(135 136 184);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .child {
      border: 3px solid rgb(64 28 163);
      background-color: wheat;
      color: black;
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
## Syntax
    
    /* Keyword values */
    content-visibility: visible;
    content-visibility: hidden;
    content-visibility: auto;
    
    /* Global values */
    content-visibility: inherit;
    content-visibility: initial;
    content-visibility: revert;
    content-visibility: revert-layer;
    content-visibility: unset;
    
### Values
`visible`
    
No effect. The element's contents are laid out and rendered as normal. This is the default value.
`hidden`
    
The element skips its contents. The skipped contents must not be accessible to user-agent features, such as find-in-page, tab-order navigation, etc., nor be selectable or focusable. This is similar to giving the contents `display: none`.
`auto`
    
The element turns on layout containment, style containment, and paint containment. If the element is not relevant to the user, it also skips its contents. Unlike hidden, the skipped contents must still be available as normal to user-agent features such as find-in-page, tab order navigation, etc., and must be focusable and selectable as normal.
## Description
>
### Animating and transitioning content-visibility
Supporting browsers animate/transition `content-visibility` with a variation on the discrete animation type.
Discrete animation generally means that the property will flip between two values 50% of the way through the animation. In the case of `content-visibility`, however, the browser will flip between the two values to show the animated content for the entire animation duration. So, for example:
  * When animating `content-visibility` from `hidden` to `visible`, the value will flip to `visible` at `0%` of the animation duration so it is visible throughout.
  * When animating `content-visibility` from `visible` to `hidden`, the value will flip to `hidden` at `100%` of the animation duration so it is visible throughout.


This behavior is useful for creating entry/exit animations where you want to, for example, remove some content from the DOM with `content-visibility: hidden`, but you want a smooth transition (such as a fade-out) rather than it disappearing immediately.
When animating `content-visibility` with CSS transitions, `transition-behavior: allow-discrete` needs to be set on `content-visibility`. This effectively enables `content-visibility` transitions.
Note: When transitioning an element's `content-visibility` value, you don't need to provide a set of starting values for transitioned properties using a `@starting-style` block, like you do when transitioning `display`. This is because `content-visibility` doesn't hide an element from the DOM like `display` does: it just skips rendering the element's content.
## Accessibility
Off-screen content within a `content-visibility: auto` property remains in the document object model and the accessibility tree. This allows improving page performance with `content-visibility: auto` without negatively impacting accessibility.
Since styles for off-screen content are not rendered, elements intentionally hidden with `display: none` or `visibility: hidden` will still appear in the accessibility tree. If you don't want an element to appear in the accessibility tree, use `aria-hidden="true"`.
## Examples
>
### Using auto to reduce rendering cost of long pages
The following example shows the use of `content-visibility: auto` to skip painting and rendering of off-screen sections. When a `section` is out of the viewport then the painting of the content is skipped until the section comes close to the viewport, this helps with both load and interactions on the page.
#### HTML
    
    <section>
      <!-- Content for each section… -->
    </section>
    <section>
      <!-- Content for each section… -->
    </section>
    <section>
      <!-- Content for each section… -->
    </section>
    <!-- … -->
    
#### CSS
The `contain-intrinsic-size` property adds a default size of 500px to the height and width of each `section` element. After a section is rendered, it will retain its rendered intrinsic size, even when it is scrolled out of the viewport.
    
    section {
      content-visibility: auto;
      contain-intrinsic-size: auto 500px;
    }
    
### Using hidden to manage visibility
The following example shows how to manage content visibility with JavaScript. Using `content-visibility: hidden;` instead of `display: none;` preserves the rendering state of content when hidden and rendering is faster.
#### HTML
    
    <div class="hidden">
      <button class="toggle">Show</button>
      <p>
        This content is initially hidden and can be shown by clicking the button.
      </p>
    </div>
    <div class="visible">
      <button class="toggle">Hide</button>
      <p>
        This content is initially visible and can be hidden by clicking the button.
      </p>
    </div>
    
#### CSS
The `content-visibility` property is set on paragraphs that are direct children of elements with the `visible` and `hidden` classes. In our example, we can show and hide content in paragraphs depending on the CSS class of parent div elements.
The `contain-intrinsic-size` property is included to represent the content size. This helps to reduce layout shift when content is hidden.
    
    p {
      contain-intrinsic-size: 0 1.1em;
      border: dotted 2px;
    }
    
    .hidden > p {
      content-visibility: hidden;
    }
    
    .visible > p {
      content-visibility: visible;
    }
    
#### JavaScript
    
    const handleClick = (event) => {
      const button = event.target;
      const div = button.parentElement;
      button.textContent = div.classList.contains("visible") ? "Show" : "Hide";
      div.classList.toggle("hidden");
      div.classList.toggle("visible");
    };
    
    document.querySelectorAll("button.toggle").forEach((button) => {
      button.addEventListener("click", handleClick);
    });
    
#### Result
### Animating content-visibility
In this example, we have a `<div>` element, the content of which can be toggled between shown and hidden by clicking or pressing any key.
#### HTML
    
    <p>
      Click anywhere on the screen or press any key to toggle the
      <code>&lt;div&gt;</code> content between hidden and showing.
    </p>
    
    <div>
      This is a <code>&lt;div&gt;</code> element that animates between
      <code>content-visibility: hidden;</code>and
      <code>content-visibility: visible;</code>. We've also animated the text color
      to create a smooth animation effect.
    </div>
    
#### CSS
In the CSS we initially set `content-visibility: hidden;` on the `<div>` to hide its content. We then set up `@keyframes` animations and attach them to classes to show and hide the `<div>`, animating `content-visibility` and `color` so that you get a smooth animation effect as the content is shown/hidden.
    
    div {
      font-size: 1.6rem;
      padding: 20px;
      border: 3px solid red;
      border-radius: 20px;
      width: 480px;
    
      content-visibility: hidden;
    }
    
    /* Animation classes */
    
    .show {
      animation: show 0.7s ease-in forwards;
    }
    
    .hide {
      animation: hide 0.7s ease-out forwards;
    }
    
    /* Animation keyframes */
    
    @keyframes show {
      0% {
        content-visibility: hidden;
        color: transparent;
      }
    
      100% {
        content-visibility: visible;
        color: black;
      }
    }
    
    @keyframes hide {
      0% {
        content-visibility: visible;
        color: black;
      }
    
      100% {
        content-visibility: hidden;
        color: transparent;
      }
    }
    
#### JavaScript
Finally, we use JavaScript to apply the `.show` and `.hide` classes to the `<div>` as appropriate to apply the animations as it is toggled between shown and hidden states.
    
    const divElem = document.querySelector("div");
    const htmlElem = document.querySelector(":root");
    
    htmlElem.addEventListener("click", showHide);
    document.addEventListener("keydown", showHide);
    
    function showHide() {
      if (divElem.classList.contains("show")) {
        divElem.classList.remove("show");
        divElem.classList.add("hide");
      } else {
        divElem.classList.remove("hide");
        divElem.classList.add("show");
      }
    }
    
#### Result
The rendered result looks like this:
# <custom-ident>
The `<custom-ident>` CSS data type denotes an arbitrary user-defined string used as an identifier. It is case-sensitive, and certain values are forbidden in various contexts to prevent ambiguity.
## Syntax
The syntax of `<custom-ident>` is similar to CSS identifiers (such as property names), except that it is case-sensitive. It consists of one or more characters, where characters can be any of the following:
  * any alphabetical character (`A` to `Z`, or `a` to `z`),
  * any decimal digit (`0` to `9`),
  * a hyphen (`-`),
  * an underscore (`_`),
  * an escaped character (preceded by a backslash, `\`),
  * a Unicode character (in the format of a backslash, `\`, followed by one to six hexadecimal digits, representing its Unicode code point)


Note that `id1`, `Id1`, `iD1`, and `ID1` are all different identifiers as they are case-sensitive.
### Escaping characters
Any Unicode code point can be included as part of a `<custom-ident>` or quoted `<string>` by escaping it.
In CSS, there are several ways to escape a character. Escape sequences start with a backslash (`\`), and continue with:
  * One to six hex (`ABCDEF0123456789`) digits. The hex digits can optionally be followed by white space. The hex escape sequence gets replaced by the Unicode code point whose value is given by those digits. The whitespace allows the sequences to be followed by actual hex digits (versus replaced ones).
  * Any Unicode code point that is not a hex digit or a newline character.


Examples:
  * "&B" can be written as `\26 B` or `\000026B`.
  * "hi.there" can be written as `hi\.there` or `hi\002Ethere`.
  * "toto?" can be written as `toto\?`, `toto\3F`, or `toto\00003F`.


To include actual white space after an escape sequence, include two white spaces in the escape sequence.
### Forbidden values
A `<custom-ident>` must not be placed between single or double quotes as this would be identical to a `<string>`. Moreover, the first character must not be a decimal digit, nor a hyphen (`-`) followed by a decimal digit.
To prevent ambiguity, each property that uses `<custom-ident>` forbids the use of specific values:
`animation-name`
    
Forbids the global CSS values (`unset`, `initial`, and `inherit`), as well as `none`.
`counter-reset`, `counter-increment`
    
Forbids the global CSS values (`unset`, `initial`, and `inherit`), as well as `none`.
`@counter-style`, `list-style-type`
    
Forbids the global CSS values (`unset`, `initial`, and `inherit`), as well as the values:
  * `none`
  * `inline`
  * `outside`


Also, quite a few predefined values are implemented by the different browsers:
  * `disc`
  * `circle`
  * `square`
  * `decimal`
  * `cjk-decimal`
  * `decimal-leading-zero`
  * `lower-roman`
  * `upper-roman`
  * `lower-greek`
  * `lower-alpha`
  * `lower-latin`
  * `upper-alpha`
  * `upper-latin`
  * `arabic-indic`
  * `armenian`
  * `bengali`
  * `cambodian`
  * `cjk-earthly-branch`
  * `cjk-heavenly-stem`
  * `cjk-ideographic`
  * `devanagari`
  * `ethiopic-numeric`
  * `georgian`
  * `gujarati`
  * `gurmukhi`
  * `hebrew`
  * `hiragana`
  * `hiragana-iroha`
  * `japanese-formal`
  * `japanese-informal`
  * `kannada`
  * `katakana`
  * `katakana-iroha`
  * `khmer`
  * `korean-hangul-formal`
  * `korean-hanja-formal`
  * `korean-hanja-informal`
  * `lao`
  * `lower-armenian`
  * `malayalam`
  * `mongolian`
  * `myanmar`
  * `oriya`
  * `persian`
  * `simp-chinese-formal`
  * `simp-chinese-informal`
  * `tamil`
  * `telugu`
  * `thai`
  * `tibetan`
  * `trad-chinese-formal`
  * `trad-chinese-informal`
  * `upper-armenian`
  * `disclosure-open`
  * `disclosure-close`


`grid-row-start`, `grid-row-end`, `grid-column-start`, `grid-column-end`, `grid-template-rows`, `grid-template-columns`
    
Forbids the `span` and `auto` values.
`view-transition-name`
    
Forbids the global CSS values (`unset`, `initial`, and `inherit`), as well as `none`.
`will-change`
    
Forbids the global CSS values (`unset`, `initial`, and `inherit`), as well as the values `will-change`, `auto`, `scroll-position`, and `contents`.
## Examples
>
### Valid identifiers
    
    nono79            A mix of alphanumeric characters and numbers
    ground-level      A mix of alphanumeric characters and a dash
    -test             A dash followed by alphanumeric characters
    _internal         An underscore followed by alphanumeric characters
    \22 toto          A Unicode character followed by a sequence of alphanumeric characters
    scooby\.doo       A correctly escaped period
    
### Invalid identifiers
    
    34rem             It must not start with a decimal digit.
    -12rad            It must not start with a dash followed by a decimal digit.
    scooby.doo        Only alphanumeric characters, _, and - needn't be escaped.
    'scoobyDoo'       This would be a <string>.
    "scoobyDoo"       This would be a <string>.
    
As this type is not a real type but a convenience type used to simplify the description of allowed values, there is no browser compatibility information as such.
# counter-set
The `counter-set` CSS property sets CSS counters on the element to the given values.
If the counters don't exist the `counter-set` property creates a new counter for each named counter in the list of space-separated counter and value pairs. However, to create a new counter it is recommended to use the `counter-reset` CSS property.
If a named counter in the list is missing a value, the value of the counter will be set to `0`.
## Try it
    
    counter-set: none;
    
    
    counter-set: chapter-count 0;
    
    
    counter-set: chapter-count;
    
    
    counter-set: chapter-count 5;
    
    
    counter-set: chapter-count -5;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="chapters">
        <h1>Alice's Adventures in Wonderland</h1>
        <h2>Down the Rabbit-Hole</h2>
        <h2 id="example-element">The Pool of Tears</h2>
        <h2>A Caucus-Race and a Long Tale</h2>
        <h2>The Rabbit Sends in a Little Bill</h2>
      </div>
    </section>
    
    
    #default-example {
      text-align: left;
      counter-set: chapter-count;
    }
    
    #example-element {
      background-color: #37077c;
      color: white;
    }
    
    h2 {
      counter-increment: chapter-count;
      font-size: 1em;
    }
    
    h2::before {
      content: "Chapter " counter(chapter-count) ": ";
    }
    
Note: The counter's value can be incremented or decremented using the `counter-increment` CSS property.
## Syntax
    
    /* Set "my-counter" to 0 */
    counter-set: my-counter;
    
    /* Set "my-counter" to -1 */
    counter-set: my-counter -1;
    
    /* Set "counter1" to 1, and "counter2" to 4 */
    counter-set: counter1 1 counter2 4;
    
    /* Cancel any counter that could have been set in less specific rules */
    counter-set: none;
    
    /* Global values */
    counter-set: inherit;
    counter-set: initial;
    counter-set: revert;
    counter-set: revert-layer;
    counter-set: unset;
    
The `counter-set` property is specified as either one of the following:
  * A `<custom-ident>` naming the counter, followed optionally by an `<integer>`. You may specify as many counters to reset as you want, with each name or name-number pair separated by a space.
  * The keyword value `none`.


### Values
`<custom-ident>`
    
The name of the counter to set.
`<integer>`
    
The value to set the counter to on each occurrence of the element. Defaults to `0` if not specified. If there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of `0` (though it may then immediately set or increment that value to something different).
`none`
    
No counter set is to be performed. This can be used to override a `counter-set` defined in a less specific rule.
## Examples
>
### Setting named counters
    
    h1 {
      counter-set: chapter section 1 page;
      /* Sets the chapter and page counters to 0,
         and the section counter to 1 */
    }
    
# perspective-origin
The `perspective-origin` CSS property determines the position at which the viewer is looking. It is used as the vanishing point by the `perspective` property.
## Try it
    
    perspective-origin: center;
    
    
    perspective-origin: top;
    
    
    perspective-origin: bottom right;
    
    
    perspective-origin: -170%;
    
    
    perspective-origin: 500% 200%;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
      perspective: 550px;
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      transform-style: preserve-3d;
      perspective: 250px;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 0.7);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 0.7);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 0.7);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 0.7);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 0.7);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 0.7);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
The `perspective-origin` and `perspective` properties are attached to the parent of a child transformed in 3-dimensional space, unlike the `perspective()` transform function which is placed on the element being transformed.
## Syntax
    
    /* One-value syntax */
    perspective-origin: x-position;
    
    /* Two-value syntax */
    perspective-origin: x-position y-position;
    
    /* When both x-position and y-position are keywords,
       the following is also valid */
    perspective-origin: y-position x-position;
    
    /* Global values */
    perspective-origin: inherit;
    perspective-origin: initial;
    perspective-origin: revert;
    perspective-origin: revert-layer;
    perspective-origin: unset;
    
### Values
x-position
    
Indicates the position of the abscissa of the vanishing point. It can have one of the following values:
  * `<length-percentage>` indicating the position as an absolute length value or relative to the width of the element. The value may be negative.
  * `left`, a keyword being a shortcut for the `0` length value.
  * `center`, a keyword being a shortcut for the `50%` percentage value.
  * `right`, a keyword being a shortcut for the `100%` percentage value.


y-position
    
Indicates the position of the ordinate of the vanishing point. It can have one of the following values:
  * `<length-percentage>` indicating the position as an absolute length value or relative to the height of the element. The value may be negative.
  * `top`, a keyword being a shortcut for the `0` length value.
  * `center`, a keyword being a shortcut for the `50%` percentage value.
  * `bottom`, a keyword being a shortcut for the `100%` percentage value.


## Examples
>
### Changing the perspective origin
An example showing how to change `perspective-origin` is given in Using CSS transforms > Changing the perspective origin.
# touch-action
The `touch-action` CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser).
By default, panning (scrolling) and pinching gestures are handled exclusively by the browser. An application using Pointer events will receive a `pointercancel` event when the browser starts handling a touch gesture. By explicitly specifying which gestures should be handled by the browser, an application can supply its own behavior in `pointermove` and `pointerup` listeners for the remaining gestures. Applications using Touch events disable the browser handling of gestures by calling `preventDefault()`, but should also use `touch-action` to ensure the browser knows the intent of the application before any event listeners have been invoked.
When a gesture is started, the browser intersects the `touch-action` values of the touched element and its ancestors, up to the one that implements the gesture (in other words, the first containing scrolling element). This means that in practice, `touch-action` is typically applied only to top-level elements which have some custom behavior, without needing to specify `touch-action` explicitly on any of that element's descendants.
Note: After a gesture starts, changes to `touch-action` will not have any impact on the behavior of the current gesture.
## Syntax
    
    /* Keyword values */
    touch-action: auto;
    touch-action: none;
    touch-action: pan-x;
    touch-action: pan-left;
    touch-action: pan-right;
    touch-action: pan-y;
    touch-action: pan-up;
    touch-action: pan-down;
    touch-action: pinch-zoom;
    touch-action: manipulation;
    
    /* Global values */
    touch-action: inherit;
    touch-action: initial;
    touch-action: revert;
    touch-action: revert-layer;
    touch-action: unset;
    
The `touch-action` property may be specified as either:
  * One of the keywords `auto`, `none`, `manipulation`, or 
  * One of the keywords `pan-x`, `pan-left`, `pan-right`, and/or one of the keywords `pan-y`, `pan-up`, `pan-down`, plus optionally the keyword `pinch-zoom`.


### Values
`auto`
    
Enable browser handling of all panning and zooming gestures.
`none`
    
Disable browser handling of all panning and zooming gestures.
`pan-x`
    
Enable single-finger horizontal panning gestures. May be combined with pan-y, pan-up, pan-down and/or pinch-zoom.
`pan-y`
    
Enable single-finger vertical panning gestures. May be combined with pan-x, pan-left, pan-right and/or pinch-zoom.
`manipulation`
    
Enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. Disabling double-tap to zoom removes the need for browsers to delay the generation of click events when the user taps the screen. This is an alias for "pan-x pan-y pinch-zoom" (which, for compatibility, is itself still valid).
`pan-left`, `pan-right`, `pan-up`, `pan-down`
    
Enable single-finger gestures that begin by scrolling in the given direction(s). Once scrolling has started, the direction may still be reversed. Note that scrolling "up" (pan-up) means that the user is dragging their finger downward on the screen surface, and likewise pan-left means the user is dragging their finger to the right. Multiple directions may be combined except when there is a simpler representation (for example, "pan-left pan-right" is invalid since "pan-x" is simpler, but "pan-left pan-down" is valid).
`pinch-zoom`
    
Enable multi-finger panning and zooming of the page. This may be combined with any of the pan- values.
## Accessibility
A declaration of `touch-action: none;` may inhibit operating a browser's zooming capabilities. This will prevent people experiencing low vision conditions from being able to read and understand page content.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | Understanding WCAG 2.0


## Examples
>
### Disabling all gestures
The most common usage is to disable all gestures on an element (and its non-scrollable descendants) that provides its own dragging and zooming behavior – such as a map or game surface.
#### HTML
    
    <div id="map"></div>
    
#### CSS
    
    #map {
      height: 150vh;
      width: 70vw;
      background: linear-gradient(blue, green);
      touch-action: none;
    }
    
#### Result
# interpolate-size
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `interpolate-size` CSS property allows you to enable animations and transitions between a `<length-percentage>` value and an intrinsic size value such as `auto`, `fit-content`, or `max-content`.
This property is typically used to animate the `width` and/or `height` of a container between a `<length-percentage>` and the full size of its content (i.e., between "closed" and "open" or "hide" and "reveal" states) when animating a non-box-model CSS property, such as `transform`, is not a viable solution.
Note: The behavior opted-into by `interpolate-size` cannot be enabled by default across the web because many sites in the wild use stylesheets that assume intrinsic size values cannot be animated. Enabling it by default would cause several backwards-compatibility issues (see relevant CSS WG discussion).
## Syntax
    
    /* Keyword values */
    interpolate-size: allow-keywords;
    interpolate-size: numeric-only;
    
    /* Global values */
    interpolate-size: inherit;
    interpolate-size: initial;
    interpolate-size: revert;
    interpolate-size: revert-layer;
    interpolate-size: unset;
    
### Values
`allow-keywords`
    
Enables interpolation between a `<length-percentage>` value and an intrinsic size value, to allow animation between the two.
`numeric-only`
    
The default behavior — intrinsic size values cannot be interpolated.
## Description
Setting `interpolate-size: allow-keywords` enables interpolation between a `<length-percentage>` value and an intrinsic size value. Note that it does not enable animating between two intrinsic size values. One end of the animation must be a `<length-percentage>`.
The `interpolate-size` value is inherited, so animating to (or from) an intrinsic size value can be enabled for an entire document by setting it on the document root:
    
    :root {
      interpolate-size: allow-keywords;
    }
    
If you want to limit the scope, you can set it on the relevant container element. The following enables interpolating intrinsic sizes only for `<main>` and its descendants:
    
    main {
      interpolate-size: allow-keywords;
    }
    
Note: The `calc-size()` function's return values can also be interpolated. In effect, including `calc-size()` in a property value automatically applies `interpolate-size: allow-keywords` to the selection. However, because `interpolate-size` is inherited as explained above, it is the preferred solution for enabling intrinsic size animations in most cases. You should only use `calc-size()` to enable intrinsic size animations if they also require calculations.
### Values that can be interpolated
The following intrinsic values can currently be opted-in to animations:
  * `auto`
  * `min-content`
  * `max-content`
  * `fit-content`
  * `content` (for containers sized using `flex-basis`).


## Examples
>
### Basic `interpolate-size` usage
This example demonstrates how to set `interpolate-size: allow-keywords` on a document to enable animations involving an intrinsic size. The demo features a character badge/"name tag", which can be hovered or focused to reveal information about the character. The reveal is handled by a `height` transition between a set length and `max-content`.
#### HTML
The HTML contains a single `<section>` element with `tabindex="0"` set on it so it can receive keyboard focus. The `<section>` contains `<header>` and `<main>` elements, each with their own child content.
    
    <section tabindex="0">
      <header>
        <h2>Tanuki</h2>
      </header>
      <main>
        <p>Tanuki is the silent phantom of MDN.</p>
        <ul>
          <li><strong>Height</strong>: 3.03m</li>
          <li><strong>Weight</strong>: 160kg</li>
          <li><strong>Tech Fu</strong>: 7</li>
          <li><strong>Bad Jokes</strong>: 9</li>
        </ul>
      </main>
    </section>
    
#### CSS
In the CSS, we first set `interpolate-size: allow-keywords` on the `:root`, to enable it for the whole document.
    
    :root {
      interpolate-size: allow-keywords;
    }
    
We then set the `<section>`'s `height` to `2.5rem` and `overflow` to `hidden` so only the `<header>` is shown by default, then specify a `transition` that animates the `<section>` `height` over 1 second during state change. Finally, we set the `<section>` `height` on `:hover` and `:focus` to `max-content`.
    
    section {
      height: 2.5rem;
      overflow: hidden;
      transition: height ease 1s;
    }
    
    section:hover,
    section:focus {
      height: max-content;
    }
    
The rest of the CSS has been hidden for brevity.
#### Result
Try hovering over the `<section>` or focusing it via the keyboard — it will animate to its full height, revealing all the content.
# :open
The `:open` CSS pseudo-class represents an element that has open and closed states, only when it is currently in the open state.
## Syntax
    
    :open {
      /* ... */
    }
    
## Description
The `:open` pseudo-class selects any element currently in the open state, which includes the following elements:
  * `<details>` and `<dialog>` elements that are in an open state, that is, they have the `open` attribute set.
  * `<input>` elements that display a picker interface for the user to choose a value from (for example `<input type="color">`), when the picker is displayed.
  * `<select>` elements that display a drop-down picker for the user to choose a value from, when the picker is displayed. Note that when implementing customizable select elements, the picker itself can be selected using the `::picker(select)` pseudo-element.


Note that the open and closed states are semantic states, and don't necessary correlate with the visibility of the element in question. For example, a `<details>` element that is expanded to show its content is open, and will be selected by the `details:open` selector, even if it is hidden with a `visibility` value of `hidden`.
Popover elements (that is, elements with the `popover` attribute set on them) have distinct semantic states representing popovers that are showing or hidden, which can coexist alongside open and closed states. To target a popover element in an showing state, use the `:popover-open` pseudo-class instead.
## Examples
>
### Basic `:open` usage
This example demonstrates some of the HTML elements that have an open state.
#### CSS
    
    details:open > summary {
      background-color: pink;
    }
    
    :is(select, input):open {
      background-color: pink;
    }
    
#### HTML
    
    <details>
      <summary>Details</summary>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pulvinar dapibus
      lacus, sit amet finibus lectus mollis eu. Nullam quis orci dictum, porta lacus
      et, cursus nunc. Aenean pulvinar imperdiet neque fermentum facilisis. Nulla
      facilisi. Curabitur vitae sapien ut nunc pulvinar semper vitae vitae nisi.
    </details>
    <hr />
    
    <label for="pet-select">Choose a pet:</label>
    <select id="pet-select">
      <option value="dog">Dog</option>
      <option value="cat">Cat</option>
      <option value="hamster">Hamster</option>
    </select>
    <hr />
    
    <label for="start">Start date:</label>
    <input type="date" id="start" />
    
#### Result
### Custom `<select>` styling with `:open`
In this example, we give a basic `<select>` element some custom styling. The `:open` pseudo-class is used to apply a styling enhancement to its open state — when the dropdown menu is displayed.
#### HTML
There is nothing special about our fruit selector.
    
    <label>
      Choose your favorite fruit:
      <select name="fruit">
        <option>apple</option>
        <option>banana</option>
        <option>boysenberry</option>
        <option>cranberry</option>
        <option>fig</option>
        <option>grapefruit</option>
        <option>lemon</option>
        <option>orange</option>
        <option>papaya</option>
        <option>pomegranate</option>
        <option>tomato</option>
      </select>
    </label>
    
Note: We are not using a multi-line `<select>` (that is, one with the `multiple` attribute set) — those tend to render as a scrolling list box rather than a drop down menu, so don't have an open state.
#### CSS
In the CSS, we set an `appearance` value of `none` on our `<select>` element to remove the default OS styling from the select box, and provide some basic styles of or own. Most notably, we set an SVG background image of a down arrow on the right-hand side — users tend to recognize `<select>` elements by the down arrow, so it is a good idea to include it.
We then set some `padding` on the surrounding `<label>` element, and a transparent border to keep the layout consistent when we later add a colored border to it.
    
    select {
      appearance: none;
      width: 100%;
      display: block;
      font-family: inherit;
      font-size: 100%;
      padding: 5px;
      border: 1px solid black;
      background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='5,5 15,5 10,15'/%3E%3C/svg%3E")
        no-repeat right 3px center / 1em 1em;
    }
    
    label {
      font-family: sans-serif;
      max-width: 20em;
      display: block;
      padding: 20px;
      border: 2px solid transparent;
    }
    
When the `<select>` is opened, we use the `:open` pseudo-class to set a different background color and change the background image to an up arrow. We also set a different background color and border on the enclosing `<label>` element using a combination of the `:open` and `:has()` pseudo-classes to create a parent selector. We are literally saying "select the `<label>`, but only when its descendant `<select>` is open."
    
    select:open {
      background-color: #f8f2dc;
      background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='5,15 10,5 15,15'/%3E%3C/svg%3E");
    }
    
    label:has(select:open) {
      background-color: #81adc8;
      border-color: #cd4631;
    }
    
#### Result
The result is as follows. Try opening the `<select>` dropdown to see the effect on the styling:
# margin-block-end
The `margin-block-end` CSS property defines the logical block end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    margin-block-end: 20px;
    writing-mode: horizontal-tb;
    
    
    margin-block-end: 20px;
    writing-mode: vertical-rl;
    
    
    margin-block-end: 20%;
    writing-mode: horizontal-tb;
    
    
    margin-block-end: auto;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row">One</div>
        <div class="row transition-all" id="example-element">Two</div>
        <div class="row">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
## Syntax
    
    /* <length> values */
    margin-block-end: 10px; /* An absolute length */
    margin-block-end: 1em; /* relative to the text size */
    margin-block-end: 5%; /* relative to the nearest block container's width */
    margin-block-end: anchor-size(inline);
    margin-block-end: calc(anchor-size(--my-anchor block, 20px) / 4);
    
    /* Keyword values */
    margin-block-end: auto;
    
    /* Global values */
    margin-block-end: inherit;
    margin-block-end: initial;
    margin-block-end: revert;
    margin-block-end: revert-layer;
    margin-block-end: unset;
    
It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
It relates to `margin-block-start`, `margin-inline-start`, and `margin-inline-end`, which define the other margins of the element.
### Values
The `margin-block-end` property takes the same values as the `margin-left` property.
## Examples
>
### Setting block end margin
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      margin-block-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# line-height-step
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `line-height-step` CSS property sets the step unit for line box heights. When the property is set, line box heights are rounded up to the closest multiple of the unit.
## Syntax
    
    /* Point values */
    line-height-step: 18pt;
    
    /* Global values */
    line-height-step: inherit;
    line-height-step: initial;
    line-height-step: revert;
    line-height-step: revert-layer;
    line-height-step: unset;
    
The `line-height-step` property is specified as any one of the following:
  * a `<length>`.


### Values
`<length>`
    
The specified `<length>` is used in the calculation of the line box height step.
## Examples
>
### Setting step unit for line box height
In the following example, the height of line box in each paragraph is rounded up to the step unit. The line box in `<h1>` does not fit into one step unit and thus occupies two, but it is still centered within the two step unit.
    
    :root {
      font-size: 12pt;
      --my-grid: 18pt;
      line-height-step: var(--my-grid);
    }
    h1 {
      font-size: 20pt;
      margin-top: calc(2 * var(--my-grid));
    }
    
The result of these rules is shown below in the following screenshot:
Currently, no browsers support this feature.
# font-variant-emoji
The `font-variant-emoji` CSS property specifies the default presentation style for displaying emojis.
Traditionally, this was done by appending a Variation Selector, `U+FE0E` for text and `U+FE0F` for emoji, to the emoji code point. Only emojis listed as contributing to a Unicode emoji presentation sequence are affected by this property.
## Syntax
    
    /* Keyword values */
    font-variant-emoji: normal;
    font-variant-emoji: text;
    font-variant-emoji: emoji;
    font-variant-emoji: unicode;
    
    /* Global values */
    font-variant-emoji: inherit;
    font-variant-emoji: initial;
    font-variant-emoji: revert;
    font-variant-emoji: revert-layer;
    font-variant-emoji: unset;
    
The `font-variant-emoji` property is specified using a single keyword value from the list below.
### Values
`normal`
    
Allows a browser to choose how to display the emoji. This often follows the operating system setting.
`text`
    
Renders the emoji as if it were using the unicode text variation selector (`U+FE0E`).
`emoji`
    
Renders the emoji as if it were using the unicode emoji variation selector (`U+FE0F`).
`unicode`
    
Renders the emoji in accordance with the Emoji presentation properties. If the `U+FE0E` or `U+FE0F` variation selector is present, then it will override this value setting.
## Accessibility
While the use of emojis may seem fun, you should consider their impact on accessibility, specifically for users with visual and cognitive impairments. Consider the following factors while using emojis:
  * Display on screen-readers: Screen-readers will read out the alt text of an emoji. Keep this in mind to consider the position of an emoji in the content. Repeated and overuse of emojis will have a detrimental effect on screen-reader users. It is better to use emojis than emoticons; emoticons will be read out as punctuation characters.
  * Contrast with background: When using emojis, consider their colors and how that will work with the background color, especially if you have background colors that can change, such as light/dark modes.
  * Intent of use: Do not use emojis to replace words because your understanding of the emoji meaning may differ from that of the users'. Also consider that emojis might have different meanings in different cultures and geographies. Our recommendation is to preferably limit usage to commonly known emojis.


## Examples
>
### Changing the way an emoji is displayed
This example shows how you can render an emoji in its `text` or `emoji` presentation.
#### HTML
    
    <section class="emojis">
      <div class="emoji">
        <h2>text presentation</h2>
        <div class="text-presentation">☎</div>
      </div>
      <div class="emoji">
        <h2>emoji presentation</h2>
        <div class="emoji-presentation">☎</div>
      </div>
    </section>
    
#### CSS
    
    .text-presentation {
      font-variant-emoji: text;
    }
    
    .emoji-presentation {
      font-variant-emoji: emoji;
    }
    
#### Result
# position-try-order
The `position-try-order` CSS property allows you to specify various fallback options that result in an available position-try fallback being used to set an anchor-positioned element's position, instead of its initial position settings.
Note: There is also a shorthand property — `position-try`, which can be used to specify `position-try-order` and `position-try-fallbacks` values in a single declaration.
## Syntax
    
    /* Keywords */
    position-try-order: normal;
    position-try-order: most-height;
    position-try-order: most-width;
    position-try-order: most-block-size;
    position-try-order: most-inline-size;
    
    /* Global values */
    position-try-order: inherit;
    position-try-order: initial;
    position-try-order: revert;
    position-try-order: revert-layer;
    position-try-order: unset;
    
### Values
The `position-try-order` property may be specified as either the keyword value `normal` or a `<try-size>`.
`normal`
    
The default. No position-try fallback options will be tried when the element is first displayed.
`<try-size>`
    
Defines the different try size fallback options, which specify criteria that determine what try fallback should be applied to the anchor-positioned element when it initially renders. Available values are:
`most-height`
    
The position try fallback option will be applied that gives the element's containing block the most height.
`most-width`
    
The position try fallback option will be applied that gives the element's containing block the most width.
`most-block-size`
    
The position try fallback option will be applied that gives the element's containing block the largest size in the block direction.
`most-inline-size`
    
The position try fallback option will be applied that gives the element's containing block the largest size in the inline direction.
## Description
The `position-try-order` property has a slightly different focus from the rest of the position-try functionality features, in that it makes use of position-try fallback options when the positioned element is first displayed, rather than when it is being scrolled. For example, you might want to initially display the element in a space that has more available height or width than the default initial position.
The browser will test the available position-try fallback options to find which one gives the anchor-positioned element the most space in the specified dimension. It will then apply that option, overriding the element's initial styling.
If no position try fallback option is available that provides more width/height than the initial positioning assigned to the element, no position try option will be applied. In effect, the behavior is as if `position-try-order` was set to `normal`.
For detailed information on anchor features and position try option usage, see the CSS anchor positioning module landing page and the Fallback options and conditional hiding for overflow guide.
## Examples
>
### Basic `position-try-order` usage
This demo shows the effect of `position-try-order`.
#### HTML
The HTML includes two `<div>` elements that will become an anchor and an anchor-positioned element, and a `<form>` containing radio buttons allowing you to select different values of `position-try-order`.
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
    <form>
      <fieldset>
        <legend>Choose a try order</legend>
        <div>
          <label for="radio-normal">normal</label>
          <input
            type="radio"
            id="radio-normal"
            name="position-try-order"
            value="normal"
            checked />
        </div>
        <div>
          <label for="radio-most-height">most-height</label>
          <input
            type="radio"
            id="radio-most-height"
            name="position-try-order"
            value="most-height" />
        </div>
      </fieldset>
    </form>
    
#### CSS
In the CSS, the anchor is given an `anchor-name` and has a large `margin` to position it toward the top center of the viewport:
    
    .anchor {
      anchor-name: --my-anchor;
      margin: 90px auto;
    }
    
We then include a custom position option named `--custom-bottom` which positions the element below the anchor and gives it an appropriate margin:
    
    @position-try --custom-bottom {
      top: anchor(bottom);
      bottom: unset;
      margin-top: 10px;
    }
    
We initially position the element above its anchor, and then give it our custom position option using the `position-try` shorthand, which also sets the `position-try-order` property to `normal`:
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
    
      bottom: anchor(top);
      margin-bottom: 10px;
      justify-self: anchor-center;
    
      position-try: normal --custom-bottom;
    }
    
#### JavaScript
Finally, we include some JavaScript. This sets a `change` event handler on the radio buttons so that, when a new value is selected, that value is applied to the infobox's `position-try-order` property.
    
    const infobox = document.querySelector(".infobox");
    const form = document.forms[0];
    const radios = form.elements["position-try-order"];
    
    for (const radio of radios) {
      radio.addEventListener("change", setTryOrder);
    }
    
    function setTryOrder(e) {
      const tryOrder = e.target.value;
      infobox.style.positionTryOrder = tryOrder;
    }
    
#### Result
Try selecting the `most-height` order option. This has the effect of applying `--custom-bottom` as a position try fallback option, which positions the element below the anchor. This occurs because there is more vertical space below the anchor than there is above it.
# padding
The `padding` CSS shorthand property sets the padding area on all four sides of an element at once.
## Try it
    
    padding: 1em;
    
    
    padding: 10% 0;
    
    
    padding: 10px 50px 20px;
    
    
    padding: 10px 50px 30px 0;
    
    
    padding: 0;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
    }
    
An element's padding area is the space between its content and its border.
Note: Padding creates extra space within an element. In contrast, `margin` creates extra space around an element.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `padding-top`
  * `padding-right`
  * `padding-bottom`
  * `padding-left`


## Syntax
    
    /* Apply to all four sides */
    padding: 1em;
    
    /* top and bottom | left and right */
    padding: 5% 10%;
    
    /* top | left and right | bottom */
    padding: 1em 2em 2em;
    
    /* top | right | bottom | left */
    padding: 5px 1em 0 2em;
    
    /* Global values */
    padding: inherit;
    padding: initial;
    padding: revert;
    padding: revert-layer;
    padding: unset;
    
The `padding` property may be specified using one, two, three, or four values. Each value is a `<length>` or a `<percentage>`. Negative values are invalid.
  * When one value is specified, it applies the same padding to all four sides.
  * When two values are specified, the first padding applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom.
  * When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length>`
    
The size of the padding as a fixed value.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
## Examples
>
### Setting padding with pixels
#### HTML
    
    <h4>This element has moderate padding.</h4>
    <h3>The padding is huge in this element!</h3>
    
#### CSS
    
    h4 {
      background-color: lime;
      padding: 20px 50px;
    }
    
    h3 {
      background-color: cyan;
      padding: 110px 50px 50px 110px;
    }
    
#### Result
### Setting padding with pixels and percentages
    
    padding: 5%; /* All sides: 5% padding */
    
    padding: 10px; /* All sides: 10px padding */
    
    padding: 10px 20px; /* top and bottom: 10px padding */
    /* left and right: 20px padding */
    
    padding: 10px 3% 20px; /* top:            10px padding */
    /* left and right: 3% padding   */
    /* bottom:         20px padding */
    
    padding: 1em 3px 30px 5px; /* top:    1em padding  */
    /* right:  3px padding  */
    /* bottom: 30px padding */
    /* left:   5px padding  */
    
# column-rule
The `column-rule` shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout.
## Try it
    
    column-rule: dotted;
    
    
    column-rule: solid 6px;
    
    
    column-rule: solid blue;
    
    
    column-rule: thick inset blue;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      columns: 3;
      column-rule: solid;
      text-align: left;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `column-rule-color`
  * `column-rule-style`
  * `column-rule-width`


## Syntax
    
    column-rule: dotted;
    column-rule: solid 8px;
    column-rule: solid blue;
    column-rule: thick inset blue;
    
    /* Global values */
    column-rule: inherit;
    column-rule: initial;
    column-rule: revert;
    column-rule: revert-layer;
    column-rule: unset;
    
### Values
The `column-rule` property is specified as one, two, or three of the values listed below, in any order.
`<'column-rule-width'>`
    
Is a `<length>` or one of the three keywords, `thin`, `medium`, or `thick`. See `border-width` for details.
`<'column-rule-style'>`
    
See `border-style` for possible values and details.
`<'column-rule-color'>`
    
Is a `<color>` value.
## Examples
>
### Example 1
    
    /* Same as "medium dotted currentColor" */
    p.foo {
      column-rule: dotted;
    }
    
    /* Same as "medium solid blue" */
    p.bar {
      column-rule: solid blue;
    }
    
    /* Same as "8px solid currentColor" */
    p.baz {
      column-rule: solid 8px;
    }
    
    p.abc {
      column-rule: thick inset blue;
    }
    
### Example 2
#### HTML
    
    <p class="content-box">
      This is a bunch of text split into three columns. Take note of how the
      `column-rule` property is used to adjust the style, width, and color of the
      rule that appears between the columns.
    </p>
    
#### CSS
    
    .content-box {
      padding: 0.3em;
      background: #ffff77;
      column-count: 3;
      column-rule: inset 2px #3333ff;
    }
    
#### Result
# CSS ruby layout
The CSS ruby layout module provides the rendering model and formatting controls related to the display of ruby annotations. Ruby annotations are a form of interlinear annotation, consisting of short runs of text alongside the base text. They are typically used in East Asian documents to indicate pronunciation or define meaning.
## Reference
>
### Properties
  * `ruby-align`
  * `ruby-position`


The CSS ruby layout module also introduces the `ruby-merge` and `ruby-overhang` properties. Currently, no browsers support these features.
### Display values
The CSS ruby layout module adds the following values to the `display` property:
  * `ruby`
  * `ruby-base`
  * `ruby-text`
  * `ruby-base-container`
  * `ruby-text-container`


### Glossary and keywords
  * ruby


## Related concepts
  * CSS display module 
    * `display`
    * `<display-internal>`
  * CSS text decoration module 
    * `text-emphasis-color`
    * `text-emphasis-position`
    * `text-emphasis-style`
    * `text-emphasis` shorthand
  * HTML elements
    * `<rb>`
    * `<rp>`
    * `<rt>`
    * `<rtc>`
    * `<ruby>`


# Pseudo-classes
A CSS pseudo-class is a keyword added to a selector that lets you style a specific state of the selected element(s). For example, the pseudo-class `:hover` can be used to select a button when a user's pointer hovers over the button and this selected button can then be styled.
    
    /* Any button over which the user's pointer is hovering */
    button:hover {
      color: blue;
    }
    
A pseudo-class consists of a colon (`:`) followed by the pseudo-class name (e.g., `:hover`). A functional pseudo-class also contains a pair of parentheses to define the arguments (e.g., `:dir()`). The element that a pseudo-class is attached to is defined as an anchor element (e.g., `button` in case `button:hover`).
Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (`:visited`, for example), the status of its content (like `:checked` on certain form elements), or the position of the mouse (like `:hover`, which lets you know if the mouse is over an element or not).
Note: In contrast to pseudo-classes, pseudo-elements can be used to style a specific part of an element.
## Elemental pseudo-classes
These pseudo-classes relate to the core identity of elements.
`:defined`
    
Matches any element that is defined.
`:heading`
    
Matches any heading element (`<h1>`-`<h6>`).
## Element display state pseudo-classes
These pseudo-classes enable the selection of elements based on their display states.
`:open`
    
Matches an element that can either be open or closed that is currently open.
`:popover-open`
    
Matches a popover element that is currently in the showing state.
`:modal`
    
Matches an element that is in a state in which it excludes all interaction with elements outside it until the interaction has been dismissed.
`:fullscreen`
    
Matches an element that is currently in fullscreen mode.
`:picture-in-picture`
    
Matches an element that is currently in picture-in-picture mode.
## Input pseudo-classes
These pseudo-classes relate to form elements, and enable selecting elements based on HTML attributes and the state that the field is in before and after interaction.
`:enabled`
    
Represents a user interface element that is in an enabled state.
`:disabled`
    
Represents a user interface element that is in a disabled state.
`:read-only`
    
Represents any element that cannot be changed by the user.
`:read-write`
    
Represents any element that is user-editable.
`:placeholder-shown`
    
Matches an input element that is displaying placeholder text. For example, it will match the `placeholder` attribute in the `<input>` and `<textarea>` elements.
`:autofill`
    
Matches when an `<input>` has been autofilled by the browser.
`:default`
    
Matches one or more UI elements that are the default among a set of elements.
`:checked`
    
Matches when elements such as checkboxes and radio buttons are toggled on.
`:indeterminate`
    
Matches UI elements when they are in an indeterminate state.
`:blank`
    
Matches a user-input element which is empty, containing an empty string or other null input.
`:valid`
    
Matches an element with valid contents. For example, an input element with the type 'email' that contains a validly formed email address or an empty value if the control is not required.
`:invalid`
    
Matches an element with invalid contents. For example, an input element with type 'email' with a name entered.
`:in-range`
    
Applies to elements with range limitations. For example, a slider control when the selected value is in the allowed range.
`:out-of-range`
    
Applies to elements with range limitations. For example, a slider control when the selected value is outside the allowed range.
`:required`
    
Matches when a form element is required.
`:optional`
    
Matches when a form element is optional.
`:user-valid`
    
Represents an element with correct input, but only when the user has interacted with it.
`:user-invalid`
    
Represents an element with incorrect input, but only when the user has interacted with it.
## Linguistic pseudo-classes
These pseudo-classes reflect the document language and enable the selection of elements based on language or script direction.
`:dir()`
    
The directionality pseudo-class selects an element based on its directionality as determined by the document language.
`:lang()`
    
Select an element based on its content language.
## Location pseudo-classes
These pseudo-classes relate to links, and to targeted elements within the current document.
`:any-link`
    
Matches an element if the element would match either `:link` or `:visited`.
`:link`
    
Matches links that have not yet been visited.
`:visited`
    
Matches links that have been visited.
`:local-link`
    
Matches links whose absolute URL is the same as the target URL. For example, anchor links to the same page.
`:target`
    
Matches the element which is the target of the document URL.
`:scope`
    
Represents elements that are a reference point for selectors to match against.
Note: A `:target-within` pseudo-class, to match elements that are or have a descendant which is the target of the document URL, was defined but removed from the specification. Use `:has(:target)` for this purpose.
## Resource state pseudo-classes
These pseudo-classes apply to media that is capable of being in a state where it would be described as playing, such as a video.
`:playing`
    
Represents a playable element that is playing.
`:paused`
    
Represents a playable element that is paused.
`:seeking`
    
Represents a playable element that is currently seeking a playback position in the media resource.
`:buffering`
    
Represents a playable element that is playing but is temporarily stalled because it is downloading the media resource.
`:stalled`
    
Represents a playable element that is playing but is stalled because it cannot download the media resource.
`:muted`
    
Represents a sound-producing element that is muted.
`:volume-locked`
    
Represents a sound-producing element that has its volume level locked by the browser.
## Time-dimensional pseudo-classes
These pseudo-classes apply when viewing something which has timing, such as a WebVTT caption track.
`:current`
    
Represents the element or ancestor of the element that is being displayed.
`:past`
    
Represents an element that occurs entirely before the `:current` element.
`:future`
    
Represents an element that occurs entirely after the `:current` element.
## Tree-structural pseudo-classes
These pseudo-classes relate to the location of an element within the document tree.
`:root`
    
Represents an element that is the root of the document. In HTML this is usually the `<html>` element.
`:empty`
    
Represents an element with no children other than white-space characters.
`:nth-child()`
    
Uses `An+B` notation to select elements from a list of sibling elements.
`:nth-last-child()`
    
Uses `An+B` notation to select elements from a list of sibling elements, counting backwards from the end of the list.
`:first-child`
    
Matches an element that is the first of its siblings.
`:last-child`
    
Matches an element that is the last of its siblings.
`:only-child`
    
Matches an element that has no siblings. For example, a list item with no other list items in that list.
`:heading()`
    
Uses `An+B` notation to select heading elements (`<h1>`-`<h6>`).
`:nth-of-type()`
    
Uses `An+B` notation to select elements from a list of sibling elements that match a certain type from a list of sibling elements.
`:nth-last-of-type()`
    
Uses `An+B` notation to select elements from a list of sibling elements that match a certain type from a list of sibling elements counting backwards from the end of the list.
`:first-of-type`
    
Matches an element that is the first of its siblings, and also matches a certain type selector.
`:last-of-type`
    
Matches an element that is the last of its siblings, and also matches a certain type selector.
`:only-of-type`
    
Matches an element that has no siblings of the chosen type selector.
## Shadow-structural pseudo-classes
These pseudo-classes relate to the shadow DOM.
`:host`
    
Matches the shadow tree's shadow host.
`:host()`
    
Matches an element that matches `:host` and matches any of the selectors in the list provided.
`:host-context()`
    
Selects elements outside of the shadow tree in the context of the shadow host.
`:has-slotted`
    
Matches slot elements that have been assigned content.
## User action pseudo-classes
These pseudo-classes require some interaction by the user in order for them to apply, such as holding a mouse pointer over an element.
`:hover`
    
Matches when a user designates an item with a pointing device, such as holding the mouse pointer over the item.
`:active`
    
Matches when an item is being activated by the user. For example, when the item is clicked on.
`:focus`
    
Matches when an element has focus.
`:focus-visible`
    
Matches when an element has focus and the user agent identifies that the element should be visibly focused.
`:focus-within`
    
Matches an element to which `:focus` applies, plus any element that has a descendant to which `:focus` applies.
`:target-current`
    
Matches the `::scroll-marker` pseudo-element of a `scroll-marker-group` that is currently scrolled to, in other words, the active scroll marker.
## Functional pseudo-classes
These pseudo-classes accept a selector list or forgiving selector list as a parameter.
`:is()`
    
The matches-any pseudo-class matches any element that matches any of the selectors in the list provided. The list is forgiving.
`:not()`
    
The negation, or matches-none, pseudo-class represents any element that is not represented by its argument.
`:where()`
    
The specificity-adjustment pseudo-class matches any element that matches any of the selectors in the list provided without adding any specificity weight. The list is forgiving.
`:has()`
    
The relational pseudo-class represents an element if any of the relative selectors match when anchored against the attached element.
## Custom state pseudo-classes
These pseudo-classes apply to custom elements.
`:state()`
    
Matches custom elements that have the specified custom state.
## Page pseudo-classes
These pseudo-classes relate to pages in a printed document and are used with the `@page` at-rule.
`:left`
    
Represents all left-hand pages of a printed document.
`:right`
    
Represents all right-hand pages of a printed document.
`:first`
    
Represents the first page of a printed document.
`:blank`
    
Represents a blank page in a printed document.
## View transition pseudo-classes
These pseudo-classes relate to elements involved in a view transition.
`:active-view-transition`
    
Matches the root element of a document when a view transition is in progress (active) and stops matching once the transition has completed.
`:active-view-transition-type()`
    
Matches the root element of a document when a specified view transition is in progress (active) and stops matching once the transition has completed.
## Syntax
    
    selector:pseudo-class {
      property: value;
    }
    
Like regular classes, you can chain together as many pseudo-classes as you want in a selector.
## Alphabetical index
Pseudo-classes defined by a set of CSS specifications include the following:
A
  * `:active`
  * `:active-view-transition`
  * `:active-view-transition-type()`
  * `:any-link`
  * `:autofill`


B
  * `:blank` (input)  Experimental
  * `:blank` (page)
  * `:buffering`


C
  * `:checked`
  * `:current` Experimental


D
  * `:default`
  * `:defined`
  * `:dir()`
  * `:disabled`


E
  * `:empty`
  * `:enabled`


F
  * `:first`
  * `:first-child`
  * `:first-of-type`
  * `:focus`
  * `:focus-visible`
  * `:focus-within`
  * `:fullscreen`
  * `:future`


H
  * `:has-slotted`
  * `:has()`
  * `:heading`
  * `:heading()`
  * `:host`
  * `:host()`
  * `:host-context()`
  * `:hover`


I
  * `:in-range`
  * `:indeterminate`
  * `:invalid`
  * `:is()`


L
  * `:lang()`
  * `:last-child`
  * `:last-of-type`
  * `:left`
  * `:link`
  * `:local-link` Experimental


M
  * `:modal`
  * `:muted`


N
  * `:not()`
  * `:nth-child()`
  * `:nth-last-child()`
  * `:nth-last-of-type()`
  * `:nth-of-type()`


O
  * `:only-child`
  * `:only-of-type`
  * `:open`
  * `:optional`
  * `:out-of-range`


P
  * `:past`
  * `:paused`
  * `:picture-in-picture`
  * `:placeholder-shown`
  * `:playing`
  * `:popover-open`


R
  * `:read-only`
  * `:read-write`
  * `:required`
  * `:right`
  * `:root`


S
  * `:scope`
  * `:seeking`
  * `:stalled`
  * `:state()`


T
  * `:target`
  * `:target-current`


U
  * `:user-invalid`
  * `:user-valid`


V
  * `:valid`
  * `:visited`
  * `:volume-locked`


W
  * `:where()`


# fit-content()
The `fit-content()` CSS function clamps a given size to an available size according to the formula `min(maximum size, max(minimum size, argument))`.
## Try it
    
    grid-template-columns: fit-content(8ch) fit-content(8ch) 1fr;
    
    
    grid-template-columns: fit-content(100px) fit-content(100px) 1fr;
    
    
    grid-template-columns: fit-content(40%) fit-content(40%) 1fr;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One. This column has more text in it.</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-gap: 10px;
      width: 250px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      text-align: left;
    }
    
The function can be used as a track size in CSS grid properties, where the maximum size is defined by `max-content` and the minimum size by `auto`, which is calculated similar to `auto` (i.e., `minmax(auto, max-content)`), except that the track size is clamped at argument if it is greater than the `auto` minimum.
See the `grid-template-columns` page for more information on the `max-content` and `auto` keywords.
The `fit-content()` function can also be used as laid out box size for `width`, `height`, `min-width`, `min-height`, `max-width` and `max-height`, where the maximum and minimum sizes refer to the content size.
## Syntax
    
    /* <length> values */
    fit-content(200px)
    fit-content(5cm)
    fit-content(30vw)
    fit-content(100ch)
    
    /* <percentage> value */
    fit-content(40%)
    
### Values
`<length>`
    
An absolute length.
`<percentage>`
    
A percentage relative to the available space in the given axis.
In grid properties it is relative to the inline size of the grid container in column tracks and to the block size of the grid container for row tracks. Otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode.
## Examples
>
### Sizing grid columns with fit-content
#### HTML
    
    <div id="container">
      <div>Item as wide as the content.</div>
      <div>
        Item with more text in it. Because the contents of it are wider than the
        maximum width, it is clamped at 300 pixels.
      </div>
      <div>Flexible item</div>
    </div>
    
#### CSS
    
    #container {
      display: grid;
      grid-template-columns: fit-content(300px) fit-content(300px) 1fr;
      grid-gap: 5px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background-color: #8cffa0;
      padding: 10px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      padding: 5px;
    }
    
#### Result
>
### css.properties.grid-template-columns.fit-content
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`fit-content_function` 57 16 52 44 10.1 57 52 43 10.3 6.0 57 10.3  
### css.properties.width.fit-content_function
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`fit-content_function` No No 91 No No No No No No No No No  
# background-position
The `background-position` CSS property sets the initial position for each background image. The position is relative to the position layer set by `background-origin`.
## Try it
    
    background-position: top;
    
    
    background-position: left;
    
    
    background-position: center;
    
    
    background-position: 25% 75%;
    
    
    background-position: bottom 50px right 100px;
    
    
    background-position: right 35% bottom 45%;
    
    
    <section class="display-block" id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      background-color: navajowhite;
      background-image: url("/shared-assets/images/examples/star.png");
      background-repeat: no-repeat;
      height: 100%;
    }
    
## Syntax
    
    /* Keyword values */
    background-position: top;
    background-position: bottom;
    background-position: left;
    background-position: right;
    background-position: center;
    
    /* <percentage> values */
    background-position: 25% 75%;
    
    /* <length> values */
    background-position: 0 0;
    background-position: 1cm 2cm;
    background-position: 10ch 8em;
    
    /* Multiple images */
    background-position:
      0 0,
      center;
    
    /* Edge offsets values */
    background-position: bottom 10px right 20px;
    background-position: right 3em bottom 10px;
    background-position: bottom 10px right;
    background-position: top right 10px;
    
    /* Global values */
    background-position: inherit;
    background-position: initial;
    background-position: revert;
    background-position: revert-layer;
    background-position: unset;
    
The `background-position` property is specified as one or more `<position>` values, separated by commas.
### Values
`<position>`
    
A `<position>`. A position defines an x/y coordinate, to place an item relative to the edges of an element's box. It can be defined using one to four values. If two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. If only one value is specified, the second value is assumed to be `center`. If three or four values are used, the length-percentage values are offsets for the preceding keyword value(s).
1-value syntax: The value may be:
  * The keyword value `center`, which centers the image.
  * One of the keyword values `top`, `left`, `bottom`, or `right`. This specifies an edge against which to place the item. The other dimension is then set to 50%, so the item is placed in the middle of the edge specified.
  * A `<length>` or `<percentage>`. This specifies the X coordinate relative to the left edge, with the Y coordinate set to 50%.


2-value syntax: One value defines X and the other defines Y. Each value may be:
  * One of the keyword values `top`, `left`, `bottom`, or `right`. If `left` or `right` is given, then this defines X and the other given value defines Y. If `top` or `bottom` is given, then this defines Y and the other value defines X.
  * A `<length>` or `<percentage>`. If the other value is `left` or `right`, then this value defines Y, relative to the top edge. If the other value is `top` or `bottom`, then this value defines X, relative to the left edge. If both values are `<length>` or `<percentage>` values, then the first defines X and the second Y.
  * Note that: If one value is `top` or `bottom`, then the other value may not be `top` or `bottom`. If one value is `left` or `right`, then the other value may not be `left` or `right`. This means, e.g., that `top top` and `left right` are not valid.
  * Order: When pairing keywords, placement is not important as the browser can reorder it; the values `top left` and `left top` will yield the same result. When pairing `<length>` or `<percentage>` with a keyword, the placement is important: the value defining X should come first followed by Y, so for example the value `right 20px` is valid while `20px right` is invalid. The values `left 20%` and `20% bottom` are valid as X and Y values are clearly defined and the placement is correct.
  * The default value is `left top` or `0% 0%`.


3-value syntax: Two values are keyword values, and the third is the offset for the preceding value:
  * The first value is one of the keyword values `top`, `left`, `bottom`, `right`, or `center`. If `left` or `right` are given here, then this defines X. If `top` or `bottom` are given, then this defines Y and the other keyword value defines X.
  * The `<length>` or `<percentage>` value, if it is the second value, is the offset for the first value. If it is the third value, it is the offset for the second value.
  * The single length or percentage value is an offset for the keyword value that precedes it. The combination of one keyword with two `<length>` or `<percentage>` values is not valid.


4-value syntax: The first and third values are keyword values defining X and Y. The second and fourth values are offsets for the preceding X and Y keyword values:
  * The first and third values are equal to one of the keyword values `top`, `left`, `bottom`, or `right`. If `left` or `right` is given for the first value, then this defines X and the other value defines Y. If `top` or `bottom` is given for the first value, then this defines Y and the other keyword value defines X.
  * The second and fourth values are `<length>` or `<percentage>` values. The second value is the offset for the first keyword. The fourth value is the offset for the second keyword.


### Regarding Percentages
The percentage offset of the given background image's position is relative to the container. A value of 0% means that the left (or top) edge of the background image is aligned with the corresponding left (or top) edge of the container, or the 0% mark of the image will be on the 0% mark of the container. A value of 100% means that the right (or bottom) edge of the background image is aligned with the right (or bottom) edge of the container, or the 100% mark of the image will be on the 100% mark of the container. Thus a value of 50% horizontally or vertically centers the background image as the 50% of the image will be at the 50% mark of the container. Similarly, `background-position: 25% 75%` means the spot on the image that is 25% from the left and 75% from the top will be placed at the spot of the container that is 25% from the container's left and 75% from the container's top.
Essentially what happens is the background image dimension is subtracted from the corresponding container dimension, and then a percentage of the resulting value is used as the direct offset from the left (or top) edge.
    
    (container width - image width) * (position x%) = (x offset value)
    (container height - image height) * (position y%) = (y offset value)
    
Using the X axis for an example, let's say we have an image that is 300px wide and we are using it in a container that is 100px wide, with `background-size` set to auto:
    
    100px - 300px = -200px (container & image difference)
    
So that with position percentages of -25%, 0%, 50%, 100%, 125%, we get these image-to-container edge offset values:
    
    -200px * -25% = 50px
    -200px * 0% = 0px
    -200px * 50% = -100px
    -200px * 100% = -200px
    -200px * 125% = -250px
    
So with these resultant values for our example, the left edge of the image is offset from the left edge of the container by:
  * \+ 50px (putting the left image edge in the center of the 100-pixel-wide container)
  * 0px (left image edge coincident with the left container edge)
  * -100px (left image edge 100px to the left of the container, in this example that means the middle 100px image area is centered in the container)
  * -200px (left image edge 200px to the left of the container, in this example that means the right image edge is coincident with the right container edge)
  * -250px (left image edge 250px to the left of the container, in this example that puts the right edge of the 300px-wide image in the center of the container)


It's worth mentioning that if your `background-size` is equal to the container size for a given axis, then a percentage position for that axis will have no effect because the "container-image difference" will be zero. You will need to offset using absolute values.
## Examples
>
### Positioning background images
Each of these three examples uses the `background` property to create a yellow, rectangular element containing a star image. In each example, the star is in a different position. The third example illustrates how to specify positions for two different background images within one element.
#### HTML
    
    <div class="example-one">Example One</div>
    <div class="example-two">Example Two</div>
    <div class="example-three">Example Three</div>
    
#### CSS
    
    /* Shared among all <div>s */
    div {
      background-color: #ffee99;
      background-repeat: no-repeat;
      width: 300px;
      height: 80px;
      margin-bottom: 12px;
    }
    
    /* These examples use the `background` shorthand property */
    .example-one {
      background: url("star-transparent.gif") #ffee99 2.5cm bottom no-repeat;
    }
    .example-two {
      background: url("star-transparent.gif") #ffee99 left 4em bottom 1em no-repeat;
    }
    
    /* Multiple background images: Each image is matched with the
       corresponding position, from first specified to last. */
    .example-three {
      background-image: url("star-transparent.gif"), url("cat-front.png");
      background-position:
        0px 0px,
        right 3em bottom 2em;
    }
    
#### Result
# stroke-dasharray
The `stroke-dasharray` CSS property defines a pattern of dashes and gaps used in the painting of the SVG shape's stroke. If present, it overrides the element's `stroke-dasharray` attribute.
This property applies to any SVG shape or text-content element (see `stroke-dasharray` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes.
## Syntax
    
    /* Keywords */
    stroke-dasharray: none;
    
    /* Numeric, length, and percentage values */
    stroke-dasharray: 2px, 5px;
    stroke-dasharray: 20%, 50%;
    stroke-dasharray: 2, 5;
    
    /* The following two rules are equivalent */
    stroke-dasharray: 2, 5, 3;
    stroke-dasharray: 2, 5, 3, 2, 5, 3;
    
    /* Global values */
    stroke-dasharray: inherit;
    stroke-dasharray: initial;
    stroke-dasharray: revert;
    stroke-dasharray: revert-layer;
    stroke-dasharray: unset;
    
### Values
The value is a list of comma and/or white space separated `<number>`, `<length>`, and / or `<percentage>` values that specify the lengths of alternating dashes and gaps, or the keyword `none`. If an odd number of values are given, the entire value will be repeated in order to set an even number of values.
`none`
    
The stroke will be drawn without any dashes. The default value.
`<number>`
    
A number of SVG units, the size of which are defined by the current unit space. Negative values are invalid.
`<length>`
    
Pixel units are handled the same as SVG units (see `<number>`, above) and font-based lengths such as `em` are calculated with respect to the element's SVG value for the text size; the effects of other length units may depend on the browser. Negative values are invalid.
`<percentage>`
    
Percentages refer to the normalized diagonal of the current SVG viewport, which is calculated as <width>2+<height>22. Negative values are invalid.
## Examples
>
### Basic dash array
This example demonstrates basic usage of the `stroke-dasharray` property using space-separated `<number>` values.
#### HTML
First, we set up a basic SVG rectangle shape. To this rectangle, a red stroke with a width of `2` is applied.
    
    <svg viewBox="0 0 100 50" width="500" height="250">
      <rect
        x="10"
        y="10"
        width="80"
        height="30"
        fill="none"
        stroke="red"
        stroke-width="2" />
    </svg>
    
#### CSS
We define a dash pattern for the stroke: ten units of dash, followed by five units of space. This means the gaps between dashes will be half the length as the dashes themselves.
    
    rect {
      stroke-dasharray: 10 5;
    }
    
#### Results
Where the stroke turns a corner, the pattern is carried along, as it were. At the top left corner, where the start and end of the stroke meet, the ten-unit-long starting dash appears to join with the part of the dash pattern seen at the end of the path, creating what looks like a longer-than-ten-units line bending around the corner.
### Dash array repetition
This example includes an odd-number of comma-separated `<number>` values to demonstrates how the value is repeated if an odd number of values is given in order to set an even number of values.
#### HTML
In this case, we define two rectangles.
    
    <svg viewBox="0 0 100 100" width="500" height="500">
      <rect
        x="10"
        y="10"
        width="80"
        height="30"
        fill="none"
        stroke="red"
        stroke-width="2" />
      <rect
        x="10"
        y="60"
        width="80"
        height="30"
        fill="none"
        stroke="red"
        stroke-width="2" />
    </svg>
    
#### CSS
To the first rectangle, we define a dasharray of `5, 5, 1`, which calls for five units of dash, five of gap, and one unit of dash. However, because this is an odd number of numbers, the entire set of numbers is repeated, thus creating a value identical to that applied to the second rectangle.
    
    rect:nth-of-type(1) {
      stroke-dasharray: 5, 5, 1;
    }
    rect:nth-of-type(2) {
      stroke-dasharray: 5, 5, 1, 5, 5, 1;
    }
    
#### Result
The reason an even count of numbers is required is so that every dash array begins with a dash and ends with a gap. Thus, the pattern defined is a five-unit dash, a five-unit gap, a one-unit dash, a five-unit gap, a five-unit dash, and a one-unit gap. In the resulting stroke, every instance of a one-unit gap between two five-unit dashes indicates a place where the dash array starts over.
### Percentage and pixel values
This example demonstrates the use of `<percentage>` and `<length>` values within the `stroke-dasharray` property value.
#### HTML
As in the previous example, we define two rectangles.
    
    <svg viewBox="0 0 100 100" width="500" height="500">
      <rect
        x="10"
        y="10"
        width="80"
        height="30"
        fill="none"
        stroke="red"
        stroke-width="2" />
      <rect
        x="10"
        y="60"
        width="80"
        height="30"
        fill="none"
        stroke="red"
        stroke-width="2" />
    </svg>
    
#### CSS
This time, rather than collections of bare numbers, we use pixel units and percentages.
    
    rect:nth-of-type(1) {
      stroke-dasharray: 5px, 5px, 1px;
    }
    rect:nth-of-type(2) {
      stroke-dasharray: 5%, 5%, 1%;
    }
    
#### Results
The results are essentially indistinguishable from the results in the previous example.
# resize
The `resize` CSS property sets whether an element is resizable, and if so, in which directions.
## Try it
    
    resize: both;
    
    
    resize: horizontal;
    
    
    resize: vertical;
    
    
    resize: none;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">Try resizing this element.</div>
    </section>
    
    
    #example-element {
      background: linear-gradient(135deg, cyan 0%, cyan 94%, white 95%);
      border: 3px solid #c5c5c5;
      overflow: auto;
      width: 250px;
      height: 250px;
      font-weight: bold;
      color: black;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 10px;
    }
    
`resize` does not apply to the following:
  * Inline elements
  * Block elements for which the `overflow` property is set to `visible` or `clip`


## Syntax
    
    /* Keyword values */
    resize: none;
    resize: both;
    resize: horizontal;
    resize: vertical;
    resize: block;
    resize: inline;
    
    /* Global values */
    resize: inherit;
    resize: initial;
    resize: revert;
    resize: revert-layer;
    resize: unset;
    
The `resize` property is specified as a single keyword value from the list below.
### Values
`none`
    
The element offers no user-controllable method for resizing it.
`both`
    
The element displays a mechanism for allowing the user to resize it, which may be resized both horizontally and vertically.
`horizontal`
    
The element displays a mechanism for allowing the user to resize it in the horizontal direction.
`vertical`
    
The element displays a mechanism for allowing the user to resize it in the vertical direction.
`block`
    
The element displays a mechanism for allowing the user to resize it in the block direction (either horizontally or vertically, depending on the `writing-mode` and `direction` value).
`inline`
    
The element displays a mechanism for allowing the user to resize it in the inline direction (either horizontally or vertically, depending on the `writing-mode` and `direction` value).
## Examples
>
### Disabling resizability of text areas
In many browsers, `<textarea>` elements are resizable by default. You may override this behavior with the `resize` property.
#### HTML
    
    <textarea>Type some text here.</textarea>
    
#### CSS
    
    textarea {
      resize: none; /* Disables resizability */
    }
    
#### Result
### Using resize with arbitrary elements
You can use the `resize` property to make any element resizable. In the example below, a resizable `<div>` contains a resizable paragraph (`<p>` element).
#### HTML
    
    <div class="resizable">
      <p class="resizable">
        This paragraph is resizable in all directions, because the CSS `resize`
        property is set to `both` on this element.
      </p>
    </div>
    
#### CSS
    
    .resizable {
      resize: both;
      overflow: scroll;
      border: 1px solid black;
    }
    
    div {
      height: 300px;
      width: 300px;
    }
    
    p {
      height: 200px;
      width: 200px;
    }
    
#### Result
# :has()
The functional `:has()` CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element. This pseudo-class presents a way of selecting a parent element or a previous sibling element with respect to a reference element by taking a relative selector list as an argument.
    
    /* Selects an h1 heading with a
    paragraph element that immediately follows
    the h1 and applies the style to h1 */
    h1:has(+ p) {
      margin-bottom: 0;
    }
    
The `:has()` pseudo-class takes on the specificity of the most specific selector in its arguments the same way as `:is()` and `:not()` do.
## Syntax
    
    :has(<relative-selector-list>) {
      /* ... */
    }
    
If the `:has()` pseudo-class itself is not supported in a browser, the entire selector block will fail unless `:has()` is in a forgiving selector list, such as in `:is()` and `:where()`.
The `:has()` pseudo-class cannot be nested within another `:has()`.
Pseudo-elements are also not valid selectors within `:has()` and pseudo-elements are not valid anchors for `:has()`. This is because many pseudo-elements exist conditionally based on the styling of their ancestors and allowing these to be queried by `:has()` can introduce cyclic querying.
## Examples
>
### Selecting a parent element
You may be looking for a "parent combinator", which allows you to go up the DOM tree and select the parent of a specific element. The `:has()` pseudo-class does that by using `parent:has(child)` (for any parent) or `parent:has(> child)` (for direct parent). This example shows how to style a `<section>` element when it contains a child with the `featured` class.
    
    <section>
      <article class="featured">Featured content</article>
      <article>Regular content</article>
    </section>
    <section>
      <article>Regular content</article>
    </section>
    
    
    section:has(.featured) {
      border: 2px solid blue;
    }
    
### Result
### With the sibling combinator
The `:has()` style declaration in the following example adjusts the spacing after `<h1>` headings if they are immediately followed by an `<h2>` heading.
#### HTML
    
    <section>
      <article>
        <h1>Morning Times</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </p>
      </article>
      <article>
        <h1>Morning Times</h1>
        <h2>Delivering you news every morning</h2>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </p>
      </article>
    </section>
    
#### CSS
    
    h1,
    h2 {
      margin: 0 0 1rem 0;
    }
    
    h1:has(+ h2) {
      margin: 0 0 0.25rem 0;
    }
    
#### Result
This example shows two similar texts side-by-side for comparison – the left one with an `H1` heading followed by a paragraph and the right one with an `H1` heading followed by an `H2` heading and then a paragraph. In the example on the right, `:has()` helps to select the `H1` element that is immediately followed by an `H2` element (indicated by the next-sibling combinator `+`) and the CSS rule reduces the spacing after such an `H1` element. Without the `:has()` pseudo-class, you cannot use CSS selectors to select a preceding sibling of a different type or a parent element.
### With the :is() pseudo-class
This example builds on the previous example to show how to select multiple elements with `:has()`.
#### HTML
    
    <section>
      <article>
        <h1>Morning Times</h1>
        <h2>Delivering you news every morning</h2>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </p>
      </article>
      <article>
        <h1>Morning Times</h1>
        <h2>Delivering you news every morning</h2>
        <h3>8:00 am</h3>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </p>
      </article>
    </section>
    
#### CSS
    
    h1,
    h2,
    h3 {
      margin: 0 0 1rem 0;
    }
    
    :is(h1, h2, h3):has(+ :is(h2, h3, h4)) {
      margin: 0 0 0.25rem 0;
    }
    
#### Result
Here, the first `:is()` pseudo-class is used to select any of the heading elements in the list. The second `:is()` pseudo-class is used to pass a list of next-sibling selectors as an argument to `:has()`. The `:has()` pseudo-class helps to select any `H1`, `H2`, or `H3` element that is immediately followed by (indicated by `+`) an `H2`, `H3`, or `H4` element and the CSS rule reduces the spacing after such `H1`, `H2`, or `H3` elements.
This selector could have also been written as:
    
    :is(h1, h2, h3):has(+ h2, + h3, + h4) {
      margin: 0 0 0.25rem 0;
    }
    
### Logical operations
The `:has()` relational selector can be used to check if one of the multiple features is true or if all the features are true.
By using comma-separated values inside the `:has()` relational selector, you are checking to see if any of the parameters exist. `x:has(a, b)` will style `x` if descendant `a` OR `b` exists.
By chaining together multiple `:has()` relational selectors together, you are checking to see if all of the parameters exist. `x:has(a):has(b)` will style `x` if descendant `a` AND `b` exist.
    
    body:has(video, audio) {
      /* styles to apply if the content contains audio OR video */
    }
    body:has(video):has(audio) {
      /* styles to apply if the content contains both audio AND video */
    }
    
## Analogy between :has() and regular expressions
Interestingly, we can relate some CSS `:has()` constructs with the lookahead assertion in regular expressions because they both allow you to select elements (or strings in regular expressions) based on a condition without actually selecting the condition matching the element (or string) itself.
### Positive lookahead (?=pattern)
In the regular expression `abc(?=xyz)`, the string `abc` is matched only if it is immediately followed by the string `xyz`. As it is a lookahead operation, the `xyz` is not included in the match.
The analogous construct in CSS would be `.abc:has(+ .xyz)`: it selects the element `.abc` only if there is a next sibling `.xyz`. The part `:has(+ .xyz)` acts as a lookahead operation because the element `.abc` is selected and not the element `.xyz`.
### Negative lookahead (?!pattern)
Similarly, for the negative lookahead case, in the regular expression `abc(?!xyz)`, the string `abc` is matched only if it is not followed by `xyz`. The analogous CSS construct `.abc:has(+ :not(.xyz))` doesn't select the element `.abc` if the next element is `.xyz`.
# rotate
The `rotate` CSS property allows you to specify rotation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` property.
## Try it
    
    rotate: none;
    
    
    rotate: -45deg;
    
    
    rotate: z 45deg;
    
    
    rotate: x 45deg;
    
    
    rotate: y 45deg;
    
    
    rotate: 3 0.5 2 45deg;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
      perspective: 550px;
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      transform-style: preserve-3d;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 0.7);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 0.7);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 0.7);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 0.7);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 0.7);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 0.7);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
## Syntax
    
    /* Keyword values */
    rotate: none;
    
    /* Angle value */
    rotate: 90deg;
    rotate: 0.25turn;
    rotate: 1.57rad;
    
    /* x, y, or z axis name plus angle */
    rotate: x 90deg;
    rotate: y 0.25turn;
    rotate: z 1.57rad;
    
    /* Vector plus angle value */
    rotate: 1 1 1 90deg;
    
    /* Global values */
    rotate: inherit;
    rotate: initial;
    rotate: revert;
    rotate: revert-layer;
    rotate: unset;
    
### Values
angle value
    
An `<angle>` specifying the angle to rotate the affected element through, around the Z axis. Equivalent to a `rotate()` (2D rotation) function.
x, y, or z axis name plus angle value
    
The name of the axis you want to rotate the affected element around (`x`, `y`, or `z`), plus an `<angle>` specifying the angle to rotate the element through. Equivalent to a `rotateX()`/`rotateY()`/`rotateZ()` (3D rotation) function.
vector plus angle value
    
Three `<number>`s representing an origin-centered vector that defines a line around which you want to rotate the element, plus an `<angle>` specifying the angle to rotate the element through. Equivalent to a `rotate3d()` (3D rotation) function.
`none`
    
Specifies that no rotation should be applied.
## Examples
>
### Rotating an element on hover
The following example shows how to use the `rotate` property to rotate an element along various axes on hover. The first box rotates 90 degrees on the Z axis hover, the second rotates 180 degrees on the Y axis on hover, and the third rotates 360 degrees on hover around a vector defined by coordinates.
#### HTML
    
    <div class="box" id="box1">rotate Z</div>
    <div class="box" id="box2">rotate Y</div>
    <div class="box" id="box3">vector & angle</div>
    
#### CSS
    
    .box {
      display: inline-block;
      margin: 1em;
      min-width: 6.5em;
      line-height: 6.5em;
      text-align: center;
      transition: 1s ease-in-out;
      border: 0.25em dotted;
    }
    
    #box1:hover {
      rotate: 90deg;
    }
    
    #box2:hover {
      rotate: y 180deg;
    }
    
    #box3:hover {
      rotate: 1 2 1 360deg;
    }
    
#### Result
# font-synthesis-position
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `font-synthesis-position` CSS property lets you specify whether or not a browser may synthesize the subscript and superscript "position" typefaces when they are missing in a font family, while using `font-variant-position` to set the positions.
The `font-synthesis-position` property has no effect when using the `<sup>` and `<sub>` elements.
It is often convenient to use the shorthand property `font-synthesis` to control all typeface synthesis values.
## Syntax
    
    /* Keyword values */
    font-synthesis-position: auto;
    font-synthesis-position: none;
    
    /* Global values */
    font-synthesis-position: inherit;
    font-synthesis-position: initial;
    font-synthesis-position: revert;
    font-synthesis-position: revert-layer;
    font-synthesis-position: unset;
    
### Values
`auto`
    
Indicates that a missing position typeface may be synthesized by the browser if needed.
`none`
    
Indicates that the synthesis of a missing position typeface by the browser is not allowed.
## Examples
>
### Disabling synthesis of position typeface
This example shows turning off synthesis of the superscript and subscript typefaces by the browser in the `Montserrat` font.
#### HTML
    
    <p>
      These are the default position <span class="super">superscript</span>,
      position <span class="sub">subscript</span>, <strong>bold</strong> and
      <em>oblique</em> typefaces.
    </p>
    
    <p class="no-syn">
      The positions <span class="super">superscript</span> and
      <span class="sub">subscript</span> typeface is turned off here but not the
      <strong>bold</strong> and <em>oblique</em> typefaces (on browsers that support
      <code>font-synthesis-position</code>).
    </p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
    
    * {
      font-family: "Montserrat", sans-serif;
    }
    .super {
      font-variant-position: super;
    }
    .sub {
      font-variant-position: sub;
    }
    .no-syn {
      font-synthesis-position: none;
    }
    
#### Result
# <text-edge>
The `<text-edge>` enumerated data type defines keywords that specify font metrics representing specific regions on a font's block-start edge and block-end edge. Each keyword specifies a position of a font's over and/or under edge.
The `<text-edge>` values are used in the `text-box-edge` property to specify an amount of space to trim from the block-start and block-end edge of a text element's block container.
## Syntax
The `<text-edge>` data type is composed of one or two keywords representing specific regions on a font's block-start (over) edge and/or block-end (under) edge:
  * When one value is specified, the position of the font's over edge and under edge are specified using that same keyword.
  * When two values are specified, the first value specifies the position of the font's over edge, and the second value specifies the position of the font's under edge.


### Values
#### Single keyword values
`text`
    
The font's over and under edges are its text-over baseline/text-under baseline: this includes the font's ascenders and descenders but excludes the half-leading set on the text.
Note: The amount of half-leading included on a text element can be controlled using the `line-height` property.
Note: The `ideographic` and `ideographic-ink` keywords are intended to specify over and under edge positions specific to CJK language characters. Currently their exact behavior is being debated and they are not supported by any browser.
#### Two keyword values
`alphabetic`
    
The font's under edge is its alphabetic baseline, which is the bottom of its short lower-case letters (for example, "m", "n", and "o") or capital letters.
`cap`
    
The font's over edge is its cap-height baseline, which is the top of its capital letters.
`ex`
    
The font's over edge is its x-height baseline, which is the top of its short lower-case letters.
`text`
    
The font's over edge is its text-over baseline (includes the font's ascenders but excludes the over edge half-leading), or its under edge is its text-under baseline (includes the font's descenders but excludes the under edge half-leading), depending on which edge the value is set for.
## Examples
See `text-box-edge` examples
# rx
The `rx` CSS property defines the x-axis, or horizontal, radius of an SVG `<ellipse>` and the horizontal curve of the corners of an SVG `<rect>` rectangle. If present, it overrides the shape's `rx` attribute.
Note: The `rx` property only applies to `<ellipse>` and `<rect>` elements nested in an `<svg>`. It doesn't apply to other SVG elements or HTML elements or pseudo-elements.
## Syntax
    
    /* Initial value */
    rx: auto;
    
    /* Length and percentage values */
    rx: 20px;
    rx: 20%;
    
    /* Global values */
    rx: inherit;
    rx: initial;
    rx: revert;
    rx: revert-layer;
    rx: unset;
    
### Values
The `<length>`, `<percentage>`, or `auto` keyword value denotes the horizontal radius of ellipses and the horizontal border-radius of rectangles.
`<length>`
    
Absolute or relative lengths can be expressed in any unit allowed by the CSS `<length>` data type. Negative values are invalid.
`<percentage>`
    
Percentages refer to the width of the current SVG viewport. The used value for a `<rect>` is never more than 50% of the width of the rectangle.
`auto`
    
When set or defaulting to `auto`, the `rx` value equals the absolute length value used for `ry`. If both `rx` and `ry` have a computed value of `auto`, the used value is `0`.
## Examples
>
### Creating rounded corners
This example demonstrates creating rectangles with rounded corners by applying the `rx` property to SVG `<rect>` elements.
#### HTML
We include an SVG image with four `<rect>` elements; all the rectangles are the same except for their `x` attribute value, which positions them along the x-axis.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <rect width="50" height="120" y="5" x="5" />
      <rect width="50" height="120" y="5" x="60" />
      <rect width="50" height="120" y="5" x="115" />
      <rect width="50" height="120" y="5" x="170" />
      <rect width="50" height="120" y="5" x="225" />
    </svg>
    
#### CSS
With CSS, we set an `rx` value on four of the rectangles:
    
    svg {
      border: 1px solid;
    }
    
    rect:nth-of-type(2) {
      rx: 10px;
      fill: red;
    }
    
    rect:nth-of-type(3) {
      rx: 2em;
      fill: blue;
    }
    
    rect:nth-of-type(4) {
      rx: 5%;
      fill: orange;
    }
    
    rect:nth-of-type(5) {
      rx: 80%;
      fill: green;
    }
    
#### Results
The first rectangle defaults to `auto`; as all the `ry` values in this example also default to `auto`, the used value of `rx` is `0`. The red and blue rectangles have `10px` and `2em` rounded corners, respectively. As the SVG viewport defaults to 300px by 150px, the orange rectangle's `5%` value creates a `15px` radius. The green rectangle has `rx: 80%` set. However, as the value of `rx` is never more than `50%` of the width of the rectangle, the effect is as if `rx: 50%; ry: 50%` was set.
### Defining the horizontal radius of an ellipse
This basic `<ellipse>` example demonstrates the CSS `rx` property taking precedence over an SVG `rx` attribute to define the shape's horizontal radius.
#### HTML
We include two identical `<ellipse>` elements in an SVG; each with the `rx` attribute set to `20`.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <ellipse cx="80" cy="50" rx="20" ry="40" />
      <ellipse cx="80" cy="50" rx="20" ry="40" />
    </svg>
    
#### CSS
We only style the first ellipse, letting its twin use default user agent styles (with `fill` defaulting to black). The geometric `rx` property overrides the value of the SVG `rx` attribute. We also set the `fill` and `stroke` properties to differentiate the styled shape from its twin.
    
    svg {
      border: 1px solid;
    }
    
    ellipse:first-of-type {
      rx: 80px;
      fill: magenta;
      stroke: rebeccapurple;
    }
    
#### Results
The styled ellipse's horizontal radius is `80px`, as defined in the CSS `rx` property value. The unstyled ellipse's horizontal radius is `20px`, which was defined by the `rx` attribute.
### Ellipse horizontal radius percentage values
This example demonstrates using percentage values for `rx`.
#### HTML
We use the same markup as the previous example.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <ellipse cx="80" cy="50" rx="20" ry="40" />
      <ellipse cx="80" cy="50" rx="20" ry="40" />
    </svg>
    
#### CSS
The CSS is similar to the previous example, with the only difference being the `rx` property value; in this case, we use a percentage value.
    
    svg {
      border: 1px solid;
    }
    
    ellipse:first-of-type {
      rx: 30%;
      fill: magenta;
      stroke: rebeccapurple;
    }
    
#### Results
When using percentage values for `rx`, the values are relative to the width of the SVG viewport. Here, the size of the styled ellipse horizontal radius is `30%` of the width of the current SVG viewport. As the width defaulted to `300px`, the `rx` value is `90px`.
# ::-webkit-slider-runnable-track
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-webkit-slider-runnable-track` CSS pseudo-element represents the "track" (the groove in which the indicator slides) of an <input type="range">.
## Syntax
    
    ::-webkit-slider-runnable-track {
      /* ... */
    }
    
Not part of any standard.
# scroll-padding-bottom
The `scroll-padding-bottom` property defines offsets for the bottom of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Try it
    
    scroll-padding-bottom: 0;
    
    
    scroll-padding-bottom: 20px;
    
    
    scroll-padding-bottom: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-padding-bottom: auto;
    
    /* <length> values */
    scroll-padding-bottom: 10px;
    scroll-padding-bottom: 1em;
    scroll-padding-bottom: 10%;
    
    /* Global values */
    scroll-padding-bottom: inherit;
    scroll-padding-bottom: initial;
    scroll-padding-bottom: revert;
    scroll-padding-bottom: revert-layer;
    scroll-padding-bottom: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the bottom edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# :host()
The `:host()` CSS pseudo-class function selects the shadow host of the shadow DOM containing the CSS it is used inside (so you can select a custom element from inside its shadow DOM) — but only if the selector given as the function's parameter matches the shadow host. `:host()` has no effect when used outside a shadow DOM.
The most obvious use of this is to put a class name only on certain custom element instances, and then include the relevant class selector as the function argument. You can't use this with a descendant selector expression to select only instances of the custom element that are inside a particular ancestor. That's the job of `:host-context()`.
Note: While other functional pseudo-classes such as `:is()` and `:not()` accept a list of selectors as their parameters, `:host()` takes a single compound selector as its parameter. In addition, while `:is()` and `:not()` only take into account the specificity of their argument, the specificity of `:host()` is both the specificity of the pseudo-class and the specificity of its argument.
## Try it
    
    /* Following CSS is being applied inside the shadow DOM. */
    
    :host(h1) {
      color: red;
    }
    
    :host(#shadow-dom-host) {
      border: 2px dashed blue;
    }
    
    
    <!-- elements outside shadow dom -->
    <div id="container">
      <h1 id="shadow-dom-host"></h1>
    </div>
    
    
    const shadowDom = init();
    
    // add a <span> element in the shadow DOM
    const span = document.createElement("span");
    span.textContent = "Inside shadow DOM";
    shadowDom.appendChild(span);
    
    // attach shadow DOM to the #shadow-dom-host element
    function init() {
      const host = document.getElementById("shadow-dom-host");
      const shadowDom = host.attachShadow({ mode: "open" });
    
      const cssTab = document.querySelector("#css-output");
      const shadowStyle = document.createElement("style");
      shadowStyle.textContent = cssTab.textContent;
      shadowDom.appendChild(shadowStyle);
    
      cssTab.addEventListener("change", () => {
        shadowStyle.textContent = cssTab.textContent;
      });
      return shadowDom;
    }
    
    
    /* Selects a shadow root host, only if it is
       matched by the selector argument */
    :host(.special-custom-element) {
      font-weight: bold;
    }
    
## Syntax
    
    :host(<compound-selector>) {
      /* ... */
    }
    
## Examples
>
### Selectively styling shadow hosts
The following snippets are taken from our host-selectors example (see it live also).
In this example we have a custom element — `<context-span>` — that you can wrap around text:
    
    <h1>
      Host selectors <a href="#"><context-span>example</context-span></a>
    </h1>
    
Inside the element's constructor, we create `style` and `span` elements, fill the `span` with the content of the custom element, and fill the `style` element with some CSS rules:
    
    const style = document.createElement("style");
    const span = document.createElement("span");
    span.textContent = this.textContent;
    
    const shadowRoot = this.attachShadow({ mode: "open" });
    shadowRoot.appendChild(style);
    shadowRoot.appendChild(span);
    
    style.textContent =
      "span:hover { text-decoration: underline; }" +
      ":host-context(h1) { font-style: italic; }" +
      ':host-context(h1)::after { content: " - no links in headers!" }' +
      ":host-context(article, aside) { color: gray; }" +
      ":host(.footer) { color : red; }" +
      ":host { background: rgb(0 0 0 / 10%); padding: 2px 5px; }";
    
The `:host(.footer) { color : red; }` rule styles all instances of the `<context-span>` element (the shadow host in this instance) in the document that have the `footer` class set on them — we've used it to give instances of the element inside the `<footer>` a special color.
# quotes
The CSS `quotes` property sets how the browser should render quotation marks that are automatically added to the HTML `<q>` element or added using the `open-quotes` or `close-quotes` (or omitted using the `no-open-quote` and `no-close-quote`) values of the of the CSS `content` property.
## Try it
    
    quotes: none;
    
    
    quotes: initial;
    
    
    quotes: "'" "'";
    
    
    quotes: "„" "“" "‚" "‘";
    
    
    quotes: "«" "»" "‹" "›";
    
    
    <section id="default-example">
      <q id="example-element"
        >Show us the wonder-working <q>Brothers,</q> let them come out publicly—and
        we will believe in them!</q
      >
    </section>
    
    
    q {
      font-size: 1.2rem;
    }
    
Browsers insert quotation marks at the opening and closing of `<q>` elements and for the `open-quote` and `close-quote` values of the `content` property. Each opening or closing quote is replaced by one of the strings from the value of `quotes`, based on the depth of nesting, or, if `quotes` is explicitly set to or otherwise resolves to `auto`, the quotation marks used are language dependent.
## Syntax
    
    /* Keyword value */
    quotes: none;
    quotes: auto;
    
    /* <string> values */
    quotes: "«" "»"; /* Set open-quote and close-quote to use French quotation marks */
    quotes: "«" "»" "‹" "›"; /* Set two levels of quotation marks */
    
    /* Global values */
    quotes: inherit;
    quotes: initial;
    quotes: revert;
    quotes: revert-layer;
    quotes: unset;
    
### Values
`none`
    
The `open-quote` and `close-quote` values of the `content` property produce no quotation marks, as if `no-open-quote` and `no-close-quote` were set, respectively.
`auto`
    
Quotation marks that are typographically appropriate for the inherited language (i.e., via the `lang` attribute set on the parent or other ancestor).
`<string>`
    
Defines one or more pairs of quotation mark values for opening and closing quotes. In each pair, the first of each pair of quotes are used as the values for the `open-quote` and the second of each pair is the `close-quote`.
The first pair represents the quotation's outer level. The second pair, if present, represents the first nested level. The next pair is used for doubly nested levels, and so on. If the depth of quote nesting is greater than the number of pairs, the last pair in the `quotes` value is repeated.
Which pair of quotes is used depends on the depth, or nesting level, of quotes: the number of occurrences of `<q>` quotes or `open-quote` (or `no-open-quote`) in all generated text before the current occurrence, minus the number of occurrences of closing quotes, either as `</q>`, `close-quote`, or `no-close-quote`. If the depth is 0, the first pair is used, if the depth is 1, the second pair is used, etc.
Note: The CSS `content` property value `open-quote` increments and `no-close-quote` decrements the quoting level, but does not insert a quotation marks.
## Examples
>
### Default quotes and overrides
This examples compares the default quotes provided by the semantic HTML `<q>` element to those we define using the CSS `quotes` property.
The default value of `quotes` is `auto`. In this example, the first list item has `quotes: auto` set, so gets the default quotes for the language specified; the same as if no `quotes` property was set. The second list item defines which quotation marks to use for quotes and nested quotes; these quotation marks will be used for descendants of an element with `specialQuotes` class regardless of the language (like any `lang` attribute values set).
#### HTML
    
    <ul>
      <li>
        Default quotes:
        <p lang="ru">
          <q
            >Митч Макконнелл - это человек, который знает о России и ее влиянии
            меньше, чем даже Дональд Трамп, и <q>я ничего не знаю</q>, сказал
            Трамп</q
          >, - писал Раджу.
        </p>
      </li>
      <li class="specialQuotes">
        Defined by <code>quotes</code> property :
        <p lang="ru">
          <q
            >Митч Макконнелл - это человек, который знает о России и ее влиянии
            меньше, чем даже Дональд Трамп, и <q>я ничего не знаю</q>, сказал
            Трамп</q
          >, - писал Раджу.
        </p>
      </li>
      <ul></ul>
    </ul>
    
#### CSS
    
    li {
      quotes: auto;
    }
    
    .specialQuotes {
      quotes: "“" "”" "‘" "’";
    }
    
#### Result
By default, browser provide language specific quotation marks when the `<q>` element is used. If the `quotes` property is defined, the values provided override the browser defaults. Note the `quotes` property is inherited. The `quotes` property is set on the `<li>` with the `specialQuotes` class, but the quotes are applied the `<q>` elements.
Note that each open-quote and close-quote is replaced by one of the strings from the value of quotes, based on the depth of nesting.
### Auto quotes
The default value of `quotes` is `auto`. This example works without it being explicitly being set.
#### HTML
    
    <ul>
      <li lang="fr">
        <q>Ceci est une citation française.</q>
      </li>
      <li lang="ru">
        <q>Это русская цитата</q>
      </li>
      <li lang="de">
        <q>Dies ist ein deutsches Zitat</q>
      </li>
      <li lang="en">
        <q>This is an English quote.</q>
      </li>
    </ul>
    
#### CSS
    
    q {
      quotes: auto;
    }
    li:not(:last-of-type) {
      border-bottom: 1px solid;
    }
    
#### Result
Note that the `lang` attribute was placed on an ancestor of the `<q>`, not the `<q>` itself. If a quotation is in a different language than the surrounding text, it is customary to quote the text with the quote marks of the language of the surrounding text, not the language of the quotation itself.
### With generated content
In this example, instead of using the `<q>` element, we are adding quotation marks to the `::before` and `::after` pseudo-elements before and after the content of each element with a specific class name.
#### HTML
    
    <p>
      <span class="quote">I should be using quotes</span>, I thought,
      <span class="quote"
        >But why use semantic HTML elements when I can add classes to
        <span class="quote">ALL THE THINGS!</span>?
      </span>
    </p>
    
#### CSS
    
    .quote {
      quotes: '"' '"' "'" "'";
    }
    .quote::before {
      content: open-quote;
    }
    .quote::after {
      content: close-quote;
    }
    
#### Result
### Text as quotes and empty quotes
This example demonstrates using something other than quotation marks as the `<string>` values. The open-quote indicates the speaker and, as there is not opening quotation mark, the close-quote is the empty. (Mixing a `<string>` with an enumerated keyword to create a pair is not supported). We set `auto` for the nested quotes. These nested quotes will be book-ended by whatever the language dictates is normal for nested quotes.
#### HTML
    
    <ul>
      <li><q data-speaker="karen">Hello</q></li>
      <li><q data-speaker="chad">Hi</q></li>
      <li><q data-speaker="karen">this conversation is not interesting</q></li>
      <li>
        <q data-speaker="pat"
          >OMG! <q>Hi</q>? Seriously? at least <q>hello</q> is five letters long.</q
        >
      </li>
    </ul>
    
#### CSS
    
    [data-speaker="karen" i] {
      quotes: "She said: " "";
    }
    [data-speaker="chad" i] {
      quotes: "He said: " "";
    }
    [data-speaker="pat" i] {
      quotes: "They said: " "";
    }
    [data-speaker] q {
      quotes: auto;
    }
    
#### Result
# margin
The `margin` CSS shorthand property sets the margin area on all four sides of an element.
## Try it
    
    margin: 1em;
    
    
    margin: 5% 0;
    
    
    margin: 10px 50px 20px;
    
    
    margin: 10px 50px 20px 0;
    
    
    margin: 0;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row"></div>
        <div class="row transition-all" id="example-element"></div>
        <div class="row"></div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `margin-top`
  * `margin-right`
  * `margin-bottom`
  * `margin-left`


## Syntax
    
    /* apply to all four sides */
    margin: 1em;
    margin: -3px;
    
    /* top and bottom | left and right */
    margin: 5% auto;
    
    /* top | left and right | bottom */
    margin: 1em auto 2em;
    
    /* top | right | bottom | left */
    margin: 2px 1em 0 auto;
    
    /* anchor-size() values */
    margin: 5% anchor-size(width);
    margin: calc(anchor-size(width) / 4) 1em 0
      anchor-size(--my-anchor self-inline, 50px);
    
    /* Keyword values */
    margin: auto;
    
    /* Global values */
    margin: inherit;
    margin: initial;
    margin: revert;
    margin: revert-layer;
    margin: unset;
    
The `margin` property may be specified using one, two, three, or four values. Each value is a `<length>`, a `<percentage>`, or the keyword `auto`. Negative values draw the element closer to its neighbors than it would be by default.
  * When one value is specified, it applies the same margin to all four sides.
  * When two values are specified, the first margin applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first margin applies to the top, the second to the right and left, the third to the bottom.
  * When four values are specified, the margins apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length>`
    
The size of the margin as a fixed value.
  * For anchor-positioned elements, the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element margin based on anchor size).


`<percentage>`
    
The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
`auto`
    
The browser selects a suitable margin to use. For example, in certain cases this value can be used to center an element.
## Description
This property can be used to set a margin on all four sides of an element. Margins create extra space around an element, unlike `padding`, which creates extra space within an element.
The top and bottom margins have no effect on non-replaced inline elements, such as `<span>` or `<code>`.
### Horizontal centering
You can horizontally center an element within its parent by setting `margin: 0 auto;`.
A more common method to center an element horizontally is by setting `display: flex;` and `justify-content: center;` on a container, which centers its flex item children.
### Margin collapsing
Elements' top and bottom margins are sometimes collapsed into a single margin that is equal to the larger of the two margins. See Mastering margin collapsing for more information.
## Examples
>
### Basic example
#### HTML
    
    <div class="center">This element is centered.</div>
    
    <div class="outside">This element is positioned outside of its container.</div>
    
#### CSS
    
    .center {
      margin: auto;
      background: lime;
      width: 66%;
    }
    
    .outside {
      margin: 3rem 0 0 -3rem;
      background: cyan;
      width: 66%;
    }
    
### More examples
    
    margin: 5%; /* All sides: 5% margin */
    
    margin: 10px; /* All sides: 10px margin */
    
    margin: 1.6em 20px; /* top and bottom: 1.6em margin */
    /* left and right: 20px margin */
    
    margin: 10px 3% -1em; /* top:            10px margin */
    /* left and right: 3% margin   */
    /* bottom:         -1em margin */
    
    margin: 10px 3px 30px 5px; /* top:    10px margin */
    /* right:  3px margin  */
    /* bottom: 30px margin */
    /* left:   5px margin  */
    
    margin: 2em auto; /* top and bottom: 2em margin   */
    /* Box is horizontally centered */
    
    margin: auto; /* top and bottom: 0 margin     */
    /* Box is horizontally centered */
    
# border-inline-start-width
The `border-inline-start-width` CSS property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-start-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-inline-start-width: thick;
    writing-mode: vertical-rl;
    
    
    border-inline-start-width: 4px;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-width'> values */
    border-inline-start-width: 5px;
    border-inline-start-width: thick;
    
    /* Global values */
    border-inline-start-width: inherit;
    border-inline-start-width: initial;
    border-inline-start-width: revert;
    border-inline-start-width: revert-layer;
    border-inline-start-width: unset;
    
Related properties are `border-block-start-width`, `border-block-end-width`, and `border-inline-end-width`, which define the other border widths of the element.
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-inline-start-width: 5px;
    }
    
# box-direction
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This is a property of the original CSS flexible box layout Module draft, and has been replaced by a newer standard. The `-moz-box-direction` will only be used for XUL while the previous standard `box-direction` has been replaced by `flex-direction`. See flexbox for information about the current standard.
The `box-direction` CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge).
## Syntax
    
    /* Keyword values */
    box-direction: normal;
    box-direction: reverse;
    
    /* Global values */
    box-direction: inherit;
    box-direction: initial;
    box-direction: revert;
    box-direction: revert-layer;
    box-direction: unset;
    
The `box-direction` property is specified as one of the keyword values listed below.
### Values
`normal`
    
The box lays out its contents from the start (the left or top edge).
`reverse`
    
The box lays out its contents from the end (the right or bottom edge).
## Notes
The edge of the box designated the start for layout purposes depends on the box's orientation:
  * For horizontal elements, the start is the top edge.
  * For vertical elements, the start is the left edge.


The edge opposite to the start is designated the end.
If the direction is set using the element's `dir` attribute, then the style is ignored.
## Examples
>
### Setting box direction
    
    .example {
      /* bottom-to-top layout */
      -moz-box-direction: reverse; /* Mozilla */
      -webkit-box-direction: reverse; /* WebKit */
      box-direction: reverse; /* As specified */
    }
    
Not part of any standard.
# mask-border-source
The `mask-border-source` CSS property sets the source image used to create an element's mask border.
The `mask-border-slice` property is used to divide the source image into regions, which are then dynamically applied to the final mask border.
## Syntax
    
    /* Keyword value */
    mask-border-source: none;
    
    /* <image> values */
    mask-border-source: url("image.jpg");
    mask-border-source: linear-gradient(to top, red, yellow);
    
    /* Global values */
    mask-border-source: inherit;
    mask-border-source: initial;
    mask-border-source: revert;
    mask-border-source: revert-layer;
    mask-border-source: unset;
    
### Values
`none`
    
No mask border is used.
`<image>`
    
Image reference to use for the mask border.
## Examples
>
### Basic usage
This property doesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to define the source of the border mask.
    
    mask-border-source: url("image.jpg");
    
Chromium-based browsers support an outdated version of this property — `mask-box-image-source` — with a prefix:
    
    -webkit-mask-box-image-source: url("image.jpg");
    
Note: The `mask-border` page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect.
# border-block-style
The `border-block-style` CSS property defines the style of the logical block borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-block-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-block-style: groove;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border style in the other dimension can be set with `border-inline-style`, which sets `border-inline-start-style`, and `border-inline-end-style`.
## Syntax
    
    /* <'border-style'> values */
    border-block-style: dashed;
    border-block-style: dotted;
    border-block-style: groove;
    
    /* Global values */
    border-block-style: inherit;
    border-block-style: initial;
    border-block-style: revert;
    border-block-style: revert-layer;
    border-block-style: unset;
    
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### Dashed border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-block-style: dashed;
    }
    
#### Results
# CSS custom properties for cascading variables
The CSS custom properties for cascading variables module adds support for cascading variables in CSS properties and lets you create custom properties to define these variables along with the mechanisms to use custom properties as the values for other CSS properties.
When working with CSS, you often end up reusing common project-specific values such as widths that work well with your layout, or a set of colors for your color scheme. One way of managing repetition in stylesheets is to define a value once and use it many times in other places. Custom properties let you create and define custom variables that can be reused, simplifying complex or repetitive rules and making them easier to read and maintain. For example, `--dark-grey-text` and `--dark-background` are easier to understand than hexadecimal colors such as `#323831`, and the context of how you use them is more obvious, too.
## Custom properties in action
To see how custom properties can be used, move the input slider left to right.
In these color swatches, the `background-color` is set using the `hsl()` `<color>` function as `hsl(var(--hue) 50% 50%)`. Each color swatch increments the `<hue>` value by 10 degrees like `calc(var(--hue) + 10)`, `calc(var(--hue) + 20)` etc. As the slider's value changes from 0 up to 360, the value of the `--hue` custom property is updated using `calc()`, and the background color of each box inside the grid is updated, also.
## Reference
>
### Properties
  * `--*`


### Functions
  * `var()`


## Guides
Using CSS custom properties (variables)
    
Explains how to use custom properties in CSS and JavaScript, with hints on handling undefined and invalid values, fallbacks, and inheritance.
Invalid custom properties
    
Explains how browsers handle property values when a custom property's value is an invalid data type for that property.
## Related concepts
  * CSS Properties and Values API module 
    * `@property` at-rule
    * `CSS.registerProperty()` method


# border-image-width
The `border-image-width` CSS property sets the width of an element's border image.
## Try it
    
    border-image-width: 30px;
    
    
    border-image-width: 15px 40px;
    
    
    border-image-width: 2.6rem;
    
    
    border-image-width: 20% 8%;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
If this property's value is greater than the element's `border-width`, the border image will extend beyond the padding (and/or content) edge.
## Syntax
    
    /* Keyword value */
    border-image-width: auto;
    
    /* <length> value */
    border-image-width: 1rem;
    
    /* <percentage> value */
    border-image-width: 25%;
    
    /* <number> value */
    border-image-width: 3;
    
    /* top and bottom | left and right */
    border-image-width: 2em 3em;
    
    /* top | left and right | bottom */
    border-image-width: 5% 15% 10%;
    
    /* top | right | bottom | left */
    border-image-width: 5% 2em 10% auto;
    
    /* Global values */
    border-image-width: inherit;
    border-image-width: initial;
    border-image-width: revert;
    border-image-width: revert-layer;
    border-image-width: unset;
    
The `border-image-width` property may be specified using one, two, three, or four values chosen from the list of values below.
  * When one value is specified, it applies the same width to all four sides.
  * When two values are specified, the first width applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length-percentage>`
    
The width of the border, specified as a `<length>` or a `<percentage>`. Percentages are relative to the width of the border image area for horizontal offsets and the height of the border image area for vertical offsets. Must not be negative.
`<number>`
    
The width of the border, specified as a multiple of the corresponding `border-width`. Must not be negative.
`auto`
    
The width of the border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding `border-image-slice`. If the image does not have the required intrinsic dimension, the corresponding `border-width` is used instead.
## Examples
>
### Tiling a border image
This example creates a border image using the following ".png" file, which is 90 by 90 pixels:
Thus, each circle in the source image is 30 by 30 pixels.
#### HTML
    
    <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
      eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
      voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
      kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
    </p>
    
#### CSS
    
    p {
      border: 20px solid;
      border-image: url("border.png") 30 round;
      border-image-width: 16px;
      padding: 40px;
    }
    
#### Result
# height
The `height` CSS property specifies the height of an element. By default, the property defines the height of the content area. If `box-sizing` is set to `border-box`, however, it instead determines the height of the border area.
## Try it
    
    height: 150px;
    
    
    height: 6em;
    
    
    height: 75%;
    
    
    height: auto;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the height.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
The `min-height` and `max-height` properties override `height`.
Note: As a geometric property, `height` also applies to the `<svg>`, `<rect>`, `<image>`, and `<foreignObject>` SVG elements, with `auto` resolving to `0` and percent values being relative to the SVG viewport height for `<rect>`. The CSS `height` property value overrides any SVG `height` attribute value set on the SVG element.
## Syntax
    
    /* <length> values */
    height: 120px;
    height: 10em;
    height: 100vh;
    height: anchor-size(height);
    height: anchor-size(--my-anchor self-block, 250px);
    height: clamp(200px, anchor-size(width));
    
    /* <percentage> value */
    height: 75%;
    
    /* Keyword values */
    height: max-content;
    height: min-content;
    height: fit-content;
    height: fit-content(20em);
    height: auto;
    height: stretch;
    
    /* Global values */
    height: inherit;
    height: initial;
    height: revert;
    height: revert-layer;
    height: unset;
    
### Values
`<length>`
    
Defines the height as a distance value.
`<percentage>`
    
Defines the height as a percentage of the containing block's height.
`auto`
    
The browser will calculate and select a height for the specified element.
`max-content`
    
The intrinsic preferred height.
`min-content`
    
The intrinsic minimum height.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the fit-content formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, <length-percentage>))`.
`stretch`
    
Sets the height of the element's margin box to the height of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
## Accessibility
Ensure that elements set with a `height` aren't truncated and/or don't obscure other content when the page is zoomed to increase text size.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Setting height using pixels and percentages
#### HTML
    
    <div id="taller">I'm 50 pixels tall.</div>
    <div id="shorter">I'm 25 pixels tall.</div>
    <div id="parent">
      <div id="child">I'm half the height of my parent.</div>
    </div>
    
#### CSS
    
    div {
      width: 250px;
      margin-bottom: 5px;
      border: 2px solid blue;
    }
    
    #taller {
      height: 50px;
    }
    
    #shorter {
      height: 25px;
    }
    
    #parent {
      height: 100px;
    }
    
    #child {
      height: 50%;
      width: 75%;
    }
    
#### Result
### Stretch height to fill the containing block
#### HTML
    
    <div class="parent">
      <div class="child">text</div>
    </div>
    
    <div class="parent">
      <div class="child stretch">stretch</div>
    </div>
    
#### CSS
    
    .parent {
      height: 150px;
      margin: 1rem;
      border: solid;
    }
    
    .child {
      margin: 1rem;
      background: #00999999;
    }
    
    .stretch {
      height: stretch;
    }
    
#### Result
# inset
The `inset` CSS property is a shorthand that corresponds to the `top`, `right`, `bottom`, and/or `left` properties. It has the same multi-value syntax of the `margin` shorthand.
This inset properties, including `inset`, have no effect on non-positioned elements.
## Try it
    
    inset: 1em;
    
    
    inset: 5% 0;
    
    
    inset: 2em 50px 20px;
    
    
    inset: 10px 30% 20px 0;
    
    
    inset: 0;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid #ad1457;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #07136c;
      border: 6px solid #ffa000;
      color: white;
      position: absolute;
      inset: 0;
    }
    
While part of the CSS logical properties and values module, it does not define logical offsets. It defines physical offsets, regardless of the element's writing mode, directionality, and text orientation.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `top`
  * `right`
  * `bottom`
  * `left`


## Syntax
    
    /* <length> values */
    inset: 10px; /* value applied to all edges */
    inset: 4px 8px; /* top/bottom left/right */
    inset: 5px 15px 10px; /* top left/right bottom */
    inset: 2.4em 3em 3em 3em; /* top right bottom left */
    inset: calc(anchor(50%) + 10px) anchor(self-start) auto auto;
    inset: anchor-size(block) calc(anchor(50%) + 10px) auto
      calc(anchor-size(width) / 4);
    
    /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */
    inset: 10% 5% 5% 5%;
    
    /* Keyword value */
    inset: auto;
    
    /* Global values */
    inset: inherit;
    inset: initial;
    inset: revert;
    inset: revert-layer;
    inset: unset;
    
### Values
The `inset` property takes the same values as the `left` property.
## Examples
>
### Setting offsets for an element
#### HTML
    
    <div>
      <span class="exampleText">Example text</span>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 150px;
      height: 120px;
      position: relative;
    }
    
    .exampleText {
      writing-mode: sideways-rl;
      position: absolute;
      inset: 20px 40px 30px 10px;
      background-color: #c8c800;
    }
    
#### Result
# ::before
In CSS, `::before` creates a pseudo-element that is the first child of the selected element. It is often used to add cosmetic content to an element with the `content` property. It is inline by default.
## Try it
    
    a {
      color: blue;
      text-decoration: none;
    }
    
    a::before {
      content: "🔗";
    }
    
    .local-link::before {
      content: url("/shared-assets/images/examples/firefox-logo.svg");
      display: inline-block;
      width: 15px;
      height: 15px;
      margin-right: 5px;
    }
    
    
    <p>
      Learning resources for web developers can be found all over the internet. Try
      out
      <a href="https://web.dev/">web.dev</a>,
      <a href="https://www.w3schools.com/">w3schools.com</a> or our
      <a href="https://developer.mozilla.org/" class="local-link">MDN web docs</a>.
    </p>
    
## Syntax
    
    ::before {
      content: /* value */;
      /* properties */
    }
    
## Description
The `::before` pseudo-element is an inline box generated as an immediate child of the element it is associated with, or the "originating element". It is often used to add cosmetic content to an element via the `content` property, such as icons, quote marks, or other decoration.
`::before` pseudo-elements can't be applied to replaced elements such as `<img>`, whose contents are determined by external resources and not affected by the current document's styles.
A `::before` pseudo-element with a `display` value of `list-item` behaves like a list item, and can therefore generate a `::marker` pseudo-element just like an `<li>` element.
If the `content` property is not specified, has an invalid value, or has `normal` or `none` as a value, then the `::before` pseudo-element is not rendered. It behaves as if `display: none` is set.
Note: The Selectors Level 3 specification introduced the double-colon notation `::before` to distinguish pseudo-classes from pseudo-elements. Browsers also accept single-colon notation `:before`, introduced in CSS2.
By default, the `::before` and `::after` pseudo-elements share the same stacking context as their parent. If no `z-index` is explicitly set, the `::after` pseudo-element's generated content will appear above the `::before` pseudo-element's generated content because `::after` is rendered later in the DOM flow.
## Accessibility
Using a `::before` pseudo-element to add content is discouraged, as it is not reliably accessible to screen readers.
## Examples
>
### Quotation marks
One example of using `::before` pseudo-elements is to provide quotation marks. Here we use both `::before` and `::after` to insert quotation characters.
#### HTML
    
    <q>Some quotes</q>, he said, <q>are better than none.</q>
    
#### CSS
    
    q::before {
      content: "«";
      color: blue;
    }
    
    q::after {
      content: "»";
      color: red;
    }
    
#### Result
### Decorative example
We can style text or images in the `content` property almost any way we want.
#### HTML
    
    <span class="ribbon">Notice where the orange box is.</span>
    
#### CSS
    
    .ribbon {
      background-color: #5bc8f7;
    }
    
    .ribbon::before {
      content: "Look at this orange box.";
      background-color: #ffba10;
      border-color: black;
      border-style: dotted;
    }
    
#### Result
### To-do list
In this example we will create a to-do list using pseudo-elements. This method can often be used to add small touches to the UI and improve user experience.
#### HTML
    
    <ul>
      <li>Buy milk</li>
      <li>Take the dog for a walk</li>
      <li>Exercise</li>
      <li>Write code</li>
      <li>Play music</li>
      <li>Relax</li>
    </ul>
    
#### CSS
    
    li {
      list-style-type: none;
      position: relative;
      margin: 2px;
      padding: 0.5em 0.5em 0.5em 2em;
      background: lightgrey;
      font-family: sans-serif;
    }
    
    li.done {
      background: #ccff99;
    }
    
    li.done::before {
      content: "";
      position: absolute;
      border-color: #009933;
      border-style: solid;
      border-width: 0 0.3em 0.25em 0;
      height: 1em;
      top: 1.3em;
      left: 0.6em;
      margin-top: -1em;
      transform: rotate(45deg);
      width: 0.5em;
    }
    
#### JavaScript
    
    const list = document.querySelector("ul");
    list.addEventListener(
      "click",
      (ev) => {
        if (ev.target.tagName === "LI") {
          ev.target.classList.toggle("done");
        }
      },
      false,
    );
    
Here is the above code example running live. Note that there are no icons used, and the check-mark is actually the `::before` that has been styled in CSS. Go ahead and get some stuff done.
#### Result
### Unicode escape sequences
As generated content is CSS, not HTML, you can't use markup entities in content values. If you need to use a special character, and can't enter it literally into your CSS content string, use a unicode escape sequence. This consists of a backslash followed by the character's hexadecimal unicode value.
#### HTML
    
    <ol>
      <li>Crack Eggs into bowl</li>
      <li>Add Milk</li>
      <li>Add Flour</li>
      <li aria-current="step">Mix thoroughly into a smooth batter</li>
      <li>Pour a ladleful of batter onto a hot, greased, flat frying pan</li>
      <li>Fry until the top of the pancake loses its gloss</li>
      <li>Flip it over and fry for a couple more minutes</li>
      <li>serve with your favorite topping</li>
    </ol>
    
#### CSS
    
    li {
      padding: 0.5em;
    }
    
    li[aria-current="step"] {
      font-weight: bold;
    }
    
    li[aria-current="step"]::before {
      content: "\21E8 "; /* Unicode escape sequence for "Rightwards White Arrow" */
      display: inline;
    }
    
#### Result
###  `::before::marker` nested pseudo-elements
The `::before::marker` nested pseudo-element selects the list `::marker` of a `::before` pseudo-element that is itself a list item, that is, it has its `display` property set to `list-item`.
In this demo, we generate extra list items before and after a list navigation menu using `::before` and `::after` (setting them to `display: list-item` so they behave like list items). We then use `ul::before::marker` and `ul::after::marker` to give their list markers a different color.
#### HTML
    
    <ul>
      <li><a href="#">Introduction</a></li>
      <li><a href="#">Getting started</a></li>
      <li><a href="#">Understanding the basics</a></li>
    </ul>
    
#### CSS
    
    ul {
      font-size: 1.5rem;
      font-family: Arial, Helvetica, sans-serif;
    }
    
    ul::before,
    ul::after {
      display: list-item;
      color: orange;
    }
    
    ul::before {
      content: "Start";
    }
    
    ul::after {
      content: "End";
    }
    
    ul::before::marker,
    ul::after::marker {
      color: red;
    }
    
#### Result
While the list bullets of the three navigation items are generated because they are `<li>` elements, "Start" and "End" have been inserted via pseudo-elements and `::marker` is used to style their bullets.
# CSSOM view
The CSSOM view module lets you manipulate the visual view of a document, including getting the position of element layout boxes, obtaining the width or height of the viewport through script, and also scrolling an element.
## Reference
>
### Events
  * `Window` events: 
    * `resize`
  * `VisualViewport` events: 
    * `resize`
    * `scroll`
    * `scrollend`
  * `Document` events 
    * `scroll`
    * `scrollend`
  * `Element` events 
    * `scroll`
    * `scrollend`
  * `MediaQueryList` events 
    * `change`


### Glossary
  * Viewport
  * Layout viewport
  * Visual viewport


### API
For the JavaScript API defined by this module, see the CSSOM view API documentation.
## Guides
Coordinate systems
    
The coordinate systems used to specify a position in a display context such as a window on a monitor, a viewport on a mobile device, or a position on a sheet of paper when printing.
Viewport concepts
    
The concept of the viewport — what it is, its impact in terms of CSS, SVG, and mobile devices — and the difference between the visual viewport and the layout viewport.
## Related concepts
  * `zoom`
  * `<meta>`


### Glossary terms and definitions
  * CSS object model (CSSOM)
  * CSS pixel
  * Scroll container


# @layer
The `@layer` CSS at-rule is used to declare a cascade layer and can also be used to define the order of precedence in case of multiple cascade layers.
## Try it
    
    @layer module, state;
    
    @layer state {
      .alert {
        background-color: brown;
      }
      p {
        border: medium solid limegreen;
      }
    }
    
    @layer module {
      .alert {
        border: medium solid violet;
        background-color: yellow;
        color: white;
      }
    }
    
    
    <p class="alert">Beware of the zombies</p>
    
## Syntax
    
    /* statement at-rules */
    @layer layer-name;
    @layer layer-name, layer-name, layer-name;
    
    /* block at-rules */
    @layer {rules}
    @layer layer-name {rules}
    
where:
layer-name
    
Is the name of the cascade layer.
rules
    
Is the set of CSS rules in the cascade layer.
## Description
Rules within a cascade layer cascade together, giving more control over the cascade to web developers. Styles that are not defined in a layer always override styles declared in named and anonymous layers.
The following diagram shows layer priorities where layers are declared in 1, 2, ..., N order.
As noted in the above diagram, important declarations, declarations with the `!important` flag, have priority over normal declarations, or regular declarations without the `!important` flag. The order of precedence among important rules is the inverse of normal rules. Transitions have the greatest precedence. Next in order of highest to lowest priority are the important user agent declarations, important user declarations, and important author declarations; in that order. Users can specify styles using browser preferences, operating system preferences, or browser extensions. Their important declarations take precedence over author, or web developer written, important declarations.
Within author styles, all important declarations within CSS layers take precedence over any important declarations declared outside of a layer, while all normal declarations within CSS layers have a lower priority than declarations declared outside of a layer. The declaration order matters. The first declared layer gets the lowest priority and the last declared layer gets the highest priority. However, the priority is reversed when the `!important` flag is used.
The `@layer` at-rule is used to create a cascade layer in one of three ways.
The first way is to use a `@layer` block at-rule to create a named cascade layer with the CSS rules for that layer inside, like so:
    
    @layer utilities {
      .padding-sm {
        padding: 0.5rem;
      }
    
      .padding-lg {
        padding: 0.8rem;
      }
    }
    
The second way is to use a `@layer` statement at-rule to create one or more comma-separated named cascade layers without assigning any styles. This can be a single layer, as shown below:
    
    @layer utilities;
    
Multiple layers can be defined at once, as shown below:
    
    @layer theme, layout, utilities;
    
This is useful because the initial order in which layers are declared indicates which layer has precedence. As with declarations, the last layer to be listed will win if declarations are found in multiple layers. Therefore, with the preceding example, if a competing rule was found in `theme` and `utilities`, the one in `utilities` would win and be applied.
A rule in `utilities` would be applied even if it has lower specificity than the rule in `theme`. This is because once the layer order has been established, specificity and order of appearance are ignored. This enables using simpler CSS selectors because you do not have to ensure that a selector will have high enough specificity to override competing rules; all you need to ensure is that it appears in a later layer.
Note: Having declared your layer names, thus setting their order, you can add CSS rules to the layer by re-declaring the name. The styles are then appended to the layer and the layer order will not be changed.
The third way is to create an unnamed layer using a `@layer` block at-rule without including a layer name. For example:
    
    @layer {
      p {
        margin-block: 1rem;
      }
    }
    
This creates an anonymous cascade layer. This layer functions in the same way as named layers; however, rules cannot be assigned to it later. The order of precedence for anonymous layers is the order in which layers are declared, named or not, and lower than the styles declared outside of a layer.
Another way to create a cascade layer is by using `@import`. In this case, the rules would be in the imported stylesheet. Remember that the `@import` at-rule must precede all other types of rules, except `@charset` and `@layer` rules.
    
    @import "theme.css" layer(utilities);
    
### Nesting layers
Layers may be nested. For example:
    
    @layer framework {
      @layer layout {
      }
    }
    
To append rules to the `layout` layer inside `framework`, join the two names with a `.`.
    
    @layer framework.layout {
      p {
        margin-block: 1rem;
      }
    }
    
## Examples
>
### Basic example
In the following example, two CSS rules are created. One for the `<p>` element outside of any layer and one inside a layer named `type` for `.box p`.
Without layers, the selector `.box p` would have the highest specificity, and therefore, the text `Hello, world!` will display in green. As the `type` layer comes before the anonymous layer created to hold non-layer content, the text will be purple.
Also notice the order. Even though we declare the non-layered style first, it's still applied after the layer styles.
#### HTML
    
    <div class="box">
      <p>Hello, world!</p>
    </div>
    
#### CSS
    
    p {
      color: rebeccapurple;
    }
    
    @layer type {
      .box p {
        font-weight: bold;
        font-size: 1.3em;
        color: green;
      }
    }
    
#### Result
### Assigning rules to existing layers
In the following example, two layers are created with no rules applied, then CSS rules are applied to the two layers. The `base` layer defines a `color`, `border`, `font-size`, and `padding`. The `special` layer defines a different color. As `special` comes last when the layers were defined, the color it provides is used and the text is displayed using `rebeccapurple`. All of the other rules from `base` still apply.
#### HTML
    
    <div class="item">
      I am displayed in <code>color: rebeccapurple</code> because the
      <code>special</code> layer comes after the <code>base</code> layer. My green
      border, font-size, and padding come from the <code>base</code> layer.
    </div>
    
#### CSS
    
    @layer base, special;
    
    @layer special {
      .item {
        color: rebeccapurple;
      }
    }
    
    @layer base {
      .item {
        color: green;
        border: 5px solid green;
        font-size: 1.3em;
        padding: 0.5em;
      }
    }
    
#### Result
# ::first-line
The `::first-line` CSS pseudo-element applies styles to the first line of a block container.
## Try it
    
    p::first-line {
      font-size: 1.2rem;
      font-weight: bold;
      text-decoration: underline;
    }
    
    
    <p>
      In warm ocean waters around the world, you may see a strange sight: A fish
      leaping from the water and soaring dozens of meters before returning to the
      ocean's depths. Early Mediterranean sailors thought these flying fish returned
      to the shore at night to sleep, and therefore called this family of marine
      fish Exocoetidae.
    </p>
    
The effects of `::first-line` are limited by the length and content of the first line of text in the element. The length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text. `::first-line` has no effect when the first child of the element, which would be the first part of the first line, is an inline block-level element, such as an inline table.
Note: Selectors Level 3 introduced the double-colon notation (`::`) to distinguish pseudo-elements from the single-colon (`:`) pseudo-classes. Browsers accept both `::first-line` and `:first-line`, which was introduced in CSS2.
For the purposes of CSS `background`, the `::first-line` pseudo-element is like an inline-level element meaning that in a left-justified first line, the background may not extend all the way to the right margin.
## Allowable properties
Only a small subset of CSS properties can be used with the `::first-line` pseudo-element:
  * All font-related properties: `font`, `font-kerning`, `font-style`, `font-variant`, `font-variant-numeric`, `font-variant-position`, `font-variant-east-asian`, `font-variant-caps`, `font-variant-alternates`, `font-variant-ligatures`, `font-synthesis`, `font-feature-settings`, `font-language-override`, `font-weight`, `font-size`, `font-size-adjust`, `font-stretch`, and `font-family`
  * All background-related properties: `background-color`, `background-clip`, `background-image`, `background-origin`, `background-position`, `background-repeat`, `background-size`, `background-attachment`, and `background-blend-mode`
  * The `color` property
  * `word-spacing`, `letter-spacing`, `text-decoration`, `text-transform`, and `line-height`
  * `text-shadow`, `text-decoration`, `text-decoration-color`, `text-decoration-line`, `text-decoration-style`, and `vertical-align`.


## Syntax
    
    ::first-line {
      /* ... */
    }
    
## Examples
>
### Styling first line of a paragraph
#### HTML
    
    <p>
      Styles will only be applied to the first line of this paragraph. After that,
      all text will be styled like normal. See what I mean?
    </p>
    
    <span>
      The first line of this text will not receive special styling because it is not
      a block-level element.
    </span>
    
#### CSS
    
    ::first-line {
      color: blue;
      font-weight: bold;
    
      /* WARNING: DO NOT USE THESE */
      /* Many properties are invalid in ::first-line pseudo-elements */
      margin-left: 20px;
      text-indent: 20px;
    }
    
### Result
### Styling the first line of a SVG text element
In this example, we style the first line of an SVG `<text>` element using the `::first-line` pseudo-element.
Note: At time of writing this feature has limited support.
#### HTML
    
    <svg viewBox="0 0 320 150">
      <text y="20">Here is an English paragraph
    that is broken into multiple lines
    in the source code so that it can
    be more easily read and edited
    in a text editor.
      </text>
    </svg>
    
#### CSS
In order to make the SVG `<text>` element wrap to multiple lines, we use the `white-space` CSS property. We then select the first line using the `::first-line` pseudo-element.
    
    text {
      white-space: break-spaces;
    }
    
    text::first-line {
      fill: blue;
      font-weight: bold;
    }
    
#### Result
# scrollbar-gutter
The `scrollbar-gutter` CSS property allows authors to reserve space for the scrollbar, preventing unwanted layout changes as the content grows while also avoiding unnecessary visuals when scrolling isn't needed.
An element's scrollbar gutter is the space between the inner border edge and the outer padding edge, where the browser may display a scrollbar. If no scrollbar is present, the gutter will be painted as an extension of the padding.
The browser determines whether classic scrollbars or overlay scrollbars are used:
  * Classic scrollbars are always placed in a gutter, consuming space when present.
  * Overlay scrollbars are placed over the content, not in a gutter, and are usually partially transparent.


## Syntax
    
    /* Initial value */
    scrollbar-gutter: auto;
    
    /* "stable" keyword, with optional modifier */
    scrollbar-gutter: stable;
    scrollbar-gutter: stable both-edges;
    
    /* Global values */
    scrollbar-gutter: inherit;
    scrollbar-gutter: initial;
    scrollbar-gutter: revert;
    scrollbar-gutter: revert-layer;
    scrollbar-gutter: unset;
    
### Values
`auto`
    
The initial value. Classic scrollbars create a gutter when `overflow` is `scroll`, or when `overflow` is `auto` and the box is overflowing. Overlay scrollbars do not consume space.
`stable`
    
When using classic scrollbars, the gutter will be present if `overflow` is `auto`, `scroll`, or `hidden` even if the box is not overflowing. When using overlay scrollbars, the gutter will not be present.
`both-edges`
    
If a gutter would be present on one of the inline start/end edges of the box, another will be present on the opposite edge as well.
## Examples
The examples below show how the different values for the `scrollbar-gutter` property would affect a scrollable `div` element (`.container`) with one or more paragraphs contained within.
Note: In the images for the examples, the user's system settings are set to classic scrollbars (always shown).
### Example 1
Prevent unneeded layout changes as the content growing or shrinking causes the scrollbar to appear/disappear, a space is reserved for it.
    
    .container {
      scrollbar-gutter: stable;
    }
    
### Example 2
Add symmetric spacing to both sides of the box so the content is centered:
    
    .container {
      scrollbar-gutter: stable both-edges;
    }
    
### Example 3
Align the contents of a non-scrolling element and a scrolling one adjacent to it: This example shows two divs side by side. The one on the left has no scroll, but the one on the right does. Both have `scrollbar-gutter` applied, which also reserves space for the div on the left which doesn't have scrollable content. This is a good technique to use to keep the width of content consistent.
    
    .container1 {
      overflow: hidden;
      scrollbar-gutter: stable;
    }
    
    .container2 {
      scrollbar-gutter: stable;
    }
    
### Overlay scrollbars
For reference, this image shows the same div as above, but with the user's system settings set to overlay scrollbars. Note here the scrollbar will only show when the user is scrolling and on top of the content, so no space is reserved for it and the `scrollbar-gutter` property has no effect.
# corner-bottom-shape
The `corner-bottom-shape` CSS property specifies the shape of both the corners on a box's bottom edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-bottom-shape` property is a shorthand for the following physical properties:
  * `corner-bottom-left-shape`
  * `corner-bottom-right-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-bottom-shape: scoop;
    corner-bottom-shape: square;
    
    /* Single superellipse() value set for both corners */
    corner-bottom-shape: superellipse(0.7);
    corner-bottom-shape: superellipse(-2.8);
    
    /* Left-hand corner, right-hand corner */
    corner-bottom-shape: scoop square;
    corner-bottom-shape: scoop superellipse(0.7);
    
    /* Global values */
    corner-bottom-shape: inherit;
    corner-bottom-shape: initial;
    corner-bottom-shape: revert;
    corner-bottom-shape: revert-layer;
    corner-bottom-shape: unset;
    
### Values
The `corner-bottom-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both bottom corners.
  * If two values are used, the first one specifies the shape of the bottom-left corner, and the second one specifies the shape of the bottom-right corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-bottom-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `60px 30px 20% 40%`, and a `corner-bottom-shape` of `square squircle`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px 30px 20% 40%;
      corner-bottom-shape: square squircle;
    }
    
#### Result
The rendered result looks like this:
# inset-block
The `inset-block` CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    inset-block: 10px 20px;
    writing-mode: horizontal-tb;
    
    
    inset-block: 20px 40px;
    writing-mode: vertical-rl;
    
    
    inset-block: 5% 20%;
    writing-mode: horizontal-tb;
    
    
    inset-block: 1rem auto;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid #ad1457;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #07136c;
      border: 6px solid #ffa000;
      color: white;
      position: absolute;
      inset: 0;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `inset-block-end`
  * `inset-block-start`


## Syntax
    
    /* <length> values */
    inset-block: 3px 10px;
    inset-block: 2.4em 3em;
    inset-block: 10px; /* value applied to start and end */
    inset-block: auto anchor(start);
    inset-block: 10em anchor-size(--my-anchor height, 10%);
    
    /* <percentage>s of the width or height of the containing block */
    inset-block: 10% 5%;
    
    /* Keyword value */
    inset-block: auto;
    
    /* Global values */
    inset-block: inherit;
    inset-block: initial;
    inset-block: revert;
    inset-block: revert-layer;
    inset-block: unset;
    
### Values
The `inset-block` property takes the same values as the `left` property.
## Examples
>
### Setting block start and end offsets
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      position: relative;
      inset-block: 20px 50px;
      background-color: #c8c800;
    }
    
#### Result
# text-box-edge
The `text-box-edge` CSS property specifies an amount of space to trim from a text element's block container.
Vertical spacing differs between fonts, making consistent typesetting historically challenging on the web. The `text-box-edge` property — along with its counterpart property `text-box-trim`, which specifies which edge(s) to trim space from — makes consistent typesetting easier to achieve. The `text-box-edge` property has no effect if `text-box-trim` is not set or is set to `none`.
Note: The `text-box` shorthand property can be used to specify the `text-box-edge` and `text-box-trim` values in a single declaration.
## Syntax
    
    /* Single keyword */
    text-box-edge: auto;
    text-box-edge: text;
    
    /* Two <text-edge> values */
    text-box-edge: text text;
    text-box-edge: text alphabetic;
    text-box-edge: cap alphabetic;
    text-box-edge: ex text;
    
    /* Global values */
    text-box-edge: inherit;
    text-box-edge: initial;
    text-box-edge: revert;
    text-box-edge: revert-layer;
    text-box-edge: unset;
    
### Value
The `text-box-edge` property value is specified as `auto` or a `<text-edge>` value:
`auto`
    
The default value. Equivalent to the `text-edge` value `text`.
`<text-edge>`
    
One or two separate keywords representing over and under edge positions to trim the text element's block container to.
  * If two values are specified, the first value specifies the trimming behavior to apply to the block-start (over) edge of the text, and the second value specifies the trimming behavior to apply to the block-end (under) edge of the text. 
    * Valid over edge trimming values: `text`, `cap`, and `ex`.
    * Valid under edge trimming values: `text` and `alphabetic`.
  * If one value is specified, it specifies the over and under edge trimming behavior. At the time of writing, the only valid single value is `text`.


## Description
The height of text-only content is relative to the height of the font. In digital font files, the height contains all characters, including capital letters, ascenders, descenders, etc. Different fonts have different base line-heights, meaning that lines of text with the same `font-size` will produce line boxes of differing heights, affecting the appearance of spacing between lines.
The `text-box-edge` property allows you to trim space from the start and/or end edge of the text's block container. This can include the leading at the text's block-start edge and block-end edges and the spacing defined inside the font (as described above). It does this by specifying a `<text-edge>` value that indicates the over edge and under edge to trim the space to.
Which edge(s) to trim space from is specified using the `text-box-trim` property. For example, you can choose to trim space from the over edge or the under edge of the text's block container, or both.
These properties make it much easier to control text spacing in the block direction.
## Examples
>
### Basic `text-box-edge` usage
The most common `text-box-edge` values you'll use for horizontal `writing-mode` languages such as English or Arabic are `cap alphabetic` and `ex alphabetic`. The `cap` value trims the over edge of the text element's block container to the top of the capital letters, whereas `ex` trims the over edge to the font's x-height (the top edge of the short lower-case letters). In each case, `alphabetic` trims the under-edge flush with the text baseline.
In this example, we demonstrate the effect of both of these common values, on two `<p>` elements. Additionally, a `text-box-trim` value of `trim-both` has been set on both of them, so that their start and end edges are trimmed.
    
    p {
      text-box-trim: trim-both;
      border-top: 5px solid magenta;
      border-bottom: 5px solid magenta;
    }
    
    .one {
      text-box-edge: cap alphabetic;
    }
    
    .two {
      text-box-edge: ex alphabetic;
    }
    
#### Result
The output is as follows. Note how we've included a top and bottom border on each paragraph, so that you can see how the space has been trimmed in each case.
### Interactive `text-box-edge` value comparison
For a complete interactive `text-box-edge` example, see the `text-box-trim` page.
# contain-intrinsic-size
The `contain-intrinsic-size` CSS shorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `contain-intrinsic-width`
  * `contain-intrinsic-height`


## Syntax
    
    /* Keyword values */
    contain-intrinsic-size: none;
    
    /* <length> values */
    contain-intrinsic-size: 1000px;
    contain-intrinsic-size: 10rem;
    
    /* width | height */
    contain-intrinsic-size: 1000px 1.5em;
    
    /* auto <length> */
    contain-intrinsic-size: auto 300px;
    contain-intrinsic-size: auto none;
    
    /* auto width | auto height */
    contain-intrinsic-size: auto 300px auto 4rem;
    
    /* Global values */
    contain-intrinsic-size: inherit;
    contain-intrinsic-size: initial;
    contain-intrinsic-size: revert;
    contain-intrinsic-size: revert-layer;
    contain-intrinsic-size: unset;
    
### Values
The following values may be specified for the `contain-intrinsic-size` property:
`none`
    
The element has no intrinsic size in the given dimension(s).
`<length>`
    
The element has the specified `<length>` in the given dimension(s).
`auto [<length> | none]`
    
A remembered value of the "normally rendered" element size if one exists and the element is skipping its contents (for example, when it is offscreen); otherwise the specified `<length>`. The `none` keyword may be used in place of `<length>` where `0px` fixed lengths behave differently than `none` (such as in multi column, or grid layouts).
If one value is provided as a keyword, a length or an `auto [<length> | none]` pair, it applies to both width and height.
Two length values may be specified, which apply to the width and height in that order. If two `auto [<length> | none]` pairs are specified, the first pair applies to the width, and the second to the height.
## Description
The property is commonly applied alongside elements that can trigger size containment, such as `contain: size` and `content-visibility`.
Size containment allows a user agent to lay out an element as though it had a fixed size, preventing unnecessary reflows by avoiding the re-rendering of child elements to determine the actual size (thereby improving user experience). By default, size containment treats elements as though they had no contents, and may collapse the layout in the same way as if the contents had no width or height. The `contain-intrinsic-size` property allows authors to specify an appropriate value to be used as the size for layout.
The `auto <length>` value allows the size of the element to be stored if the element is ever "normally rendered" (with its child elements), and then used instead of the specified length when the element is skipping its contents. This allows offscreen elements with `content-visibility: auto` to benefit from size containment without developers having to be as precise in their estimates of element size. The remembered value is not used if the child elements are being rendered (if size containment is enabled, the `<length>` will be used).
In grid and multi column layouts, an explicit size is treated differently than implicit content-based height. Elements might lay out substantially differently than it would have were it simply filled with content up to that height. The `auto none` value allows the element to fallback to `contain-intrinsic-size: none` if no remembered value exists, which will allow the element to be laid out as though it had no contents. This is almost always preferred to setting 0px as the intrinsic size in grid and multi column layouts, where contained elements may overflow their parents and can result in unexpected page layout.
## Examples
>
### Using auto value pairs for intrinsic size
This example demonstrates `contain-intrinsic-size: auto <length>` and `contain-intrinsic-size: auto none`, using a layout where there are many elements displayed vertically that have both accurate and incorrect intrinsic size estimations. Using `content-visibility: auto` skips rendering elements when they are offscreen, so this property is a good candidate to combine with `contain-intrinsic-size` to improve rendering performance and minimize reflows.
The `contain-intrinsic-size: auto 500px` value pair tells the browser to use 500px as a kind of 'placeholder' size (width and height) for the element when it is offscreen and the page is being laid out. When the user scrolls to the element and it needs to be displayed, the browser will calculate the actual size of the element and its contents. If there is a difference between the placeholder and calculated size this might force a new layout, with accompanying changes to the sidebar position.
Once the browser has actual size information for the element, it will remember this size when the element scrolls offscreen again, and use the remembered size for layout calculations instead of the placeholder value. The benefit is that the browser does not need to repeatedly render the element contents to calculate its size and is especially useful when the contents are complex or depend on network resources or JavaScript.
#### HTML
    
    <div id="container">
      <div id="auto-length-note">
        <p>
          Your browser does not support
          <code>contain-intrinsic-size: auto &lt;length&gt;</code>.
        </p>
      </div>
      <div class="auto-length">
        <p>Item one</p>
      </div>
      <div class="auto-length">
        <p>Item two</p>
      </div>
      <div class="auto-length large-intrinsic-size">
        <p class="small">Item three</p>
      </div>
      <div class="auto-length large-intrinsic-size">
        <p class="small">Item four</p>
      </div>
      <div id="auto-none-note">
        <p>
          Your browser does not support
          <code>contain-intrinsic-size: auto none</code>.
        </p>
      </div>
      <div class="auto-length none">
        <p>Item five</p>
      </div>
      <div class="auto-length none">
        <p>Item six</p>
      </div>
    </div>
    
#### CSS
    
    p {
      height: 500px;
      width: 500px;
      border: 4px dotted;
      background: lightblue;
    }
    
    .auto-length {
      content-visibility: auto;
      contain-intrinsic-size: auto 500px;
      background-color: linen;
      outline: 4px dotted blue;
    }
    
    .large-intrinsic-size {
      /* Setting an inaccurate intrinsic size for the element */
      contain-intrinsic-size: auto 5000px;
      background-color: lightgray;
      outline: 4px dotted red;
    }
    
    .small {
      /* This element is a lot smaller than expected */
      height: 100px;
      width: 100px;
    }
    
    .none {
      background-color: papayawhip;
      contain-intrinsic-size: auto none;
      outline: 4px dotted red;
    }
    
#### Result
  * The first two boxes have an intrinsic size that matches their actual size, so as they flow into view, the layout is recalculated but we see no change in the scrollbar or the scroll position.
  * The third and fourth boxes have a huge intrinsic size, so the initial layout that the browser calculated is far too big, and we've made these boxes smaller so that it's obvious when you've reached a point that forces a drastic layout change.
When the third and fourth boxes scroll into view, the size is recalculated, making the box and its parent less tall. The effect is that the scroller jumps down the page (we've effectively scrolled further through the box than we'd estimated) and the scroller is longer, because the entire page is less tall than we'd estimated.
  * The last boxes have `auto none`, so they have zero estimated size. When they scroll into view the size of the element and its parent are recalculated to be much larger, so the scroller decreases in size and moves up the bar.


After scrolling all the way to the bottom you can subsequently scroll up and down smoothly, because using `content-visibility: auto` saves the actual rendered size of the element for next time it is displayed.
### Setting the intrinsic size
This example provides selection lists that can be used to modify `contain-intrinsic-size`, `content-visibility` and `contain` on an element in order to observe the effect of the different settings.
#### CSS
    
    #contained_element {
      border: 2px solid green;
      width: 120px;
    }
    .child_element {
      border: 1px solid red;
      background: blue;
      height: 50px;
      width: 150px;
    }
    
#### JavaScript
The code below adds styles to, and removes styles from, the containing element based on the selected options.
    
    const containedElement = document.querySelector("#contained_element");
    const intrinsicSizeSelector = document.querySelector(
      "#contain_intrinsic_size_selector",
    );
    const containSelector = document.querySelector("#contain_selector");
    const contentVisibilitySelector = document.querySelector(
      "#content_visibility_selector",
    );
    
    containedElement.style["contain-intrinsic-size"] =
      intrinsicSizeSelector.options[intrinsicSizeSelector.selectedIndex].text;
    containedElement.style["contain"] =
      containSelector.options[containSelector.selectedIndex].text;
    containedElement.style["content-visibility"] =
      contentVisibilitySelector.options[
        contentVisibilitySelector.selectedIndex
      ].text;
    
    intrinsicSizeSelector.addEventListener("change", () => {
      containedElement.style["contain-intrinsic-size"] =
        intrinsicSizeSelector.options[intrinsicSizeSelector.selectedIndex].text;
    });
    
    containSelector.addEventListener("change", () => {
      containedElement.style["contain"] =
        containSelector.options[containSelector.selectedIndex].text;
    });
    
    contentVisibilitySelector.addEventListener("change", () => {
      containedElement.style["content-visibility"] =
        contentVisibilitySelector.options[
          contentVisibilitySelector.selectedIndex
        ].text;
    });
    
#### HTML
The HTML defines two buttons, a container element that is subject to containment via the `content-visibility` property.
    
    <p>
      <label for="contain_intrinsic_size_selector">contain-intrinsic-size:</label>
      <select id="contain_intrinsic_size_selector">
        <option>none</option>
        <option>40px 130px</option>
        <option>auto 40px auto 130px</option></select
      >;<br />
    
      <label for="contain_selector">contain:</label>
      <select id="contain_selector">
        <option>none</option>
        <option>size</option>
        <option>strict</option></select
      >;<br />
    
      <label for="content_visibility_selector">content-visibility:</label>
      <select id="content_visibility_selector">
        <option>visible</option>
        <option>auto</option>
        <option>hidden</option></select
      >;
    </p>
    
    <div id="contained_element">
      <div class="child_element"></div>
    </div>
    
#### Result
Use the selectors to apply the given styles to the containing `div` element. Note that when `content-visibility` is `visible` or `auto`, changing `contain-intrinsic-size` makes no difference. However if the content is hidden, having a `contain-intrinsic-size` of `none` collapses the parent element as though its child element had no size.
# scroll-padding
The `scroll-padding` shorthand property sets scroll padding on all sides of an element at once, much like the `padding` property does for padding on an element.
## Try it
    
    scroll-padding: 0;
    
    
    scroll-padding: 20px;
    
    
    scroll-padding: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
The `scroll-padding-*` properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars), or to put more breathing room between a targeted element and the edges of the scrollport.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-padding-bottom`
  * `scroll-padding-left`
  * `scroll-padding-right`
  * `scroll-padding-top`


## Syntax
    
    /* Keyword values */
    scroll-padding: auto;
    
    /* <length> values */
    scroll-padding: 10px;
    scroll-padding: 1em 0.5em 1em 1em;
    scroll-padding: 10%;
    
    /* Global values */
    scroll-padding: inherit;
    scroll-padding: initial;
    scroll-padding: revert;
    scroll-padding: revert-layer;
    scroll-padding: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the corresponding edge of the scrollport, as a valid `<length>` or a `<percentage>`.
`auto`
    
The offset is determined by the user agent. This will generally be `0px`, but the user agent is free to detect and do something else if a non-zero value is more appropriate.
# border-inline-start-color
The `border-inline-start-color` CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-start-color: red;
    writing-mode: horizontal-tb;
    
    
    border-inline-start-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-inline-start-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    border-inline-start-color: red;
    border-inline-start-color: #ee4141;
    
    /* Global values */
    border-inline-start-color: inherit;
    border-inline-start-color: initial;
    border-inline-start-color: revert;
    border-inline-start-color: revert-layer;
    border-inline-start-color: unset;
    
Related properties are `border-block-start-color`, `border-block-end-color`, and `border-inline-end-color`, which define the other border colors of the element.
### Values
`<color>`
    
The color of the border.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-inline-start-color: red;
    }
    
# :invalid
The `:invalid` CSS pseudo-class represents any `<form>`, `<fieldset>`, `<input>` or other `<form>` element whose contents fail to validate.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:invalid {
      background-color: ivory;
      border: none;
      outline: 2px solid red;
      border-radius: 5px;
    }
    
    
    <form>
      <label for="email">Email Address:</label>
      <input id="email" name="email" type="email" value="na@me@example.com" />
    
      <label for="secret">Secret Code: (lower case letters)</label>
      <input id="secret" name="secret" type="text" value="test" pattern="[a-z]+" />
    
      <label for="age">Your age: (18+)</label>
      <input id="age" name="age" type="number" value="5" min="18" />
    
      <label
        ><input name="tos" type="checkbox" required checked /> - Do you agree to
        ToS?</label
      >
    </form>
    
This pseudo-class is useful for highlighting field errors for the user.
## Syntax
    
    :invalid {
      /* ... */
    }
    
## Accessibility
The color red is commonly used to indicate invalid input. People who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning. Typically, descriptive text and/or an icon are used.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.1 | W3C Understanding WCAG 2.0


## Examples
>
### Coloring elements to show validation
#### HTML
    
    <form>
      <div class="field">
        <label for="url_input">Enter a URL:</label>
        <input type="url" id="url_input" />
      </div>
    
      <div class="field">
        <label for="email_input">Enter an email address:</label>
        <input type="email" id="email_input" required />
      </div>
    </form>
    
#### CSS
    
    label {
      display: block;
      margin: 1px;
      padding: 1px;
    }
    
    .field {
      margin: 1px;
      padding: 1px;
    }
    
    input:invalid {
      background-color: #ffdddd;
    }
    
    form:invalid {
      border: 5px solid #ffdddd;
    }
    
    input:valid {
      background-color: #ddffdd;
    }
    
    form:valid {
      border: 5px solid #ddffdd;
    }
    
    input:required {
      border-color: maroon;
      border-width: 3px;
    }
    
    input:required:invalid {
      border-color: #c00000;
    }
    
#### Result
### Showing sections in stages
In this example we use `:invalid` along with `~`, the subsequent-sibling combinator, to make a form appear in stages, so the form initially shows the first item to complete, and when the user completes each item the form displays the next one. When the whole form is complete the user can submit it.
#### HTML
    
    <form>
      <fieldset>
        <label for="form-name">Name</label><br />
        <input type="text" name="name" id="form-name" required />
      </fieldset>
    
      <fieldset>
        <label for="form-email">Email Address</label><br />
        <input type="email" name="email" id="form-email" required />
      </fieldset>
    
      <fieldset>
        <label for="form-message">Message</label><br />
        <textarea name="message" id="form-message" required></textarea>
      </fieldset>
    
      <button type="submit" name="send">Submit</button>
    </form>
    
#### CSS
    
    /* Hide the fieldset after an invalid fieldset */
    fieldset:invalid ~ fieldset {
      display: none;
    }
    
    /* Dim and disable the button while the form is invalid */
    form:invalid button {
      opacity: 0.3;
      pointer-events: none;
    }
    
    input,
    textarea {
      box-sizing: border-box;
      width: 100%;
      font-family: monospace;
      padding: 0.25em 0.5em;
    }
    
    button {
      width: 100%;
      border: thin solid darkgrey;
      font-size: 1.25em;
      background-color: darkgrey;
      color: white;
    }
    
#### Result
## Notes
>
### Radio buttons
If any one of the radio buttons in a group is `required`, the `:invalid` pseudo-class is applied to all of them if none of the buttons in the group is selected. (Grouped radio buttons share the same value for their `name` attribute.)
### Gecko defaults
By default, Gecko does not apply a style to the `:invalid` pseudo-class. However, it does apply a style (a red "glow" using the `box-shadow` property) to the `:user-invalid` pseudo-class, which applies in a subset of cases for `:invalid`.
# animation-range
The `animation-range` CSS shorthand property is used to set the start and end of an animation's attachment range along its timeline, i.e., where along the timeline an animation will start and end.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `animation-range-start`
  * `animation-range-end`


## Syntax
    
    /* single keyword or length percentage value */
    animation-range: normal; /* Equivalent to normal normal */
    animation-range: 20%; /* Equivalent to 20% normal */
    animation-range: 100px; /* Equivalent to 100px normal */
    
    /* single named timeline range value */
    animation-range: cover; /* Equivalent to cover 0% cover 100% */
    animation-range: contain; /* Equivalent to contain 0% contain 100% */
    animation-range: cover 20%; /* Equivalent to cover 20% cover 100% */
    animation-range: contain 100px; /* Equivalent to contain 100px cover 100% */
    
    /* two values for range start and end */
    animation-range: normal 25%;
    animation-range: 25% normal;
    animation-range: 25% 50%;
    animation-range: entry exit; /* Equivalent to entry 0% exit 100% */
    animation-range: cover cover 200px; /* Equivalent to cover 0% cover 200px */
    animation-range: entry 10% exit; /* Equivalent to entry 10% exit 100% */
    animation-range: 10% exit 90%;
    animation-range: entry 10% 90%;
    
The `animation-range` shorthand property can be applied to a container element as a combination of the `<animation-range-start>` and `<animation-range-end>` values. If both the values are specified, they will be interpreted in the order `<animation-range-start>` then `<animation-range-end>`.
As shown by the comments in the syntax block above, if only a single value is provided there are a couple of possible interpretations:
  * If the value is a `<length-percentage>` or `normal`, `<animation-range-start>` will take that value, and `<animation-range-end>` will equal `normal`.
  * If the value is a named timeline range without a `<length-percentage>` following it, the range will be between that named timeline range at 0% and 100%.
  * If the value is a named timeline range with a `<length-percentage>` following it, the range will start at that named timeline range and percentage, and end at that named timeline range and 100%.


### Values
One or two values representing the `animation-range-start` and/or `animation-range-end`. These values can be one of the following:
`normal`
    
Represents the start of the timeline in the case of `animation-range-start` and the end of the timeline in the case of `animation-range-end`. This is the default value.
`<length-percentage>`
    
A length or percentage value measured from the beginning of the timeline.
`<timeline-range-name>`
    
A specific named timeline range inside the overall timeline. Possible values are:
`cover`
    
Represents the full range of a named view progress timeline (see CSS scroll-driven animations for more details), from the point where the subject element first starts to enter the scroll port's view progress visibility range (0% progress) to the point where it has completely left it (100% progress).
`contain`
    
Represents the range of a named view progress timeline where the subject element is fully contained by, or fully contains, the scroll port's view progress visibility range.
  * If the subject element is smaller than the scrollport, it ranges from the point where the subject element is first completely contained by the scroll port (0% progress), to the point where it is no longer completely contained by the scroll port (100% progress).
  * If the subject element is larger than the scrollport, it ranges from the point where the subject element first completely covers the scroll port (0% progress), to the point where it no longer completely covers the scroll port (100% progress).


`entry`
    
Represents the range of a named view progress timeline from the point where the subject element first starts to enter the scroll port (0% progress), to the point where it has completely entered the scroll port (100%).
`exit`
    
Represents the range of a named view progress timeline from the point where the subject element first starts to exit the scroll port (0% progress), to the point where it has completely exited the scroll port (100%).
`entry-crossing`
    
Represents the range of a named view progress timeline from the point where the subject element first starts to cross the scroll port's starting edge (0% progress), to the point where it has completely crossed the scroll port's starting edge (100%).
`exit-crossing`
    
Represents the range of a named view progress timeline from the point where the subject element first starts to cross the scroll port's end edge (0% progress), to the point where it has completely crossed the scroll port's end edge (100%).
In the case of `<timeline-range-name>` values that do not include a `<length-percentage>`, the percentage defaults to `0%` if it is an `animation-range-start` value, and `100%` if it is an `animation-range-end` value.
Note: It is quite hard to visualize what these values mean from the descriptions above. Fortunately, the View Timeline Ranges Visualizer shows exactly what they mean in an easy visual format.
`<timeline-range-name> <length-percentage>`
    
A combination value that equals the specified percentage or distance through the specified named timeline range, measured from the start of that timeline range.
Note: The scroll port (see Scroll container for more details) area known as the view progress visibility range is the area inside which the subject element of a named view progress timeline animation is deemed to be visible. By default, this is the full range of the scrollport, but it can be adjusted using the `view-timeline-inset` property.
## Examples
>
### View Timeline Ranges Visualizer
See the View Timeline Ranges Visualizer for a nice easy visual explanation of what all the value types mean.
### Creating a named view progress timeline with range
A view progress timeline named `--subject-reveal` is defined using the `view-timeline` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
An `animation-range` declaration is also set to make the animation begin later than expected, and finish earlier.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed. We also give it an `animation-range` declaration to make the animation begin later than expected, and finish earlier.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline: --subject-reveal block;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-range: entry 10% contain 25%;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# border-inline-end
The `border-inline-end` CSS property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet.
## Try it
    
    border-inline-end: solid;
    writing-mode: horizontal-tb;
    
    
    border-inline-end: dashed red;
    writing-mode: vertical-rl;
    
    
    border-inline-end: 1rem solid;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-inline-end-color`
  * `border-inline-end-style`
  * `border-inline-end-width`


## Syntax
    
    border-inline-end: 1px;
    border-inline-end: 2px dashed;
    border-inline-end: medium dashed blue;
    
    /* Global values */
    border-inline-end: inherit;
    border-inline-end: initial;
    border-inline-end: revert;
    border-inline-end: revert-layer;
    border-inline-end: unset;
    
The physical border to which `border-inline-end` maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top`, `border-right`, `border-bottom`, or `border-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
Related properties are `border-block-start`, `border-block-end`, and `border-inline-start`, which define the other borders of the element.
### Values
The `border-inline-end` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-inline-end: 5px dashed blue;
    }
    
# :indeterminate
The `:indeterminate` CSS pseudo-class represents any form element whose state is indeterminate, such as checkboxes that have been set to an `indeterminate` state with JavaScript, radio buttons which are members of a group in which all radio buttons are unchecked, and `<progress>` elements with no `value` attribute.
    
    /* Selects any <input> whose state is indeterminate */
    input:indeterminate {
      background: lime;
    }
    
Elements targeted by this selector are:
  * `<input type="checkbox">` elements with the `indeterminate` property set to `true`.
  * `<input type="radio">` elements with the same `name` value and none of them `checked`.
  * `<progress>` elements with no `value`, placing them in an indeterminate state.


## Syntax
    
    :indeterminate {
      /* ... */
    }
    
## Examples
>
### Checkbox & radio button
This example applies special styles to the labels associated with indeterminate form fields.
#### HTML
    
    <fieldset>
      <legend>Checkbox</legend>
      <div>
        <input type="checkbox" id="checkbox" />
        <label for="checkbox">This checkbox label starts out lime.</label>
      </div>
    </fieldset>
    
    <fieldset>
      <legend>Radio</legend>
      <div>
        <input type="radio" id="radio1" name="radioButton" value="val1" />
        <label for="radio1">First radio label starts out lime.</label>
      </div>
      <div>
        <input type="radio" id="radio2" name="radioButton" value="val2" />
        <label for="radio2">Second radio label also starts out lime.</label>
      </div>
    </fieldset>
    
#### CSS
    
    input:indeterminate + label {
      background: lime;
    }
    
#### JavaScript
    
    const inputs = document.getElementsByTagName("input");
    
    for (const input of inputs) {
      input.indeterminate = true;
    }
    
#### Result
### Progress bar
#### HTML
    
    <progress></progress>
    
#### CSS
    
    progress {
      margin: 4px;
    }
    
    progress:indeterminate {
      width: 80vw;
      height: 20px;
    }
    
#### Result
# min-width
The `min-width` CSS property sets the minimum width of an element. It prevents the used value of the `width` property from becoming smaller than the value specified for `min-width`.
## Try it
    
    min-width: 150px;
    
    
    min-width: 20em;
    
    
    min-width: 75%;
    
    
    min-width: 40ch;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        Change the minimum width.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
The element's width is set to the value of `min-width` whenever `min-width` is larger than `max-width` or `width`.
## Syntax
    
    /* <length> value */
    min-width: 3.5em;
    min-width: anchor-size(width);
    min-width: anchor-size(--my-anchor self-inline, 200%);
    
    /* <percentage> value */
    min-width: 10%;
    
    /* Keyword values */
    min-width: max-content;
    min-width: min-content;
    min-width: fit-content;
    min-width: fit-content(20em);
    min-width: stretch;
    
    /* Global values */
    min-width: inherit;
    min-width: initial;
    min-width: revert;
    min-width: revert-layer;
    min-width: unset;
    
### Values
`<length>`
    
Defines the `min-width` as an absolute value.
`<percentage>`
    
Defines the `min-width` as a percentage of the containing block's width.
`auto`
    
The default value. The source of the automatic value for the specified element depends on its display value. For block boxes, inline boxes, inline blocks, and all table layout boxes `auto` resolves to `0`.
For flex items and grid items, the minimum width value is either the specified suggested size, such as the value of the `width` property, the transferred size, calculated if the element has an `aspect-ratio` set and the height is a definite size, otherwise, the `min-content` size is used. If the flex or grid item is a scroll container, or if a grid item spans more than one flexible column track, the automatic minimum size is `0`.
`max-content`
    
The intrinsic preferred `min-width`.
`min-content`
    
The intrinsic minimum `min-width`.
`fit-content`
    
Use the available space, but not more than `max-content`, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the `fit-content` formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, argument))`.
`stretch`
    
Limits the minimum width of the element's margin box to the width of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
Note: To check aliases used by browsers for the `stretch` value and its implementation status, see the Browser compatibility section.
## Examples
>
### Setting minimum element width
    
    table {
      min-width: 75%;
    }
    
    form {
      min-width: 0;
    }
    
# orphans
The `orphans` CSS property sets the minimum number of lines in a block container that must be shown at the bottom of a page, region, or column.
In typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page. (The paragraph continues on a following page.)
## Syntax
    
    /* <integer> values */
    orphans: 2;
    orphans: 3;
    
    /* Global values */
    orphans: inherit;
    orphans: initial;
    orphans: revert;
    orphans: revert-layer;
    orphans: unset;
    
### Values
`<integer>`
    
The minimum number of lines that can stay by themselves at the bottom of a fragment before a fragmentation break. The value must be positive.
## Examples
>
### Setting a minimum orphan size of three lines
#### HTML
    
    <div>
      <p>This is the first paragraph containing some text.</p>
      <p>
        This is the second paragraph containing some more text than the first one.
        It is used to demonstrate how orphans work.
      </p>
      <p>
        This is the third paragraph. It has a little bit more text than the first
        one.
      </p>
    </div>
    
#### CSS
    
    div {
      background-color: #8cffa0;
      height: 150px;
      columns: 3;
      orphans: 3;
    }
    
    p {
      background-color: #8ca0ff;
    }
    
    p:first-child {
      margin-top: 0;
    }
    
#### Result
# ::checkmark
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
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.
## Try it
    
    <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>
    
    
    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;
    }
    
## Syntax
    
    ::checkmark {
      /* ... */
    }
    
## Description
The `::checkmark` pseudo-element targets the checkmark placed inside a customizable select element's currently-selected `<option>`.
It is only available to target when the originating element has a picker and has base appearance set on it via the `appearance` property `base-select` value. Its generated box appears before any boxes generated by the `::before` pseudo-element. The icon can be customized using the `content` property.
The `::checkmark` selector is useful for example if you want to hide the checkmark, use a custom icon, or adjust the checkmark's rendering position inside `<option>` elements.
Note: The `::checkmark` pseudo-element is not included in the accessibility tree, so any generated `content` set on it will not be announced by assistive technologies. You should still make sure that any new icon you set visually makes sense for its intended purpose.
## Examples
>
### Customizing the checkmark
To opt-in to customizable select functionality, the `<select>` element and its picker both need to have an `appearance` value of `base-select` set on them:
    
    select,
    ::picker(select) {
      appearance: base-select;
    }
    
Assuming flexbox is being used to lay out the `<option>` elements (which is true in current implementations of customizable selects), you could then move the checkmark from the start of the row to the end by setting an `order` value on it greater than `0`, and aligning it to the end of the row using an `auto` `margin-left` value (see Alignment and auto margins).
The value of the `content` property could also be set to a different emoji to change the displayed icon.
    
    option::checkmark {
      order: 1;
      margin-left: auto;
      content: "☑️";
    }
    
See Styling the current selection checkmark for a full example that uses this code, along with a live example rendering.
# ::view-transition-old()
The `::view-transition-old()` CSS pseudo-element represents the "old" view state of a view transition — a static snapshot of the old view, before the transition.
During a view transition, `::view-transition-old()` is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree, provided there's an "old" view state to represent. It is only ever a child of a `::view-transition-image-pair()`, and never has any children.
It is a replaced element and therefore can be manipulated with properties such as `object-fit` and `object-position`. It has natural dimensions equal to the content's size.
The following default styling is included in the UA stylesheet:
    
    :root::view-transition-old(*),
    :root::view-transition-new(*) {
      position: absolute;
      inset-block-start: 0;
      inline-size: 100%;
      block-size: auto;
    
      animation-duration: inherit;
      animation-fill-mode: inherit;
      animation-delay: inherit;
    }
    
    /* Keyframes for blending when there are 2 images */
    @keyframes -ua-mix-blend-mode-plus-lighter {
      from {
        mix-blend-mode: plus-lighter;
      }
      to {
        mix-blend-mode: plus-lighter;
      }
    }
    
    @keyframes -ua-view-transition-fade-out {
      to {
        opacity: 0;
      }
    }
    
Note: Additional view transition styles are also setup to animate `::view-transition-old()`. These are dynamically generated during the view transition; see the specification setup transition pseudo-elements and update pseudo-element styles sections for more details.
## Syntax
    
    ::view-transition-old([ <pt-name-selector> <pt-class-selector>? ] | <pt-class-selector>) {
      /* ... */
    }
    
### Parameters
`*`
    
The universal selector (`*`) selects all view transition groups on a page.
`root`
    
Causes the pseudo-element to match the default `root` view transition snapshot group created by the user agent to contain the view transition for the overall page. This group includes any element not assigned to its own specific view transition snapshot group via the `view-transition-name` property.
`<pt-name-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-name` property.
`<pt-class-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-class` property preceded by a period (`.`).
## Examples
    
    figcaption {
      view-transition-name: figure-caption;
    }
    
    @keyframes grow-x {
      from {
        transform: scaleX(0);
      }
      to {
        transform: scaleX(1);
      }
    }
    
    @keyframes shrink-x {
      from {
        transform: scaleX(1);
      }
      to {
        transform: scaleX(0);
      }
    }
    
    ::view-transition-old(figure-caption),
    ::view-transition-new(figure-caption) {
      height: auto;
      right: 0;
      left: auto;
      transform-origin: right center;
    }
    
    ::view-transition-old(figure-caption) {
      animation: 0.25s linear both shrink-x;
    }
    
    ::view-transition-new(figure-caption) {
      animation: 0.25s 0.25s linear both grow-x;
    }
    
# <resolution>
The `<resolution>` CSS data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
On screens, the units are related to CSS inches, centimeters, or pixels, not physical values.
## Syntax
The `<resolution>` data type consists of a strictly positive `<number>` followed by one of the units listed below. As with all CSS dimensions, there is no space between the unit literal and the number.
### Units
`dpi`
    
Represents the number of dots per inch. Screens typically contains 72 or 96 dots per inch, but the dpi for printed documents is usually much greater. As 1 inch is 2.54 cm, `1dpi ≈ 0.39dpcm`.
`dpcm`
    
Represents the number of dots per centimeter. As 1 inch is 2.54 cm, `1dpcm ≈ 2.54dpi`.
`dppx`
    
Represents the number of dots per `px` unit. Due to the 1:96 fixed ratio of CSS `in` to CSS `px`, `1dppx` is equivalent to `96dpi`, which corresponds to the default resolution of images displayed in CSS as defined by `image-resolution`.
`x`
    
Alias for `dppx`.
Note: Although the number `0` is always the same regardless of unit, the unit may not be omitted. In other words, `0` is invalid and does not represent `0dpi`, `0dpcm`, or `0dppx`.
## Examples
>
### Use in a media query
    
    @media print and (resolution >= 300dpi) {
      /* … */
    }
    
    @media (resolution: 120dpcm) {
      /* … */
    }
    
    @media (resolution >= 2dppx) {
      /* … */
    }
    
    @media (resolution: 1x) {
      /* … */
    }
    
### Valid resolutions
    
    96dpi
    50.82dpcm
    3dppx
    
### Invalid resolutions
    
    72 dpi     Spaces are not allowed between the number and the unit.
    ten dpi    The number must use digits only.
    0          The unit is required.
    
# column-span
The `column-span` CSS property makes it possible for an element to span across all columns when its value is set to `all`.
## Try it
    
    column-span: none;
    
    
    column-span: all;
    
    
    <section id="default-example">
      <div class="multicol-element">
        <p>
          London. Michaelmas term lately over, and the Lord Chancellor sitting in
          Lincoln's Inn Hall.
        </p>
        <div id="example-element">Spanner?</div>
        <p>
          Implacable November weather. As much mud in the streets as if the waters
          had but newly retired from the face of the earth, and it would not be
          wonderful to meet a Megalosaurus, forty feet long or so, waddling like an
          elephantine lizard up Holborn Hill.
        </p>
      </div>
    </section>
    
    
    .multicol-element {
      width: 100%;
      text-align: left;
      column-count: 3;
    }
    
    .multicol-element p {
      margin: 0;
    }
    
    #example-element {
      background-color: rebeccapurple;
      padding: 10px;
      color: white;
    }
    
An element that spans more than one column is called a spanning element.
## Syntax
    
    /* Keyword values */
    column-span: none;
    column-span: all;
    
    /* Global values */
    column-span: inherit;
    column-span: initial;
    column-span: revert;
    column-span: revert-layer;
    column-span: unset;
    
The `column-span` property is specified as one of the keyword values listed below.
### Values
`none`
    
The element does not span multiple columns.
`all`
    
The element spans across all columns. Content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. The element establishes a new block formatting context.
## Examples
>
### Making a heading span columns
In this example, the heading is made to span across all the columns of the article.
#### HTML
    
    <article>
      <h2>Header spanning all of the columns</h2>
      <p>
        The h2 should span all the columns. The rest of the text should be
        distributed among the columns.
      </p>
      <p>
        This is a bunch of text split into three columns using the CSS `columns`
        property. The text is equally distributed over the columns.
      </p>
      <p>
        This is a bunch of text split into three columns using the CSS `columns`
        property. The text is equally distributed over the columns.
      </p>
      <p>
        This is a bunch of text split into three columns using the CSS `columns`
        property. The text is equally distributed over the columns.
      </p>
      <p>
        This is a bunch of text split into three columns using the CSS `columns`
        property. The text is equally distributed over the columns.
      </p>
    </article>
    
#### CSS
    
    article {
      columns: 3;
    }
    
    h2 {
      column-span: all;
    }
    
#### Result
# <absolute-size>
The `<absolute-size>` CSS data type describes the absolute size keywords. This data type is used in the `font` shorthand and `font-size` properties.
The font size keywords are mapped to the deprecated HTML `size` attribute. See the HTML size attribute section below).
## Syntax
    
    <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large
    
### Values
The `<absolute-size>` data type is defined using a keyword value chosen from the list below.
`xx-small`
    
An absolute size 60% the size of `medium`. Mapped to the deprecated `size="1"`.
`x-small`
    
An absolute size 75% the size of `medium`.
`small`
    
An absolute size 89% the size of `medium`. Mapped to the deprecated `size="2"`.
`medium`
    
A user's preferred font size. This value is used as the reference middle value. Mapped to `size="3"`.
`large`
    
An absolute size 20% larger than `medium`. Mapped to the deprecated `size="4"`.
`x-large`
    
An absolute size 50% larger than `medium`. Mapped to the deprecated `size="5"`.
`xx-large`
    
An absolute size twice the size of `medium`. Mapped to the deprecated `size="6"`.
`xxx-large`
    
An absolute size three times the size of `medium`. Mapped to the deprecated `size="7"`.
## Description
Each `<absolute-size>` keyword value is sized relative to the `medium` size and the individual device's characteristics, such as device resolution. User agents maintain a table of font sizes for each font, with the `<absolute-size>` keywords being the index.
In CSS1 (1996), the scaling factor between adjacent keyword value indexes was 1.5, which was too large. In CSS2 (1998), the scaling factor between adjacent keyword value indexes was 1.2, which created issues for the small values. As a single fixed ratio between adjacent absolute-size keywords was found to be problematic, there is no longer a fixed ratio recommendation. The only recommendation to preserve readability is that the smallest font size should not be less than `9px`.
For each `<absolute-size>` keyword value, the following table lists the scaling factor, mapping to `<h1>` to `<h6>` headings, and mapping to the deprecated HTML `size` attribute.
`<absolute-size>` xx-small x-small small medium large x-large xx-large xxx-large  
scaling factor 3/5 3/4 8/9 1 6/5 3/2 2/1 3/1  
HTML headings h6 h5 h4 h3 h2 h1  
HTML `size` attribute 1 2 3 4 5 6 7  
### HTML size attribute
The `size` attribute to set a font's size in HTML is deprecated. The attribute value was either an integer between `1` and `7` or a relative value. Relative values were an integer preceded by `+` or `-` to increase or decrease the font size, respectively. A value of `+1` meant increasing the `size` by one and `-2` meant decreasing the size by two, with the computed value clamped at a minimum of `1` and a maximum computed value of `7`.
## Examples
>
### Comparing the keyword values
    
    <ul>
      <li class="xx-small">font-size: xx-small;</li>
      <li class="x-small">font-size: x-small;</li>
      <li class="small">font-size: small;</li>
      <li class="medium">font-size: medium;</li>
      <li class="large">font-size: large;</li>
      <li class="x-large">font-size: x-large;</li>
      <li class="xx-large">font-size: xx-large;</li>
      <li class="xxx-large">font-size: xxx-large;</li>
    </ul>
    
    
    li {
      margin-bottom: 0.3em;
    }
    .xx-small {
      font-size: xx-small;
    }
    .x-small {
      font-size: x-small;
    }
    .small {
      font-size: small;
    }
    .medium {
      font-size: medium;
    }
    .large {
      font-size: large;
    }
    .x-large {
      font-size: x-large;
    }
    .xx-large {
      font-size: xx-large;
    }
    .xxx-large {
      font-size: xxx-large;
    }
    
#### Result
# max()
The `max()` CSS function lets you set the largest (most positive) value from a list of comma-separated expressions as the value of a CSS property value. The `max()` function can be used anywhere a `<length>`, `<frequency>`, `<angle>`, `<time>`, `<percentage>`, `<number>`, or `<integer>` is allowed.
## Try it
    
    width: max(20vw, 400px);
    
    
    width: max(20vw, 100px);
    
    
    width: max(5vw, 100px);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <img
          alt="Firefox logo"
          class="logo"
          src="/shared-assets/images/examples/firefox-logo.svg" />
      </div>
    </section>
    
In the first example shown above, the width will be at least 400px, but will be wider if the viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px). This technique uses an absolute unit to specify a fixed minimum value for the property, and a relative unit to allow the value to grow to suit larger viewports.
## Syntax
    
    max(1, 2, 3)
    max(1px, 2px, 3px)
    
### Parameters
The `max()` function takes one or more comma-separated expressions as its parameter, with the largest (most positive) expression value used as the value of the property to which it is assigned.
The expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as `attr()`, that evaluate to a valid argument type (like `<length>`), or nested `min()` and `max()` functions.
You can use different units for each value in your expression. You may also use parentheses to establish computation order when needed.
### Notes
  * Math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if `auto` had been specified.
  * It is permitted to nest `min()` and other `max()` functions as expression values. The expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself.
  * The expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules. Make sure to put a space on each side of the + and - operands. The operands in the expression may be any <length> syntax value.
  * You can (and often need to) combine `min()` and `max()` values, or use `max()` within a `clamp()` or `calc()` function.


## Accessibility
When `max()` is used for controlling text size, make sure the text is always large enough to read. A suggestion is to use the `min()` function nested within a `max()` that has as its second value a relative length unit that is always large enough to read. For example:
    
    small {
      font-size: max(min(0.5vw, 0.5em), 1rem);
    }
    
This ensures a minimum size of 1rem, with a text size that scales if the page is zoomed.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Setting a minimum size for a font
Another use case for `max()` is to allow a font size to grow while ensuring it is at least a minimum size, enabling responsive font sizes while ensuring legibility.
Let's look at some CSS:
    
    h1 {
      font-size: 2rem;
    }
    h1.responsive {
      font-size: max(4vw, 2em, 2rem);
    }
    
The font-size will at minimum be 2rems, or twice the default size of font for the page. This ensures that it is legible and accessible.
    
    <h1>This text is always legible, but doesn't change size</h1>
    <h1 class="responsive">
      This text is always legible, and is responsive, to a point
    </h1>
    
Think of the `max()` function as finding the minimum value allowed for a property.
# mask-composite
The `mask-composite` CSS property represents a compositing operation used on the current mask layer with the mask layers below it.
## Syntax
    
    /* Keyword values */
    mask-composite: add;
    mask-composite: subtract;
    mask-composite: intersect;
    mask-composite: exclude;
    
    /* Global values */
    mask-composite: inherit;
    mask-composite: initial;
    mask-composite: revert;
    mask-composite: revert-layer;
    mask-composite: unset;
    
### Values
The property accepts a comma-separated list of `<compositing-operator>` keyword values, each representing a Porter-Duff compositing operator which defines the compositing operation used on the current mask layer with the mask layers below it, including:
`add`
    
The associated mask image is placed over all mask layers below it (with the corresponding compositing operators applied). This is the default value.
`subtract`
    
The associated mask image is placed, where it falls outside of all mask layers below it (with the corresponding compositing operators applied).
`intersect`
    
The parts of the associated mask image that overlap all composited mask layers below it replace those previously composited layers.
`exclude`
    
The non-overlapping regions of the associated mask image and the mask layers below it, with their corresponding compositing operators applied, are combined.
## Description
When an element has multiple mask layers applied, the `mask-composite` property can be used to define how the multiple masks interact with each other, or are combined, in creating the final mask effect.
The number of layers is determined by the number of comma-separated values in the `mask-image` property value (even if a value is `none`). Each `mask-composite` value in the comma-separated list of values is matched up with a `mask-image` value, in order. If the number of values in `mask-composite` are equal to or greater than the number of `mask-image` values, the extra values are ignored. If the `mask-composite` property doesn't have enough comma-separated values to match the number of layers, the list of values are repeated until there are enough.
For processing, the source layer, which is current or associated mask layer image, is either added to (the default), subtracted from, intersected with, or is excluded from, the destination layers. The destination layers are the mask layers below the source with their corresponding compositing operators applied; this includes all the previous layers, composed in order of appearance within the comma-separated list of masks. All mask layers below the current mask layer must be composited before applying the compositing operation for the current mask layer. Mask layer images are transformed to alpha masks for processing before being combined by the defined compositing value.
The multiple mask layers applied to any element or pseudo-element act as if they are rendered into an isolated group. In other words, the mask layers are composited with other mask layers, not with the element's content or the content behind the element.
## Examples
>
### Basic usage
This example demonstrates the basic usage of the `mask-composite` property.
#### HTML
We include an HTML `<div>` element, that we will then style.
    
    <div></div>
    
#### CSS
We provide size and color our `<div>`, then add two `mask-image`s, and make their size match that of the element they're masking with the `mask-size` property. Lastly, we subtract the second mask image from the first mask image with the `mask-composite` property set to `subtract`.
    
    div {
      width: 100px;
      height: 100px;
      background-color: red;
    
      mask-image:
        url("https://mdn.github.io/shared-assets/images/examples/mdn.svg"),
        url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg");
      mask-size: 100% 100%;
    
      mask-composite: subtract;
    }
    
#### Results
### Value comparison
This example demonstrates the `mask-composite` property's four `<compositing-operator>` keyword values, along with comparing the effects of `alpha` and `luminance` mask modes.
#### HTML
We have a `<table>` that contains eight images. The `<table>` has been hidden for brevity.
    
    <img
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    
And an SVG with 4 masks; an alpha heart and circle and a luminance heart and circle. The heart masks are defined using solid colors. The circle masks are created using semi-transparent white and black `stroke` and `fill` colors.
    
    <svg height="0" width="0">
      <mask id="heartAlpha" class="alpha">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green"
          stroke="white"
          stroke-width="20" />
      </mask>
      <mask id="circleAlpha" class="alpha">
        <circle
          cx="130"
          cy="130"
          r="50"
          fill="rgb(0 0 0 / 0.5)"
          stroke="rgb(255 255 255 / 0.5)"
          stroke-width="20" />
      </mask>
      <mask id="heartLuminance" class="luminance">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green"
          stroke="white"
          stroke-width="20" />
      </mask>
      <mask id="circleLuminance" class="luminance">
        <circle
          cx="130"
          cy="130"
          r="50"
          fill="rgb(0 0 0 / 0.5)"
          stroke="rgb(255 255 255 / 0.5)"
          stroke-width="20" />
      </mask>
    </svg>
    
#### CSS
First we style the `<mask>` elements, providing each mask with a `mask-type` property value of either `alpha` or `luminance`.
    
    mask.luminance {
      mask-type: luminance;
    }
    
    mask.alpha {
      mask-type: alpha;
    }
    
We then apply the heart and circle masks as the comma-separated `mask-image` property values. These are applied to each `<img>` element, with all the images in a row getting the same masks.
    
    /* apply the mask images */
    tr.alphaMaskType img {
      mask-image: url("#heartAlpha"), url("#circleAlpha");
    }
    
    tr.luminanceMaskType img {
      mask-image: url("#heartLuminance"), url("#circleLuminance");
    }
    
Finally, we compose the masks using the `mask-composite` property, applying the four different enumerated `mask-composite` values by table column.
    
    /* property we're testing */
    td:nth-of-type(1) img {
      mask-composite: add;
    }
    td:nth-of-type(2) img {
      mask-composite: subtract;
    }
    td:nth-of-type(3) img {
      mask-composite: intersect;
    }
    td:nth-of-type(4) img {
      mask-composite: exclude;
    }
    
The table styles have been hidden for the sake of brevity.
#### Results
# scroll-snap-stop
The `scroll-snap-stop` CSS property defines whether or not the scroll container is allowed to "pass over" possible snap positions.
## Try it
    
    scroll-snap-stop: normal;
    
    
    scroll-snap-stop: always;
    
    
    <section class="default-example" id="default-example">
      <p class="explanation">
        The effect of this property can be noticed on devices with a touchpad. Try
        to scroll through all items with a single swing. Value
        <b class="keyword">'normal'</b> should pass through all pages, while
        <b class="keyword">'always'</b> will stop at the second page.
      </p>
      <div class="snap-container">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-direction: column;
    }
    
    .explanation {
      margin-top: 0;
    }
    
    .keyword {
      color: darkorange;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .snap-container {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .snap-container > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .snap-container > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Keyword values */
    scroll-snap-stop: normal;
    scroll-snap-stop: always;
    
    /* Global values */
    scroll-snap-stop: inherit;
    scroll-snap-stop: initial;
    scroll-snap-stop: revert;
    scroll-snap-stop: revert-layer;
    scroll-snap-stop: unset;
    
### Values
`normal`
    
When the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions.
`always`
    
The scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions.
## Examples
>
### Setting different snap stops
The example below demonstrates the contrast between the `always` and `normal` values of `scroll-snap-stop`. The difference in the two `scroll-snap-stop` values is more noticeable when the `scroll-snap-type` property is set to `mandatory`, which is what is used in this example.
#### HTML
    
    <p>scroll-snap-stop: always (X Mandatory)</p>
    <div class="x mandatory-scroll-snapping always-stop">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    <p>scroll-snap-stop: always (X Mandatory) on odd child elements</p>
    <div class="x mandatory-scroll-snapping always-stop-odd">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    <p>scroll-snap-stop: always (X Mandatory) on even child elements</p>
    <div class="x mandatory-scroll-snapping always-stop-even">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    <p>scroll-snap-stop: normal (X Mandatory)</p>
    <div class="x mandatory-scroll-snapping normal-stop">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    <p>scroll-snap-stop: always (Y Mandatory)</p>
    <div class="y mandatory-scroll-snapping always-stop">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
    <p>scroll-snap-stop: normal (Y Mandatory)</p>
    <div class="y mandatory-scroll-snapping normal-stop">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
    </div>
    
#### CSS
    
    /* setting up mandatory scroll-snap on parent */
    .x.mandatory-scroll-snapping {
      scroll-snap-type: x mandatory;
    }
    
    .y.mandatory-scroll-snapping {
      scroll-snap-type: y mandatory;
    }
    
    /* defining scroll-snap alignment on children */
    div > div {
      scroll-snap-align: center;
    }
    
    /* defining scroll-snap stop on children */
    .always-stop > div {
      scroll-snap-stop: always;
    }
    
    .always-stop-odd > div:nth-of-type(odd) {
      scroll-snap-stop: always;
    }
    
    .always-stop-even > div:nth-of-type(even) {
      scroll-snap-stop: always;
    }
    
    .normal-stop > div {
      scroll-snap-stop: normal;
    }
    
#### Result
Scroll from left to right and from top to bottom in the X and Y boxes below, respectively. In the X and Y boxes where the `scroll-snap-stop` property is set to `always`, the scrolling is forced to stop at the snap point even when you scroll fast. However, in the boxes where the `scroll-snap-stop` property is set to `normal`, the snap points are skipped when you scroll fast.
If required, you can be selective about the items that are `always` stopped at inside the scroll container. This is demonstrated in the example below by targeting odd and even items; you can choose a different strategy based on your requirement. In the example below, scrolling does not "pass over" odd and even items in the second and third boxes, respectively.
# :hover
The `:hover` CSS pseudo-class matches an element when a user interacts with it using a pointing device. The pseudo-class is generally triggered when the user moves the cursor (mouse pointer) over an element without pressing the mouse button.
## Try it
    
    .joinBtn {
      width: 10em;
      height: 5ex;
      background-color: gold;
      border: 2px solid firebrick;
      border-radius: 10px;
      font-weight: bold;
      color: black;
      cursor: pointer;
    }
    
    .joinBtn:hover {
      background-color: bisque;
    }
    
    
    <p>Would you like to join our quest?</p>
    <button class="joinBtn">Confirm</button>
    
Styles defined by the `:hover` pseudo-class will be overridden by any subsequent link-related pseudo-class (`:link`, `:visited`, or `:active`) that has at least equal specificity. To style links appropriately, put the `:hover` rule after the `:link` and `:visited` rules but before the `:active` one, as defined by the LVHA-order: `:link` — `:visited` — `:hover` — `:active`.
Note: The `:hover` pseudo-class is problematic on touchscreens. Depending on the browser, the `:hover` pseudo-class might never match, match only for a moment after touching an element, or continue to match even after the user has stopped touching and until the user touches another element. Web developers should make sure that content is accessible on devices with limited or non-existent hovering capabilities.
## Syntax
    
    :hover {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <a href="#">Try hovering over this link.</a>
    
#### CSS
    
    a {
      background-color: powderblue;
      transition: background-color 0.5s;
    }
    
    a:hover {
      background-color: gold;
    }
    
#### Result
# env()
The `env()` CSS function can be used to insert the value of a user-agent defined environment variable into your CSS.
## Syntax
    
    /* Using the four safe area inset values with no fallback values */
    env(safe-area-inset-top);
    env(safe-area-inset-right);
    env(safe-area-inset-bottom);
    env(safe-area-inset-left);
    
    /* Using them with fallback values */
    env(safe-area-inset-top, 20px);
    env(safe-area-inset-right, 1em);
    env(safe-area-inset-bottom, 0.5vh);
    env(safe-area-inset-left, 1.4rem);
    
### Parameters
The `env()` function's syntax is as follows:
    
    env(<environment-variable-name>, <fallback>)
    
The `<environment-variable-name>` can be one of the following:
`safe-area-inset-top`, `safe-area-inset-right`, `safe-area-inset-bottom`, `safe-area-inset-left`
    
The `safe-area-inset-*` variables are four environment variables that define a rectangle by its top, right, bottom, and left insets from the edge of the viewport, which is safe to put content into without risking it being cut off by the shape of a non‑rectangular display. For rectangular viewports, like your average laptop monitor, their value is equal to zero. For non-rectangular displays — like a round watch face — the four values set by the user agent form a rectangle such that all content inside the rectangle is visible.
`safe-area-max-inset-top`, `safe-area-max-inset-right`, `safe-area-max-inset-bottom`, `safe-area-max-inset-left`
    
The safe area maximum inset environment variables represent the static maximum value of their dynamic `safe-area-inset-*` variable counterpart.
`titlebar-area-x`, `titlebar-area-y`, `titlebar-area-width`, `titlebar-area-height`
    
The `titlebar-area-*` variables are useful for PWA installed on Desktop devices. When a desktop PWA uses the `window-controls-overlay` display_override value, then it can use the `titlebar-area-*` variables to make sure content doesn't overlap with the window control buttons (i.e., minimize, maximize, and close).
`keyboard-inset-top`, `keyboard-inset-right`, `keyboard-inset-bottom`, `keyboard-inset-left`, `keyboard-inset-width`, `keyboard-inset-height`
    
The `keyboard-inset-*` variables provide information about the on-screen virtual keyboard's appearance. They define a rectangle by its top, right, bottom, and left insets from the edge of the viewport (the width and height insets are calculated from the other insets). To learn more, see the VirtualKeyboard API.
Note: Like other CSS custom property names, user agent-defined environment variable names are case-sensitive.
## Description
The `env()` function inserts the value of a user-agent defined environment variable into your CSS, in a similar fashion to the `var()` function and custom properties. The difference is that, as well as being user-agent defined rather than author-defined, environment variables are globally scoped to a document, whereas custom properties are scoped to the element(s) on which they are declared.
In addition, unlike custom properties, which cannot be used outside of declarations, the `env()` function can be used in place of any part of a property value, or any part of a descriptor (e.g., in Media query rules). As the spec evolves, it may also be usable in other places such as selectors.
Originally provided by the iOS browser to allow developers to place their content in a safe area of the viewport, the `safe-area-inset-*` values defined in the specification can be used to help ensure content is visible even to viewers using non‑rectangular displays.
For example, a common issue solved by `env()` is that of device notifications covering up some of the app user interface. By positioning fixed elements using `env()` you can ensure that they display in a safe area of the viewport.
Another use case for `env()` variables is for desktop Progressive web apps (PWAs) that use the Window Controls Overlay feature to take advantage of the full application window surface area. Using the `titlebar-area-*` values, developers can position elements where the title bar would have been and ensure that content stays clear of the window control buttons.
## Usage
To tell the browser to use the whole available space on the screen, and so enabling us to use the `env()` variables, we need to add a new viewport meta value:
    
    <meta name="viewport" content="viewport-fit=cover" />
    
You can then use `env()` in your CSS:
    
    body {
      padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px)
        env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
    }
    
## Examples
>
### Using env() to ensure buttons are not obscured by device UI
In the following example `env()` is used to ensure that fixed app toolbar buttons are not obscured by device notifications appearing at the bottom of the screen. On the desktop `safe-area-inset-bottom` is `0`. However, in devices that display notifications at the bottom of the screen, such as iOS, it contains a value that leaves space for the notification to display. This can then be used in the value for `padding-bottom` to create a gap that appears natural on that device.
    
    <main>Main content of app here</main>
    <footer>
      <button>Go here</button>
      <button>Or here</button>
    </footer>
    
    
    body {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      font: 1em system-ui;
    }
    
    main {
      flex: 1;
      background-color: #eeeeee;
      padding: 1em;
    }
    
    footer {
      flex: none;
      display: flex;
      gap: 1em;
      justify-content: space-evenly;
      background: black;
      padding: 1em 1em calc(1em + env(safe-area-inset-bottom));
      /* adds the safe-area-inset-bottom value to the initial 1em of padding.
      a larger black area will display for a device that has a positive value for this variable. */
      position: sticky;
      bottom: 0;
    }
    
    button {
      padding: 1em;
      background: white;
      color: black;
      margin: 0;
      width: 100%;
      border: none;
      font: 1em system-ui;
    }
    
### Using the fallback value
The below example makes use of the optional second parameter of `env()`, which allows you to provide a fallback value in case the environment variable is not available.
    
    <p>
      If the <code>env()</code> function is supported in your browser, this
      paragraph's text will have 50px of padding between it and the left border —
      but not the top, right and bottom. This is because the accompanying CSS is the
      equivalent of <code>padding: 0 0 0 50px</code>, because, unlike other CSS
      properties, user agent property names are case-sensitive.
    </p>
    
    
    p {
      width: 300px;
      border: 2px solid red;
      padding: env(safe-area-inset-top, 50px) env(safe-area-inset-right, 50px)
        env(safe-area-inset-bottom, 50px) env(SAFE-AREA-INSET-LEFT, 50px);
    }
    
### Example values
    
    /* zero for all rectangular user agents */
    padding: env(safe-area-inset-bottom, 50px);
    
    /* 50px because UA properties are case sensitive */
    padding: env(Safe-area-inset-bottom, 50px);
    
    /* as if padding: '50px 20px' were set because x is not a valid environment variable */
    padding: env(x, 50px 20px);
    
    /* ignored because '50px, 20px' is not a valid padding value and x is not a valid environment variable */
    padding: env(x, 50px, 20px);
    
The syntax of the fallback, like that of custom properties, allows commas. But, if the property value doesn't support commas, the value is not valid.
Note: User agent properties are not reset by the all property.
### Using env() to ensure content is not obscured by window control buttons in desktop PWAs
In the following example `env()` ensures that content displayed in a desktop Progressive Web App that uses the Window Controls Overlay API is not obscured by the operating system's window control buttons. The `titlebar-area-*` values define a rectangle where the title bar would normally have been displayed. On devices that do not support the Window Controls Overlay feature, such as mobile devices, the fallback values are used.
Here is what a PWA installed on a desktop device normally looks like:
With the Window Controls Overlay feature, the web content covers the whole app window surface area, with the window controls and PWA buttons displayed as overlays:
    
    <header>Title of the app here</header>
    <main>Main content of app here</main>
    
    
    header {
      position: fixed;
      left: env(titlebar-area-x);
      top: env(titlebar-area-y);
      width: env(titlebar-area-width);
      height: env(titlebar-area-height);
    }
    
    main {
      margin-top: env(titlebar-area-height);
    }
    
Note: Using `position:fixed` makes sure the header does not scroll with the rest of the content, and instead stays aligned with the window control buttons, even on device/browsers that support elastic overscroll (also known as rubber banding).
# overscroll-behavior-block
The `overscroll-behavior-block` CSS property sets the browser's behavior when the block direction boundary of a scrolling area is reached.
See `overscroll-behavior` for a full explanation.
## Syntax
    
    /* Keyword values */
    overscroll-behavior-block: auto; /* default */
    overscroll-behavior-block: contain;
    overscroll-behavior-block: none;
    
    /* Global values */
    overscroll-behavior-block: inherit;
    overscroll-behavior-block: initial;
    overscroll-behavior-block: revert;
    overscroll-behavior-block: revert-layer;
    overscroll-behavior-block: unset;
    
The `overscroll-behavior-block` property is specified as a keyword chosen from the list of values below.
### Values
`auto`
    
The default scroll overflow behavior occurs as normal.
`contain`
    
Default scroll overflow behavior (e.g., "bounce" effects) is observed inside the element where this value is set. However, no scroll chaining occurs on neighboring scrolling areas; the underlying elements will not scroll. The `contain` value disables native browser navigation, including the vertical pull-to-refresh gesture and horizontal swipe navigation.
`none`
    
No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
## Examples
>
### Preventing block overscrolling
In this demo we have two block-level boxes, one inside the other. The outer box has a large `height` set on it so the page will scroll vertically. The inner box has a small `width` (and `height`) set on it so it sits comfortably inside the viewport, but its content is given a large `height` so it will also scroll vertically.
By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. To avoid this happening in the block direction, we've set `overscroll-behavior-block: contain` on the inner box.
#### HTML
    
    <main>
      <div>
        <div>
          <p>
            <code>overscroll-behavior-block</code> has been used to make it so that
            when the scroll boundaries of the yellow inner box are reached, the
            whole page does not begin to scroll.
          </p>
        </div>
      </div>
    </main>
    
#### CSS
    
    main {
      height: 3000px;
      width: 500px;
      background-color: white;
      background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 19px,
        rgb(0 0 0 / 50%) 20px
      );
    }
    
    main > div {
      height: 300px;
      width: 400px;
      overflow: auto;
      position: relative;
      top: 50px;
      left: 50px;
      overscroll-behavior-block: contain;
    }
    
    div > div {
      height: 1500px;
      width: 100%;
      background-color: yellow;
      background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 19px,
        rgb(0 0 0 / 50%) 20px
      );
    }
    
    p {
      padding: 10px;
      background-color: rgb(255 0 0 / 50%);
      margin: 0;
      width: 340px;
      position: relative;
      top: 10px;
      left: 10px;
    }
    
#### Result
# ::grammar-error
The `::grammar-error` CSS pseudo-element represents a text segment which the user agent has flagged as grammatically incorrect.
The `::grammar-error` pseudo-element follows a special inheritance model common to all highlight pseudo-elements. For more details on how this inheritance works, see the Highlight pseudo-elements inheritance section.
## Allowable properties
Only a small subset of CSS properties can be used in a rule with `::grammar-error` in its selector:
  * `color`
  * `background-color`
  * `cursor`
  * `caret-color`
  * `outline` and its longhands
  * `text-decoration` and its associated properties
  * `text-emphasis-color`
  * `text-shadow`


## Syntax
    
    ::grammar-error {
      /* ... */
    }
    
## Examples
>
### Basic document grammar check
In this example, eventual supporting browsers should highlight any flagged grammatical errors with the styles shown.
#### HTML
    
    <p contenteditable spellcheck="true">
      My friends is coming to the party tonight.
    </p>
    
#### CSS
    
    ::grammar-error {
      text-decoration: underline red;
      color: red;
    }
    
#### Result
# transform-box
The `transform-box` CSS property defines the layout box to which the `transform`, individual transform properties `translate`, `scale`, and `rotate`, and `transform-origin` properties relate.
## Syntax
    
    /* Keyword values */
    transform-box: content-box;
    transform-box: border-box;
    transform-box: fill-box;
    transform-box: stroke-box;
    transform-box: view-box;
    
    /* Global values */
    transform-box: inherit;
    transform-box: initial;
    transform-box: revert;
    transform-box: revert-layer;
    transform-box: unset;
    
The `transform-box` property is specified as one of the keyword values listed below.
### Values
`content-box`
    
The content box is used as the reference box. The reference box of a `<table>` is the border box of its table wrapper box, not its table box.
`border-box`
    
The border box is used as the reference box. The reference box of a `<table>` is the border box of its table wrapper box, not its table box.
`fill-box`
    
The object bounding box is used as the reference box. For elements with associated CSS layout box, acts as `content-box`.
`stroke-box`
    
The stroke bounding box is used as the reference box. For elements with associated CSS layout box, acts as `border-box`.
`view-box`
    
The nearest SVG viewport is used as the reference box. If a `viewBox` attribute is specified for the SVG viewport creating element, the reference box is positioned at the origin of the coordinate system established by the `viewBox` attribute, and the dimension of the reference box is set to the width and height values of the `viewBox` attribute. For elements with associated CSS layout box, acts as `border-box`.
## Examples
>
### SVG transform-origin scoping
In this example we have an SVG:
    
    <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
      <g>
        <circle id="center" fill="red" r="1" transform="translate(25 25)" />
        <circle id="boxcenter" fill="blue" r=".5" transform="translate(15 15)" />
        <rect
          id="box"
          x="10"
          y="10"
          width="10"
          height="10"
          rx="1"
          ry="1"
          stroke="black"
          fill="none" />
      </g>
    </svg>
    
In the CSS we have an animation that uses a transform to rotate the rectangle infinitely. `transform-box: fill-box` is used to make the `transform-origin` the center of the bounding box, so the rectangle spins in place. Without it, the transform origin is the center of the SVG canvas, and so you get a very different effect.
    
    svg {
      width: 80vh;
      border: 1px solid #d9d9d9;
      position: absolute;
      margin: auto;
      inset: 0;
    }
    
    #box {
      transform-origin: 50% 50%; /* anything other than `0 0` to see the effect */
      transform-box: fill-box;
      animation: rotate-box 3s linear infinite;
    }
    
    @keyframes rotate-box {
      to {
        transform: rotate(360deg);
      }
    }
    
# sibling-count()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `sibling-count()` CSS function returns an integer representing the total number of sibling DOM elements (direct children of the parent) of the element on which it is used, including itself.
Note: The `counter()` function provides a similar result but it returns a `<string>`, while `sibling-count()` returns an `<integer>` which can be used for calculations.
## Syntax
    
    sibling-count()
    
### Parameters
The `sibling-count()` function doesn't accept parameters.
### Return value
An integer; the total number of sibling DOM elements including the element itself.
## Examples
>
### Dynamic column count
This example demonstrates setting the width of each item in a list based on the number of items, enabling placing each child in its own column.
#### HTML
We include a `<ul>` container and several `<li>` elements children.
    
    <ul>
      <li>One</li>
      <li>Two</li>
      <li>Three</li>
      <li>Four</li>
      <li>Five</li>
    </ul>
    
#### CSS
We divide the `width` of each list item by the number of direct children the list contains. We also set every odd element to have a `background-color` to better demonstrate the resulting effect.
    
    ul {
      list-style-type: none;
      padding: 0;
      margin: 0;
      text-align: center;
      display: flex;
    }
    
    li {
      width: calc(100% / sibling-count());
    }
    
    li:nth-of-type(odd) {
      background-color: rgb(0 0 0 / 0.05);
    }
    
#### Results
# :host
The `:host` CSS pseudo-class selects the shadow host of the shadow DOM containing the CSS it is used inside — in other words, this allows you to select a custom element from inside its shadow DOM.
Note: This has no effect when used outside a shadow DOM.
## Try it
    
    /* This CSS is being applied inside the shadow DOM. */
    
    :host {
      background-color: aqua;
    }
    
    
    <h1 id="shadow-dom-host"></h1>
    
    
    const shadowDom = init();
    
    // add a <span> element in the shadow DOM
    const span = document.createElement("span");
    span.textContent = "Inside shadow DOM";
    shadowDom.appendChild(span);
    
    // attach shadow DOM to the #shadow-dom-host element
    function init() {
      const host = document.getElementById("shadow-dom-host");
      const shadowDom = host.attachShadow({ mode: "open" });
    
      const cssTab = document.querySelector("#css-output");
      const shadowStyle = document.createElement("style");
      shadowStyle.textContent = cssTab.textContent;
      shadowDom.appendChild(shadowStyle);
    
      cssTab.addEventListener("change", () => {
        shadowStyle.textContent = cssTab.textContent;
      });
      return shadowDom;
    }
    
    
    /* Selects a shadow root host */
    :host {
      font-weight: bold;
    }
    
## Syntax
    
    :host {
      /* ... */
    }
    
## Examples
>
### Styling the shadow host
The following snippets are taken from our host-selectors example (see it live also).
In this example we have a basic custom element — `<context-span>` — that you can wrap around text:
    
    <h1>
      Host selectors <a href="#"><context-span>example</context-span></a>
    </h1>
    
Inside the element's constructor, we create `style` and `span` elements, fill the `span` with the content of the custom element, and fill the `style` element with some CSS rules:
    
    const style = document.createElement("style");
    const span = document.createElement("span");
    span.textContent = this.textContent;
    
    const shadowRoot = this.attachShadow({ mode: "open" });
    shadowRoot.appendChild(style);
    shadowRoot.appendChild(span);
    
    style.textContent =
      "span:hover { text-decoration: underline; }" +
      ":host-context(h1) { font-style: italic; }" +
      ':host-context(h1)::after { content: " - no links in headers!" }' +
      ":host-context(article, aside) { color: gray; }" +
      ":host(.footer) { color : red; }" +
      ":host { background: rgb(0 0 0 / 10%); padding: 2px 5px; }";
    
The `:host { background: rgb(0 0 0 / 10%); padding: 2px 5px; }` rule styles all instances of the `<context-span>` element (the shadow host in this instance) in the document.
# :only-child
The `:only-child` CSS pseudo-class represents an element without any siblings. This is the same as `:first-child:last-child` or `:nth-child(1):nth-last-child(1)`, but with a lower specificity.
## Try it
    
    li:only-child {
      color: fuchsia;
    }
    
    b:only-child {
      text-decoration: underline;
    }
    
    
    <p>Stars expected to attend:</p>
    <ol>
      <li>Robert Downey, Jr.</li>
    </ol>
    
    <p>Stars yet to confirm:</p>
    <ol>
      <li>Scarlett Johansson</li>
      <li>Samuel L. Jackson</li>
      <li>Chris Pratt</li>
    </ol>
    
    <p>The ceremony is going to be held in <b>The Dolby Theatre</b>.</p>
    
## Syntax
    
    :only-child {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <div>
      <div>I am an only child.</div>
    </div>
    
    <div>
      <div>I am the 1st sibling.</div>
      <div>I am the 2nd sibling.</div>
      <div>
        I am the 3rd sibling,
        <div>but this is an only child.</div>
      </div>
    </div>
    
#### CSS
    
    div:only-child {
      color: red;
    }
    
    div {
      display: inline-block;
      margin: 6px;
      outline: 1px solid;
    }
    
#### Result
### A list example
#### HTML
    
    <ol>
      <li>
        First
        <ul>
          <li>This list has just one element.</li>
        </ul>
      </li>
      <li>
        Second
        <ul>
          <li>This list has three elements.</li>
          <li>This list has three elements.</li>
          <li>This list has three elements.</li>
        </ul>
      </li>
    </ol>
    
#### CSS
    
    li li {
      list-style-type: disc;
    }
    
    li:only-child {
      color: red;
      list-style-type: square;
    }
    
#### Result
# border-block-start-color
The `border-block-start-color` CSS property defines the color of the logical block-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-start-color: red;
    writing-mode: horizontal-tb;
    
    
    border-block-start-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-block-start-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    
    
    border-block-start-color: hsl(60 90% 50% / 0.8);
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    border-block-start-color: blue;
    border-block-start-color: #4c5d21;
    
    /* Global values */
    border-block-start-color: inherit;
    border-block-start-color: initial;
    border-block-start-color: revert;
    border-block-start-color: revert-layer;
    border-block-start-color: unset;
    
Related properties are `border-block-end-color`, `border-inline-start-color`, and `border-inline-end-color`, which define the other border colors of the element.
### Values
`<color>`
    
The color of the border.
## Examples
>
### Border color with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-block-start-color: red;
    }
    
#### Results
# transition-timing-function
The `transition-timing-function` CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect.
## Try it
    
    transition-timing-function: linear;
    
    
    transition-timing-function: ease-in;
    
    
    transition-timing-function: steps(6, end);
    
    
    transition-timing-function: cubic-bezier(0.29, 1.01, 1, -0.68);
    
    
    <section id="default-example">
      <div id="example-element">Hover to see<br />the transition.</div>
    </section>
    
    
    #example-element {
      background-color: #e4f0f5;
      color: black;
      padding: 1rem;
      border-radius: 0.5rem;
      font: 1em monospace;
      width: 100%;
      transition: margin-right 2s;
    }
    
    #default-example:hover > #example-element {
      background-color: #990099;
      color: white;
      margin-right: 40%;
    }
    
This, in essence, lets you establish an acceleration curve so that the speed of the transition can vary over its duration.
This acceleration curve is defined using one `<easing-function>` for each property to be transitioned.
You may specify multiple easing functions; each one will be applied to the corresponding property as specified by the `transition-property` property, which acts as a `transition-property` list. If there are fewer easing functions specified than in the `transition-property` list, the user agent must calculate which value is used by repeating the list of values until there is one for each transition property. If there are more easing functions, the list is truncated to the right size. In both cases, the CSS declaration stays valid.
## Syntax
    
    /* Keyword values */
    transition-timing-function: ease;
    transition-timing-function: ease-in;
    transition-timing-function: ease-out;
    transition-timing-function: ease-in-out;
    transition-timing-function: linear;
    transition-timing-function: step-start;
    transition-timing-function: step-end;
    
    /* Function values */
    transition-timing-function: steps(4, jump-end);
    transition-timing-function: cubic-bezier(0.1, 0.7, 1, 0.1);
    
    /* Steps Function keywords */
    transition-timing-function: steps(4, jump-start);
    transition-timing-function: steps(10, jump-end);
    transition-timing-function: steps(20, jump-none);
    transition-timing-function: steps(5, jump-both);
    transition-timing-function: steps(6, start);
    transition-timing-function: steps(8, end);
    
    /* Multiple easing functions */
    transition-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1, 0.1);
    
    /* Global values */
    transition-timing-function: inherit;
    transition-timing-function: initial;
    transition-timing-function: revert;
    transition-timing-function: revert-layer;
    transition-timing-function: unset;
    
### Values
`<easing-function>`
    
Each `<easing-function>` represents the easing function to link to the corresponding property to transition, as defined in `transition-property`.
The non-step keyword values (ease, linear, ease-in-out, etc.) each represent cubic Bézier curve with fixed four point values, with the cubic-bezier() function value allowing for a non-predefined value. The step easing functions divide the input time into a specified number of intervals that are equal in length. It is defined by a number of steps and a step position.
`ease`
    
Equal to `cubic-bezier(0.25, 0.1, 0.25, 1.0)`, the default value, increases in velocity towards the middle of the transition, slowing back down at the end.
`linear`
    
Equal to `cubic-bezier(0.0, 0.0, 1.0, 1.0)`, transitions at an even speed.
`ease-in`
    
Equal to `cubic-bezier(0.42, 0, 1.0, 1.0)`, starts off slowly, with the transition speed increasing until complete.
`ease-out`
    
Equal to `cubic-bezier(0, 0, 0.58, 1.0)`, starts transitioning quickly, slowing down as the transition continues.
`ease-in-out`
    
Equal to `cubic-bezier(0.42, 0, 0.58, 1.0)`, starts transitioning slowly, speeds up, and then slows down again.
`cubic-bezier(p1, p2, p3, p4)`
    
An author-defined cubic-Bezier curve, where the p1 and p3 values must be in the range of 0 to 1.
`steps(n, <jump-term>)`
    
Displays the transition along n stops along the transition, displaying each stop for equal lengths of time. For example, if n is 5, there are 5 steps. Whether the transition holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the transition, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used:
`jump-start`
    
Denotes a left-continuous function, so that the first jump happens when the transition begins;
`jump-end`
    
Denotes a right-continuous function, so that the last jump happens when the animation ends;
`jump-none`
    
There is no jump on either end. Instead, holding at both the 0% mark and the 100% mark, each for 1/n of the duration
`jump-both`
    
Includes pauses at both the 0% and 100% marks, effectively adding a step during the transition time.
`start`
    
Same as `jump-start`.
`end`
    
Same as `jump-end`.
`step-start`
    
Equal to `steps(1, jump-start)`
`step-end`
    
Equal to `steps(1, jump-end)`
## Accessibility
Some animations can be helpful such as to guide users to understand what actions are expected, to show relationships within the user interface, and to inform users as to what actions have occurred. Animations can help reduce cognitive load, prevent change blindness, and establish better recall in spatial relationships. However, some animations can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD) and certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity.
Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query (or equivalent User Agent client hint `Sec-CH-Prefers-Reduced-Motion`) to create a complimentary experience for users who have expressed a preference for less animation.
## Examples
>
### Cubic-Bezier examples
    
    .ease {
      transition-timing-function: ease;
    }
    .ease-in {
      transition-timing-function: ease-in;
    }
    .ease-out {
      transition-timing-function: ease-out;
    }
    .ease-in-out {
      transition-timing-function: ease-in-out;
    }
    .linear {
      transition-timing-function: linear;
    }
    .cb {
      transition-timing-function: cubic-bezier(0.2, -2, 0.8, 2);
    }
    
### Step examples
    
    .jump-start {
      transition-timing-function: steps(5, jump-start);
    }
    .jump-end {
      transition-timing-function: steps(5, jump-end);
    }
    .jump-none {
      transition-timing-function: steps(5, jump-none);
    }
    .jump-both {
      transition-timing-function: steps(5, jump-both);
    }
    .step-start {
      transition-timing-function: step-start;
    }
    .step-end {
      transition-timing-function: step-end;
    }
    
# corner-end-start-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-end-start-shape` CSS property specifies the shape of a box's block-end and inline-start corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-end-start-shape: round;
    corner-end-start-shape: scoop;
    
    /* superellipse() function values */
    corner-end-start-shape: superellipse(0.2);
    corner-end-start-shape: superellipse(-5);
    
    /* Global values */
    corner-end-start-shape: inherit;
    corner-end-start-shape: initial;
    corner-end-start-shape: revert;
    corner-end-start-shape: revert-layer;
    corner-end-start-shape: unset;
    
### Values
The `corner-end-start-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-end-start-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `60px / 20%`, and a `corner-end-start-shape` of `bevel`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 60px / 20%;
      corner-end-start-shape: bevel;
    }
    
#### Result
The rendered result looks like this:
# stop-color
The `stop-color` CSS property defines the color to use for an SVG `<stop>` element within a gradient. If present, it overrides the element's `stop-color` attribute.
Note: The `stop-color` property only applies to `<stop>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* <color> values */
    stop-color: red;
    stop-color: hsl(120deg 75% 25% / 60%);
    stop-color: currentColor;
    
    /* Global values */
    stop-color: inherit;
    stop-color: initial;
    stop-color: revert;
    stop-color: revert-layer;
    stop-color: unset;
    
### Values
`<color>`
    
The color of the fill. This can be any valid CSS `<color>` value.
## Examples
>
### Defining the color stops of SVG gradients
This example demonstrates the basic use case of `stop-color`, and how the CSS `stop-color` property takes precedence over the `stop-color` attribute.
#### HTML
We have an SVG with three `<rect>` squares and three `<linearGradient>` elements. Each gradient has four `<stop>` elements creating gradients that go from black to white and then white to grey; the only difference between them is the `id` value.
    
    <svg viewBox="0 0 264 100" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <linearGradient id="myGradient1">
          <stop offset="25%" stop-color="black" />
          <stop offset="40%" stop-color="white" />
          <stop offset="60%" stop-color="white" />
          <stop offset="75%" stop-color="#333333" />
        </linearGradient>
        <linearGradient id="myGradient2">
          <stop offset="25%" stop-color="black" />
          <stop offset="40%" stop-color="white" />
          <stop offset="60%" stop-color="white" />
          <stop offset="75%" stop-color="#333333" />
        </linearGradient>
        <linearGradient id="myGradient3">
          <stop offset="25%" stop-color="black" />
          <stop offset="40%" stop-color="white" />
          <stop offset="60%" stop-color="white" />
          <stop offset="75%" stop-color="#333333" />
        </linearGradient>
      </defs>
      <rect x="2" y="10" width="80" height="80" fill="url('#myGradient1')" />
      <rect x="92" y="10" width="80" height="80" fill="url('#myGradient2')" />
      <rect x="182" y="10" width="80" height="80" fill="url('#myGradient3')" />
    </svg>
    
#### CSS
We include a `stroke` and `stroke-width` outlining the rectangle. We define the colors of the first and last stops in each gradient, overriding their `stop-color` attribute values, using the `stop-color` property. Various CSS `<color>` syntaxes are shown.
    
    rect {
      stroke: #333333;
      stroke-width: 1px;
    }
    
    #myGradient1 {
      stop:first-of-type {
        stop-color: #66ccff;
      }
      stop:last-of-type {
        stop-color: #f4aab9;
      }
    }
    #myGradient2 {
      stop:first-of-type {
        stop-color: yellow;
      }
      stop:last-of-type {
        stop-color: purple;
      }
    }
    #myGradient3 {
      stop:first-of-type {
        stop-color: hsl(0deg 90% 50%);
      }
      stop:last-of-type {
        stop-color: hsl(20deg 60% 50%);
      }
    }
    
#### Results
# grid-area
The `grid-area` CSS shorthand property specifies a grid item's size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area.
## Try it
    
    grid-area: a;
    
    
    grid-area: b;
    
    
    grid-area: c;
    
    
    grid-area: 2 / 1 / 2 / 4;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">Example</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-template-areas:
        "a a a"
        "b c c"
        "b c c";
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
If four `<grid-line>` values are specified, `grid-row-start` is set to the first value, `grid-column-start` is set to the second value, `grid-row-end` is set to the third value, and `grid-column-end` is set to the fourth value.
When `grid-column-end` is omitted, if `grid-column-start` is a `<custom-ident>`, `grid-column-end` is set to that `<custom-ident>`; otherwise, it is set to `auto`.
When `grid-row-end` is omitted, if `grid-row-start` is a `<custom-ident>`, `grid-row-end` is set to that `<custom-ident>`; otherwise, it is set to `auto`.
When `grid-column-start` is omitted, if `grid-row-start` is a `<custom-ident>`, all four longhands are set to that value. Otherwise, it is set to `auto`.
The `grid-area` property can also be set to a `<custom-ident>` which acts as a name for the area, which can then be placed using `grid-template-areas`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `grid-row-start`
  * `grid-column-start`
  * `grid-row-end`
  * `grid-column-end`


## Syntax
    
    /* Keyword values */
    grid-area: auto;
    grid-area: auto / auto;
    grid-area: auto / auto / auto;
    grid-area: auto / auto / auto / auto;
    
    /* <custom-ident> values */
    grid-area: some-grid-area;
    grid-area: some-grid-area / another-grid-area;
    
    /* <integer> && <custom-ident>? values */
    grid-area: 4 some-grid-area;
    grid-area: 4 some-grid-area / 2 another-grid-area;
    
    /* span && [ <integer> || <custom-ident> ] values */
    grid-area: span 3;
    grid-area: span 3 / span some-grid-area;
    grid-area: 2 span / another-grid-area span;
    
    /* Global values */
    grid-area: inherit;
    grid-area: initial;
    grid-area: revert;
    grid-area: revert-layer;
    grid-area: unset;
    
### Values
`auto`
    
Is a keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name `<custom-ident>-start` or `<custom-ident>-end`, it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-area: foo;` will choose the start/end edge of that named grid area (unless another line named `foo-start`/`foo-end` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the n-th grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement such that the corresponding edge of the grid item's grid area is n lines from the opposite edge.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the `<integer>` is omitted, it defaults to `1`. Negative integers or 0 are invalid.
## Examples
>
### Setting grid areas
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 100px;
      grid-template: repeat(4, 1fr) / 50px 100px;
    }
    
    #item1 {
      background-color: lime;
      grid-area: 2 / 2 / auto / span 3;
    }
    
    #item2 {
      background-color: yellow;
    }
    
    #item3 {
      background-color: blue;
    }
    
#### Result
# flood-opacity
The `flood-opacity` CSS property defines the opacity of the current filter primitive subregion in `<feFlood>` and `<feDropShadow>` elements within a `<filter>`. If present, it overrides the element's `flood-opacity` attribute.
The property value impacts the `flood-color`'s alpha channel; it can increase the transparency of a `flood-color` but can not make the color defined by the `flood-color` property more opaque.
Note: The `flood-opacity` property only applies to `<feFlood>` and `<feDropShadow>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* numeric and percentage values */
    flood-opacity: 0.2;
    flood-opacity: 20%;
    
    /* Global values */
    flood-opacity: inherit;
    flood-opacity: initial;
    flood-opacity: revert;
    flood-opacity: revert-layer;
    flood-opacity: unset;
    
### Values
The `<opacity-value>` is a `<number>` or `<percentage>` denoting the opacity of the SVG gradient `<flood>` element.
`<number>`
    
A numeric value between `0` and `1`, inclusive.
`<percentage>`
    
A percentage value between `0%` and `100%`, inclusive.
With `0` or `0%` set, the flood is fully transparent. With `1` or `100%` set, the element is the full opacity of the `flood-color` value, which may or may not be partially opaque.
## Examples
>
### Defining the flood opacity of a filter
This example demonstrates the basic use case of `flood-opacity`, and how the CSS `flood-opacity` property takes precedence over the `flood-opacity` attribute.
#### HTML
We have an SVG with a few `<filter>` elements, each with a `<feFlood>` child. The `<feFlood>` define the filters as `seagreen`, with the first being declared by its `flood-opacity` attribute as fully opaque and the second being fully transparent. We included two `<rect>` elements, each with a filter attribute.
    
    <svg viewBox="0 0 420 120" xmlns="http://www.w3.org/2000/svg">
      <filter id="flood1">
        <feFlood flood-color="seagreen" flood-opacity="1" />
      </filter>
      <filter id="flood2">
        <feFlood flood-color="seagreen" flood-opacity="0" />
      </filter>
    
      <rect id="r1" filter="url(#flood1)" />
      <rect id="r2" filter="url(#flood2)" />
    </svg>
    
#### CSS
We define the `height`, `width`, `x`, and `y`,positioning of our rectangles with CSS, and include a repeating linear gradient as a `background-image` on the SVG so the opacity of the flood-color is more apparent:
    
    svg {
      background-image: repeating-linear-gradient(
        45deg,
        transparent 0 9px,
        #cccccc 0px 10px
      );
    }
    rect {
      width: 100px;
      height: 100px;
      x: 10px;
      y: 10px;
    }
    #r2 {
      x: 150px;
    }
    
We then apply different flood opacity values to the `<feFlood>` elements using the CSS `flood-opacity`: property:
    
    #flood1 feFlood {
      flood-opacity: 0.5;
    }
    #flood2 feFlood {
      flood-opacity: 90%;
    }
    
#### Results
The attributes defined the first square as fully opaque and the second as fully transparent, but these values were overridden by the CSS `flood-opacity` values. The seagreen filters are 50% and 90% opaque, respectively.
# overflow-inline
The `overflow-inline` CSS property sets what shows when content overflows the inline start and end edges of a box. This may be nothing, a scroll bar, or the overflow content.
Note: The `overflow-inline` property maps to `overflow-y` or `overflow-x` depending on the writing mode of the document.
## Syntax
    
    /* Keyword values */
    overflow-inline: visible;
    overflow-inline: hidden;
    overflow-inline: clip;
    overflow-inline: scroll;
    overflow-inline: auto;
    
    /* Global values */
    overflow-inline: inherit;
    overflow-inline: initial;
    overflow-inline: revert;
    overflow-inline: revert-layer;
    overflow-inline: unset;
    
The `overflow-inline` property is specified as a single `<overflow>` keyword value.
### Values
`visible`
    
Content is not clipped and may be rendered outside the padding box's inline start and end edges.
`hidden`
    
Content is clipped if necessary to fit the inline dimension in the padding box. No scrollbars are provided.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property.
`scroll`
    
Content is clipped if necessary to fit in the padding box in the inline dimension. Browsers display scrollbars whether or not any content is actually clipped. (This prevents scrollbars from appearing or disappearing when the content changes.) Printers may still print overflowing content.
`auto`
    
Depends on the user agent. If content fits inside the padding box, it looks the same as `visible`, but still establishes a new block-formatting context. Desktop browsers provide scrollbars if content overflows.
## Examples
>
### Setting inline overflow behavior
#### HTML
    
    <ul>
      <li>
        <code>overflow-inline: hidden</code> (hides the text outside the box)
        <div id="div1">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-inline: scroll</code> (always adds a scrollbar)
        <div id="div2">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-inline: visible</code> (displays the text outside the box if
        needed)
        <div id="div3">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-inline: auto</code> (equivalent to <code>scroll</code>
        in most browsers)
        <div id="div4">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-inline: clip</code> (hides the text outside the box beyond
        the overflow clip edge)
        <code>clip</code>
        <div id="div5">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    </ul>
    
#### CSS
    
    div {
      border: 1px solid black;
      width: 250px;
      margin-bottom: 12px;
    }
    
    #div1 {
      overflow-inline: hidden;
    }
    #div2 {
      overflow-inline: scroll;
    }
    #div3 {
      overflow-inline: visible;
    }
    #div4 {
      overflow-inline: auto;
    }
    #div5 {
      overflow-inline: clip;
      overflow-clip-margin: 2em;
    }
    
#### Result
# align-content
The CSS `align-content` property sets the distribution of space between and around content items along a flexbox's cross axis, or a grid or block-level element's block axis.
The interactive example below uses grid layout to demonstrate some of the values of this property.
## Try it
    
    align-content: start;
    
    
    align-content: center;
    
    
    align-content: space-between;
    
    
    align-content: space-around;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 60px 60px;
      grid-auto-rows: 40px;
      column-gap: 10px;
      height: 180px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
This property has no effect on single line flex containers (i.e., ones with `flex-wrap: nowrap`).
## Syntax
    
    /* Normal alignment */
    align-content: normal;
    
    /* Basic positional alignment */
    /* align-content does not take left and right values */
    align-content: start;
    align-content: center;
    align-content: end;
    align-content: flex-start;
    align-content: flex-end;
    
    /* Baseline alignment */
    align-content: baseline;
    align-content: first baseline;
    align-content: last baseline;
    
    /* Distributed alignment */
    align-content: space-between;
    align-content: space-around;
    align-content: space-evenly;
    align-content: stretch;
    
    /* Overflow alignment */
    align-content: safe center;
    align-content: unsafe center;
    
    /* Global values */
    align-content: inherit;
    align-content: initial;
    align-content: revert;
    align-content: revert-layer;
    align-content: unset;
    
### Values
`normal`
    
The items are packed in their default position as if no `align-content` value was set.
`start`
    
The items are packed flush to each other against the start edge of the alignment container in the cross axis.
`center`
    
The items are packed flush to each other in the center of the alignment container along the cross axis.
`end`
    
The items are packed flush to each other against the end edge of the alignment container in the cross axis.
`flex-start`
    
The items are packed flush to each other against the edge of the alignment container depending on the flex container's cross-start side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `start`.
`flex-end`
    
The items are packed flush to each other against the edge of the alignment container depending on the flex container's cross-end side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `end`.
`baseline`, `first baseline`, `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`space-between`
    
The items are evenly distributed within the alignment container along the cross axis. The spacing between each pair of adjacent items is the same. The first item is flush with the start edge of the alignment container in the cross axis, and the last item is flush with the end edge of the alignment container in the cross axis.
`space-around`
    
The items are evenly distributed within the alignment container along the cross axis. The spacing between each pair of adjacent items is the same. The empty space before the first and after the last item equals half of the space between each pair of adjacent items.
`space-evenly`
    
The items are evenly distributed within the alignment container along the cross axis. The spacing between each pair of adjacent items, the start edge and the first item, and the end edge and the last item, are all exactly the same.
`stretch`
    
If the combined size of the items along the cross axis is less than the size of the alignment container, any `auto`-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size exactly fills the alignment container along the cross axis.
`safe`
    
Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored.
Note: The `<content-distribution>` values (`space-between`, `space-around`, `space-evenly`, and `stretch`) have no effect in block layout as all the content in that block is treated as a single alignment-subject.
## Examples
>
### Effects of different align-content values
In this example, you can switch between three different `display` property values, including `flex`, `grid`, and `block`. You can also switch between the different values for `align-content`.
#### HTML
    
    <section>
      <div class="olive">Olive</div>
      <div class="coral">Coral</div>
      <div class="deepskyblue">Deep<br />sky<br />blue</div>
      <div class="orchid">Orchid</div>
      <div class="slateblue">Slateblue</div>
      <div class="maroon">Maroon</div>
    </section>
    
#### CSS
    
    section {
      border: solid 1.5px tomato;
      height: 300px;
      width: 300px;
      flex-wrap: wrap; /* used by flex only */
      gap: 0.2rem; /* not used by block */
    }
    .olive {
      background-color: olive;
    }
    .coral {
      background-color: coral;
    }
    .deepskyblue {
      background-color: deepskyblue;
    }
    .orchid {
      background-color: orchid;
    }
    .slateblue {
      background-color: slateblue;
      color: white;
    }
    .maroon {
      background-color: maroon;
      color: white;
    }
    
#### Result
Try changing the `display` value and the `align-content` value.
In block layout, child elements are treated as a single element, meaning `space-between`, `space-around`, and `space-evenly` behave differently.
# border-bottom-color
The `border-bottom-color` CSS property sets the color of an element's bottom border. It can also be set with the shorthand CSS properties `border-color` or `border-bottom`.
## Try it
    
    border-bottom-color: red;
    
    
    border-bottom-color: #32a1ce;
    
    
    border-bottom-color: rgb(170 50 220 / 0.6);
    
    
    border-bottom-color: hsl(60 90% 50% / 0.8);
    
    
    border-bottom-color: transparent;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* <color> values */
    border-bottom-color: red;
    border-bottom-color: #ffbb00;
    border-bottom-color: rgb(255 0 0);
    border-bottom-color: hsl(100deg 50% 25% / 75%);
    border-bottom-color: currentColor;
    border-bottom-color: transparent;
    
    /* Global values */
    border-bottom-color: inherit;
    border-bottom-color: initial;
    border-bottom-color: revert;
    border-bottom-color: revert-layer;
    border-bottom-color: unset;
    
The `border-bottom-color` property is specified as a single value.
### Values
`<color>`
    
The color of the bottom border.
## Examples
>
### A div with a border
#### HTML
    
    <div class="my-box">
      <p>
        This is a box with a border around it. Note which side of the box is
        <span class="red-text">red</span>.
      </p>
    </div>
    
#### CSS
    
    .my-box {
      border: solid 0.3em gold;
      border-bottom-color: red;
      width: auto;
    }
    
    .red-text {
      color: red;
    }
    
#### Result
# :in-range
The `:in-range` CSS pseudo-class represents an `<input>` element whose current value is within the range limits specified by the `min` and `max` attributes.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:in-range {
      background-color: palegreen;
    }
    
    
    <form>
      <label for="amount">How many tickets? (You can buy 2-6 tickets)</label>
      <input id="amount" name="amount" type="number" min="2" max="6" value="4" />
    
      <label for="dep">Departure Date: (Whole year 2022 is acceptable)</label>
      <input
        id="dep"
        name="dep"
        type="date"
        min="2022-01-01"
        max="2022-12-31"
        value="2025-05-05" />
    
      <label for="ret">Return Date: (Whole year 2022 is acceptable)</label>
      <input id="ret" name="ret" type="date" min="2022-01-01" max="2022-12-31" />
    </form>
    
This pseudo-class is useful for giving the user a visual indication that a field's current value is within the permitted limits.
Note: This pseudo-class only applies to elements that have (and can take) a range limitation. In the absence of such a limitation, the element can neither be "in-range" nor "out-of-range."
## Syntax
    
    :in-range {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <form action="" id="form1">
      <ul>
        Values between 1 and 10 are valid.
        <li>
          <input
            id="value1"
            name="value1"
            type="number"
            placeholder="1 to 10"
            min="1"
            max="10"
            value="12"
            required />
          <label for="value1">Your value is </label>
        </li>
      </ul>
    </form>
    
### CSS
    
    li {
      list-style: none;
      margin-bottom: 1em;
    }
    
    input {
      border: 1px solid black;
    }
    
    input:in-range {
      background-color: rgb(0 255 0 / 25%);
    }
    
    input:out-of-range {
      background-color: rgb(255 0 0 / 25%);
      border: 2px solid red;
    }
    
    input:in-range + label::after {
      content: "okay.";
    }
    
    input:out-of-range + label::after {
      content: "out of range!";
    }
    
### Result
Note: An empty `<input>` does not count as out of range, and will not be selected using the `:out-of-range` pseudo-class selector. The `:blank` pseudo-class exists to select blank inputs, although at the time of writing this is experimental and not well-supported. You could also use the `required` attribute and the `:invalid` pseudo-class to provide more general logic and styling for making inputs mandatory (`:invalid` will style blank and out-of-range inputs).
# font-variant
The `font-variant` CSS shorthand property allows you to set all the font variants for a font.
You can also set the `<font-variant-css2>` values of `font-variant` defined in CSS Level 2.1, (that is, `normal` or `small-caps`), by using the `font` shorthand.
## Try it
    
    font-variant: normal;
    
    
    font-variant: no-common-ligatures proportional-nums;
    
    
    font-variant: common-ligatures tabular-nums;
    
    
    font-variant: small-caps slashed-zero;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>Difficult waffles</p>
        <table>
          <tr>
            <td><span class="tabular">0O</span></td>
          </tr>
          <tr>
            <td><span class="tabular">3.14</span></td>
          </tr>
          <tr>
            <td><span class="tabular">2.71</span></td>
          </tr>
        </table>
      </div>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    section {
      font-family: "Fira Sans", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
    #example-element table {
      margin-left: auto;
      margin-right: auto;
    }
    
    .tabular {
      border: 1px solid;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `font-variant-alternates`
  * `font-variant-caps`
  * `font-variant-east-asian`
  * `font-variant-emoji`
  * `font-variant-ligatures`
  * `font-variant-numeric`
  * `font-variant-position`


## Syntax
    
    font-variant: small-caps;
    font-variant: common-ligatures small-caps;
    
    /* Global values */
    font-variant: inherit;
    font-variant: initial;
    font-variant: revert;
    font-variant: revert-layer;
    font-variant: unset;
    
### Values
`normal`
    
Specifies a normal font face. Each longhand property has an initial value of `normal`.
`none`
    
Sets the value of the `font-variant-ligatures` as `none` and the values of the other longhand properties as `normal`, their initial value.
`<common-lig-values>`, `<discretionary-lig-values>`, `<historical-lig-values>`, `<contextual-alt-values>`
    
Specifies the keywords related to the `font-variant-ligatures` longhand property. The possible values are `common-ligatures`, `no-common-ligatures`, `discretionary-ligatures`, `no-discretionary-ligatures`, `historical-ligatures`, `no-historical-ligatures`, `contextual`, and `no-contextual`.
`stylistic()`, `historical-forms`, `styleset()`, `character-variant()`, `swash()`, `ornaments()`, `annotation()`
    
Specifies the keywords and functions related to the `font-variant-ligatures` longhand property.
`small-caps`, `all-small-caps`, `petite-caps`, `all-petite-caps`, `unicase`, `titling-caps`
    
Specifies the keywords and functions related to the `font-variant-caps` longhand property. The `small-caps` value is the only non-`normal` font variant valid within the `font` shorthand property.
`<numeric-figure-values>`, `<numeric-spacing-values>`, `<numeric-fraction-values>`, `ordinal`, `slashed-zero`
    
Specifies the keywords related to the `font-variant-numeric` longhand property. The possible values are `lining-nums`, `oldstyle-nums`, `proportional-nums`, `tabular-nums`, `diagonal-fractions`, `stacked-fractions`, `ordinal`, and `slashed-zero`.
`<east-asian-variant-values>`, `<east-asian-width-values>`, `ruby`
    
Specifies the keywords related to the `font-variant-east-asian` longhand property. The possible values are `jis78`, `jis83`, `jis90`, `jis04`, `simplified`, `traditional`, `full-width`, `proportional-width`, and `ruby`.
`sub`, `super`
    
Specifies the keywords and functions related to the `font-variant-position` longhand property.
`text`, `emoji`, `unicode`
    
Specifies the keywords and functions related to the `font-variant-emoji` longhand property.
## Examples
>
### Setting the small-caps font variant
#### HTML
    
    <p class="normal">Firefox rocks!</p>
    <p class="small">Firefox rocks!</p>
    
#### CSS
    
    p.normal {
      font-variant: normal;
    }
    p.small {
      font-variant: small-caps;
    }
    
#### Result
# ::details-content
The `::details-content` CSS pseudo-element represents the expandable/collapsible contents of a `<details>` element.
## Try it
    
    details[open]::details-content {
      color: dodgerblue;
      padding: 0.5em;
      border: thin solid grey;
    }
    
    
    <details open>
      <summary>Example summary</summary>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
      <p>
        Architecto cupiditate ea optio modi quas sequi, esse libero asperiores
        debitis eveniet commodi hic ad.
      </p>
    </details>
    
## Syntax
    
    selector::details-content
    
## Examples
>
### Basic example
In this example the `::details-content` pseudo-element is used to set a `background-color` on the content of the `<details>` element.
#### HTML
    
    <details>
      <summary>Click me</summary>
      <p>Here is some content</p>
    </details>
    
#### CSS
    
    details::details-content {
      background-color: #a29bfe;
    }
    
#### Result
### Transition example
In this example the `::details-content` pseudo-element is used to set a `transition` on the content of the `<details>` element so that it smoothly fades into view when expanded, and fades out again when collapsed. To achieve this, two separate transitions are specified inside the `transition` shorthand property:
  * The `opacity` property is given a basic transition over `600ms` to create the fade-in/fade-out effect.
  * The `content-visibility` property (which is toggled between `hidden` and `visible` when the `<details>` content is expanded/collapsed) is also given a basic `600ms` transition, but with the `transition-behavior` value `allow-discrete` specified. This opts the browser into having a transition started on `content-visibility`, the animation behavior of which is discrete. The effect is that the content is visible for the entire duration of the transition, allowing other transitions to be seen. If this transition was not included, the content would immediately disappear when the `<details>` content was collapsed — you wouldn't see the smooth fade-out.


#### HTML
    
    <details>
      <summary>Click me</summary>
      <p>Here is some content</p>
    </details>
    
#### CSS
    
    details::details-content {
      opacity: 0;
      transition:
        opacity 600ms,
        content-visibility 600ms allow-discrete;
    }
    
    details[open]::details-content {
      opacity: 1;
    }
    
#### Result
# stroke-opacity
The `stroke-opacity` CSS property defines the opacity of an SVG shape's stroke. The effect is identical to that of `opacity`, except it is applied only to the stroke, not to the entire element. If present, it overrides the element's `stroke-opacity` attribute.
This property applies to SVG shapes and text-content elements (see `stroke-opacity` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes.
Note that a shape's stroke partially covers the fill of that shape, so a stroke with an opacity less than `1` will show the fill blended with the stroke where they overlap. To avoid this effect, it is possible to apply a global opacity with the `opacity` property or to put the stroke behind the fill with the `paint-order` attribute.
## Syntax
    
    /* numeric and percentage values */
    stroke-opacity: 1;
    stroke-opacity: 0.3;
    stroke-opacity: 50%;
    
    /* Global values */
    stroke-opacity: inherit;
    stroke-opacity: initial;
    stroke-opacity: revert;
    stroke-opacity: revert-layer;
    stroke-opacity: unset;
    
### Values
`<number>`
    
Any real number from 0 to 1, inclusive. A value of `0` makes the stroke completely transparent, and a value of `1` makes it completely opaque. Values outside the range 0 – 1 are clipped to the nearest end of that range; thus, negative values are clipped to `0`.
`<percentage>`
    
The same as `<number>` (see above), except the allowed range is 0% to 100% and clipping is done with regard to that range.
## Examples
>
### Various stroke opacities
This example demonstrates basic usage of the `stroke-opacity` property and how, as a shape's stroke partially covers its fill, a stroke with an opacity less than `1` blends with the fill where they overlap.
#### HTML
First, we set up five multi-segment paths, all of which use a black stroke with a width of one, and a `dodgerblue` fill for the subpaths. Each path creates a series of mountain symbols, going from left (a shallow corner angle) to right (an extreme corner angle).
    
    <svg viewBox="0 0 39 36" xmlns="http://www.w3.org/2000/svg">
      <g stroke="black" stroke-width="1" fill="dodgerblue">
        <path
          d="M1,5 l7   ,-3 l7   ,3
             m2,0 l3.5 ,-3 l3.5 ,3
             m2,0 l2   ,-3 l2   ,3
             m2,0 l0.75,-3 l0.75,3
             m2,0 l0.5 ,-3 l0.5 ,3" />
        <path
          d="M1,12 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,19 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,26 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
        <path
          d="M1,33 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" />
      </g>
    </svg>
    
#### CSS
To these paths, we apply a successively higher stroke opacity value. For the first four paths, the fill can be seen through the inner half of the stroke path, though it may be difficult to discern for the fourth path. For the fifth and last path, the stroke is fully opaque and so the fill cannot be seen through the stroke.
    
    g path:nth-child(1) {
      stroke-opacity: 0.2;
    } /* equiv. 20% */
    g path:nth-child(2) {
      stroke-opacity: 0.4;
    } /* equiv. 40% */
    g path:nth-child(3) {
      stroke-opacity: 0.6;
    } /* equiv. 60% */
    g path:nth-child(4) {
      stroke-opacity: 0.8;
    } /* equiv. 80% */
    g path:nth-child(5) {
      stroke-opacity: 1;
    } /* equiv. 100% */
    
#### Results
# <relative-size>
The `<relative-size>` CSS data type describes relative size keywords. The `<relative-size>` keywords define a size relative to the computed size of the parent element. This data type is used in the `font` shorthand and `font-size` properties.
## Syntax
    
    <relative-size> = smaller | larger
    
### Values
The `<relative-size>` data type is defined using a keyword value chosen from the list below.
`smaller`
    
A relative size one size smaller than the inherited size.
`larger`
    
A relative size one size larger than the inherited size.
## Description
The `<relative-size>` keywords are relative to the current size of the element. If the inherited size is defined using an `<absolute-size>` keyword, the `<relative-size>` value equates to the adjacent size in the `<absolute-size>` table. Otherwise, the relative increase or decrease in size is between 120% and 150%.
## Examples
>
### Comparing the keyword values
    
    <ul>
      <li class="smaller">font-size: smaller;</li>
      <li>font-size is not specified</li>
      <li class="larger">font-size: larger;</li>
    </ul>
    
    
    li {
      margin-bottom: 0.3em;
    }
    .smaller {
      font-size: smaller;
    }
    .larger {
      font-size: larger;
    }
    
#### Result
# background-size
The `background-size` CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space.
## Try it
    
    background-size: contain;
    
    
    background-size: contain;
    background-repeat: no-repeat;
    
    
    background-size: cover;
    
    
    background-size: 30%;
    
    
    background-size: 200px 100px;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      background-image: url("/shared-assets/images/examples/hand.jpg");
      min-width: 100%;
      min-height: 100%;
    }
    
Spaces not covered by a background image are filled with the `background-color` property, and the background color will be visible behind background images that have transparency/translucency.
## Syntax
    
    /* Keyword values */
    background-size: cover;
    background-size: contain;
    
    /* One-value syntax */
    /* the width of the image (height becomes 'auto') */
    background-size: 50%;
    background-size: 3.2em;
    background-size: 12px;
    background-size: auto;
    
    /* Two-value syntax */
    /* first value: width of the image, second value: height */
    background-size: 50% auto;
    background-size: 3em 25%;
    background-size: auto 6px;
    background-size: auto auto;
    
    /* Multiple backgrounds */
    background-size: auto, auto; /* Not to be confused with `auto auto` */
    background-size: 50%, 25%, 25%;
    background-size: 6px, auto, contain;
    
    /* Global values */
    background-size: inherit;
    background-size: initial;
    background-size: revert;
    background-size: revert-layer;
    background-size: unset;
    
The `background-size` property is specified in one of the following ways:
  * Using the keyword values `contain` or `cover`.
  * Using a width value only, in which case the height defaults to `auto`.
  * Using both a width and a height value, in which case the first sets the width and the second sets the height. Each value can be a `<length>`, a `<percentage>`, or `auto`.


To specify the size of multiple background images, separate the value for each one with a comma.
### Values
`contain`
    
Scales the image as large as possible within its container without cropping or stretching the image. If the container is larger than the image, this will result in image tiling, unless the `background-repeat` property is set to `no-repeat`.
`cover`
    
Scales the image (while preserving its ratio) to the smallest possible size to fill the container (that is: both its height and width completely cover the container), leaving no empty space. If the proportions of the background differ from the element, the image is cropped either vertically or horizontally.
`auto`
    
Scales the background image in the corresponding direction such that its intrinsic proportions are maintained.
`<length>`
    
Stretches the image in the corresponding dimension to the specified length. Negative values are not allowed.
`<percentage>`
    
Stretches the image in the corresponding dimension to the specified percentage of the background positioning area. The background positioning area is determined by the value of `background-origin` (by default, the padding box). However, if the background's `background-attachment` value is `fixed`, the positioning area is instead the entire viewport. Negative values are not allowed.
### Intrinsic dimensions and proportions
The computation of values depends on the image's intrinsic dimensions (width and height) and intrinsic proportions (width-to-height ratio). These attributes are as follows:
  * A bitmap image (such as JPG) always has intrinsic dimensions and proportions.
  * A vector image (such as SVG) does not necessarily have intrinsic dimensions. If it has both horizontal and vertical intrinsic dimensions, it also has intrinsic proportions. If it has no dimensions or only one dimension, it may or may not have proportions.
  * CSS `<gradient>`s have no intrinsic dimensions or intrinsic proportions.
  * Background images created with the `element()` function use the intrinsic dimensions and proportions of the generating element.


Note: In Gecko, background images created using the `element()` function are currently treated as images with the dimensions of the element, or of the background positioning area if the element is SVG, with the corresponding intrinsic proportion. This is non-standard behavior.
Based on the intrinsic dimensions and proportions, the rendered size of the background image is computed as follows:
  * If both components of `background-size` are specified and are not `auto`: The background image is rendered at the specified size.
  * If the `background-size` is `contain` or `cover`: While preserving its intrinsic proportions, the image is rendered at the largest size contained within, or covering, the background positioning area. If the image has no intrinsic proportions, then it's rendered at the size of the background positioning area.
  * If the `background-size` is `auto` or `auto auto`:
    * If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.
    * If the image has no intrinsic dimensions and has no intrinsic proportions, it's rendered at the size of the background positioning area.
    * If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if `contain` had been specified instead.
    * If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension. The other dimension is computed using the specified dimension and the intrinsic proportions.
    * If the image has only one intrinsic dimension but has no intrinsic proportions, it's rendered using the specified dimension and the other dimension of the background positioning area.
Note: SVG images have a `preserveAspectRatio` attribute that defaults to the equivalent of `contain`; an explicit `background-size` causes `preserveAspectRatio` to be ignored.
  * If the `background-size` has one `auto` component and one non-`auto` component:
    * If the image has intrinsic proportions, it's stretched to the specified dimension. The unspecified dimension is computed using the specified dimension and the intrinsic proportions.
    * If the image has no intrinsic proportions, it's stretched to the specified dimension. The unspecified dimension is computed using the image's corresponding intrinsic dimension, if there is one. If there is no such intrinsic dimension, it becomes the corresponding dimension of the background positioning area.


Note: Background sizing for vector images that lack intrinsic dimensions or proportions is not yet fully implemented in all browsers. Be careful about relying on the behavior described above, and test in multiple browsers to be sure the results are acceptable.
## Examples
>
### Tiling a large image
Let's consider a large image, a 2982x2808 Firefox logo image. We want to tile four copies of this image into a 300x300-pixel element. To do this, we can use a fixed `background-size` value of 150 pixels.
#### HTML
    
    <div class="tiledBackground"></div>
    
#### CSS
    
    .tiledBackground {
      background-image: url("https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png");
      background-size: 150px;
      width: 300px;
      height: 300px;
      border: 2px solid;
      color: pink;
    }
    
#### Result
See Resizing background images for more examples.
# caret
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `caret` shorthand CSS property sets the appearance and behavior of the insertion caret in a single declaration.
## Try it
    
    caret: red;
    
    
    caret: block manual;
    
    
    caret: underscore auto green;
    
    
    caret: bar manual orange;
    
    
    <section class="default-example container" id="default-example">
      <div>
        <label for="example-element">Edit text field:</label>
        <input id="example-element" type="text" value="Sample text" />
      </div>
    </section>
    
    
    div {
      text-align: left;
    }
    
    #example-element {
      font-size: 1.2rem;
      padding: 8px;
      width: 300px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `caret-color`
  * `caret-animation`
  * `caret-shape`


## Syntax
    
    /* Individual values */
    caret: red; /* caret-color only */
    caret: block; /* caret-shape only */
    caret: manual; /* caret-animation only */
    
    /* Two values */
    caret: red manual; /* caret-color + caret-animation */
    caret: block auto; /* caret-shape + caret-animation */
    caret: underscore orange; /* caret-shape + caret-color */
    
    /* Three values */
    caret: bar manual red; /* caret-shape + caret-animation + caret-color */
    caret: block auto #00ff00; /* caret-shape + caret-animation + caret-color */
    
    /* Global values */
    caret: inherit;
    caret: initial;
    caret: revert;
    caret: revert-layer;
    caret: unset;
    
The `caret` property is specified as one, two, or three values from the constituent properties. Values can be specified in any order, and omitted values are set to their initial values.
### Values
`caret-color`
    
Sets the color of the caret.
`caret-animation`
    
Controls whether the caret blinks.
`caret-shape`
    
Sets the visual shape of the caret.
## Description
The `caret` shorthand allows you to set multiple caret properties in a single declaration, making it convenient to customize the complete appearance and behavior of the insertion caret.
### Value resolution
When values are omitted from the shorthand, they reset to their initial values:
  * `caret-color`: `auto` (resolves to `currentColor`).
  * `caret-animation`: `auto` (caret blinks).
  * `caret-shape`: `auto` (browser-determined shape).


### Order independence
Unlike some CSS shorthands, the `caret` property accepts values in any order. The browser determines which value applies to which property based on the value type:
  * `<color>` values apply to `caret-color`.
  * `auto`/`manual` keywords apply to `caret-animation`.
  * Shape keywords (`bar`, `block`, `underscore`) apply to `caret-shape`.


## Examples
>
### Retro terminal with animated caret
This example creates a vintage terminal interface using the `caret` shorthand to combine multiple caret properties, demonstrating how it replaces older border-based techniques.
The main advantage of the `caret` shorthand is combining multiple properties in one declaration. Here we set the shape to `block`, disable default blinking, and set the color to `green`, all in a single line.
#### HTML
    
    <label for="terminal">Enter a command</label>
    <div class="old-screen">
      <span>></span>
      <textarea id="terminal" class="terminal-input"></textarea>
    </div>
    
#### CSS
    
    .terminal-input {
      caret: block manual green;
      animation: vintage-caret 2s infinite;
    }
    
    @keyframes vintage-caret {
      0%,
      50% {
        caret-color: #00ad00;
      }
      75%,
      100% {
        caret-color: transparent;
      }
    }
    
#### Result
# overflow
The `overflow` CSS shorthand property sets the desired behavior when content does not fit in the element's padding box (overflows) in the horizontal and/or vertical direction.
## Try it
    
    overflow: visible;
    
    
    overflow: hidden;
    
    
    overflow: clip;
    
    
    overflow: scroll;
    
    
    overflow: auto;
    
    
    <section class="default-example" id="default-example">
      <p id="example-element">
        Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's
        Inn Hall. Implacable November weather. As much mud in the streets as if the
        waters had but newly retired from the face of the earth.
      </p>
    </section>
    
    
    #example-element {
      width: 15em;
      height: 9em;
      border: medium dotted;
      padding: 0.75em;
      text-align: left;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `overflow-x`
  * `overflow-y`


## Syntax
    
    /* Keyword values */
    overflow: visible;
    overflow: hidden;
    overflow: clip;
    overflow: scroll;
    overflow: auto;
    overflow: hidden visible;
    
    /* Global values */
    overflow: inherit;
    overflow: initial;
    overflow: revert;
    overflow: revert-layer;
    overflow: unset;
    
The `overflow` property is specified as one or two `<overflow>` keyword values. If only one keyword is specified, both `overflow-x` and `overflow-y` are set to the same value. If two keywords are specified, the first value applies to `overflow-x` in the horizontal direction and the second one applies to `overflow-y` in the vertical direction.
### Values
`visible`
    
Overflow content is not clipped and may be visible outside the element's padding box. The element box is not a scroll container. This is the default value of the `overflow` property.
`hidden`
    
Overflow content is clipped at the element's padding box. There are no scroll bars, and the clipped content is not visible (i.e., clipped content is hidden), but the content still exists. User agents do not add scroll bars and also do not allow users to view the content outside the clipped region by actions such as dragging on a touch screen or using the scroll wheel on a mouse. The content can be scrolled programmatically (for example, by linking to anchor text, by tabbing to a hidden yet focusable element, or by setting the value of the `scrollLeft` property or the `scrollTo()` method), in which case the element box is a scroll container.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property. As a result, content overflows the element's padding box by the `<length>` value of `overflow-clip-margin` or by `0px` if not set. Overflow content outside the clipped region is not visible, user agents do not add a scroll bar, and programmatic scrolling is also not supported. No new formatting context is created. To establish a formatting context, use `overflow: clip` along with `display: flow-root`. The element box is not a scroll container.
`scroll`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view using scroll bars. User agents display scroll bars whether or not any content is overflowing, so in the horizontal and vertical directions if the value applies to both directions. The use of this keyword, therefore, can prevent scroll bars from appearing and disappearing as content changes. Printers may still print overflow content. The element box is a scroll container.
`auto`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view using scroll bars. Unlike `scroll`, user agents display scroll bars only if the content is overflowing. If content fits inside the element's padding box, it looks the same as with `visible` but still establishes a new formatting context. The element box is a scroll container.
Note: The keyword value `overlay` is a legacy value alias for `auto`. With `overlay`, the scroll bars are drawn on top of the content instead of taking up space.
## Description
Overflow options include hiding overflow content, enabling scroll bars to view overflow content or displaying the content flowing out of an element box into the surrounding area, and combinations there of.
The following nuances should be kept in mind while using the various keywords for `overflow`:
  * Specifying a value other than `visible` (the default) or `clip` for `overflow` creates a new block formatting context. This is necessary for technical reasons; if a float intersects with a scrolling element, it would forcibly rewrap the content after each scroll step, leading to a slow scrolling experience.
  * For an `overflow` setting to create the desired effect, the block-level element must have either a set height (`height` or `max-height`) if the overflow is in the vertical direction, a set width (`width` or `max-width`) if the overflow is in the horizontal direction, a set block-size ((`block-size` or `max-block-size`) if the overflow is in the block direction, or a set inline-size ((`inline-size` or `max-inline-size`) or `white-space` set to `nowrap` if the overflow is in the inline direction.
  * Setting overflow to `visible` in one direction (i.e., `overflow-x` or `overflow-y`) when it isn't set to `visible` or `clip` in the other direction results in the `visible` value behaving as `auto`.
  * Setting overflow to `clip` in one direction when it isn't set to `visible` or `clip` in the other direction results in the `clip` value behaving as `hidden`.
  * The JavaScript `Element.scrollTop` property may be used to scroll through content in a scroll container, except when `overflow` is set to `clip`.


## Accessibility
A scrolling content area is not keyboard-focusable, so it cannot be scrolled by a keyboard-only user. Firefox and Chrome 132 and later are exceptions; they make scroll containers focusable by default.
For other browsers, to enable keyboard-only users to scroll the container, you will need to assign a `tabindex` to the container using `tabindex="0"`. Unfortunately, when a screen reader encounters this tab-stop, it may have no context about the container and could likely announce entire contents of the container. To mitigate this, give the container an appropriate WAI-ARIA role (`role="region"`, for example) and an accessible name (via `aria-label` or `aria-labelledby`).
## Examples
>
### Demonstrating results of various overflow keywords
#### HTML
    
    <div>
      <code>visible</code>
      <p class="visible">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
    <div>
      <code>hidden</code>
      <p class="hidden">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
    <div>
      <code>clip</code>
      <p class="clip">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
    <div>
      <code>scroll</code>
      <p class="scroll">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
    <div>
      <code>auto</code>
      <p class="auto">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
    <div>
      <code>overlay</code>
      <p class="overlay">
        Maya Angelou: "I've learned that people will forget what you said, people
        will forget what you did, but people will never forget how you made them
        feel."
      </p>
    </div>
    
#### CSS
    
    p.visible {
      overflow: visible;
    }
    
    p.hidden {
      overflow: hidden;
    }
    
    p.clip {
      overflow: clip;
      overflow-clip-margin: 1em;
    }
    
    p.scroll {
      overflow: scroll;
    }
    
    p.auto {
      overflow: auto;
    }
    
    p.overlay {
      overflow: overlay;
    }
    
#### Result
# <display-listitem>
The `list-item` keyword causes the element to generate a `::marker` pseudo-element with the content specified by its `list-style` properties (for example a bullet point) together with a principal box of the specified type for its own contents.
## Syntax
A single value of `list-item` will cause the element to behave like a list item. This can be used together with `list-style-type` and `list-style-position`.
`list-item` can also be combined with any `<display-outside>` keyword and the `flow` or `flow-root` `<display-inside>` keywords.
Note: In browsers that support the two-value syntax, if no inner value is specified it will default to `flow`. If no outer value is specified, the principal box will have an outer display type of `block`.
## Examples
>
### HTML
    
    <div class="fake-list">I will display as a list item</div>
    
### CSS
    
    .fake-list {
      display: list-item;
      list-style-position: inside;
    }
    
### Result
# flex-direction
The `flex-direction` CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
## Try it
    
    flex-direction: row;
    
    
    flex-direction: row-reverse;
    
    
    flex-direction: column;
    
    
    flex-direction: column-reverse;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div>Item One</div>
        <div>Item Two</div>
        <div>Item Three</div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 80%;
      display: flex;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      width: 60px;
      margin: 10px;
    }
    
Note that the values `row` and `row-reverse` are affected by the directionality of the flex container. If its `dir` attribute is `ltr`, `row` represents the horizontal axis oriented from the left to the right, and `row-reverse` from the right to the left; if the `dir` attribute is `rtl`, `row` represents the axis oriented from the right to the left, and `row-reverse` from the left to the right.
## Syntax
    
    /* The direction text is laid out in a line */
    flex-direction: row;
    
    /* Like <row>, but reversed */
    flex-direction: row-reverse;
    
    /* The direction in which lines of text are stacked */
    flex-direction: column;
    
    /* Like <column>, but reversed */
    flex-direction: column-reverse;
    
    /* Global values */
    flex-direction: inherit;
    flex-direction: initial;
    flex-direction: revert;
    flex-direction: revert-layer;
    flex-direction: unset;
    
### Values
The following values are accepted:
`row`
    
The flex container's main-axis is defined to be the same as the text direction. The main-start and main-end points are the same as the content direction.
`row-reverse`
    
Behaves the same as `row` but the main-start and main-end points are opposite to the content direction.
`column`
    
The flex container's main-axis is the same as the block-axis. The main-start and main-end points are the same as the before and after points of the writing-mode.
`column-reverse`
    
Behaves the same as `column` but the main-start and main-end are opposite to the content direction.
## Accessibility
Using the `flex-direction` property with values of `row-reverse` or `column-reverse` will create a disconnect between the visual presentation of content and DOM order. This will adversely affect users experiencing low vision navigating with the aid of assistive technology such as a screen reader. If the visual (CSS) order is important, then screen reader users will not have access to the correct reading order.
  * Flexbox & the keyboard navigation disconnect — Tink
  * Source Order Matters | Adrian Roselli
  * MDN Understanding WCAG, Guideline 1.3 explanations
  * Understanding Success Criterion 1.3.2 | W3C Understanding WCAG 2.0


## Examples
>
### Reversing flex container columns and rows
#### HTML
    
    <h4>This is a Column-Reverse</h4>
    <div id="col-rev" class="content">
      <div class="box red">A</div>
      <div class="box lightblue">B</div>
      <div class="box yellow">C</div>
    </div>
    <h4>This is a Row-Reverse</h4>
    <div id="row-rev" class="content">
      <div class="box red">A</div>
      <div class="box lightblue">B</div>
      <div class="box yellow">C</div>
    </div>
    
#### CSS
    
    .content {
      width: 200px;
      height: 200px;
      border: 1px solid #c3c3c3;
      display: flex;
    }
    
    .box {
      width: 50px;
      height: 50px;
    }
    
    #col-rev {
      flex-direction: column-reverse;
    }
    
    #row-rev {
      flex-direction: row-reverse;
    }
    
    .red {
      background-color: red;
    }
    
    .lightblue {
      background-color: lightblue;
    }
    
    .yellow {
      background-color: yellow;
    }
    
#### Result
# Custom properties (--*): CSS variables
Property names that are prefixed with `--`, like `--example-name`, represent custom properties that contain a value that can be used in other declarations using the `var()` function.
Custom properties are scoped to the element(s) they are declared on, and participate in the cascade: the value of such a custom property is that from the declaration decided by the cascading algorithm.
Initial value see prose  
Applies to all elements  
Inherited yes  
Computed value as specified with variables substituted  
Animation type discrete  
## Syntax
    
    --some-keyword: left;
    --some-color: #123456;
    --some-complex-value: 3px 6px rgb(20 32 54);
    
`<declaration-value>`
    
This value matches any sequence of one or more tokens, so long as the sequence does not contain any disallowed token. It represents the entirety of what a valid declaration can have as its value.
Note: Custom property names are case sensitive — `--my-color` will be treated as a separate custom property to `--My-color`.
## Example
>
### HTML
    
    <p id="firstParagraph">
      This paragraph should have a blue background and yellow text.
    </p>
    <p id="secondParagraph">
      This paragraph should have a yellow background and blue text.
    </p>
    <div id="container">
      <p id="thirdParagraph">
        This paragraph should have a green background and yellow text.
      </p>
    </div>
    
### CSS
    
    :root {
      --first-color: #1166ff;
      --second-color: #ffff77;
    }
    
    #firstParagraph {
      background-color: var(--first-color);
      color: var(--second-color);
    }
    
    #secondParagraph {
      background-color: var(--second-color);
      color: var(--first-color);
    }
    
    #container {
      --first-color: #229900;
    }
    
    #thirdParagraph {
      background-color: var(--first-color);
      color: var(--second-color);
    }
    
### Result
# border-block-start-width
The `border-block-start-width` CSS property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-start-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-block-start-width: thick;
    writing-mode: vertical-rl;
    
    
    border-block-start-width: 4px;
    writing-mode: horizontal-tb;
    
    
    border-block-start-width: 4px;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-width'> values */
    border-block-start-width: 5px;
    border-block-start-width: thick;
    
    /* Global values */
    border-block-start-width: inherit;
    border-block-start-width: initial;
    border-block-start-width: revert;
    border-block-start-width: revert-layer;
    border-block-start-width: unset;
    
Related properties are `border-block-end-width`, `border-inline-start-width`, and `border-inline-end-width`, which define the other border widths of the element.
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### Border width with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-block-start-width: 5px;
    }
    
#### Results
# <blend-mode>
The `<blend-mode>` CSS data type describes how colors should appear when elements overlap. It is used in the `background-blend-mode` and `mix-blend-mode` properties.
## Syntax
The `<blend-mode>` data type is defined using a keyword value chosen from the list below.
### Values
`normal`
    
The final color is the top color, regardless of what the bottom color is. The effect is like two opaque pieces of paper overlapping.
`multiply`
    
The final color is the result of multiplying the top and bottom colors. A black layer leads to a black final layer, and a white layer leads to no change. The effect is like two images printed on transparent film overlapping.
`screen`
    
The final color is the result of inverting the colors, multiplying them, and inverting that value. A black layer leads to no change, and a white layer leads to a white final layer. The effect is like two images shining onto a projection screen.
`overlay`
    
The final color is the result of `multiply` if the bottom color is darker, or `screen` if the bottom color is lighter. This blend mode is equivalent to `hard-light` but with the layers swapped.
`darken`
    
The final color is composed of the darkest values of each color channel.
`lighten`
    
The final color is composed of the lightest values of each color channel.
`color-dodge`
    
The final color is the result of dividing the bottom color by the inverse of the top color. A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color. This blend mode is similar to `screen`, but the foreground only needs to be as light as the inverse of the backdrop to create a fully lit color.
`color-burn`
    
The final color is the result of inverting the bottom color, dividing the value by the top color, and inverting that value. A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image. This blend mode is similar to `multiply`, but the foreground only needs to be as dark as the inverse of the backdrop to make the final image black.
`hard-light`
    
The final color is the result of `multiply` if the top color is darker, or `screen` if the top color is lighter. This blend mode is equivalent to `overlay` but with the layers swapped. The effect is similar to shining a harsh spotlight on the backdrop.
`soft-light`
    
The final color is similar to `hard-light`, but softer. This blend mode behaves similar to `hard-light`. The effect is similar to shining a diffused spotlight on the backdrop.
`difference`
    
The final color is the result of subtracting the darker of the two colors from the lighter one. A black layer has no effect, while a white layer inverts the other layer's color.
`exclusion`
    
The final color is similar to `difference`, but with less contrast. As with `difference`, a black layer has no effect, while a white layer inverts the other layer's color.
`hue`
    
The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
`saturation`
    
The final color has the saturation of the top color, while using the hue and luminosity of the bottom color. A pure gray backdrop, having no saturation, will have no effect.
`color`
    
The final color has the hue and saturation of the top color, while using the luminosity of the bottom color. The effect preserves gray levels and can be used to colorize the foreground.
`luminosity`
    
The final color has the luminosity of the top color, while using the hue and saturation of the bottom color. This blend mode is equivalent to `color`, but with the layers swapped.
## Description
For each pixel among the layers to which it is applied, a blend mode takes the colors of the foreground and the background, performs a calculation on them, and returns a new color value.
Changes between blend modes are not interpolated. Any change occurs immediately.
## Examples
>
### Example using "normal"
    
    #div {
      width: 150px;
      height: 150px;
      background: url("br.png"), url("tr.png");
      background-blend-mode: normal;
    }
    
Set other values for `background-blend-mode`, you will get different results.
### Comparison between different values with `background-blend-mode`
    
    .container {
      width: 720px;
      height: 760px;
      display: grid;
      grid: auto-flow 190px / repeat(4, 180px);
      border-top: 1px solid #d8d8d8;
      border-left: 1px solid #d8d8d8;
    }
    
    .container > div {
      border-right: 1px solid #d8d8d8;
      border-bottom: 1px solid #d8d8d8;
    }
    
    .container div div {
      margin-left: 15px;
      width: 150px;
      height: 150px;
      background: url("br.png"), url("tr.png");
    }
    
    .container div p {
      line-height: 30px;
      margin: 0;
      color: #a33333;
      text-align: center;
    }
    
    
    const list = [
      "normal",
      "multiply",
      "screen",
      "overlay",
      "darken",
      "lighten",
      "color-dodge",
      "color-burn",
      "hard-light",
      "soft-light",
      "difference",
      "exclusion",
      "hue",
      "saturation",
      "color",
      "luminosity",
    ];
    
    const containerElem = document.querySelector(".container");
    
    list.forEach((item) => {
      const innerElem = document.createElement("div");
      innerElem.style.backgroundBlendMode = item;
    
      const textElem = document.createElement("p");
      textElem.innerText = item;
    
      const outerElem = document.createElement("div");
      outerElem.appendChild(textElem);
      outerElem.appendChild(innerElem);
    
      containerElem.appendChild(outerElem);
    });
    
Create multiple `div` elements by traversing a list and set different `backgroundBlendMode` value for each.
### Comparison between different values with `mix-blend-mode`
In the following example, we create multiple `<div>` elements by traversing a list and set different `mixBlendMode` values for each.
### Blend mode comparison
In the following example, we have a `<div>` with two background images set on it — a Firefox logo on top of a linear gradient. Below it, we have a provided a `<select>` menu that allows you to change the `background-blend-mode` applied to the `<div>`, allowing you to compare the different blend mode effects.
#### HTML
    
    <div></div>
    <p>Choose a blend-mode:</p>
    <select>
      <option selected>normal</option>
      <option>multiply</option>
      <option>screen</option>
      <option>overlay</option>
      <option>darken</option>
      <option>lighten</option>
      <option>color-dodge</option>
      <option>color-burn</option>
      <option>hard-light</option>
      <option>soft-light</option>
      <option>difference</option>
      <option>exclusion</option>
      <option>hue</option>
      <option>saturation</option>
      <option>color</option>
      <option>luminosity</option>
    </select>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background:
        url("https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png")
          no-repeat center,
        linear-gradient(to bottom, blue, orange);
    }
    
#### JavaScript
    
    const selectElem = document.querySelector("select");
    const divElem = document.querySelector("div");
    
    selectElem.addEventListener("change", () => {
      divElem.style.backgroundBlendMode = selectElem.value;
    });
    
#### Result
# text-size-adjust
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `text-size-adjust` CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property.
Because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages. Instead of laying out pages at the width of the device screen, they lay them out using a viewport that is much wider, usually 800 or 1000 pixels. To map the extra-wide layout back to the original device size, they either show only part of the whole render or scale the viewport down to fit.
Since text that has been scaled down to fit a mobile screen may be very small, many mobile browsers apply a text inflation algorithm to enlarge the text to make it more readable. When an element containing text uses 100% of the screen's width, the algorithm increases its text size, but without modifying the layout. The `text-size-adjust` property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it.
## Syntax
    
    /* Keyword values */
    text-size-adjust: none;
    text-size-adjust: auto;
    
    /* <percentage> value */
    text-size-adjust: 80%;
    
    /* Global values */
    text-size-adjust: inherit;
    text-size-adjust: initial;
    text-size-adjust: revert;
    text-size-adjust: revert-layer;
    text-size-adjust: unset;
    
The `text-size-adjust` property is specified as `none`, `auto`, or a `<percentage>`.
### Values
`none`
    
Disables the browser's inflation algorithm.
`auto`
    
Enables the browser's inflation algorithm. This value is used to cancel a `none` value previously set with CSS.
`<percentage>`
    
Enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size.
## Examples
>
### Basic disabling usage
As hinted at above, on a properly designed responsive site the `text-size-adjust` behavior is not needed, so developers can elect to turn it off by specifying a value of none:
    
    p {
      -webkit-text-size-adjust: none;
      text-size-adjust: none;
    }
    
# <position>
The `<position>` CSS data type denotes a two-dimensional coordinate used to set a location relative to an element box. It is used in the `background-position`, `object-position`, `mask-position` `offset-position`, `offset-anchor` and `transform-origin` properties.
Note: The final position described by the `<position>` value does not need to be inside the element's box.
## Syntax
The `<position>` data type is specified with one or two keywords, with optional offsets.
The keyword values are `center`, `top`, `right`, `bottom`, and `left`. Each keyword represents either an edge of the element's box or the center line between two edges. Depending on the context, `center` represents either the center between the left and right edges, or the center between the top and bottom edges.
If specified, an offset can be either a relative `<percentage>` value or an absolute `<length>` value. Positive values are offset towards the right or the bottom, whichever is appropriate. Negative values are offset in the opposite directions.
If only a single offset value is specified, it defines the x-coordinate, with the value for the other axis defaulting to `center`.
    
    /* 1-value syntax */
    keyword                  /* Either the horizontal or vertical position; the other axis defaults to center */
    value                    /* The position on the x-axis; the y-axis defaults to 50% */
    
    /* 2-value syntax */
    keyword keyword          /* A keyword for each direction (the order is irrelevant) */
    keyword value            /* A keyword for horizontal position, value for vertical position */
    value keyword            /* A value for horizontal position, keyword for vertical position */
    value value              /* A value for each direction (horizontal then vertical) */
    
    /* 4-value syntax */
    keyword value keyword value /* Each value is an offset from the keyword that precedes it */
    
Note: The `background-position` property also accepts a three-value syntax. This is not allowed in other properties that use `<position>`.
## Interpolation
When animated, a point's abscissa and ordinate values are interpolated independently. However, because the speed of the interpolation is determined by a single easing function for both coordinates, the point will move in a straight line.
## Examples
>
### Valid positions
    
    center
    left
    center top
    
    right 8.5%
    bottom 12vmin right -6px
    
    10% 20%
    8rem 14px
    
### Invalid positions
    
    left right
    bottom top
    10px 15px 20px 15px
    
# border-bottom-width
The `border-bottom-width` CSS property sets the width of the bottom border of an element.
## Try it
    
    border-bottom-width: thick;
    
    
    border-bottom-width: 2em;
    
    
    border-bottom-width: 4px;
    
    
    border-bottom-width: 2ex;
    
    
    border-bottom-width: 0;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
## Syntax
    
    /* Keyword values */
    border-bottom-width: thin;
    border-bottom-width: medium;
    border-bottom-width: thick;
    
    /* <length> values */
    border-bottom-width: 10em;
    border-bottom-width: 3vmax;
    border-bottom-width: 6px;
    
    /* Global keywords */
    border-bottom-width: inherit;
    border-bottom-width: initial;
    border-bottom-width: revert;
    border-bottom-width: revert-layer;
    border-bottom-width: unset;
    
### Values
`<line-width>`
    
Defines the width of the border, either as an explicit nonnegative `<length>` or a keyword. If it's a keyword, it must be one of the following values:
  * `thin`
  * `medium`
  * `thick`


Note: Because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. Nevertheless, they always follow the pattern `thin ≤ medium ≤ thick`, and the values are constant within a single document.
## Examples
>
### Comparing bottom border widths
#### HTML
    
    <div>Element 1</div>
    <div>Element 2</div>
    
#### CSS
    
    div {
      border: 1px solid red;
      margin: 1em 0;
    }
    
    div:nth-child(1) {
      border-bottom-width: thick;
    }
    div:nth-child(2) {
      border-bottom-width: 2em;
    }
    
#### Result
# font-variant-caps
The `font-variant-caps` CSS property controls the use of alternate glyphs used for small or petite capitals or for titling.
## Try it
    
    font-variant-caps: normal;
    
    
    font-variant-caps: small-caps;
    
    
    font-variant-caps: all-small-caps;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>Difficult waffles</p>
      </div>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    section {
      font-family: "Fira Sans", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
When a given font includes capital letter glyphs of multiple different sizes, this property selects the most appropriate ones. If petite capital glyphs are not available, they are rendered using small capital glyphs. If these are not present, the browser synthesizes them from the uppercase glyphs.
Fonts sometimes include special glyphs for various caseless characters (such as punctuation marks) to better match the capitalized characters around them. However, small capital glyphs are never synthesized for caseless characters.
### Language-specific rules
This property accounts for language-specific case mapping rules. For example:
  * In Turkic languages, such as Turkish (tr), Azerbaijani (az), Crimean Tatar (crh), Volga Tatar (tt), and Bashkir (ba), there are two kinds of `i` (one with the dot, one without) and two case pairings: `i`/`İ` and `ı`/`I`.
  * In German (de), the `ß` may become `ẞ` (U+1E9E) in uppercase.
  * In Greek (el), vowels lose their accent when the whole word is in uppercase (`ά`/`Α`), except for the disjunctive eta (`ή`/`Ή`). Also, diphthongs with an accent on the first vowel lose the accent and gain a diacritic on the second vowel (`άι`/`ΑΪ`).


## Syntax
    
    /* Keyword values */
    font-variant-caps: normal;
    font-variant-caps: small-caps;
    font-variant-caps: all-small-caps;
    font-variant-caps: petite-caps;
    font-variant-caps: all-petite-caps;
    font-variant-caps: unicase;
    font-variant-caps: titling-caps;
    
    /* Global values */
    font-variant-caps: inherit;
    font-variant-caps: initial;
    font-variant-caps: revert;
    font-variant-caps: revert-layer;
    font-variant-caps: unset;
    
The `font-variant-caps` property is specified using a single keyword value from the list below. In each case, if the font doesn't support the OpenType value, then it synthesizes the glyphs.
### Values
`normal`
    
Deactivates of the use of alternate glyphs.
`small-caps`
    
Enables display of small capitals (OpenType feature: `smcp`). Small-caps glyphs typically use the form of uppercase letters but are displayed using the same size as lowercase letters.
`all-small-caps`
    
Enables display of small capitals for both upper and lowercase letters (OpenType features: `c2sc`, `smcp`).
`petite-caps`
    
Enables display of petite capitals (OpenType feature: `pcap`).
`all-petite-caps`
    
Enables display of petite capitals for both upper and lowercase letters (OpenType features: `c2pc`, `pcap`).
`unicase`
    
Enables display of mixture of small capitals for uppercase letters with normal lowercase letters (OpenType feature: `unic`).
`titling-caps`
    
Enables display of titling capitals (OpenType feature: `titl`). Uppercase letter glyphs are often designed for use with lowercase letters. When used in all uppercase titling sequences they can appear too strong. Titling capitals are designed specifically for this situation.
## Accessibility
Large sections of text set with a `font-variant` value of `all-small-caps` or `all-petite-caps` may be difficult for people with cognitive concerns such as Dyslexia to read.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * W3C Understanding WCAG 2.2


## Examples
>
### Setting the small-caps font variant
#### HTML
    
    <p class="small-caps">Firefox rocks, small caps!</p>
    <p class="normal">Firefox rocks, normal caps!</p>
    
#### CSS
    
    .small-caps {
      font-variant-caps: small-caps;
      font-style: italic;
    }
    .normal {
      font-variant-caps: normal;
      font-style: italic;
    }
    
#### Result
# border-left
The `border-left` shorthand CSS property sets all the properties of an element's left border.
## Try it
    
    border-left: solid;
    
    
    border-left: dashed red;
    
    
    border-left: 1rem solid;
    
    
    border-left: thick double #32a1ce;
    
    
    border-left: 4mm ridge rgb(211 220 50 / 0.6);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
As with all shorthand properties, `border-left` always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. Consider the following code:
    
    border-left-style: dotted;
    border-left: thick green;
    
It is actually the same as this one:
    
    border-left-style: dotted;
    border-left: none thick green;
    
The value of `border-left-style` given before `border-left` is ignored. Since the default value of `border-left-style` is `none`, not specifying the `border-style` part results in no border.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-left-color`
  * `border-left-style`
  * `border-left-width`


## Syntax
    
    border-left: 1px;
    border-left: 2px dotted;
    border-left: medium dashed blue;
    
    /* Global values */
    border-left: inherit;
    border-left: initial;
    border-left: revert;
    border-left: revert-layer;
    border-left: unset;
    
The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.
### Values
`<br-width>`
    
See `border-left-width`.
`<br-style>`
    
See `border-left-style`.
`<color>`
    
See `border-left-color`.
## Examples
>
### Applying a left border
#### HTML
    
    <div>This box has a border on the left side.</div>
    
#### CSS
    
    div {
      border-left: 4px dashed blue;
      background-color: gold;
      height: 100px;
      width: 100px;
      font-weight: bold;
      text-align: center;
    }
    
#### Results
# padding-top
The `padding-top` CSS property sets the height of the padding area on the top of an element.
## Try it
    
    padding-top: 1em;
    
    
    padding-top: 10%;
    
    
    padding-top: 20px;
    
    
    padding-top: 1ch;
    
    
    padding-top: 0;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
    }
    
An element's padding area is the space between its content and its border.
Note: The `padding` property can be used to set paddings on all four sides of an element with a single declaration.
## Syntax
    
    /* <length> values */
    padding-top: 0.5em;
    padding-top: 0;
    padding-top: 2cm;
    
    /* <percentage> value */
    padding-top: 10%;
    
    /* Global values */
    padding-top: inherit;
    padding-top: initial;
    padding-top: revert;
    padding-top: revert-layer;
    padding-top: unset;
    
The `padding-top` property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Examples
>
### Setting top padding using pixels and percentages
    
    .content {
      padding-top: 5%;
    }
    .side-box {
      padding-top: 10px;
    }
    
# min()
The `min()` CSS function lets you set the smallest (most negative) value from a list of comma-separated expressions as the value of a CSS property value. The `min()` function can be used anywhere a `<length>`, `<frequency>`, `<angle>`, `<time>`, `<percentage>`, `<number>`, or `<integer>` is allowed.
## Try it
    
    width: min(50vw, 200px);
    
    
    width: min(100vw, 4000px);
    
    
    width: min(150vw, 100px);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <img
          alt="Firefox logo"
          class="logo"
          src="/shared-assets/images/examples/firefox-logo.svg" />
      </div>
    </section>
    
In the first above example, the width will be at most 200px, but will be smaller if the viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px). This technique uses an absolute unit to specify a fixed maximum value for the property, and a relative unit to allow the value to shrink to suit smaller viewports.
## Syntax
    
    max(1, 2, 3)
    max(1px, 2px, 3px)
    
### Parameters
The `min()` function takes one or more comma-separated expressions as its parameter, with the smallest (most negative) expression value result used as the value.
The expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as `attr()`, that evaluate to a valid argument type (like `<length>`).
You can use different units for each value in your expression, if you wish. You may also use parentheses to establish computation order when needed.
### Notes
  * Math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if `auto` had been specified.
  * It is permitted to nest `max()` and other `min()` functions as expression values. The expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the `calc()` function itself.
  * The expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules. Make sure to put a space on each side of the + and - operands. The operands in the expression may be any `<length>` syntax value.
  * You can (and often need to) combine `min()` and `max()` values, or use `min()` within a `clamp()` or `calc()` function.
  * You can provide more than two arguments, if you have multiple constraints to apply.


## Accessibility
When using `min()` to set a maximum font size, ensure that the font can still be scaled at least 200% for readability (without assistive technology like a zoom function).
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Setting a maximum size for a label and input
Another use case for `min()` is to set a maximum size on responsive form controls: enabling the width of labels and inputs to shrink as the width of the form shrinks.
Let's look at some CSS:
    
    input,
    label {
      padding: 2px;
      box-sizing: border-box;
      display: inline-block;
      width: min(40%, 400px);
      background-color: pink;
    }
    
    form {
      margin: 4px;
      border: 1px solid black;
      padding: 4px;
    }
    
Here, the form itself, along with the margin, border, and padding, will be 100% of its parent's width. We declare the input and label to be the lesser of 40% of the form width up to the padding or 400px wide, whichever is smaller. In other words, the widest that the label and input can be is 400px. The narrowest they will be is 40% of the form's width, which on a smartwatch's screen is very small.
    
    <form>
      <label for="misc">Type something:</label>
      <input type="text" id="misc" name="misc" />
    </form>
    
# font-variant-numeric
The `font-variant-numeric` CSS property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers.
## Try it
    
    font-variant-numeric: normal;
    
    
    font-variant-numeric: slashed-zero;
    
    
    font-variant-numeric: tabular-nums;
    
    
    font-variant-numeric: oldstyle-nums;
    
    
    <section id="default-example">
      <div id="example-element">
        <table>
          <tr>
            <td><span class="tabular">0</span></td>
          </tr>
          <tr>
            <td><span class="tabular">3.54</span></td>
          </tr>
          <tr>
            <td><span class="tabular">1.71</span></td>
          </tr>
        </table>
      </div>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    section {
      font-family: "Fira Sans", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
    #example-element table {
      margin-left: auto;
      margin-right: auto;
    }
    
    .tabular {
      border: 1px solid;
    }
    
## Syntax
    
    font-variant-numeric: normal;
    font-variant-numeric: ordinal;
    font-variant-numeric: slashed-zero;
    font-variant-numeric: lining-nums; /* <numeric-figure-values> */
    font-variant-numeric: oldstyle-nums; /* <numeric-figure-values> */
    font-variant-numeric: proportional-nums; /* <numeric-spacing-values> */
    font-variant-numeric: tabular-nums; /* <numeric-spacing-values> */
    font-variant-numeric: diagonal-fractions; /* <numeric-fraction-values> */
    font-variant-numeric: stacked-fractions; /* <numeric-fraction-values> */
    font-variant-numeric: oldstyle-nums stacked-fractions;
    
    /* Global values */
    font-variant-numeric: inherit;
    font-variant-numeric: initial;
    font-variant-numeric: revert;
    font-variant-numeric: revert-layer;
    font-variant-numeric: unset;
    
This property can take one of two forms:
  * either the keyword value `normal`
  * or one or more of the other values listed below, space-separated, in any order.


### Values
`normal`
    
This keyword leads to the deactivation of the use of such alternate glyphs.
`ordinal`
    
This keyword forces the use of special glyphs for the ordinal markers, like 1st, 2nd, 3rd, 4th in English or a 1a in Italian. It corresponds to the OpenType values `ordn`.
`slashed-zero`
    
This keyword forces the use of a 0 with a slash; this is useful when a clear distinction between O and 0 is needed. It corresponds to the OpenType values `zero`.
`<numeric-figure-values>`
    
These values control the figures used for numbers. Two values are possible:
  * `lining-nums` activating the set of figures where numbers are all lying on the baseline. It corresponds to the OpenType values `lnum`.
  * `oldstyle-nums` activating the set of figures where some numbers, like 3, 4, 7, 9 have descenders. It corresponds to the OpenType values `onum`.


`<numeric-spacing-values>`
    
These values controls the sizing of figures used for numbers. Two values are possible:
  * `proportional-nums` activating the set of figures where numbers are not all of the same size. It corresponds to the OpenType values `pnum`.
  * `tabular-nums` activating the set of figures where numbers are all of the same size, allowing them to be easily aligned like in tables. It corresponds to the OpenType values `tnum`.


`<numeric-fraction-values>`
    
These values controls the glyphs used to display fractions. Two values are possible:
  * `diagonal-fractions` activating the set of figures where the numerator and denominator are made smaller and separated by a slash. It corresponds to the OpenType values `frac`.
  * `stacked-fractions` activating the set of figures where the numerator and denominator are made smaller, stacked and separated by a horizontal line. It corresponds to the OpenType values `afrc`.


## Examples
>
### Setting ordinal numeric forms
Click "Play" in the code blocks below to edit the example in the MDN Playground:
    
    <p class="ordinal">1st, 2nd, 3rd, 4th, 5th</p>
    
    
    @font-face {
      font-family: "Source Sans Pro";
      src: url("https://mdn.github.io/shared-assets/fonts/SourceSansPro-Regular.otf")
        format("opentype");
      font-weight: 400;
      font-style: normal;
    }
    
    .ordinal {
      font-family: "Source Sans Pro", sans-serif;
      font-size: 2rem;
      font-variant-numeric: ordinal;
    }
    
# stop-opacity
The `stop-opacity` CSS property defines the opacity of a given color gradient stop in the SVG `<stop>` element within an SVG gradient. If present, it overrides the element's `stop-opacity` attribute.
The property value impacts the `stop-color`'s alpha channel; it can increase the transparency of a `<stop>`'s color but can not make the color defined by the `stop-color` property more opaque.
Note: The `stop-opacity` property only applies to `<stop>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* numeric and percentage values */
    stop-opacity: 0.2;
    stop-opacity: 20%;
    
    /* Global values */
    stop-opacity: inherit;
    stop-opacity: initial;
    stop-opacity: revert;
    stop-opacity: revert-layer;
    stop-opacity: unset;
    
### Values
The `<opacity-value>` is a `<number>` or `<percentage>` denoting the opacity of the SVG gradient `<stop>` element.
`<number>`
    
A numeric value between `0` and `1`, inclusive.
`<percentage>`
    
A percentage value between `0%` and `100%`, inclusive.
With `0` or `0%` set, the stop is fully transparent. With `1` or `100%` set, the element is the full opacity of the `stop-color` value, which may or may not be partially opaque.
## Examples
>
### Defining the opacity of a SVG gradient color stop
This example demonstrates the basic use case of `stop-opacity`, and how the CSS `stop-opacity` property takes precedence over the `stop-opacity` attribute.
#### HTML
We have an SVG with a few `<polygon>` stars and three `<linearGradient>` elements: each has three `<stop>` elements defining three color-stops that create a gradient going from blue to white to pink; the only difference between them is the `id` value.
    
    <svg viewBox="0 0 250 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <linearGradient id="myGradient1">
          <stop offset="5%" stop-color="#66ccff" stop-opacity="1" />
          <stop offset="50%" stop-color="#fefefe" stop-opacity="1" />
          <stop offset="95%" stop-color="#f4aab9" stop-opacity="1" />
        </linearGradient>
        <linearGradient id="myGradient2">
          <stop offset="5%" stop-color="#66ccff" stop-opacity="1" />
          <stop offset="50%" stop-color="#fefefe" stop-opacity="1" />
          <stop offset="95%" stop-color="#f4aab9" stop-opacity="1" />
        </linearGradient>
        <linearGradient id="myGradient3">
          <stop offset="5%" stop-color="#66ccff" stop-opacity="1" />
          <stop offset="50%" stop-color="#fefefe" stop-opacity="1" />
          <stop offset="95%" stop-color="#f4aab9" stop-opacity="1" />
        </linearGradient>
      </defs>
      <polygon points="40,10 10,100 80,40 0,40 70,100" />
      <polygon points="125,10 95,100 165,40 85,40 155,100" />
      <polygon points="210,10 180,100 250,40 170,40 240,100" />
    </svg>
    
#### CSS
We include a `stroke` and `stroke-width` making the polygon path line visible.
Each `polygon` has a gradient background set using the `fill` property; the gradient's `id` is the `url()` parameter. We set `magenta` as the fallback color.
We define the opacity of the stops of each gradient using the `stop-opacity` property.
The SVG has a striped background to make the transparency settings more apparent.
    
    polygon {
      stroke: #333333;
      stroke-width: 1px;
    }
    polygon:nth-of-type(1) {
      fill: url("#myGradient1") magenta;
    }
    polygon:nth-of-type(2) {
      fill: url("#myGradient2") magenta;
    }
    polygon:nth-of-type(3) {
      fill: url("#myGradient3") magenta;
    }
    
    #myGradient1 stop {
      stop-opacity: 1;
    }
    #myGradient2 stop {
      stop-opacity: 0.8;
    }
    #myGradient3 stop {
      stop-opacity: 25%;
    }
    
#### Results
The first star is fully opaque. The fill of the second star is 80% opaque because the color stops are slightly translucent; the `stop-opacity: 0.8;` overrode the `stop-opacity="1"` element attribute value. The fill of the last star is barely noticeable with color stops that are 25% opaque. Note the stroke is the same opaque dark grey in all cases.
Note: Because we used the same `stop-opacity` value for all the sibling `<stop>` elements in the linear gradient, we could have instead used a single `<linearGradient>` with fully opaque stops, and set a value for each `<polygon>`s `fill-opacity` property instead.
# CSS overscroll behavior
The CSS overscroll behavior module provides properties to control the behavior of a scroll container when its scroll position reaches the scroll boundary. Controlling this aspect is particularly useful in scenarios where embedded scrollable areas should not trigger scrolling of the parent container.
When commenting on a blog, you might notice that if your comment exceeds the length of the provided `<textarea>`, scrolling beyond the end of the text area causes the entire blog to scroll. This is because reaching the end of a scrollable area, known as the scroll boundary, can lead to scrolling other content or the entire page. This continuous scrolling experience is called scroll chaining.
In situations where the contents of an element are larger than its container and `overflow` allows or defaults to scrolling (like in `<textarea>`), continued scrolling past the element's scrollable area will initiate scrolling in the parent element or the underlying page.
Conversely, scrolling through a website's terms and conditions and reaching the end of the content to enable a checkbox, may not force the page to scroll or bounce (as on a phone). This example shows that you can control overscroll behavior and prevent scroll chaining.
This module defines the overscroll behavior, enabling you to specify the actions when a user scrolls beyond the boundaries of a scrollable element.
## Reference
>
### CSS properties
  * `overscroll-behavior` shorthand
  * `overscroll-behavior-block`
  * `overscroll-behavior-inline`
  * `overscroll-behavior-x`
  * `overscroll-behavior-y`


### Glossary terms
  * Scroll boundary
  * Scroll chaining


## Guides
Learn: Overflowing content
    
Learn what overflow is and how to manage it.
## Related concepts
  * `scrollbar` ARIA role
  * Containing block concept
  * CSS overflow module:
    * `overflow` shorthand property 
      * `overflow-x`
      * `overflow-y`
      * `overflow-block`
      * `overflow-inline`
    * `overflow-clip-margin` property
    * `scroll-behavior` property
    * `text-overflow` property
  * Scroll container and scrollport glossary terms
  * CSS scroll snap module:
    * `scroll-padding` shorthand property
    * `scroll-snap-type` property
    * `scroll-margin` shorthand property
    * `scroll-snap-stop` property
    * `scroll-snap-align` property
  * CSSOM view module:
    * `Element.getBoundingClientRect()` method
    * `Element.scroll()` method
    * `Element.scrollBy()` method
    * `Element.scrollIntoView()` method
    * `Element.scrollTo()` method
    * `scroll` Document event


# scroll-timeline
The `scroll-timeline` CSS shorthand property is used to define a named scroll progress timeline, which is progressed through by scrolling a scrollable element (scroller) between top and bottom (or left and right). `scroll-timeline` is set on the scroller that will provide the timeline. The starting scroll position represents 0% progress and the ending scroll position represents 100% progress. If the 0% position and 100% position coincide (i.e., the scroll container has no overflow to scroll), the timeline is inactive.
`scroll-timeline` can contain two constituent values — a name for the named scroll progress timeline, and an optional scroll axis value.
The name is then referenced in an `animation-timeline` declaration to indicate the container's element that is used to drive the progress of the animation through the scrolling action.
Note: If the scroller does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no timeline will be created.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-timeline-name`
  * `scroll-timeline-axis`


## Syntax
    
    /* two values: one each for scroll-timeline-name and scroll-timeline-axis */
    scroll-timeline: --custom_name_for_timeline block;
    scroll-timeline: --custom_name_for_timeline inline;
    scroll-timeline: --custom_name_for_timeline y;
    scroll-timeline: --custom_name_for_timeline x;
    scroll-timeline: none block;
    scroll-timeline: none inline;
    scroll-timeline: none y;
    scroll-timeline: none x;
    
    /* one value: scroll-timeline-name */
    scroll-timeline: none;
    scroll-timeline: --custom_name_for_timeline;
    
The `scroll-timeline` shorthand property can be applied to a container element as a combination of the `<scroll-timeline-name>` and `<scroll-timeline-axis>` values. At least one of the values must be specified. If both the values are specified, the order followed must be the `<scroll-timeline-name>` value followed by the `<scroll-timeline-axis>` value.
Note: `<scroll-timeline-name>`s must be `<dashed-ident>` values, which means they must start with `--`. This helps avoid name clashes with standard CSS keywords.
### Values
`<scroll-timeline-name>`
    
See `scroll-timeline-name`.
`<scroll-timeline-axis>`
    
See `scroll-timeline-axis`. The default value is `block`.
## Examples
>
### Creating a named scroll progress timeline animation
In this example, a scroll timeline named `--square-timeline` is defined using the `scroll-timeline-name` property on the element with the ID `container`. This is then applied to the animation on the `#square` element using `animation-timeline: --square-timeline`.
#### HTML
The HTML for the example is shown below.
    
    <div id="container">
      <div id="square"></div>
      <div id="stretcher"></div>
    </div>
    
#### CSS
The CSS for the container sets it as the source of a scroll timeline named `--square-timeline` using the `scroll-timeline` property. It also sets the scrollbar to use for the timeline as the vertical scrollbar (this is not actually needed as it is the default).
The height of the container is set to `300px`, and the container is also set to create a vertical scrollbar if it overflows (the CSS `height` rule on the `stretcher` element below does make the content overflow its container).
    
    #container {
      height: 300px;
      overflow-y: scroll;
      scroll-timeline: --square-timeline y;
      /* Firefox supports the older "vertical" syntax */
      scroll-timeline: --square-timeline vertical;
      position: relative;
    }
    
The CSS below defines a square that rotates according to the timeline provided by the `animation-timeline` property, which is set to the `--square-timeline` timeline named above.
    
    #square {
      background-color: deeppink;
      width: 100px;
      height: 100px;
      animation-name: rotateAnimation;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
      animation-timeline: --square-timeline;
      position: absolute;
      bottom: 0;
    }
    
    #stretcher {
      height: 600px;
      background: #dedede;
    }
    
    @keyframes rotateAnimation {
      from {
        transform: rotate(0deg);
      }
    
      to {
        transform: rotate(360deg);
      }
    }
    
The `stretcher` CSS rule sets the block height to `600px`, which creates content that overflows the container element, thereby creating scroll bars. Without this element, the content would not overflow the container, there would be no scrollbar, and hence no scroll timeline to associate with the animation timeline.
#### Result
Scroll the vertical bar to see the square animate as you scroll.
The square animates as you scroll, and the animation duration when using `scroll-timeline` depends on the scroll speed (nevertheless, the `animation-duration` property has been defined so you can make out the scroll-driven animation).
# text-decoration-thickness
The `text-decoration-thickness` CSS property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline.
## Try it
    
    text-decoration-line: underline;
    text-decoration-thickness: 3px;
    
    
    text-decoration-line: line-through;
    text-decoration-thickness: 0.4rem;
    
    
    text-decoration-line: underline overline;
    text-decoration-thickness: from-font;
    font-size: 2rem;
    
    
    <section id="default-example">
      <p id="example-element">
        Confusion kissed me on the cheek, and left a taste so bittersweet
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
      text-decoration-color: red;
    }
    
## Syntax
    
    /* Single keyword */
    text-decoration-thickness: auto;
    text-decoration-thickness: from-font;
    
    /* length */
    text-decoration-thickness: 0.1em;
    text-decoration-thickness: 3px;
    
    /* percentage */
    text-decoration-thickness: 10%;
    
    /* Global values */
    text-decoration-thickness: inherit;
    text-decoration-thickness: initial;
    text-decoration-thickness: revert;
    text-decoration-thickness: revert-layer;
    text-decoration-thickness: unset;
    
### Values
`auto`
    
The browser chooses an appropriate width for the text decoration line.
`from-font`
    
If the font file includes information about a preferred thickness, use that value. If the font file doesn't include this information, behave as if `auto` was set, with the browser choosing an appropriate thickness.
`<length>`
    
Specifies the thickness of the text decoration line as a `<length>`, overriding the font file suggestion or the browser default.
`<percentage>`
    
Specifies the thickness of the text decoration line as a `<percentage>` of 1em in the current font. A percentage inherits as a relative value, and so therefore scales with changes in the font. The browser must use a minimum of 1 device pixel. For a given application of this property, the thickness is constant across the whole box it is applied to, even if there are child elements with a different font size.
## Examples
>
### Varying thickness
#### HTML
    
    <p class="thin">Here's some text with a 1px red underline.</p>
    <p class="thick">This one has a 5px red underline.</p>
    <p class="shorthand">This uses the equivalent shorthand.</p>
    
#### CSS
    
    .thin {
      text-decoration-line: underline;
      text-decoration-style: solid;
      text-decoration-color: red;
      text-decoration-thickness: 1px;
    }
    
    .thick {
      text-decoration-line: underline;
      text-decoration-style: solid;
      text-decoration-color: red;
      text-decoration-thickness: 5px;
    }
    
    .shorthand {
      text-decoration: underline solid red 5px;
    }
    
#### Results
Note: The property used to be called `text-decoration-width`, but was updated in 2019 to `text-decoration-thickness`.
# <dimension>
The `<dimension>` CSS data type represents a `<number>` with a unit attached to it, for example `10px`.
CSS uses dimensions to specify distances (`<length>`), durations (`<time>`), frequencies (`<frequency>`), resolutions (`<resolution>`), and other quantities.
## Syntax
The syntax of `<dimension>` is a `<number>` immediately followed by a unit which is an identifier. Unit identifiers are case insensitive.
## Examples
>
### Valid dimensions
    
    12px      12 pixels
    1rem      1 rem
    1.2pt     1.2 points
    2200ms    2200 milliseconds
    5s        5 seconds
    200hz     200 Hertz
    200Hz     200 Hertz (values are case insensitive)
    
### Invalid dimensions
    
    12 px       The unit must come immediately after the number.
    12"px"      Units are identifiers and therefore unquoted.
    3sec        The seconds unit is abbreviated "s" not "sec".
    
# <display-legacy>
CSS 2 used a single-keyword syntax for the `display` property, requiring separate keywords for block-level and inline-level variants of the same layout mode. This page details those values.
## Syntax
Valid `<display-legacy>` values:
`inline-block`
    
The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would).
It is equivalent to `inline flow-root`.
`inline-table`
    
The `inline-table` value does not have a direct mapping in HTML. It behaves like an HTML `<table>` element, but as an inline box, rather than a block-level box. Inside the table box is a block-level context.
It is equivalent to `inline table`.
`inline-flex`
    
The element behaves like an inline element and lays out its content according to the flexbox model.
It is equivalent to `inline flex`.
`inline-grid`
    
The element behaves like an inline element and lays out its content according to the grid model.
It is equivalent to `inline grid`.
## Examples
In the below example, we are creating an inline flex container with the legacy keyword inline-flex.
### HTML
    
    <div class="container">
      <div>Flex Item</div>
      <div>Flex Item</div>
    </div>
    
    Not a flex item
    
### CSS
    
    .container {
      display: inline-flex;
    }
    
### Result
In the new syntax the inline flex container would be created using two values, inline for the outer display type, and flex for the inner display type.
    
    .container {
      display: inline flex;
    }
    
>
### css.properties.display.inline-block
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-legacy` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.inline-table
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-legacy` 1 12 3 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.inline-flex
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-legacy` 2921 12 20Firefox 28 added multi-line flexbox support. 1615 97 2925 20Firefox for Android 28 added multi-line flexbox support. 1614 97 2.01.5 4.44.4 97  
### css.properties.display.inline-grid
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-legacy` 57 1612 52 44 10.1 57 52 43 10.3 6.0Samsung Internet added this earlier than the corresponding Chrome version would indicate. 57 10.3  
# scroll-snap-type
The `scroll-snap-type` CSS property is set on a scroll container, opting it into scroll snapping by setting the direction and strictness of snap point enforcement within the snap port.
## Try it
    
    scroll-snap-type: none;
    
    
    scroll-snap-type: x mandatory;
    
    
    scroll-snap-type: x proximity;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    #example-element {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
    }
    
    #example-element > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    #example-element > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
If the content in the scroll port changes — for example, if content is added, moved, deleted, or resized — the scroll container will re-snap to the previously snapped content if that content is still present.
If the value of a scroll snap-related property, such as `scroll-snap-type` or `scroll-margin`, is changed, the scroll container will re-snap based on the current value of `scroll-snap-type`.
Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.
## Syntax
    
    /* No snapping */
    scroll-snap-type: none;
    
    /* Keyword values for snap axes */
    scroll-snap-type: x;
    scroll-snap-type: y;
    scroll-snap-type: block;
    scroll-snap-type: inline;
    scroll-snap-type: both;
    
    /* Optional keyword values for snap strictness */
    /* mandatory | proximity */
    scroll-snap-type: x mandatory;
    scroll-snap-type: y proximity;
    scroll-snap-type: both mandatory;
    
    /* Global values */
    scroll-snap-type: inherit;
    scroll-snap-type: initial;
    scroll-snap-type: revert;
    scroll-snap-type: revert-layer;
    scroll-snap-type: unset;
    
### Values
`none`
    
When the visual viewport of this scroll container is scrolled, it must ignore snap points.
`x`
    
The scroll container snaps to snap positions in its horizontal axis only.
`y`
    
The scroll container snaps to snap positions in its vertical axis only.
`block`
    
The scroll container snaps to snap positions in its block axis only.
`inline`
    
The scroll container snaps to snap positions in its inline axis only.
`both`
    
The scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis).
`mandatory`
    
The visual viewport of this scroll container must snap to a snap position if it isn't currently scrolled.
`proximity`
    
The visual viewport of this scroll container may snap to a snap position if it isn't currently scrolled. The user agent decides if it snaps or not based on scroll parameters. This is the default snap strictness if any snap axis is specified.
## Examples
>
### Snapping in different axes
#### HTML
    
    <main>
      <section class="x mandatory-scroll-snapping" dir="ltr">
        <div>X Mand. LTR</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="x proximity-scroll-snapping" dir="ltr">
        <div>X Prox. LTR</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="y mandatory-scroll-snapping" dir="ltr">
        <div>Y Mand. LTR</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="y proximity-scroll-snapping" dir="ltr">
        <div>Y Prox. LTR</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="x mandatory-scroll-snapping" dir="rtl">
        <div>X Mand. RTL</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="x proximity-scroll-snapping" dir="rtl">
        <div>X Prox. RTL</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="y mandatory-scroll-snapping" dir="rtl">
        <div>Y Mand. RTL</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
      <section class="y proximity-scroll-snapping" dir="rtl">
        <div>Y Prox. RTL</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
      </section>
    </main>
    
#### CSS
    
    /* scroll-snap */
    .x.mandatory-scroll-snapping {
      scroll-snap-type: x mandatory;
    }
    .x.proximity-scroll-snapping {
      scroll-snap-type: x proximity;
    }
    .y.mandatory-scroll-snapping {
      scroll-snap-type: y mandatory;
    }
    .y.proximity-scroll-snapping {
      scroll-snap-type: y proximity;
    }
    
    div {
      text-align: center;
      scroll-snap-align: center;
      flex: none;
    }
    
#### Results
# inherit
The `inherit` CSS keyword causes the element to take the computed value of the property from its parent element. It can be applied to any CSS property, including the CSS shorthand property `all`.
For inherited properties, this reinforces the default behavior, and is only needed to override another rule.
Note: Inheritance is always from the parent element in the document tree, even when the parent element is not the containing block.
## Examples
>
### Exclude selected elements from a rule
    
    /* Make second-level headers green */
    h2 {
      color: green;
    }
    
    /* Leave those in the sidebar alone so they use their parent's color */
    #sidebar h2 {
      color: inherit;
    }
    
In this example, the `h2` elements inside the sidebar might be different colors. For example, consider one of them that would by the child of a `div` matched by the rule:
    
    div#current {
      color: blue;
    }
    
Then, it would be blue.
# @counter-style
The `@counter-style` CSS at-rule lets you extend predefined list styles and define your own counter styles that are not part of the predefined set of styles. The `@counter-style` rule contains descriptors defining how the counter value is converted into a string representation.
While CSS provides many useful predefined counter styles, the `@counter-style` at-rule offers an open-ended method for creating counters. This at-rule caters to the needs of worldwide typography by allowing authors to define their own counter styles when the predefined styles don't fit their requirements.
## Syntax
    
    @counter-style thumbs {
      system: cyclic;
      symbols: "\1F44D";
      suffix: " ";
    }
    
The `@counter-style` at-rule is identified by a counter style name, and the style of the named counter can be fine-tuned using a `<declaration-list>` consisting of one or more descriptors and their values.
### Counter style name
`<counter-style-name>`
    
Provides a name for your counter style. It is specified as a case-sensitive `<custom-ident>` without quotes. The value should not be equal to `none`. Like all custom identifiers, the value of your counter style can't be a CSS-wide keyword. Avoid other enumerated CSS property values, including values of list and counter style properties. The name of your counter can't be the case-insensitive `list-style-type` property values of `decimal`, `disc`, `square`, `circle`, `disclosure-open`, and `disclosure-closed`.
Note: The non-overridable counter style names `decimal`, `disc`, `square`, `circle`, `disclosure-open`, and `disclosure-closed` cannot be used as the name of a custom counter. However, they are valid in other contexts where the `<counter-style-name>` data type is expected, such as in `system: extends <counter-style-name>`.
### Descriptors
`system`
    
Specifies the algorithm to be used for converting the integer value of a counter to a string representation. If the value is `cyclic`, `numeric`, `alphabetic`, `symbolic`, or `fixed`, the `symbols` descriptor must also be specified. If the value is `additive`, the `additive-symbols` descriptor must also be specified.
`symbols`
    
Specifies the symbols that are to be used for the marker representations. Symbols can contain strings, images, or custom identifiers. This descriptor is required if the `system` descriptor is set to `cyclic`, `numeric`, `alphabetic`, `symbolic`, or `fixed`.
`additive-symbols`
    
Defines the additive tuples for additive systems. While the symbols specified in the `symbols` descriptor are used for constructing marker representation by most algorithms, additive counter systems, such as Roman numerals, consist of a series of weighted symbols. The descriptors is a list of counter symbol along with their non-negative integer weights, listed by weight in descending order. This descriptor is required if the `system` descriptor is set to `additive`.
`negative`
    
Specifies to symbols to be appended or prepended to the counter representation if the value is negative.
`prefix`
    
Specifies a symbol that should be prepended to the marker representation. Prefixes are added to the representation in the final stage, before any characters added to negative counter values by the `negative` descriptor.
`suffix`
    
Specifies, similar to the prefix descriptor, a symbol that is appended to the marker representation. Suffixes come after the marker representation, including after any characters added to negative counter values by the `negative` descriptor.
`range`
    
Defines the range of values over which the counter style is applicable. If a counter style is used to represent a counter value outside of the ranges defined by this descriptor, the counter style will drop back to its `fallback` style.
`pad`
    
Is used when you need the marker representations to be of a minimum length. For example if you want the counters to start at 01 and go through 02, 03, 04, etc., then the `pad` descriptor is to be used. For representations larger than the specified `pad` value, the marker is constructed as normal.
`speak-as`
    
Describes how speech synthesizers, such as screen readers, should announce the counter style. For example, the value of the list item marker can be read out as numbers or alphabets for ordered lists or as audio cues for unordered lists, based on the value of this descriptor.
`fallback`
    
Specifies the counter name of the system to fall back to if either the specified system is unable to construct the representation of a counter value or if the counter value is outside the specified `range`. If the fallback counter also fails to represent the value, then that counter's fallback is used, if one is specified. If there are either no fallback counters described or if the chain of fallback systems are unable to represent a counter value, then it will ultimately fall back to the `decimal` style.
## Examples
>
### Specifying symbols with counter-style
    
    @counter-style circled-alpha {
      system: fixed;
      symbols: Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ;
      suffix: " ";
    }
    
The above counter style rule can be applied to lists like this:
    
    .items {
      list-style: circled-alpha;
    }
    
The above code produces the following result:
See more examples on the demo page (code).
### Ready-made counter styles
Find a collection of over 100 `counter-style` code snippets in the Ready-made Counter Styles document. This document provides counters that meet the needs of languages and cultures around the world.
The Counter styles converter pulls from this list to test and create copy and paste code for counter styles.
# ::spelling-error
The `::spelling-error` CSS pseudo-element represents a text segment which the user agent has flagged as incorrectly spelled.
The `::spelling-error` pseudo-element follows a special inheritance model common to all highlight pseudo-elements. For more details on how this inheritance works, see the Highlight pseudo-elements inheritance section.
## Allowable properties
Only a small subset of CSS properties can be used in a rule with `::spelling-error` in its selector:
  * `color`
  * `background-color`
  * `cursor`
  * `caret-color`
  * `outline` and its longhands
  * `text-decoration` and its associated properties
  * `text-emphasis-color`
  * `text-shadow`


## Syntax
    
    ::spelling-error {
      /* ... */
    }
    
## Examples
>
### Basic document spell check
In this example, eventual supporting browsers should highlight any flagged spelling errors with the styles shown.
#### HTML
    
    <p contenteditable spellcheck="true">
      My friends are coegdfgfddffbgning to the party tonight.
    </p>
    
#### CSS
    
    ::spelling-error {
      text-decoration: wavy red underline;
    }
    
#### Result
# scroll-snap-align
The `scroll-snap-align` property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snap port (as the alignment container).
## Try it
    
    scroll-snap-align: start;
    
    
    scroll-snap-align: end;
    
    
    scroll-snap-align: center;
    
    
    <section class="default-example" id="default-example">
      <div id="example-parent">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    #example-parent {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    #example-parent > div {
      flex: 0 0 66%;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    #example-parent > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Syntax
    
    /* Single keyword value */
    scroll-snap-align: none;
    scroll-snap-align: center;
    scroll-snap-align: start;
    scroll-snap-align: end;
    
    /* Two keyword values */
    scroll-snap-align: start end;
    scroll-snap-align: end center;
    scroll-snap-align: center start;
    
    /* Global values */
    scroll-snap-align: inherit;
    scroll-snap-align: initial;
    scroll-snap-align: revert;
    scroll-snap-align: revert-layer;
    scroll-snap-align: unset;
    
### Values
One or two values can be specified for the `scroll-snap-align` property. If one value is set, it is applied to both the block and inline axes. If two values are set, the first value controls the block axis and the second value controls the inline axis.
`none`
    
The box does not define a snap position in that axis.
`start`
    
The start alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.
`end`
    
The end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.
`center`
    
The center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.
# :defined
The `:defined` CSS pseudo-class represents any element that has been defined. This includes any standard element built into the browser and custom elements that have been successfully defined (i.e., with the `CustomElementRegistry.define()` method).
    
    /* Selects any defined element */
    :defined {
      font-style: italic;
    }
    
    /* Selects any instance of a specific custom element */
    custom-element:defined {
      display: block;
    }
    
## Syntax
    
    :defined {
      /* ... */
    }
    
## Examples
>
### Hiding elements until they are defined
In this demo, we define a basic custom element named `<custom-element>` and use the `:not(:defined)` and `:defined` selectors to style the element before and after it is defined. This is useful if you have a complex custom element that takes a while to load into the page — you might want to hide instances of the element until the definition is complete so that you don't end up with flashes of ugly unstyled elements on the page.
#### HTML
The following HTML code uses the custom element but the element hasn't been defined yet. We also include a `<button>` that will define the custom element when clicked, allowing you to see its state before and after definition.
    
    <custom-element>
      <p>
        Loaded content: Lorem ipsum tel sed tellus eiusmod tellus. Aenean. Semper
        dolor sit nisi. Elit porttitor nisi sit vivamus.
      </p>
    </custom-element>
    
    <button id="btn">define the <code>&lt;custom-element&gt;</code></button>
    
#### CSS
In the following CSS, we use the `custom-element:not(:defined)` selector to select the element and color it grey while it is not defined and the `custom-element:defined` selector to select the element and color it black after it is defined.
    
    custom-element:not(:defined) {
      border-color: grey;
      color: grey;
    }
    
    custom-element:defined {
      background-color: wheat;
      border-color: black;
      color: black;
    }
    
    /* show loading message */
    custom-element:not(:defined)::before {
      content: "Loading...";
      position: absolute;
      inset: 0;
      align-content: center;
      text-align: center;
      font-size: 2rem;
      background-color: white;
      border-radius: 1rem;
    }
    
    /* remove the loading message */
    custom-element:defined::before {
      content: "";
    }
    
We have also used the `::before` pseudo-element to show a "Loading..." overlay message until the element is defined. After definition, it is removed by setting the `content` to an empty string.
The following JavaScript has been used to define the custom element. To allow you to see the state of the custom element before and after definition we run the `define()` method when the button is clicked.
    
    const btn = document.querySelector("#btn");
    
    btn.addEventListener("click", () => {
      customElements.define("custom-element", class extends HTMLElement {});
      btn.remove();
    });
    
#### Result
# :-moz-only-whitespace
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Note: In Selectors Level 4, the `:empty` selector was changed to act like `:-moz-only-whitespace`, but no browser currently supports this yet.
The `:-moz-only-whitespace` CSS pseudo-class matches elements that only contain text nodes that only contain whitespace. (This includes elements with empty text nodes and elements with no child nodes.)
## Syntax
    
    :-moz-only-whitespace {
      /* ... */
    }
    
## Examples
>
### Basic :-moz-only-whitespace example
#### HTML
    
    <div> </div>
    
#### CSS
    
    div {
      border: 4px solid red;
    }
    
    :-moz-only-whitespace {
      border-color: lime;
    }
    
#### Result
Briefly defined as `:blank` in Selectors Level 4, but then the functionality was merged into `:empty` and `:blank` redefined to mean empty `<input>`.
# fill-rule
The `fill-rule` CSS property defines the rule used to determine which parts of the SVG shape's canvas are included inside a shape to be filled. If present, it overrides the element's `fill-rule` attribute.
The `fill-rule` clarifies which areas of a shape should be considered "inside" the shape. It provides two values you can set to tell the browser how the inside of a shape should be determined. For shapes that don't have intersecting paths, like a circle, the bounds of what is inside a shape to be filled are intuitively clear. With complex shapes that include intersecting paths (such as a Venn diagram) or paths enclosing other paths (such as a donut), the interpretation of which sections of the shape are "inside" the shape and should be filled by the `fill` property, may not be obvious.
Note: The `fill-rule` property only applies to `<path>`, `<polygon>`, `<polyline>`, `<text>`, `<textPath>`, and `<tspan>` elements nested in an `<svg>`. It doesn't apply to other SVG, HTML, or pseudo-elements.
## Syntax
    
    /* keywords */
    fill-rule: evenodd;
    fill-rule: nonzero;
    
    /* Global values */
    fill-rule: inherit;
    fill-rule: initial;
    fill-rule: revert;
    fill-rule: revert-layer;
    fill-rule: unset;
    
### Values
`nonzero`
    
For every point in the shape, a ray is drawn in a random direction to beyond the shape's outer edges. Each ray is examined to determine the places where the ray crosses the shape. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
`evenodd`
    
For every point in the fill rule's box, a ray is drawn in a random direction. The number of path segments from the given shape that the ray crosses are counted. If this number is odd, the point is inside; if even, the point is outside. Zero is taken to be even.
## Examples
>
### Defining the fill rules for SVG elements
This example demonstrates how a `fill-rule` is declared, the effect of the property, and how the CSS `fill-rule` property takes precedence over the `fill-rule` attribute.
#### HTML
We define an SVG with two complex shapes defined using the SVG `<polygon>` and `<path>` elements. The polygon has the SVG `fill-rule` attribute set to `evenodd` and the star-shaped path is set to `nonzero`, which is the default. To make the lines visible, we set the outline to `red` using the SVG `stroke` attribute (we could have alternatively used the `stroke` property).
    
    <svg viewBox="0 0 220 120" xmlns="http://www.w3.org/2000/svg">
      <polygon
        points="180,10 150,100 220,40 140,40 210,100"
        stroke="red"
        fill-rule="evenodd" />
      <path
        d="M 10,5 l 90,0 -80,80 0,-60 80,80 -90,0 z"
        stroke="red"
        fill-rule="nonzero" />
    </svg>
    
The above SVG is repeated three times; we've only shown one copy for the sake of brevity.
#### CSS
The shapes nested in the first SVG have no CSS applied. We set the shapes inside the second SVG to use the `nonzero` value. The third SVG has all its nested shapes set to `evenodd`.
    
    svg:nth-of-type(2) > * {
      fill-rule: nonzero;
    }
    svg:nth-of-type(3) > * {
      fill-rule: evenodd;
    }
    
#### Results
With the `nonzero` value for `fill-rule`, the "inside" of the shape is the entire shape. The `evenodd` value defines some space as empty. The first image renders the `fill-rule` included as an attribute. Declaring the `fill-rule` in the CSS overrides the attribute values in the second and third images.
# column-width
The `column-width` CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width.
## Try it
    
    column-width: auto;
    
    
    column-width: 6rem;
    
    
    column-width: 120px;
    
    
    column-width: 18ch;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      width: 100%;
      columns: auto;
      text-align: left;
    }
    
This property can help you create responsive designs that fit different screen sizes. Especially in the presence of the `column-count` property (which has precedence), you must specify all related length values to achieve an exact column width. In horizontal text these are `width`, `column-width`, `column-gap`, and `column-rule-width`.
## Syntax
    
    /* Keyword value */
    column-width: auto;
    
    /* <length> values */
    column-width: 60px;
    column-width: 15.5em;
    column-width: 3.3vw;
    
    /* Global values */
    column-width: inherit;
    column-width: initial;
    column-width: revert;
    column-width: revert-layer;
    column-width: unset;
    
The `column-width` property is specified as one of the values listed below.
### Values
`<length>`
    
Indicates the optimal column width. The actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. The value must be strictly positive or the declaration is invalid. Percentage values are also invalid.
`auto`
    
The width of the column is determined by other CSS properties, such as `column-count`.
## Examples
>
### Setting column width in pixels
#### HTML
    
    <p class="content-box">
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
      nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
      enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit lobortis
      nisl ut aliquip ex ea commodo consequat.
    </p>
    
#### CSS
    
    .content-box {
      column-width: 100px;
    }
    
#### Result
# tab-size
The `tab-size` CSS property is used to customize the width of tab characters (U+0009).
## Try it
    
    tab-size: 10px;
    
    
    tab-size: 16px;
    
    
    tab-size: 24px;
    
    
    tab-size: 4;
    
    
    <section id="default-example">
      <pre id="example-element">&#9;123</pre>
    </section>
    
    
    #example-element {
      border: 1px solid;
    }
    
## Syntax
    
    /* <number> values */
    tab-size: 4;
    tab-size: 0;
    
    /* <length> values */
    tab-size: 10px;
    tab-size: 2em;
    
    /* Global values */
    tab-size: inherit;
    tab-size: initial;
    tab-size: revert;
    tab-size: revert-layer;
    tab-size: unset;
    
### Values
`<number>`
    
A multiple of the advance width of the space character (U+0020) to be used as the width of tabs. Must be non-negative. The advance width means the distance a cursor or a print head moves before printing the next character.
`<length>`
    
The width of tabs. Must be non-negative.
## Examples
>
### Expanding by character count
    
    pre {
      tab-size: 4; /* Set tab size to 4 characters wide */
    }
    
### Collapse tabs
    
    pre {
      tab-size: 0; /* Remove indentation */
    }
    
### Default tab size vs custom sizes
This example compares a default tab size with a custom tab size. Note that `white-space` is set to `pre` to prevent the tabs from collapsing.
#### HTML
    
    <p>no tab</p>
    <p>&#0009;default tab size of 8 characters wide</p>
    <p class="custom-number">&#0009;custom tab size of 3 characters wide</p>
    <p>&nbsp;&nbsp;&nbsp;3 spaces, equivalent to the custom tab size</p>
    <p class="custom-length">&#0009;custom tab size of 50px wide</p>
    
#### CSS
    
    p {
      white-space: pre;
    }
    
    .custom-number {
      tab-size: 3;
    }
    
    .custom-length {
      tab-size: 50px;
    }
    
#### Result
# r
The `r` CSS property defines the radius of a circle. It can only be used with the SVG `<circle>` element. If present, it overrides the circle's `r` attribute.
Note: The `r` property only applies to `<circle>` elements nested in an `<svg>`. It doesn't apply to other SVG elements or HTML elements or pseudo-elements.
## Syntax
    
    /* Length and percentage values */
    r: 3px;
    r: 20%;
    
    /* Global values */
    r: inherit;
    r: initial;
    r: revert;
    r: revert-layer;
    r: unset;
    
### Values
The `<length>` and `<percentage>` values define the radius of the circle.
`<length>`
    
Absolute or relative lengths can be expressed in any unit allowed by the CSS `<length>` data type. Negative values are invalid.
`<percentage>`
    
Percentages refer to the normalized diagonal of the current SVG viewport, which is calculated as <width>2+<height>22.
## Examples
>
### Defining the radius of a circle
In this example, we have two identical `<circle>` elements in an SVG, each with a `10` radius and the same x- and y-axis coordinates for their center points.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="10" />
      <circle cx="50" cy="50" r="10" />
    </svg>
    
With CSS, we style only the first circle, allowing the second circle to use default styles (with (`fill` defaulting to black). We use the `r` property to override the value of the SVG `r` attribute, giving it a `fill` and `stroke`. The default size of an SVG is `300px` wide and `150px` tall.
    
    svg {
      border: 1px solid black;
    }
    
    circle:first-of-type {
      r: 30px;
      fill: lightgreen;
      stroke: black;
    }
    
### ViewBox versus viewport pixels
This example contains two SVGs, each with two `<circle>` elements. The second SVG includes a `viewBox` attribute to demonstrate the difference between SVG viewBox and SVG viewports.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="10" />
      <circle cx="50" cy="50" r="10" />
    </svg>
    <svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
      <circle cx="50" cy="50" r="10" />
      <circle cx="50" cy="50" r="10" />
    </svg>
    
The CSS is similar to the previous example, with `r: 30px` set, but we set a `width` to ensure the images are both `300px` wide:
    
    svg {
      border: 1px solid black;
      width: 300px;
    }
    
    circle:first-of-type {
      r: 30px;
      fill: lightgreen;
      stroke: black;
    }
    
Because the `viewBox` attribute defines the SVG as 200 SVG coordinate system pixels wide, and the image is scaled up to `300px`, the `30` SVG coordinate pixels are scaled to be rendered as `45` CSS pixels.
### Defining the radius of a circle using percentages
In this example, we use the same markup as the previous example. The only difference is the `r` value; in this case, we use a percentage value.
    
    svg {
      border: 1px solid black;
      width: 300px;
    }
    
    circle:first-of-type {
      r: 30%;
      fill: lightgreen;
      stroke: black;
    }
    
In both cases, the circle radius is `30%` of the normalized diagonal of the SVG viewport. The radius `r` is equal to 0.3×<width>2+<height>22. While the first image is using `300` and `150` CSS pixels and the second is using `200` and `100` SVG view box units, 30% is a proportional value. As a result, the `r` value is the same: `47.43` viewBox units, which resolves to `71.15` CSS pixels.
While the `r` is the same, the center points differ because the second SVG is scaled up by 50%, pushing its center down and to the right by 50%.
# :user-valid
The `:user-valid` CSS pseudo-class represents any validated form element whose value validates correctly based on its validation constraints. However, unlike `:valid` it only matches once the user has interacted with it.
This pseudo-class is applied if the form control is valid and any of the following has occurred:
  * The user made a change to the form control and committed the change such as by moving focus elsewhere.
  * The user has attempted to submit the form, even if no change was made to the control.
  * The value was invalid when it gained focus, and the user made a change making it valid, even if focus is still in the control.


Once this pseudo-class has been applied, the user-agent re-validates whether the control is valid at every keystroke when the control has focus.
  * If the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke.


The result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. However, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. Required items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value.
## Syntax
    
    :user-valid {
      /* ... */
    }
    
## Examples
>
### Setting a color and symbol on :user-valid
In the following example, the green border and ✅ only display once the user has interacted with the field. Try changing the email address to another valid email to see it in action.
    
    <form>
      <label for="email">Email *: </label>
      <input
        id="email"
        name="email"
        type="email"
        value="test@example.com"
        required />
      <span></span>
    </form>
    
    
    input:user-valid {
      border: 2px solid green;
    }
    
    input:user-valid + span::before {
      content: "✓";
      color: green;
    }
    
# dominant-baseline
The `dominant-baseline` CSS property specifies the specific baseline used to align the box's text and inline-level contents. It also indicates the default alignment baseline of any boxes participating in baseline alignment in the box's alignment context. If present, it overrides the shape's `dominant-baseline` attribute.
Baselines are selected from the font baseline table. If there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline, then the browser may use heuristics to determine the position of the desired baseline.
The `dominant-baseline` property is used to determine or re-determine a scaled-baseline-table. A scaled-baseline-table is a compound value with three components:
  1. a baseline-identifier for the dominant-baseline,
  2. a baseline-table, and
  3. a baseline-table font-size.


Some values of `dominant-baseline` re-determine all three values. Others only re-establish the baseline-table font-size. When the initial value, `auto`, would give an undesired result, this property can be used to explicitly set the desired scaled-baseline-table.
Note: The `dominant-baseline` property only has an effect on the `<text>`, `<textPath>`, and `<tspan>` SVG elements.
## Syntax
    
    /* Initial value */
    dominant-baseline: auto;
    
    /* Keyword values */
    dominant-baseline: alphabetic;
    dominant-baseline: central;
    dominant-baseline: hanging;
    dominant-baseline: ideographic;
    dominant-baseline: mathematical;
    dominant-baseline: middle;
    dominant-baseline: text-bottom;
    dominant-baseline: text-top;
    
    /* Global values */
    dominant-baseline: inherit;
    dominant-baseline: initial;
    dominant-baseline: revert;
    dominant-baseline: revert-layer;
    dominant-baseline: unset;
    
### Values
`auto`
    
If this property is applied to a `<text>` element, then the computed value depends on the value of the `writing-mode` attribute.
If the `writing-mode` is horizontal, then the value of the dominant-baseline component is `alphabetic`. Otherwise, if the `writing-mode` is vertical, then the value of the dominant-baseline component is `central`.
If this property is applied to a `<tspan>`, or `<textPath>` element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element.
If the computed `baseline-shift` value actually shifts the baseline, then the baseline-table font-size component is set to the value of the `font-size` attribute on the element on which the `dominant-baseline` attribute occurs, otherwise the baseline-table font-size remains the same as that of the element.
If there is no parent text content element, the scaled-baseline-table value is constructed as for `<text>` elements.
`alphabetic`
    
The baseline-identifier for the dominant-baseline is set to be `alphabetic`, the derived baseline-table is constructed using the `alphabetic` baseline-table in the font, and the baseline-table font-size is changed to the value of the element's `font-size` SVG attribute or the CSS `font-size`, if set.
`central`
    
The baseline-identifier for the dominant-baseline is set to be `central`. The derived baseline-table is constructed from the defined baselines in the font's baseline-table. That font baseline-table is chosen using the following priority order of baseline-table names: `ideographic`, `alphabetic`, `hanging`, `mathematical`. The baseline-table font-size is changed to the value of the element's `font-size` SVG attribute or the CSS `font-size`, if set.
`hanging`
    
The baseline-identifier for the dominant-baseline is set to be `hanging`, the derived baseline-table is constructed using the `hanging` baseline-table in the font, and the baseline-table font-size is changed to the value of the `font-size` SVG attribute of `font-size` CSS property on this element.
`ideographic`
    
The baseline-identifier for the dominant-baseline is set to be `ideographic`, the derived baseline-table is constructed using the `ideographic` baseline-table in the font, and the baseline-table font-size is changed to the value of the value of the element's `font-size` SVG attribute or the CSS `font-size`, if set.
`mathematical`
    
The baseline-identifier for the dominant-baseline is set to be `mathematical`, the derived baseline-table is constructed using the `mathematical` baseline-table in the font, and the baseline-table font-size is changed to the value of the value of the element's `font-size` SVG attribute or the CSS `font-size`, if set.
`middle`
    
The baseline-identifier for the dominant-baseline is set to be `middle`. The derived baseline-table is constructed from the defined baselines in a baseline-table in the font. That font baseline-table is chosen using the following priority order of baseline-table names: `ideographic`, `alphabetic`, `hanging`, `mathematical`. The baseline-table font-size is changed to the value of the element's `font-size` SVG attribute or the CSS `font-size`, if set.
`text-bottom`
    
The line-under edge is used as the baseline, which is usually the bottom edge of the font's em box.
`text-top`
    
The line-over edge is used as the baseline, which is usually the top edge of the font's em box.
## Example
    
    <svg viewBox="0 0 450 160" width="700" height="200">
      <text x="50" y="20">alphabetic</text>
      <text x="50" y="60">central</text>
      <text x="50" y="100">hanging</text>
      <text x="50" y="140">ideographic</text>
      <text x="250" y="20">mathematical</text>
      <text x="250" y="60">middle</text>
      <text x="250" y="100">text-bottom</text>
      <text x="250" y="140">text-top</text>
      <path
        d="M   0,20 l 400,0
           m -400,40 l 400,0
           m -400,40 l 400,0
           m -400,40 l 400,0"
        stroke="grey" />
      <text x="0" y="20" fill="red">auto</text>
      <text x="0" y="60" fill="red">auto</text>
      <text x="0" y="100" fill="red">auto</text>
      <text x="0" y="140" fill="red">auto</text>
    </svg>
    
    
    text {
      font-size: 20px;
    }
    text:nth-of-type(1) {
      dominant-baseline: alphabetic;
    }
    text:nth-of-type(2) {
      dominant-baseline: central;
    }
    text:nth-of-type(3) {
      dominant-baseline: hanging;
    }
    text:nth-of-type(4) {
      dominant-baseline: ideographic;
    }
    text:nth-of-type(5) {
      dominant-baseline: mathematical;
    }
    text:nth-of-type(6) {
      dominant-baseline: middle;
    }
    text:nth-of-type(7) {
      dominant-baseline: text-bottom;
    }
    text:nth-of-type(8) {
      dominant-baseline: text-top;
    }
    
# log()
The `log()` CSS function is an exponential function that returns the logarithm of a number.
Logarithm is the inverse of exponentiation. It is the number that a fixed base has to be raised to in order to yield the number passed as the first parameter.
In CSS, when a single parameter is passed, the natural logarithm `e`, or approximately `2.7182818`, is used, though the base can be set to any value with an optional second parameter.
## Syntax
    
    /* A <number> value */
    width: calc(100px * log(7.389)); /* 200px */
    width: calc(100px * log(8, 2)); /* 300px */
    width: calc(100px * log(625, 5)); /* 400px */
    
### Parameters
The `log(value [, base]?)` function accepts two comma-separated values as its parameters.
`value`
    
A calculation which resolves to a `<number>` greater than or equal to 0. Representing the value to be taken the log of.
`base`
    
Optional. A calculation which resolves to a `<number>` greater than or equal to 0. Representing the base of the logarithm. If not defined, the default logarithmic base `e` is used.
### Return value
The logarithm of `value`, when `base` is defined.
The natural logarithm (base `e`) of `value`, when `base` is not defined.
## Examples
>
### Using the `log()` function on a logarithmic scale
This example illustrates how the `log()` function can be used to visualize data values by using a logarithmic scale. The width of each bar in this example is relative to its data value on a logarithmic scale with base 10. On each element, its value is assigned to a CSS custom property named `--value`, which is then used by the `.bar` class to calculate its width.
#### HTML
    
    <div class="bar" style="--value: 50">50</div>
    <div class="bar" style="--value: 100">100</div>
    <div class="bar" style="--value: 500">500</div>
    <div class="bar" style="--value: 10000">10,000</div>
    <div class="bar" style="--value: 2000000">2,000,000</div>
    
#### CSS
    
    .bar {
      width: calc(log(var(--value), 10) * 2em);
    }
    
#### Result
# left
The `left` CSS property participates in specifying the horizontal position of a positioned element. This inset property has no effect on non-positioned elements.
## Try it
    
    left: 0;
    
    
    left: 4em;
    
    
    left: 10%;
    
    
    left: 20px;
    
    
    <section id="default-example">
      <div class="example-container">
        <div id="example-element">I am absolutely positioned.</div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    .example-container {
      border: 0.75em solid;
      padding: 0.75em;
      text-align: left;
      position: relative;
      width: 100%;
      min-height: 200px;
    }
    
    #example-element {
      background-color: #264653;
      border: 4px solid #ffb500;
      color: white;
      position: absolute;
      width: 140px;
      height: 60px;
    }
    
## Syntax
    
    /* <length> values */
    left: 3px;
    left: 2.4em;
    left: anchor(--my-anchor 50%);
    left: calc(anchor-size(--my-anchor inline, 100px) * 2);
    
    /* <percentage>s of the width of the containing block */
    left: 10%;
    
    /* Keyword value */
    left: auto;
    
    /* Global values */
    left: inherit;
    left: initial;
    left: revert;
    left: revert-layer;
    left: unset;
    
### Values
`<length>`
    
A negative, null, or positive `<length>`:
  * for absolutely positioned elements, it represents the distance to the left edge of the containing block.
  * for anchor-positioned elements, the `anchor()` function resolves to a `<length>` value relative to the position of the associated anchor element's left or right edge (see Using inset properties with `anchor()` function values), and the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element position based on anchor size).
  * for relatively positioned elements, it represents the distance that the element is moved to the right of its normal position.


`<percentage>`
    
A `<percentage>` of the containing block's width.
`auto`
    
Specifies that:
  * for absolutely positioned elements, the position of the element is based on the `right` property, while `width: auto` is treated as a width based on the content; or if `right` is also `auto`, the element is positioned where it should horizontally be positioned if it were a static element.
  * for relatively positioned elements, the distance of the element from its normal position is based on the `right` property; or if `right` is also `auto`, the element is not moved horizontally at all.


## Description
The effect of `left` depends on how the element is positioned (i.e., the value of the `position` property):
  * When `position` is set to `absolute` or `fixed`, the `left` property specifies the distance between the element's outer margin of left edge and the inner border of left edge of its containing block. (The containing block is the ancestor to which the element is relatively positioned.) If the positioned element has an associated anchor element, and the property value includes an `anchor()` function, `left` positions the left edge of the positioned element relative to the position of the specified `<anchor-side>` edge. The `left` property is compatible with the `left`, `right`, `start`, `end`, `self-start`, `self-end`, `center`, and `<percentage>` values.
  * When `position` is set to `relative`, the `left` property specifies the distance the element's left edge is moved to the right from its normal position.
  * When `position` is set to `sticky`, the `left` property is used to compute the sticky-constraint rectangle.
  * When `position` is set to `static`, the `left` property has no effect.


When both `left` and `right` are defined, and width constraints don't prevent it, the element will stretch to satisfy both. If the element cannot stretch to satisfy both, the position of the element is overspecified. When this is the case, the `left` value has precedence when the container is left-to-right; the `right` value has precedence when the container is right-to-left.
## Examples
>
### Positioning elements
#### HTML
    
    <div id="wrap">
      <div id="example_1">
        <pre>
          position: absolute;
          left: 20px;
          top: 20px;
        </pre>
        <p>
          The only containing element for this div is the main window, so it
          positions itself in relation to it.
        </p>
      </div>
    
      <div id="example_2">
        <pre>
          position: relative;
          top: 0;
          right: 0;
        </pre>
        <p>Relative position in relation to its siblings.</p>
      </div>
    
      <div id="example_3">
        <pre>
          float: right;
          position: relative;
          top: 20px;
          left: 20px;
        </pre>
        <p>Relative to its sibling div above, but removed from flow of content.</p>
    
        <div id="example_4">
          <pre>
            position: absolute;
            bottom: 10px;
            right: 20px;
          </pre>
          <p>Absolute position inside of a parent with relative position</p>
        </div>
    
        <div id="example_5">
          <pre>
            position: absolute;
            right: 0;
            left: 0;
            top: 200px;
          </pre>
          <p>Absolute position with both left and right declared</p>
        </div>
      </div>
    </div>
    
#### CSS
    
    #wrap {
      width: 700px;
      margin: 0 auto;
      background: #5c5c5c;
    }
    
    pre {
      white-space: pre-line;
      word-wrap: break-word;
    }
    
    #example_1 {
      width: 200px;
      height: 200px;
      position: absolute;
      left: 20px;
      top: 20px;
      background-color: #d8f5ff;
    }
    
    #example_2 {
      width: 200px;
      height: 200px;
      position: relative;
      top: 0;
      right: 0;
      background-color: #c1ffdb;
    }
    #example_3 {
      width: 600px;
      height: 400px;
      position: relative;
      top: 20px;
      left: 20px;
      background-color: #ffd7c2;
    }
    
    #example_4 {
      width: 200px;
      height: 200px;
      position: absolute;
      bottom: 10px;
      right: 20px;
      background-color: #ffc7e4;
    }
    #example_5 {
      position: absolute;
      right: 0;
      left: 0;
      top: 100px;
      background-color: #d7ffc2;
    }
    
#### Result
# <angle-percentage>
The `<angle-percentage>` CSS data type represents a value that can be either a `<angle>` or a `<percentage>`.
Where an `<angle-percentage>` is specified as an allowable type, this means that the percentage resolves to an angle and therefore can be used in a `calc()` expression.
## Syntax
Refer to the documentation for `<angle>` and `<percentage>` for details of the individual syntaxes allowed by this type.
# border-start-end-radius
The `border-start-end-radius` CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode.
## Try it
    
    border-start-end-radius: 80px 80px;
    
    
    border-start-end-radius: 250px 100px;
    direction: rtl;
    
    
    border-start-end-radius: 50%;
    writing-mode: vertical-lr;
    
    
    border-start-end-radius: 50%;
    writing-mode: vertical-rl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a top right rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
This property affects the corner between the block-start and the inline-end sides of the element. For instance, in a `horizontal-tb` writing mode with `ltr` direction, it corresponds to the `border-top-right-radius` property.
## Syntax
    
    /* <length> values */
    /* With one value the corner will be a circle */
    border-start-end-radius: 10px;
    border-start-end-radius: 1em;
    
    /* With two values the corner will be an ellipse */
    border-start-end-radius: 1em 2em;
    
    /* Global values */
    border-start-end-radius: inherit;
    border-start-end-radius: initial;
    border-start-end-radius: revert;
    border-start-end-radius: revert-layer;
    border-start-end-radius: unset;
    
### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Border radius with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example</p>
    </div>
    
#### CSS
    
    div {
      background-color: rebeccapurple;
      width: 120px;
      height: 120px;
      border-start-end-radius: 10px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding: 10px;
      background-color: white;
      border-start-end-radius: 10px;
    }
    
#### Results
# mask-clip
The `mask-clip` CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area.
## Syntax
    
    /* <coord-box> values */
    mask-clip: content-box;
    mask-clip: padding-box;
    mask-clip: border-box;
    mask-clip: fill-box;
    mask-clip: stroke-box;
    mask-clip: view-box;
    
    /* Keyword values */
    mask-clip: no-clip;
    
    /* Multiple values */
    mask-clip: padding-box, no-clip;
    mask-clip: view-box, fill-box, border-box;
    
    /* Global values */
    mask-clip: inherit;
    mask-clip: initial;
    mask-clip: revert;
    mask-clip: revert-layer;
    mask-clip: unset;
    
### Values
The property accepts a comma-separated list of keyword values. Each value is a `<coord-box>` or `no-clip`:
`content-box`
    
The painted content is clipped to the content box.
`padding-box`
    
The painted content is clipped to the padding box.
`border-box`
    
The painted content is clipped to the border box.
`fill-box`
    
The painted content is clipped to the object bounding box.
`stroke-box`
    
The painted content is clipped to the stroke bounding box.
`view-box`
    
Uses the nearest SVG viewport as reference box. If a `viewBox` attribute is specified for the element creating the SVG viewport, the reference box is positioned at the origin of the coordinate system established by the `viewBox` attribute and the dimension of the reference box is set to the width and height values of the `viewBox` attribute.
`no-clip`
    
The painted content is not clipped.
`border`
    
This keyword behaves the same as `border-box`.
`padding`
    
This keyword behaves the same as `padding-box`.
`content`
    
This keyword behaves the same as `content-box`.
`text`
    
This keyword clips the mask image to the text of the element.
## Description
The `mask-clip` property defines the area of the element that is affected by the applied mask.
For mask layer images that do not reference an SVG `<mask>` element, the `mask-clip` property defines the mask painting area, or the area affected by the mask. The painted content of the element will be restricted to this area.
The `mask-clip` property has no affect on a mask layer image that references a `<mask>` element. The `<mask>` element's `x`, `y`, `width`, `height`, and `maskUnits` attributes determine the mask painting area when the source of the `mask-image` is a `<mask>`.
An element can have multiple mask layers applied. The number of layers is determined by the number of comma-separated values in the `mask-image` property value (even if a value is `none`). Each `mask-clip` value in the comma-separated list of values is matched up with the `mask-image` values, in order. If the number of values in the two properties differs, any excess values of `mask-clip` are not used, or, if `mask-clip` has fewer values than `mask-image`, the `mask-clip` values are repeated.
## Examples
>
### Clipping a mask to the border box
This examples demonstrates three `mask-clip` values.
#### HTML
We include three elements, each with a different `<coord-box>` value as a class name.
    
    <div class="border-box"></div>
    <div class="padding-box"></div>
    <div class="content-box"></div>
    
#### CSS
The CSS defines the element to have a background, border, padding, and margin, along with a mask image, with each `<div>` having a different `<coord-box>`. We generated content with the name of the class, moving that text up 10px to prevent it from being masked out of view.
    
    div {
      width: 100px;
      height: 100px;
      background-color: #8cffa0;
      margin: 10px;
      border: 20px solid #8ca0ff;
      padding: 20px;
      mask-image: url("https://mdn.github.io/shared-assets/images/examples/mdn.svg");
      mask-size: 100% 100%;
    }
    .content-box {
      mask-clip: content-box;
    }
    .border-box {
      mask-clip: border-box;
    }
    .padding-box {
      mask-clip: padding-box;
    }
    div::before {
      content: attr(class);
      position: relative;
      top: -10px;
    }
    
#### Results
# box-decoration-break
The `box-decoration-break` CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages.
## Try it
    
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
    
    
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    
    
    <section id="default-example">
      <div id="example-container">
        <span id="example-element">This text breaks across multiple lines.</span>
      </div>
    </section>
    
    
    #example-container {
      width: 14rem;
    }
    
    #example-element {
      background: linear-gradient(to bottom right, #6f6f6f, black);
      color: white;
      box-shadow:
        8px 8px 10px 0 #ff1492,
        -5px -5px 5px 0 blue,
        5px 5px 15px 0 yellow;
      padding: 0 1em;
      border-radius: 16px;
      border-style: solid;
      margin-left: 10px;
      font: 24px sans-serif;
      line-height: 2;
    }
    
The specified value will impact the appearance of the following properties:
  * `background`
  * `border`
  * `border-image`
  * `box-shadow`
  * `clip-path`
  * `margin`
  * `padding`


## Syntax
    
    /* Keyword values */
    box-decoration-break: slice;
    box-decoration-break: clone;
    
    /* Global values */
    box-decoration-break: inherit;
    box-decoration-break: initial;
    box-decoration-break: revert;
    box-decoration-break: revert-layer;
    box-decoration-break: unset;
    
The `box-decoration-break` property is specified as one of the keyword values listed below.
### Values
`slice`
    
The element is initially rendered as if its box were not fragmented, after which the rendering for this hypothetical box is sliced into pieces for each line/column/page. Note that the hypothetical box can be different for each fragment since it uses its own height if the break occurs in the inline direction, and its own width if the break occurs in the block direction. See the CSS specification for details.
`clone`
    
Each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. The `border-radius`, `border-image`, and `box-shadow` are applied to each fragment independently. The background is also drawn independently for each fragment, which means that a background image with `background-repeat: no-repeat` may nevertheless repeat multiple times.
## Examples
>
### Inline box fragments
An inline element with a box decoration may have unexpected appearance when it contains line breaks due to the initial `slice` value. The following example shows the effect of adding `box-decoration-break: clone` to a `<span>` that contains `<br>` tags:
    
    span {
      background: linear-gradient(to bottom right, yellow, green);
      box-shadow:
        8px 8px 10px 0px deeppink,
        -5px -5px 5px 0px blue,
        5px 5px 15px 0px yellow;
    }
    
    #clone {
      -webkit-box-decoration-break: clone;
      box-decoration-break: clone;
    }
    
    
    <p>
      <span>The<br />quick<br />orange fox</span>
    </p>
    <p>
      <span id="clone">The<br />quick<br />orange fox</span>
    </p>
    
### Block box fragments
The following example shows how block elements with box decoration look when they contain line breaks in a multi-column layout. Notice how the result of `box-decoration-break: slice` would be the equivalent of the first `<div>` if stacked vertically.
    
    span {
      display: block;
      background: linear-gradient(to bottom right, yellow, green);
      box-shadow:
        inset 8px 8px 10px 0px deeppink,
        inset -5px -5px 5px 0px blue,
        inset 5px 5px 15px 0px yellow;
    }
    #base {
      width: 33%;
    }
    .columns {
      columns: 3;
    }
    
    .clone {
      -webkit-box-decoration-break: clone;
      box-decoration-break: clone;
    }
    
    
    <div id="base">
      <span>The<br />quick<br />orange fox</span>
    </div>
    <br />
    
    <h2>'box-decoration-break: slice'</h2>
    <div class="columns">
      <span>The<br />quick<br />orange fox</span>
    </div>
    
    <h2>'box-decoration-break: clone'</h2>
    <div class="columns">
      <span class="clone">The<br />quick<br />orange fox</span>
    </div>
    
# ry
The `ry` CSS property defines the y-axis, or vertical, radius of an SVG `<ellipse>` and the vertical curve of the corners of an SVG `<rect>` rectangle. If present, it overrides the shape's `ry` attribute.
Note: The `ry` property only applies to `<ellipse>` and `<rect>` elements nested in an `<svg>`. It doesn't apply to other SVG elements or HTML elements or pseudo-elements.
## Syntax
    
    /* Initial value */
    ry: auto;
    
    /* Length and percentage values */
    ry: 30px;
    ry: 30%;
    
    /* Global values */
    ry: inherit;
    ry: initial;
    ry: revert;
    ry: revert-layer;
    ry: unset;
    
### Values
The `<length>`, `<percentage>`, or `auto` keyword value denotes the vertical radius of ellipses and the vertical border-radius of rectangles.
`<length>`
    
Absolute or relative lengths can be expressed in any unit allowed by the CSS `<length>` data type. Negative values are invalid.
`<percentage>`
    
Percentages refer to the height of the current SVG viewport. The used value for a `<rect>` is never more than 50% of the height of the rectangle.
`auto`
    
When set or defaulting to `auto`, the `ry` value equals the absolute length value used for `rx`. If both `ry` and `rx` have a computed value of `auto`, the used value is `0`.
## Examples
>
### Creating rounded corners
This example demonstrates creating rectangles with rounded corners by applying the `ry` property to SVG `<rect>` elements.
#### HTML
We include an SVG image with four `<rect>` elements; all the rectangles are the same except for their `x` attribute value, which positions them along the x-axis.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <rect width="50" height="120" y="5" x="5" />
      <rect width="50" height="120" y="5" x="60" />
      <rect width="50" height="120" y="5" x="115" />
      <rect width="50" height="120" y="5" x="170" />
      <rect width="50" height="120" y="5" x="225" />
    </svg>
    
#### CSS
With CSS, we set an `ry` value on four of the rectangles:
    
    svg {
      border: 1px solid;
    }
    
    rect:nth-of-type(2) {
      ry: 10px;
      fill: red;
    }
    
    rect:nth-of-type(3) {
      ry: 2em;
      fill: blue;
    }
    
    rect:nth-of-type(4) {
      ry: 5%;
      fill: orange;
    }
    
    rect:nth-of-type(5) {
      ry: 80%;
      fill: green;
    }
    
#### Results
The first rectangle defaults to `auto`; as all the `rx` values in this example also default to `auto`, the used value of `ry` is `0`. The red and blue rectangles have `10px` and `2em` rounded corners, respectively. As the SVG viewport defaults to 300px by 150px, the orange rectangle's `5%` value creates a `7.5px` radius. The green rectangle has `ry: 80%` set. However, as the value of `ry` is never more than `50%` of the height of the rectangle, the effect is as if `ry: 50%; rx: 50%` was set.
### Defining the vertical radius of an ellipse
This basic `<ellipse>` example demonstrates the CSS `ry` property taking precedence over an SVG `ry` attribute to define the shape's vertical radius.
#### HTML
We include two identical `<ellipse>` elements in an SVG; each with the `ry` attribute set to `20`.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <ellipse cx="80" cy="50" rx="40" ry="20" />
      <ellipse cx="80" cy="50" rx="40" ry="20" />
    </svg>
    
#### CSS
We only style the first ellipse, letting its twin use default user agent styles (with `fill` defaulting to black). The geometric `ry` property overrides the value of the SVG `ry` attribute. We also set the `fill` and `stroke` properties to differentiate the styled shape from its twin.
    
    svg {
      border: 1px solid;
    }
    
    ellipse:first-of-type {
      ry: 80px;
      fill: magenta;
      stroke: rebeccapurple;
    }
    
#### Results
The styled ellipse's vertical radius is `80px`, as defined in the CSS `ry` property value. The unstyled ellipse's vertical radius is `20px`, which was defined by the `ry` attribute.
### Ellipse vertical radius percentage values
This example demonstrates using percentage values for `ry`.
#### HTML
We use the same markup as the previous example.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <ellipse cx="80" cy="50" rx="40" ry="20" />
      <ellipse cx="80" cy="50" rx="40" ry="20" />
    </svg>
    
#### CSS
The CSS is similar to the previous example, with the only difference being the `ry` property value; in this case, we use a percentage value.
    
    svg {
      border: 1px solid;
    }
    
    ellipse:first-of-type {
      ry: 30%;
      fill: magenta;
      stroke: rebeccapurple;
    }
    
#### Results
When using percentage values for `ry`, the values are relative to the height of the SVG viewport. Here, the size of the styled ellipse vertical radius is `30%` of the height of the current SVG viewport. As the height defaulted to `150px`, the `ry` value is `45px`, making the ellipse `90px` tall.
# <transform-function>
The `<transform-function>` CSS data type represents a transformation that affects an element's appearance. Transformation functions can rotate, resize, distort, or move an element in 2D or 3D space. It is used in the `transform` property.
## Syntax
The `<transform-function>` data type is specified using one of the transformation functions listed below. Each function applies a geometric operation in either 2D or 3D.
### Matrix transformation
`matrix()`
    
Describes a homogeneous 2D transformation matrix.
`matrix3d()`
    
Describes a 3D transformation as a 4×4 homogeneous matrix.
### Perspective
`perspective()`
    
Sets the distance between the user and the z=0 plane.
### Rotation
`rotate()`
    
Rotates an element around a fixed point on the 2D plane.
`rotate3d()`
    
Rotates an element around a fixed axis in 3D space.
`rotateX()`
    
Rotates an element around the horizontal axis.
`rotateY()`
    
Rotates an element around the vertical axis.
`rotateZ()`
    
Rotates an element around the z-axis.
### Scaling (resizing)
`scale()`
    
Scales an element up or down on the 2D plane.
`scale3d()`
    
Scales an element up or down in 3D space.
`scaleX()`
    
Scales an element up or down horizontally.
`scaleY()`
    
Scales an element up or down vertically.
`scaleZ()`
    
Scales an element up or down along the z-axis.
### Skewing (distortion)
`skew()`
    
Skews an element on the 2D plane.
`skewX()`
    
Skews an element in the horizontal direction.
`skewY()`
    
Skews an element in the vertical direction.
### Translation (moving)
`translate()`
    
Translates an element on the 2D plane.
`translate3d()`
    
Translates an element in 3D space.
`translateX()`
    
Translates an element horizontally.
`translateY()`
    
Translates an element vertically.
`translateZ()`
    
Translates an element along the z-axis.
## Description
Various coordinate models can be used to describe an HTML element's size and shape, as well as any transformations applied to it. The most common is the Cartesian coordinate system, although homogeneous coordinates are also sometimes used.
### Cartesian coordinates
In the Cartesian coordinate system, a two-dimensional point is described using two values: an x coordinate (abscissa) and a y coordinate (ordinate). This is represented by the vector notation `(x, y)`.
In CSS (and most computer graphics), the origin `(0, 0)` represents the top-left corner of any element. Positive coordinates are down and to the right of the origin, while negative ones are up and to the left. Thus, a point that's 2 units to the right and 5 units down would be `(2, 5)`, while a point 3 units to the left and 12 units up would be `(-3, -12)`.
### Transformation functions
Transformation functions alter the appearance of an element by manipulating the values of its coordinates. A linear transformation function is described using a 2×2 matrix, like this:
(acbd)\begin{pmatrix} a & c \\\ b & d \end{pmatrix}
The function is applied to an element by using matrix multiplication. Thus, each coordinate changes based on the values in the matrix:
(acbd)(xy)=(ax+cybx+dy)\left( \begin{array}{cc} a & c \\\ b & d \end{array} \right) \left( \begin{array}{c} x \\\ y \end{array} \right) = \left( \begin{array}{c} ax + cy \\\ bx + dy \end{array} \right)
It is even possible to apply several transformations in a row:
(a1c1b1d1)(a2c2b2d2)=(a1a2+c1b2a1c2+c1d2b1a2+d1b2b1c2+d1d2)\left( \begin{array}{cc} a_1 & c_1 \\\ b_1 & d_1 \end{array} \right) \left( \begin{array}{cc} a_2 & c_2 \\\ b_2 & d_2 \end{array} \right) = \left( \begin{array}{cc} a_1a_2 + c_1b_2 & a_1c_2 + c_1d_2 \\\ b_1a_2 + d_1b_2 & b_1c_2 + d_1d_2 \end{array} \right)
With this notation, it is possible to describe, and therefore compose, most common transformations: rotations, scaling, or skewing. (In fact, all transformations that are linear functions can be described.) Composite transformations are effectively applied in order from right to left.
However, one major transformation is not linear, and therefore must be special-cased when using this notation: translation. The translation vector `(tx, ty)` must be expressed separately, as two additional parameters.
Note: Though trickier than Cartesian coordinates, homogeneous coordinates in projective geometry lead to 3×3 transformation matrices, and can express translations as linear functions.
Note: Transform functions are used with the `transform` property but not with individual transform properties-`translate`, `scale`, and `rotate`.
## Examples
>
### Transform function comparison
The following example provides a 3D cube created from DOM elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types.
Choose one, and the transform is applied to the cube; after 2 seconds, the cube reverts back to its starting state. The cube's starting state is slightly rotated using `transform3d()`, to allow you to see the effect of all the transforms.
#### HTML
    
    <main>
      <section id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </section>
    
      <div class="select-form">
        <label for="transfunction">Select a transform function</label>
        <select id="transfunction">
          <option selected>Choose a function</option>
          <option>rotate(360deg)</option>
          <option>rotateX(360deg)</option>
          <option>rotateY(360deg)</option>
          <option>rotateZ(360deg)</option>
          <option>rotate3d(1, 1, 1, 90deg)</option>
          <option>scale(1.5)</option>
          <option>scaleX(1.5)</option>
          <option>scaleY(1.5)</option>
          <option>scaleZ(1.5)</option>
          <option>scale3d(1, 1.5, 1.5)</option>
          <option>skew(17deg, 13deg)</option>
          <option>skewX(17deg)</option>
          <option>skewY(17deg)</option>
          <option>translate(100px, 100px)</option>
          <option>translateX(100px)</option>
          <option>translateY(100px)</option>
          <option>translateZ(100px)</option>
          <option>translate3d(50px, 50px, 50px)</option>
          <option>perspective(200px)</option>
          <option>matrix(1, 2, -1, 1, 80, 80)</option>
          <option>matrix3d(1,0,0,0,0,1,3,0,0,0,1,0,50,100,0,1.1)</option>
        </select>
      </div>
    </main>
    
#### CSS
    
    main {
      width: 400px;
      height: 200px;
      padding: 50px;
      background-image: linear-gradient(135deg, white, cyan, white);
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      transform-style: preserve-3d;
      transition: transform 1.5s;
      transform: rotate3d(1, 1, 1, 30deg);
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 70%);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 70%);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 70%);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 70%);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 70%);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 70%);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
    .select-form {
      margin-top: 50px;
    }
    
#### JavaScript
    
    const selectElem = document.querySelector("select");
    const example = document.querySelector("#example-element");
    
    selectElem.addEventListener("change", () => {
      if (selectElem.value === "Choose a function") {
        return;
      }
      example.style.transform = `rotate3d(1, 1, 1, 30deg) ${selectElem.value}`;
      setTimeout(() => {
        example.style.transform = "rotate3d(1, 1, 1, 30deg)";
      }, 2000);
    });
    
#### Result
# abs()
The `abs()` CSS function returns the absolute value of the argument, as the same type as the input.
## Syntax
    
    /* property: abs(expression) */
    width: abs(20% - 100px);
    
### Parameters
The `abs(x)` function accepts only one value as its parameter.
`x`
    
A calculation which resolves to a number.
### Return value
The absolute value of `x`.
  * if `x`'s numeric value is positive or `0⁺`, return `x`.
  * Otherwise, returns `-1 * x`.


## Examples
>
### Positive variables
The `abs()` function can be used to ensure that a value is always positive. In the following example a CSS custom property `--font-size` is used as the value of `font-size`. Wrapping this custom property in `abs()` will convert a negative value to a positive one.
    
    h1 {
      font-size: abs(var(--font-size));
    }
    
### Control gradient angle of direction
You can also control the gradient direction using `abs()` function. In the following example, with an angle of -45deg the gradient would start red and transition to blue. By using `abs()` to make the value positive, the gradient will start blue and transition to red.
    
    div {
      --deg: -45deg;
      background-image: linear-gradient(abs(var(--deg)), blue, red);
    }
    
### Backwards compatible fallback
In older browsers that lack the support for CSS `abs()` function, you can use the CSS `max()` function to achieve the same result, as shown below:
    
    p {
      line-height: max(var(--lh), -1 * var(--lh));
    }
    
We use the `max()` function to return the largest (most positive) value from a list of two values: `var(--lh)` or `-1 * var(--lh)`. Irrespective of whether `--lh` is positive or negative, the calculated return value will always be positive, that is, an absolute number.
# overflow-wrap
The `overflow-wrap` CSS property applies to text, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
Note: The property was originally a nonstandard and unprefixed Microsoft extension called `word-wrap`, and was implemented by most browsers with the same name. It has since been renamed to `overflow-wrap`, with `word-wrap` being an alias.
## Try it
    
    overflow-wrap: normal;
    
    
    overflow-wrap: anywhere;
    
    
    overflow-wrap: break-word;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        Most words are short &amp; don't need to break. But
        <strong class="transition-all" id="example-element"
          >Antidisestablishmentarianism</strong
        >
        is long. The width is set to min-content, with a max-width of 11em.
      </div>
    </section>
    
    
    .example-container {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
      padding: 0.75em;
      width: min-content;
      max-width: 11em;
      height: 200px;
    }
    
Note: In contrast to `word-break`, `overflow-wrap` will only create a break if an entire word cannot be placed on its own line without overflowing.
## Syntax
    
    /* Keyword values */
    overflow-wrap: normal;
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
    
    /* Global values */
    overflow-wrap: inherit;
    overflow-wrap: initial;
    overflow-wrap: revert;
    overflow-wrap: revert-layer;
    overflow-wrap: unset;
    
The `overflow-wrap` property is specified as a single keyword chosen from the list of values below.
### Values
`normal`
    
Lines may only break at normal word break points (such as a space between two words).
`anywhere`
    
To prevent overflow, an otherwise unbreakable string of characters — like a long word or URL — may be broken at any point if there are no otherwise-acceptable break points in the line. No hyphenation character is inserted at the break point. Soft wrap opportunities introduced by the word break are considered when calculating min-content intrinsic sizes.
`break-word`
    
The same as the `anywhere` value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are NOT considered when calculating min-content intrinsic sizes.
## Examples
>
### Comparing overflow-wrap, word-break, and hyphens
This example compares the results of `overflow-wrap`, `word-break`, and `hyphens` when breaking up a long word.
#### HTML
    
    <p>
      They say the fishing is excellent at Lake
      <em class="normal">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though
      I've never been there myself. (<code>normal</code>)
    </p>
    <p>
      They say the fishing is excellent at Lake
      <em class="ow-anywhere">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
      though I've never been there myself. (<code>overflow-wrap: anywhere</code>)
    </p>
    <p>
      They say the fishing is excellent at Lake
      <em class="ow-break-word">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
      though I've never been there myself. (<code>overflow-wrap: break-word</code>)
    </p>
    <p>
      They say the fishing is excellent at Lake
      <em class="word-break">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>,
      though I've never been there myself. (<code>word-break</code>)
    </p>
    <p>
      They say the fishing is excellent at Lake
      <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though
      I've never been there myself. (<code>hyphens</code>, without
      <code>lang</code> attribute)
    </p>
    <p lang="en">
      They say the fishing is excellent at Lake
      <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though
      I've never been there myself. (<code>hyphens</code>, English rules)
    </p>
    <p class="hyphens" lang="de">
      They say the fishing is excellent at Lake
      <em class="hyphens">Chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though
      I've never been there myself. (<code>hyphens</code>, German rules)
    </p>
    
#### CSS
    
    p {
      width: 13em;
      margin: 2px;
      background: gold;
    }
    
    .ow-anywhere {
      overflow-wrap: anywhere;
    }
    
    .ow-break-word {
      overflow-wrap: break-word;
    }
    
    .word-break {
      word-break: break-all;
    }
    
    .hyphens {
      hyphens: auto;
    }
    
#### Result
# border-block-end-style
The `border-block-end-style` CSS property defines the style of the logical block-end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-end-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-block-end-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-block-end-style: groove;
    writing-mode: horizontal-tb;
    
    
    border-block-end-style: dashed;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-style'> values */
    border-block-end-style: dashed;
    border-block-end-style: dotted;
    border-block-end-style: groove;
    
    /* Global values */
    border-block-end-style: inherit;
    border-block-end-style: initial;
    border-block-end-style: revert;
    border-block-end-style: revert-layer;
    border-block-end-style: unset;
    
Related properties are `border-block-start-style`, `border-inline-start-style`, and `border-inline-end-style`, which define the other border styles of the element.
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### Dashed border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-block-end-style: dashed;
    }
    
#### Results
# text-decoration-style
The `text-decoration-style` CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`.
## Try it
    
    text-decoration-style: solid;
    
    
    text-decoration-style: double;
    
    
    text-decoration-style: dotted;
    
    
    text-decoration-style: dashed;
    
    
    text-decoration-style: wavy;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
    #example-element {
      text-decoration-line: underline;
    }
    
If the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an HTML tag, like `<del>` or `<s>`. As browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation.
When setting multiple line-decoration properties at once, it may be more convenient to use the `text-decoration` shorthand property instead.
## Syntax
    
    /* Keyword values */
    text-decoration-style: solid;
    text-decoration-style: double;
    text-decoration-style: dotted;
    text-decoration-style: dashed;
    text-decoration-style: wavy;
    
    /* Global values */
    text-decoration-style: inherit;
    text-decoration-style: initial;
    text-decoration-style: revert;
    text-decoration-style: revert-layer;
    text-decoration-style: unset;
    
### Values
solid
    
Draws a single line.
double
    
Draws a double line.
dotted
    
Draws a dotted line.
dashed
    
Draws a dashed line.
wavy
    
Draws a wavy line.
-moz-none
    
Draws no line. Use `text-decoration-line: none` instead.
## Examples
>
### Setting a wavy underline
The following creates a red wavy underline:
#### CSS
    
    .wavy {
      text-decoration-line: underline;
      text-decoration-style: wavy;
      text-decoration-color: red;
    }
    
#### HTML
    
    <p class="wavy">This text has a wavy red line beneath it.</p>
    
#### Results
# CSS fragmentation
The CSS fragmentation module defines how content is displayed when it is broken (fragmented) and flows across multiple pages, regions, or columns. This module defines features for pagination, breaking variable fragment size and orientation, widows and orphans.
This module explains how content breaks across fragmentation containers and how such breaks can be controlled by the author. The generic term for breaking content across containers is fragmentation. Fragmentation occurs when an inline box wraps onto multiple lines. This can happen when using layout features such as CSS multi-column layout: For example, when a block spans more than one column inside a column layout container, or spans a page break when printed. Each piece of the rendering for the element is called a fragment.
When content is physically printed or displayed as a print preview, there are page breaks. In this paged media, as opposed to continuous media, document content can be split between one or more pages, or fragments. To avoid awkward breaks, such as halfway through a line of text or with a lone word on its own page, browsers can move content that would otherwise fall across the page break in a process is called pagination.
## Reference
>
### Properties
  * `box-decoration-break`
  * `break-after`
  * `break-before`
  * `break-inside`
  * `orphans`
  * `widows`


### Glossary terms and definitions
  * Fragmentainer


## Guides
Handling content breaks in multi-column layout
    
Introduction to the fragmentation specification and how to control where column content breaks.
## Related concepts
  * `overflow`
  * `height`, `max-height`, and `block-size` CSS properties
  * `width`, `max-width`, and `inline-size` CSS properties
  * Block formatting context


CSS paged media module
  * `page`
  * `@page`


CSS display module
  * Principal box term
  * Block formatting context guide


# CSS flexible box layout
The CSS flexible box layout module defines a CSS box model optimized for user interface design, and the layout of items in one dimension. In the flex layout model, the children of a flex container can be laid out in any direction, and can "flex" their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. Both horizontal and vertical alignment of the children can be easily manipulated.
## Flexible box layout in action
In the following example, a container has been set to `display: flex`, which means that the three child items become flex items. The value of `justify-content` has been set to `space-between` in order to space the items out evenly on the main axis. An equal amount of space is placed between each item with the left and right items being flush with the edges of the flex container. You can also see that the items are stretching on the cross axis, due to the default value of `align-items` being `stretch`. The items stretch to the height of the flex container, making them each appear as tall as the tallest item.
    
    <div class="box">
      <div>One</div>
      <div>Two</div>
      <div>Three <br />has <br />extra <br />text</div>
    </div>
    
    
    body {
      font-family: sans-serif;
    }
    
    .box {
      border: 2px dotted rgb(96 139 168);
      display: flex;
      justify-content: space-between;
    }
    
    .box > * {
      border: 2px solid rgb(96 139 168);
      border-radius: 5px;
      background-color: rgb(96 139 168 / 0.2);
      padding: 1em;
    }
    
## Reference
>
### Properties
  * `align-content`
  * `align-items`
  * `align-self`
  * `flex`
  * `flex-basis`
  * `flex-direction`
  * `flex-flow`
  * `flex-grow`
  * `flex-shrink`
  * `flex-wrap`
  * `justify-content`


### Glossary terms
  * Flexbox
  * Flex container
  * Flex item
  * Main axis
  * Cross axis
  * Flex


## Guides
Basic concepts of flexbox
    
An overview of the features of Flexbox.
Relationship of flexbox to other layout methods
    
How Flexbox relates to other layout methods and other CSS specifications.
Aligning items in a flex container
    
How the box alignment properties work with Flexbox.
Ordering flex items
    
Explaining the different ways to change the order and direction of items, and covering the potential issues in doing so.
Controlling ratios of flex items along the main axis
    
Explaining the flex-grow, flex-shrink and flex-basis properties.
Mastering wrapping of flex items
    
How to create flex containers with multiple lines and control the display of the items in those lines.
Typical use cases of flexbox
    
Common design patterns that are typical Flexbox use cases.
CSS layout: flexbox
    
Learn how to use flexbox layout to create web layouts.
Box alignment in flexbox
    
Details features of CSS box alignment which are specific to flexbox.
## Related concepts
CSS display module
  * `display`
  * `order`


CSS box alignment module
  * `align-content`
  * `align-items`
  * `align-self`
  * `column-gap`
  * `gap`
  * `justify-items`
  * `place-content`
  * `place-items`
  * `row-gap`


CSS box sizing module
  * `aspect-ratio`
  * `max-content` value
  * `min-content` value
  * `fit-content` value
  * intrinsic size glossary term


# <calc-sum>
The `<calc-sum>` CSS data type represents an expression which performs a calculation in any CSS math function. The expression executes a basic arithmetic operation of addition and subtraction between two values.
## Syntax
The `<calc-sum>` type defines two numeric values and one of the following arithmetic operators between them.
`+`
    
Adds two numbers together.
`-`
    
Subtracts the right number from the left.
## Description
The operands in the expression may be any `<length>` syntax value. You can use `<length>`, `<frequency>`, `<angle>`, `<time>`, `<percentage>`, `<number>`, or `<integer>`.
The two operands' types must be consistent. For lengths, you can't use `0` to mean `0px` (or another length unit). Instead, you must add an explicit unit: `margin-top: calc(0px + 20px);` is valid, while `margin-top: calc(0 + 20px);` is invalid. Percentage value types are resolved based on the context. For example, `margin-top: calc(50% + 20px);` is valid because `margin-top` resolves percentages to lengths.
Including CSS variables in `calc-sum` expressions is also allowed. The following code `calc(10px + var(--variable))`, is a valid expression.
The `+` and `-` operators must be surrounded by whitespace. For instance, `calc(50% -8px)` will be parsed as "a percentage followed by a negative length" — which is an invalid expression — while `calc(50% - 8px)` is "a percentage followed by a subtraction operator and a length". Likewise, `calc(8px + -50%)` is treated as "a length followed by an addition operator and a negative percentage".
# column-rule-width
The `column-rule-width` CSS property sets the width of the line drawn between columns in a multi-column layout.
## Try it
    
    column-rule-width: thin;
    
    
    column-rule-width: medium;
    
    
    column-rule-width: thick;
    
    
    column-rule-width: 12px;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      columns: 3;
      column-rule: solid;
      text-align: left;
    }
    
## Syntax
    
    /* Keyword values */
    column-rule-width: thin;
    column-rule-width: medium;
    column-rule-width: thick;
    
    /* <length> values */
    column-rule-width: 1px;
    column-rule-width: 2.5em;
    
    /* Global values */
    column-rule-width: inherit;
    column-rule-width: initial;
    column-rule-width: revert;
    column-rule-width: revert-layer;
    column-rule-width: unset;
    
The `column-rule-width` property is specified as a single `<'border-width'>` value.
### Values
`<'border-width'>`
    
Is a keyword defined by `border-width` describing the width of the rule. It may be either a `<length>` or one of the `thin`, `medium`, or `thick` keywords.
## Examples
>
### Setting a thick column rule
#### HTML
    
    <p>
      This is a bunch of text split into three columns. The `column-rule-width`
      property is used to change the width of the line that is drawn between
      columns. Don't you think that's wonderful?
    </p>
    
#### CSS
    
    p {
      column-count: 3;
      column-rule-style: solid;
      column-rule-width: thick;
    }
    
#### Result
# hyphens
The `hyphens` CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate.
## Try it
    
    hyphens: none;
    
    
    hyphens: manual;
    
    
    hyphens: auto;
    
    
    <section id="default-example">
      <p id="example-element">An extra­ordinarily long English word!</p>
    </section>
    
    
    #example-element {
      border: 2px dashed #999999;
      font-size: 1.5rem;
      text-align: left;
      width: 7rem;
    }
    
Note: In the above demo, the string "An extraordinarily long English word!" contains the hidden `&shy;` (soft hyphen) character: `An extra&shy;ordinarily long English word!`. This character is used to indicate a potential place to insert a hyphen when `hyphens: manual;` is specified.
Hyphenation rules are language-specific. In HTML, the language is determined by the `lang` attribute, and browsers will hyphenate only if this attribute is present and the appropriate hyphenation dictionary is available. In XML, the `xml:lang` attribute must be used.
Note: The rules defining how hyphenation is performed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser.
If supported, `hyphenate-character` may be used to specify an alternative hyphenation character to use at the end of the line being broken.
## Syntax
    
    /* Keyword values */
    hyphens: none;
    hyphens: manual;
    hyphens: auto;
    
    /* Global values */
    hyphens: inherit;
    hyphens: initial;
    hyphens: revert;
    hyphens: revert-layer;
    hyphens: unset;
    
The `hyphens` property is specified as a single keyword value chosen from the list below.
### Values
`none`
    
Words are not broken at line breaks, even if characters inside the words suggest line break points. Lines will only wrap at whitespace.
`manual`
    
Default value. Words are broken for line-wrapping only where characters inside the word suggest line break opportunities. See Suggesting line break opportunities below for details.
`auto`
    
The browser is free to automatically break words at appropriate hyphenation points, following whatever rules it chooses. However, suggested line break opportunities (see Suggesting line break opportunities below) will override automatic break point selection when present.
Note: The `auto` setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules. You must specify a language using the `lang` HTML attribute to guarantee that automatic hyphenation is applied in that language.
Note: If you apply `word-break: break-all` then no hyphens are shown, even if the word breaks at a hyphenation point.
## Suggesting line break opportunities
There are two Unicode characters used to manually specify potential line break points within text:
U+2010 (HYPHEN)
    
The "hard" hyphen character indicates a visible line break opportunity. Even if the line is not actually broken at that point, the hyphen is still rendered.
U+00AD (SHY)
    
An invisible, "soft" hyphen. This character is not rendered visibly; instead, it marks a place where the browser should break the word if hyphenation is necessary. In HTML, use `&shy;` to insert a soft hyphen.
Note: When the HTML `<wbr>` element leads to a line break, no hyphen is added.
## Examples
>
### Specifying text hyphenation
This example uses three classes, one for each possible configuration of the `hyphens` property.
#### HTML
    
    <dl>
      <dt><code>none</code>: no hyphen; overflow if needed</dt>
      <dd lang="en" class="none">An extreme&shy;ly long English word</dd>
      <dt>
        <code>manual</code>: hyphen only at &amp;hyphen; or &amp;shy; (if needed)
      </dt>
      <dd lang="en" class="manual">An extreme&shy;ly long English word</dd>
      <dt><code>auto</code>: hyphens where the algorithm decides (if needed)</dt>
      <dd lang="en" class="auto">An extreme&shy;ly long English word</dd>
    </dl>
    
#### CSS
    
    dd {
      width: 55px;
      border: 1px solid black;
    }
    dd.none {
      hyphens: none;
    }
    dd.manual {
      hyphens: manual;
    }
    dd.auto {
      hyphens: auto;
    }
    
#### Result
# inset-inline-end
The `inset-inline-end` CSS property defines the logical inline end inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    writing-mode: horizontal-tb;
    
    
    writing-mode: vertical-rl;
    
    
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="example-container" id="example-element">
        <div id="abspos">
          I am absolutely positioned with inset-inline-end: 50px
        </div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    #example-element {
      border: 0.75em solid;
      padding: 0.75em;
      position: relative;
      width: 100%;
      min-height: 200px;
      unicode-bidi: bidi-override;
    }
    
    #abspos {
      background-color: yellow;
      color: black;
      border: 3px solid red;
      position: absolute;
      inset-inline-end: 50px;
      inline-size: 140px;
      min-block-size: 80px;
    }
    
## Syntax
    
    /* <length> values */
    inset-inline-end: 3px;
    inset-inline-end: 2.4em;
    inset-inline-end: calc(anchor(self-start) + 5px);
    inset-inline-end: anchor-size(height);
    
    /* <percentage>s of the width or height of the containing block */
    inset-inline-end: 10%;
    
    /* Keyword value */
    inset-inline-end: auto;
    
    /* Global values */
    inset-inline-end: inherit;
    inset-inline-end: initial;
    inset-inline-end: revert;
    inset-inline-end: revert-layer;
    inset-inline-end: unset;
    
The shorthand for `inset-inline-start` and `inset-inline-end` is `inset-inline`.
### Values
The `inset-inline-end` property takes the same values as the `left` property.
## Examples
>
### Setting inline end offset
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      position: relative;
      inset-inline-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# <time-percentage>
The `<time-percentage>` CSS data type represents a value that can be either a `<time>` or a `<percentage>`.
## Syntax
Refer to the documentation for `<time>` and `<percentage>` for details of the individual syntaxes allowed by this type.
## Examples
>
### Use in calc()
Where a `<time-percentage>` is specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a `calc()` expression.
### Valid percentages
    
    50%
    +50%        Optional plus sign
    -50%        Negative percentages are not valid for all properties that accept percentages
    
### Invalid percentages
    
    50 %        Space not allowed between the number and the percentage sign
    
### Valid times
    
    12s         Positive integer
    -456ms      Negative integer
    4.3ms       Non-integer
    14mS        The unit is case-insensitive, although capital letters are not recommended.
    +0s         Zero with a leading + and a unit
    -0ms        Zero with a leading - and a unit
    
### Invalid times
    
    0           Although unitless zero is allowed for <length>s, it's invalid for <time>s.
    12.0        This is a <number>, not a <time>, because it's missing a unit.
    7 ms        No space is allowed between the number and the unit.
    
# CSS easing functions
The CSS easing functions module defines easing functions, which provide a means to control the transformation of values. The functions defined include linear, cubic bezier, and step easing functions. These easing functions can be applied to animations and transitions.
Gradually increasing the speed at which an element moves can give the element a sense of weight as it appears to gather momentum. Easing functions enable you to control the rate of change. Cubic bezier easing functions can be used to produce intuitive user interface elements or convincing cartoon props that behave like their physical counterparts.
Alternatively, you may want an animation to move forward in distinct steps, to create robot-like movement, or the effect of a segmented wheel that rotates such that the segments always appear in the same position. For this, step easing functions can be used.
## Reference
>
### Functions
  * `cubic-bezier()`
  * `linear()`
  * `steps()`


### data types
  * `<easing-function>`
  * `<linear-easing-function>`
  * `<cubic-bezier-easing-function>`
  * `<step-easing-function>`


### Terms and glossary definitions
  * Bézier curve
  * Interpolation


## Guides
CSS value functions: easing functions
    
The CSS statements that invoke special data processing or calculations to return a CSS value for a CSS property.
## Related concepts
  * CSS animations module
    * `animation-timing-function`
    * `animation` shorthand
  * CSS transitions module
    * `transition-timing-function`
    * `transition` shorthand


# view-transition-class
The `view-transition-class` CSS property provides the selected elements with an identifying class (a `<custom-ident>`), providing an additional method of styling the view transitions for those elements.
## Syntax
    
    /* <custom-ident> value examples */
    view-transition-class: card;
    
    /* Keyword value */
    view-transition-class: none;
    
    /* Global values */
    view-transition-class: inherit;
    view-transition-class: initial;
    view-transition-class: revert;
    view-transition-class: revert-layer;
    view-transition-class: unset;
    
### Values
`<custom-ident>`
    
An identifying name that causes the selected element to participate in a separate view transition from the root view transition. The identifier must be unique. If two rendered elements have the same `view-transition-name` at the same time, `ViewTransition.ready` will reject and the transition will be skipped.
`none`
    
No class would apply to the named view transition pseudo-elements generated for this element.
## Description
The `view-transition-class` value provides a styling hook, similar to a CSS class name, which can be used to apply the same styles to multiple view transition pseudo-elements. It does not mark an element for capturing. Each individual element still needs its own unique `view-transition-name`; the `view-transition-class` is only used as an additional way to style elements that already have a `view-transition-name`. Support for determining the `view-transition-name` automatically is being discussed in the CSS View Transitions Module Level 2 spec.
The `view-transition-class` apply styles using the view transition pseudo-elements, including `::view-transition-group()`, `::view-transition-image-pair()`, `::view-transition-old()`, and `::view-transition-new()`. This is different from the `view-transition-name`, which matches view transitions between the element in the old state with its corresponding element in the new state.
Until the `view-transition-class` property is fully supported in all browsers supporting view transitions, include a custom `::view-transition-group()` for each element.
## Examples
    
    ::view-transition-group(.fast-card-slide) {
      animation-duration: 3s;
    }
    
    .product {
      view-transition-class: fast-card-slide;
    }
    
    .product#card1 {
      view-transition-name: show-card;
    }
    
    .product#card2 {
      view-transition-name: hide-card;
    }
    
# CSS shapes
The CSS shapes module describes geometric shapes. It also defines CSS properties that can use the shapes to control the geometry of an element's float area; this area can then be applied to exclusions, or specify an element's content area.
The specification defines several ways to create shapes. Content can be wrapped around or within a shape rather than following the default rectangle shape of the element's box.
Shapes define geometries that can be used as CSS values. This module provides functions for creating ellipses, polygons, and arbitrary geometries. Other CSS modules can make use of shapes defined in this specification, including CSS motion path and CSS masking.
## CSS shapes in action
The example below shows an image that has been floated left, and the `shape-outside` property applied with a value of `circle(50%)`. This creates a circle shape, and the content wrapping the float now wraps around that shape. This changes the length of the wrapping text's line boxes. You can click "Play" to edit the code in the MDN Playground.
## Reference
>
### Properties
  * `shape-image-threshold`
  * `shape-margin`
  * `shape-outside`


The CSS shapes module also introduces the `shape-inside` and `shape-padding` properties. Currently, no browsers support these features.
### Data types
  * `<basic-shape>`


### Functions
  * `circle()`
  * `ellipse()`
  * `inset()`
  * `path()`
  * `polygon()`
  * `rect()`
  * `shape()`
  * `xywh()`


### Terms
  * Reference box


## Guides
Overview of shapes
    
Defining basic shapes with the `shape-margin` and `clip-path` properties, and debugging basic shapes with Developer Tools.
Shapes from box values
    
Using `border-radius` curvatures and CSS box model values to create shapes.
Basic shapes with `shape-outside`
    
Creating rectangles, circles, ellipses, and polygons with CSS shapes, the reference box, and the `shape-outside` property.
Shapes from images
    
Creating shapes from semi-transparent image files and CSS Gradients.
## Related concepts
CSS motion path module
  * `offset`
  * `offset-anchor`
  * `offset-distance`
  * `offset-path`
  * `offset-position`
  * `offset-rotate`
  * `ray()` function


CSS masking module
  * `clip`
  * `clip-path`
  * `clip-rule`
  * `mask`
  * `mask-origin`
  * `mask-position`


CSS backgrounds and borders module
  * `border-radius` shorthand


CSS box model module
  * `<box-edge>` data type


# CSS positioned layout
The CSS positioned layout module defines the coordinate-based positioning and offsetting schemes available in CSS and the properties used to position and stack elements on a web page. The module is best known for defining the basic positioning methods, including relative positioning, sticky positioning, absolute positioning, and fixed positioning. It also defines how positioned elements are painted and layered, clarifying stacking behavior and visual order.
The positioned layout module defines the physical, logical, and shorthand inset properties. The logical properties enable developing with internationalization and responsiveness in mind.
Like all CSS modules, this module impacts and is impacted by other modules. This module describes how positioning interacts with other layout modules such as CSS flexible box layout and CSS Grid layout. Other modules, such as CSS anchor positioning, build upon this module to enable positioning elements relative to other elements and layers.
## Reference
>
### Properties
  * `bottom`
  * `inset`
  * `inset-block`
  * `inset-block-end`
  * `inset-block-start`
  * `inset-inline`
  * `inset-inline-end`
  * `inset-inline-start`
  * `left`
  * `overlay`
  * `position`
  * `right`
  * `top`


### Selectors
  * `::backdrop`


### Glossary and terms
  * Block direction
  * Containing block
  * Flow relative values
  * Inline direction
  * Inset properties
  * Positioning context
  * Relative position
  * Stacking context
  * Static positioning
  * Top layer


## Guides
Understanding z-index
    
Presents the notion of stacking context and explains how z-ordering works, with several examples.
Stacking without the `z-index` property
    
The stacking rules that apply when `z-index` is not used.
Stacking floating elements
    
How floating elements are handled with stacking.
Using `z-index`
    
How to use `z-index` to change default stacking.
Stacking context
    
CSS stacking context, the CSS features that create new stacking contexts, and nested stacking contexts.
Learn: positioning
    
The different position values and how to use them.
## Related concepts
  * `float`
  * `clear`
  * `transition-property`
  * `transition-behavior`
  * Popover API
  * `<dialog>` element
  * CSS anchor positioning module
    * `position-anchor`
    * `position-area`
    * `position-try-fallbacks`
    * `position-try-order`
    * `position-try` shorthand
    * `position-visibility`
  * CSS transforms module
    * `transform`
    * `transform-origin`
    * `translate`


# mask-border-width
The `mask-border-width` CSS property sets the width of an element's mask border.
## Syntax
    
    /* Keyword value */
    mask-border-width: auto;
    
    /* <length> value */
    mask-border-width: 1rem;
    
    /* <percentage> value */
    mask-border-width: 25%;
    
    /* <number> value */
    mask-border-width: 3;
    
    /* top and bottom | left and right */
    mask-border-width: 2em 3em;
    
    /* top | left and right | bottom */
    mask-border-width: 5% 15% 10%;
    
    /* top | right | bottom | left */
    mask-border-width: 5% 2em 10% auto;
    
    /* Global values */
    mask-border-width: inherit;
    mask-border-width: initial;
    mask-border-width: revert;
    mask-border-width: revert-layer;
    mask-border-width: unset;
    
The `mask-border-width` property may be specified using one, two, three, or four values chosen from the list of values below.
  * When one value is specified, it applies the same width to all four sides.
  * When two values are specified, the first width applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length-percentage>`
    
The width of the mask border, specified as a `<length>` or a `<percentage>`. Percentages are relative to the width of the border area for horizontal offsets and the height of the border area for vertical offsets. Must not be negative.
`<number>`
    
The width of the mask border, specified as a multiple of the corresponding `border-width`. Must not be negative.
`auto`
    
The width of the mask border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding `mask-border-slice`. If the image does not have the required intrinsic dimension, the corresponding `border-width` is used instead.
## Examples
>
### Basic usage
`mask-border-width` defines the width of the border mask — setting this to a different value to `mask-border-slice` will cause the slices to be scaled to fit the border mask.
    
    /* Final mask scaled down to 20px wide */
    mask-border-slice: 30 fill;
    mask-border-width: 20px;
    
Chromium-based browsers support an outdated version of this property — `mask-box-image-width` — with a prefix:
    
    -webkit-mask-box-image-width: 20px;
    
Note: The `mask-border` page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect.
# timeline-scope
The `timeline-scope` CSS property modifies the scope of a named animation timeline.
By default, a named timeline (i.e., declared using `scroll-timeline-name` or `view-timeline-name`) can only be set as the controlling timeline of a direct descendant element (i.e., by setting `animation-timeline` on it with the timeline name as its value). This is the timeline's default "scope".
`timeline-scope` is given the name of a timeline defined on a descendant element; this causes the scope of the timeline to be increased to the element that `timeline-scope` is set on and any of its descendants. In other words, that element and any of its descendant elements can now be controlled using that timeline.
Note: If no timeline (or more than one timeline) exists with the name given for the `timeline-scope` value, an inactive timeline with the specified name is created.
## Syntax
    
    timeline-scope: none;
    timeline-scope: custom_name_for_timeline;
    
### Values
Allowed values for `timeline-scope` are:
`none`
    
There is no change in timeline scope.
`<dashed-ident>`
    
Specifies the name of an existing named timeline (i.e., declared using `scroll-timeline-name` or `view-timeline-name`) defined on a descendant element. This causes the timeline scope to be increased to the element that `timeline-scope` is set on and any of its descendants.
Note: `<dashed-ident>` values must start with `--`, which helps to avoid name clashes with standard CSS keywords.
## Examples
In this example, a scroll timeline named `--my-scroller` is defined using the `scroll-timeline-name` property on the element with the `scroller` class (the scrolling element). This is then applied to the animation on the element with the `box` and `animation` classes (the animated element) using `animation-timeline: --my-scroller`. The key point to note here is that the animated element is not a descendant of the scrolling element — to make this work, we increase the scope of the `--my-scroller` timeline by setting `timeline-scope: --my-scroller` on the `<body>`.
### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <div class="box animation"></div>
    </div>
    
    <div class="scroller">
      <div class="long-element"></div>
    </div>
    
### CSS
The CSS is as follows.
First of all, we set the `<body>`'s height to `100vh`, and lay its two child elements out as two equal columns using flexbox. We also set `timeline-scope: --my-scroller` on it so that the `--my-scroller` timeline can be set as the controlling timeline for an animation set on the `<body>` and any element inside it.
    
    body {
      margin: 0;
      height: 100vh;
      display: flex;
    
      /* increases the timeline scope from the .scroller <div> element
      to the whole <body> */
      timeline-scope: --my-scroller;
    }
    
    .content,
    .scroller {
      flex: 1;
    }
    
Next, the scrolling element has the `--my-scroller` timeline set on it, `overflow` so that it will scroll, and it is given a background color so that its boundary is clear to see. The scrolling element's child long element is given a large height so that the scrolling element will actually scroll.
    
    .scroller {
      overflow: scroll;
      scroll-timeline-name: --my-scroller;
      background: deeppink;
    }
    
    .long-element {
      height: 2000px;
    }
    
Next, we give the animated element some rudimentary styling, and apply an animation to it. We also apply the `--my-scroller` timeline to it using `animation-timeline: --my-scroller`. To reiterate, this is only possible because earlier we set `timeline-scope: --my-scroller` on the `<body>` element — the animated element is not a descendant of the scrolling element.
    
    .box {
      width: 100px;
      height: 100px;
      border-radius: 10px;
      background-color: rebeccapurple;
      position: fixed;
      top: 20px;
      left: 0%;
    }
    
    .animation {
      animation: rotate-appear;
      animation-timeline: --my-scroller;
    }
    
    @keyframes rotate-appear {
      from {
        rotate: 0deg;
        left: 0%;
      }
    
      to {
        rotate: 720deg;
        left: 100%;
      }
    }
    
### Result
Scroll the vertical bar on the pink area to see the square animate.
# clear
The `clear` CSS property sets whether an element must be moved below (cleared) floating elements that precede it. The `clear` property applies to floating and non-floating elements.
## Try it
    
    clear: none;
    
    
    clear: left;
    
    
    clear: right;
    
    
    clear: both;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="floated-left">Left</div>
        <div class="floated-right">Right</div>
        <div class="transition-all" id="example-element">
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      padding: 0.75em;
      text-align: left;
      line-height: normal;
    }
    
    .floated-left {
      border: solid 10px #ffc129;
      background-color: rgb(81 81 81 / 0.6);
      padding: 1em;
      float: left;
    }
    
    .floated-right {
      border: solid 10px #ffc129;
      background-color: rgb(81 81 81 / 0.6);
      padding: 1em;
      float: right;
      height: 150px;
    }
    
When applied to non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. The non-floated block's top margin collapses.
Vertical margins between two floated elements on the other hand will not collapse. When applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats. This affects the position of later floats, since later floats cannot be positioned higher than earlier ones.
The floats that are relevant to be cleared are the earlier floats within the same block formatting context.
Note: If an element contains only floated elements, its height collapses to nothing. If you want it to always be able to resize, so that it contains floating elements inside it, set the value of the element's `display` property to `flow-root`.
    
    #container {
      display: flow-root;
    }
    
## Syntax
    
    /* Keyword values */
    clear: none;
    clear: left;
    clear: right;
    clear: both;
    clear: inline-start;
    clear: inline-end;
    
    /* Global values */
    clear: inherit;
    clear: initial;
    clear: revert;
    clear: revert-layer;
    clear: unset;
    
### Values
`none`
    
Is a keyword indicating that the element is not moved down to clear past floating elements.
`left`
    
Is a keyword indicating that the element is moved down to clear past left floats.
`right`
    
Is a keyword indicating that the element is moved down to clear past right floats.
`both`
    
Is a keyword indicating that the element is moved down to clear past both left and right floats.
`inline-start`
    
Is a keyword indicating that the element is moved down to clear floats on start side of its containing block, that is the left floats on ltr scripts and the right floats on rtl scripts.
`inline-end`
    
Is a keyword indicating that the element is moved down to clear floats on end side of its containing block, that is the right floats on ltr scripts and the left floats on rtl scripts.
## Examples
>
### clear: left
#### HTML
    
    <div class="wrapper">
      <p class="black">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus sit amet
        diam. Duis mattis varius dui. Suspendisse eget dolor.
      </p>
      <p class="red">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
      <p class="left">This paragraph clears left.</p>
    </div>
    
#### CSS
    
    .wrapper {
      border: 1px solid black;
      padding: 10px;
    }
    .left {
      border: 1px solid black;
      clear: left;
    }
    .black {
      float: left;
      margin: 0;
      background-color: black;
      color: white;
      width: 20%;
    }
    .red {
      float: left;
      margin: 0;
      background-color: pink;
      width: 20%;
    }
    p {
      width: 50%;
    }
    
### clear: right
#### HTML
    
    <div class="wrapper">
      <p class="black">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus sit amet
        diam. Duis mattis varius dui. Suspendisse eget dolor.
      </p>
      <p class="red">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
      <p class="right">This paragraph clears right.</p>
    </div>
    
#### CSS
    
    .wrapper {
      border: 1px solid black;
      padding: 10px;
    }
    .right {
      border: 1px solid black;
      clear: right;
    }
    .black {
      float: right;
      margin: 0;
      background-color: black;
      color: white;
      width: 20%;
    }
    .red {
      float: right;
      margin: 0;
      background-color: pink;
      width: 20%;
    }
    p {
      width: 50%;
    }
    
### clear: both
#### HTML
    
    <div class="wrapper">
      <p class="black">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus sit amet
        diam. Duis mattis varius dui. Suspendisse eget dolor. Fusce pulvinar lacus
        ac dui.
      </p>
      <p class="red">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus sit amet
        diam. Duis mattis varius dui. Suspendisse eget dolor.
      </p>
      <p class="both">This paragraph clears both.</p>
    </div>
    
#### CSS
    
    .wrapper {
      border: 1px solid black;
      padding: 10px;
    }
    .both {
      border: 1px solid black;
      clear: both;
    }
    .black {
      float: left;
      margin: 0;
      background-color: black;
      color: white;
      width: 20%;
    }
    .red {
      float: right;
      margin: 0;
      background-color: pink;
      width: 20%;
    }
    p {
      width: 45%;
    }
    
# grid-column
The `grid-column` CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
## Try it
    
    grid-column: 1;
    
    
    grid-column: 1 / 3;
    
    
    grid-column: 2 / -1;
    
    
    grid-column: 1 / span 2;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `grid-column-end`
  * `grid-column-start`


## Syntax
    
    /* Keyword values */
    grid-column: auto;
    grid-column: auto / auto;
    
    /* <custom-ident> values */
    grid-column: some-grid-area;
    grid-column: some-grid-area / some-other-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-column: some-grid-area 4;
    grid-column: 4 some-grid-area / 6;
    
    /* span + <integer> + <custom-ident> values */
    grid-column: span 3;
    grid-column: span some-grid-area;
    grid-column: 5 some-grid-area span;
    grid-column: span 3 / 6;
    grid-column: span some-grid-area / span some-other-grid-area;
    grid-column: 5 some-grid-area span / 2 span;
    
    /* Global values */
    grid-column: inherit;
    grid-column: initial;
    grid-column: revert;
    grid-column: revert-layer;
    grid-column: unset;
    
This property is specified as one or two `<grid-line>` values.
If two `<grid-line>` values are given, they are separated by `/`. The `grid-column-start` longhand is set to the value before the slash, and the `grid-column-end` longhand is set to the value after the slash.
Each `<grid-line>` value can be specified as:
  * either the `auto` keyword
  * or a `<custom-ident>` value
  * or an `<integer>` value
  * or both `<custom-ident>` and `<integer>`, separated by a space
  * or the keyword `span` together with either a `<custom-ident>` or an `<integer>` or both.


### Values
`auto`
    
Is a keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name `<custom-ident>-start`/`<custom-ident>-end`, it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-column: foo;` will choose the start/end edge of that named grid area (unless another line named `foo-start`/`foo-end` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement such that the corresponding edge of the grid item's grid area is n lines from the opposite edge.
If a name is given as a `<custom-ident>`, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the `<integer>` is omitted, it defaults to `1`. Negative integers or 0 are invalid.
## Examples
>
### Setting grid column size and location
#### HTML
    
    <div id="grid">
      <div id="item1"></div>
      <div id="item2"></div>
      <div id="item3"></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 100px;
      grid-template-columns: repeat(6, 1fr);
      grid-template-rows: 100px;
    }
    
    #item1 {
      background-color: lime;
    }
    
    #item2 {
      background-color: yellow;
      grid-column: 2 / 4;
    }
    
    #item3 {
      background-color: blue;
      grid-column: span 2 / 7;
    }
    
#### Result
# text-decoration-line
The `text-decoration-line` CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline.
## Try it
    
    text-decoration-line: none;
    
    
    text-decoration-line: underline;
    
    
    text-decoration-line: overline;
    
    
    text-decoration-line: line-through;
    
    
    text-decoration-line: grammar-error;
    
    
    text-decoration-line: spelling-error;
    
    
    text-decoration-line: underline overline;
    
    
    text-decoration-line: underline line-through;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
When setting multiple line-decoration properties at once, it may be more convenient to use the `text-decoration` shorthand property instead.
## Syntax
    
    /* Single keyword */
    text-decoration-line: none;
    text-decoration-line: underline;
    text-decoration-line: overline;
    text-decoration-line: line-through;
    text-decoration-line: blink;
    text-decoration-line: spelling-error;
    text-decoration-line: grammar-error;
    
    /* Multiple keywords */
    text-decoration-line: underline overline; /* Two decoration lines */
    text-decoration-line: overline underline line-through; /* Multiple decoration lines */
    
    /* Global values */
    text-decoration-line: inherit;
    text-decoration-line: initial;
    text-decoration-line: revert;
    text-decoration-line: revert-layer;
    text-decoration-line: unset;
    
The `text-decoration-line` property is specified as `none`, or one or more space-separated values from the list below.
### Values
`none`
    
Produces no text decoration.
`underline`
    
Each line of text has a decorative line beneath it.
`overline`
    
Each line of text has a decorative line above it.
`line-through`
    
Each line of text has a decorative line going through its middle.
`blink`
    
The text blinks (alternates between visible and invisible). Conforming user agents may not blink the text. This value is deprecated in favor of CSS animations.
`spelling-error`
    
Each line of text uses the user agents' method of highlighting spelling mistakes, which is a dotted red line in most browsers.
`grammar-error`
    
Each line of text uses the user agents' method of highlighting grammar mistakes, which is a dotted green line in most browsers.
Note: When using `spelling-error` and `grammar-error` values, the browser disregards the other properties in the `text-decoration` shorthand (such as `text-underline-position`, `color`, or `stroke`).
## Examples
>
### Basic example
    
    <p class="wavy">Here's some text with wavy red underline!</p>
    <p class="both">This text has lines both above and below it.</p>
    
    
    .wavy {
      text-decoration-line: underline;
      text-decoration-style: wavy;
      text-decoration-color: red;
    }
    
    .both {
      text-decoration-line: underline overline;
    }
    
### Errors example
In this example, the first paragraph contains a spelling mistake and uses the browser's styling for spelling errors on the misspelled word. The second paragraph uses the browser's styling for grammar errors. There is no styling change in browsers that do not support these `text-decoration-line` values.
    
    <p>This text contains a <span class="spelling">speling</span> mistake.</p>
    <p class="grammar">This text contain grammatical errors.</p>
    
    
    .spelling {
      text-decoration-line: spelling-error;
    }
    
    .grammar {
      text-decoration-line: grammar-error;
    }
    
# ::scroll-button()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `::scroll-button()` CSS pseudo-element represents a button for controlling the scrolling of a scroll container. They are generated on scroll containers when their `content` value is not `none`. The direction of the scrolling is determined by the parameter value.
## Syntax
    
    ::scroll-button(<scroll-button-direction>) {
      /* ... */
    }
    
### Parameters
`<scroll-button-direction>`
    
A value representing which direction of scroll button you want to select. The following values are available:
`*`
    
Selects all the originating element's scroll buttons, allowing styles to be applied to each of them in a single rule.
`down`
    
Selects the button that will scroll the content downward.
`left`
    
Selects the button that will scroll the content left.
`right`
    
Selects the button that will scroll the content right.
`up`
    
Selects the button that will scroll the content upward.
`block-end`
    
Selects the button that will scroll the content in the block-end direction.
`block-start`
    
Selects the button that will scroll the content in the block-start direction.
`inline-end`
    
Selects the button that will scroll the content in the inline-end direction.
`inline-start`
    
Selects the button that will scroll the content in the inline-start direction.
The specification also defines two other values — `next` and `prev` — but these are not currently supported in any browser.
## Description
The `::scroll-button()` pseudo-elements are generated inside a scroll container only when their `content` properties are set to a value other than `none`. They are generated as siblings of the scroll container's child DOM elements, immediately preceding them and any `::scroll-marker-group` generated on the container.
You can generate up to four scroll buttons per scroll container, which will scroll the content towards the start and end of the block and inline axes. The selector's argument specifies which scrolling direction is selected. You can also specify a value of `*` to target all of the `::scroll-button()` pseudo-elements, providing styles to all the buttons in a single rule.
The generated buttons behave just like regular `<button>` elements, including sharing their default browser styles. They are focusable, accessible, and can be activated like regular buttons. When a scroll button is pressed, the scroll container's content is scrolled in the specified direction by one "page," or approximately the dimension of the scroll container, similar to pressing `PgUp` and `PgDn` keys.
The recommendation is to set up CSS scroll snapping on the scroll container and set each separate item of content you want to scroll to as a snap target. This being the case, activating a scroll button will scroll the content to the snap target that is one "page" away. While the scroll buttons will work without scroll snapping, you might not get the desired effect.
When it is not possible to scroll any further in a particular scroll button's scrolling direction, the button is automatically disabled, otherwise it is enabled. You can style the scroll buttons in their enabled and disabled states using the `:enabled` and `:disabled` pseudo-classes.
## Examples
See Creating CSS carousels for more carousel examples.
### Creating scroll buttons
In this example, we demonstrate how to create scroll buttons on a CSS carousel.
#### HTML
We have a basic HTML `<ul>` list with several `<li>` list items.
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>
      <li>Item 7</li>
      <li>Item 8</li>
    </ul>
    
#### CSS
##### Styling the carousel
We convert our `<ul>` into a carousel by setting the `display` to `flex`, creating a single, non-wrapping row of `<li>` elements. The `overflow-x` property is set to `auto`, meaning if the items overflow their container on the x-axis, the content will scroll horizontally. We then convert the `<ul>` into a scroll-snap container, ensuring that items always snap into place when the container is scrolled with a `scroll-snap-type` value of `mandatory`.
    
    ul {
      display: flex;
      gap: 4vw;
      padding-left: 0;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
    }
    
Next, we style the `<li>` elements, using the `flex` property to make them 100% of the width of the container. The `scroll-snap-align` value of `start` causes the left-hand side of the left-most visible item to snap to the left edge of the container when the content is scrolled.
    
    li {
      list-style-type: none;
      background-color: #eeeeee;
      flex: 0 0 100%;
      height: 100px;
      padding-top: 20px;
      scroll-snap-align: start;
      text-align: center;
    }
    
##### Creating the scroll buttons
First, all scroll buttons are targeted with some rudimentary styles, as well as styling based on different states. It is important to set `:focus` styles for keyboard users. Also, as scroll buttons are automatically set to `disabled` when no more scrolling can occur in that direction, we use the `:disabled` pseudo-class to target this state.
    
    ul::scroll-button(*) {
      border: 0;
      font-size: 2rem;
      background: none;
      color: black;
      opacity: 0.7;
      cursor: pointer;
    }
    
    ul::scroll-button(*):hover,
    ul::scroll-button(*):focus {
      opacity: 1;
    }
    
    ul::scroll-button(*):active {
      translate: 1px 1px;
    }
    
    ul::scroll-button(*):disabled {
      opacity: 0.2;
      cursor: unset;
    }
    
Note: We also set a `cursor` value of `pointer` on the scroll buttons to make it more obvious that they can be interacted with (an improvement for both general UX and cognitive accessibility), unsetting it when the scroll buttons are `:disabled`.
Next, an appropriate icon is set on the left and right scroll buttons via the `content` property, which is also what causes the scroll buttons to be generated:
    
    ul::scroll-button(left) {
      content: "◄";
    }
    
    ul::scroll-button(right) {
      content: "►";
    }
    
We don't need to set alternative text for the icons on the `content` as the browser takes care of providing appropriate accessible names automatically.
#### Result
Note how the scroll buttons are created at the bottom left on the carousel. Try pressing them to see how they cause the content to be scrolled.
### Positioning the scroll buttons
The previous example works, but the buttons are not ideally placed. In this section, we will add some CSS to position them using anchor positioning.
#### CSS
First of all, a reference `anchor-name` is set on the `<ul>` to define it as a named anchor. Next, each scroll button has its `position` set to `absolute` and its `position-anchor` property set to the list's `anchor-name`, to associate the two together.
    
    ul {
      anchor-name: --my-carousel;
    }
    
    ul::scroll-button(*) {
      position: absolute;
      position-anchor: --my-carousel;
    }
    
To actually position each scroll button, we first set an `align-self` value of `anchor-center` on both of them, to center them vertically on the carousel:
    
    ul::scroll-button(*) {
      align-self: anchor-center;
    }
    
We then set values on their inset properties to handle the horizontal positioning. We use `anchor()` functions to position the specified sides of the buttons relative to the sides of the carousel. In each case, the `calc()` function is used to add some space between the button edge and the carousel edge. For example, the right-hand edge of the left scroll button is positioned 45 pixels to the right of the carousel's left-hand edge.
    
    ul::scroll-button(left) {
      right: calc(anchor(left) - 45px);
    }
    
    ul::scroll-button(right) {
      left: calc(anchor(right) - 45px);
    }
    
#### Result
# column-rule-color
The `column-rule-color` CSS property sets the color of the line drawn between columns in a multi-column layout.
## Try it
    
    column-rule-color: red;
    
    
    column-rule-color: rgb(48 125 222);
    
    
    column-rule-color: hsl(120 80% 40% / 0.6);
    
    
    column-rule-color: currentColor;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      columns: 3;
      column-rule: solid;
      text-align: left;
    }
    
## Syntax
    
    /* <color> values */
    column-rule-color: red;
    column-rule-color: rgb(192 56 78);
    column-rule-color: transparent;
    column-rule-color: hsl(0 100% 50% / 60%);
    
    /* Global values */
    column-rule-color: inherit;
    column-rule-color: initial;
    column-rule-color: revert;
    column-rule-color: revert-layer;
    column-rule-color: unset;
    
The `column-rule-color` property is specified as a single `<color>` value.
### Values
`<color>`
    
The color of the rule that separates columns.
## Examples
>
### Setting a blue column rule
#### HTML
    
    <p>
      This is a bunch of text split into three columns. The `column-rule-color`
      property is used to change the color of the line that is drawn between
      columns. Don't you think that's wonderful?
    </p>
    
#### CSS
    
    p {
      column-count: 3;
      column-rule-style: solid;
      column-rule-color: blue;
    }
    
#### Result
# ::part()
The `::part` CSS pseudo-element represents any element within a shadow tree that has a matching `part` attribute.
    
    custom-element::part(foo) {
      /* Styles to apply to the `foo` part */
    }
    
## Description
The global `part` attribute makes a shadow tree element visible to its parent DOM. The part names declared using the `part` attribute are used as the parameter of the `::part()` pseudo-element. In this way, you can apply CSS styles to elements in the shadow tree from outside of it.
Part names are similar to CSS classes: multiple elements can have the same part name, and a single element can have multiple part names. All part names used in `::part()` pseudo-element must be present in the `part` value declared on the shadow tree element but the order of the part names doesn't matter, i.e., the selectors `::part(tab active)` and `::part(active tab)` are the same.
The `::part()` pseudo-element is only visible to the parent DOM. This means that when a shadow tree is nested, the parts are not visible to any ancestors other than the direct parent. The `exportparts` attribute solves this limitation by explicitly exporting already defined `part` names, making them globally stylable.
Pseudo-classes (such as `::part(label):hover`) can be appended to the `::part()` selector, but structural pseudo-classes that match based on tree information, such as `:empty` and `:last-child`, cannot be appended.
Additional pseudo-elements, such as `::before`, can be appended to the `::part()` selector, but additional `::part()` element can't be appended. For example, `::part(confirm-button)::part(active)` never matches anything, i.e, it is not the same as `::part(confirm-button active)`. This is because doing so would expose more structural information than is intended.
## Syntax
    
    ::part(<ident>+) {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <template id="tabbed-custom-element">
      <style>
        *,
        ::before,
        ::after {
          box-sizing: border-box;
          padding: 1rem;
        }
        :host {
          display: flex;
        }
      </style>
      <div part="tab active">Tab A</div>
      <div part="tab">Tab B</div>
      <div part="tab">Tab C</div>
    </template>
    
    <tabbed-custom-element></tabbed-custom-element>
    
### CSS
    
    tabbed-custom-element::part(tab) {
      color: blue;
      border-bottom: transparent solid 4px;
    }
    
    tabbed-custom-element::part(tab):hover {
      background-color: black;
      color: white;
    }
    
    tabbed-custom-element::part(tab active) {
      border-color: blue !important;
    }
    
### JavaScript
    
    const template = document.querySelector("#tabbed-custom-element");
    globalThis.customElements.define(
      template.id,
      class extends HTMLElement {
        constructor() {
          super().attachShadow({ mode: "open" }).append(template.content);
        }
      },
    );
    
### Result
# text-decoration
The `text-decoration` shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for `text-decoration-line`, `text-decoration-color`, `text-decoration-style`, and the newer `text-decoration-thickness` property.
## Try it
    
    text-decoration: underline;
    
    
    text-decoration: underline dotted;
    
    
    text-decoration: underline dotted red;
    
    
    text-decoration: green wavy underline;
    
    
    text-decoration: underline overline #ff3028;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
Text decorations are drawn across descendant text elements. This means that if an element specifies a text decoration, then a child element can't remove the decoration. For example, in the markup `<p>This text has <em>some emphasized words</em> in it.</p>`, the style rule `p { text-decoration: underline; }` would cause the entire paragraph to be underlined. The style rule `em { text-decoration: none; }` would not cause any change; the entire paragraph would still be underlined. However, the rule `em { text-decoration: overline; }` would cause a second decoration to appear on "some emphasized words".
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `text-decoration-color`
  * `text-decoration-line`
  * `text-decoration-style`
  * `text-decoration-thickness`


## Syntax
    
    text-decoration: underline;
    text-decoration: overline red;
    text-decoration: none;
    
    /* Global values */
    text-decoration: inherit;
    text-decoration: initial;
    text-decoration: revert;
    text-decoration: revert-layer;
    text-decoration: unset;
    
The `text-decoration` property is specified as one or more space-separated values representing the various longhand text-decoration properties.
### Values
`text-decoration-line`
    
Sets the kind of decoration used, such as `underline` or `line-through`.
`text-decoration-color`
    
Sets the color of the decoration.
`text-decoration-style`
    
Sets the style of the line used for the decoration, such as `solid`, `wavy`, or `dashed`.
`text-decoration-thickness`
    
Sets the thickness of the line used for the decoration.
## Examples
>
### Demonstration of text-decoration values
    
    .under {
      text-decoration: underline red;
    }
    
    .over {
      text-decoration: wavy overline lime;
    }
    
    .line {
      text-decoration: line-through;
    }
    
    .plain {
      text-decoration: none;
    }
    
    .underover {
      text-decoration: dashed underline overline;
    }
    
    .thick {
      text-decoration: solid underline purple 4px;
    }
    
    .blink {
      text-decoration: blink;
    }
    
    
    <p class="under">This text has a line underneath it.</p>
    <p class="over">This text has a line over it.</p>
    <p class="line">This text has a line going through it.</p>
    <p>
      This <a class="plain" href="#">link will not be underlined</a>, as links
      generally are by default. Be careful when removing the text decoration on
      anchors since users often depend on the underline to denote hyperlinks.
    </p>
    <p class="underover">This text has lines above <em>and</em> below it.</p>
    <p class="thick">
      This text has a really thick purple underline in supporting browsers.
    </p>
    <p class="blink">
      This text might blink for you, depending on the browser you use.
    </p>
    
#### Result
# CSS borders and box decorations
The CSS borders and box decorations module provides properties for adding borders, shaped corners, and box shadows to elements. This module extends borders and box decorations introduced in the CSS backgrounds and borders module, adding `corner-shape` and `border-shape` properties, logical `border-radius` properties, longhand properties for the `box-shadow` property, and properties to create partial borders.
## Borders and box decorations in action
Select a `superellipse()` value from the drop down menu to change the border shape. Use the slider to change the border radius size. Toggle the checkbox to hide and show the box shadow.
## Reference
>
### Properties
  * `border-block`
  * `border-block-color`
  * `border-block-end`
  * `border-block-end-color`
  * `border-block-end-style`
  * `border-block-end-width`
  * `border-block-start`
  * `border-block-start-color`
  * `border-block-start-style`
  * `border-block-start-width`
  * `border-block-style`
  * `border-block-width`
  * `border-bottom`
  * `border-bottom-color`
  * `border-bottom-left-radius`
  * `border-bottom-right-radius`
  * `border-bottom-style`
  * `border-bottom-width`
  * `border-color`
  * `border-end-end-radius`
  * `border-end-start-radius`
  * `border-inline`
  * `border-inline-color`
  * `border-inline-end`
  * `border-inline-end-color`
  * `border-inline-end-style`
  * `border-inline-end-width`
  * `border-inline-start`
  * `border-inline-start-color`
  * `border-inline-start-style`
  * `border-inline-start-width`
  * `border-inline-style`
  * `border-inline-width`
  * `border-left`
  * `border-left-color`
  * `border-left-style`
  * `border-left-width`
  * `border-radius`
  * `border-right`
  * `border-right-color`
  * `border-right-style`
  * `border-right-width`
  * `border-start-end-radius`
  * `border-start-start-radius`
  * `border-top`
  * `border-top-color`
  * `border-top-left-radius`
  * `border-top-right-radius`
  * `border-top-style`
  * `border-top-width`
  * `box-shadow`
  * `corner-block-end-shape`
  * `corner-block-start-shape`
  * `corner-bottom-left-shape`
  * `corner-bottom-right-shape`
  * `corner-bottom-shape`
  * `corner-end-end-shape`
  * `corner-end-start-shape`
  * `corner-inline-end-shape`
  * `corner-inline-start-shape`
  * `corner-left-shape`
  * `corner-right-shape`
  * `corner-shape`
  * `corner-start-end-shape`
  * `corner-start-start-shape`
  * `corner-top-left-shape`
  * `corner-top-right-shape`
  * `corner-top-shape`


The CSS borders and box decorations module level 4 also introduces the `border-shape`, `border-limit`, and `border-clip` properties, along with the `border-clip-bottom`, `border-clip-left`, `border-clip-right`, `border-clip-top` longhand properties. Currently, no browsers support these features. The module also introduces component properties for the well supported `border-radius` and `box-shadow` properties, including `border-block-end-radius`, `border-block-start-radius`, `border-bottom-radius`, `border-inline-end-radius`, `border-inline-start-radius`, `border-right-radius`, `border-top-radius`, `box-shadow-blur`, `box-shadow-color`, `box-shadow-offset`, `box-shadow-position`, and `box-shadow-spread`. These component properties are also as yet unsupported.
### Data types
  * `<corner-shape-value>`


### Functions
  * `superellipse()`


## Guides
Learn CSS: the box model
    
Learn how borders and other box model properties impact the CSS box model.
## Related concepts
  * `box-sizing` property
  * `box-decoration-break` property
  * `text-shadow` property
  * `<url>` CSS type
  * `<color>` data type
  * `<image>` data type
  * `<position>` data type
  * `currentColor` keyword


CSS backgrounds and borders module
  * `background-attachment`
  * `background-clip`
  * `background-color`
  * `background-image`
  * `background-origin`
  * `background-position`
  * `background-repeat`
  * `background-size`
  * `background` shorthand
  * `background-position-x`
  * `background-position-y`
  * `border-image-outset`
  * `border-image-repeat`
  * `border-image-slice`
  * `border-image-source`
  * `border-image-width`
  * `border-image` shorthand


# box-orient
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: This is a property of the original CSS flexible box layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard.
The `box-orient` CSS property sets whether an element lays out its contents horizontally or vertically.
## Syntax
    
    /* Keyword values */
    box-orient: horizontal;
    box-orient: vertical;
    box-orient: inline-axis;
    box-orient: block-axis;
    
    /* Global values */
    box-orient: inherit;
    box-orient: initial;
    box-orient: unset;
    
The `box-orient` property is specified as one of the keyword values listed below.
### Values
`horizontal`
    
The box lays out its contents horizontally.
`vertical`
    
The box lays out its contents vertically.
`inline-axis` (HTML)
    
The box displays its children along the inline axis.
`block-axis` (HTML)
    
The box displays its children along the block axis.
The inline and block axes are the writing-mode dependent keywords which, in English, map to `horizontal` and `vertical` respectively.
## Description
HTML DOM elements lay out their contents along the inline-axis by default. This CSS property will only apply to HTML elements with a CSS `display` value of `box` or `inline-box`.
## Examples
>
### Setting horizontal box orientation
Here, the `box-orient` property will cause the two `<p>` sections in the example to display in the same line.
#### HTML
    
    <div class="example">
      <p>I will be to the left of my sibling.</p>
      <p>I will be to the right of my sibling.</p>
    </div>
    
#### CSS
    
    div.example {
      display: -moz-box; /* Mozilla */
      display: -webkit-box; /* WebKit */
      display: box; /* As specified */
    
      /* Children should be oriented vertically */
      -moz-box-orient: horizontal; /* Mozilla */
      -webkit-box-orient: horizontal; /* WebKit */
      box-orient: horizontal; /* As specified */
    }
    
#### Result
Not part of any standard.
# transform-style
The `transform-style` CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element.
## Try it
    
    transform-style: flat;
    
    
    transform-style: preserve-3d;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all layer" id="example-element">
        <p>Parent</p>
        <div class="numeral"><code>rotate3d(1, 1, 1, 45deg)</code></div>
      </div>
    </section>
    
    
    .layer {
      background: #623e3f;
      border-radius: 0.75rem;
      color: white;
      transform: perspective(200px) rotateY(30deg);
    }
    
    .numeral {
      background-color: #ffba08;
      border-radius: 0.2rem;
      color: black;
      margin: 1rem;
      padding: 0.2rem;
      transform: rotate3d(1, 1, 1, 45deg);
    }
    
If flattened, the element's children will not exist on their own in the 3D-space.
As this property is not inherited, it must be set for all non-leaf descendants of the element.
## Syntax
    
    /* Keyword values */
    transform-style: flat;
    transform-style: preserve-3d;
    
    /* Global values */
    transform-style: inherit;
    transform-style: initial;
    transform-style: revert;
    transform-style: revert-layer;
    transform-style: unset;
    
### Values
`flat`
    
Indicates that the children of the element are lying in the plane of the element itself.
`preserve-3d`
    
Indicates that the children of the element should be positioned in the 3D-space.
## Description
The spec lists some grouping property values, which require the user agent to create a flattened representation of the descendant elements before they can be applied, and therefore force the element to have a used value of `transform-style: flat`, even when `preserve-3d` is specified. These property values include:
  * `overflow`: any value other than `visible` or `clip`.
  * `opacity`: any value less than `1`.
  * `filter`: any value other than `none`.
  * `clip`: any value other than `auto`.
  * `clip-path`: any value other than `none`.
  * `isolation`: used value of `isolate`.
  * `mask-image`: any value other than `none`.
  * `mask-border-source`: any value other than `none`.
  * `mix-blend-mode`: any value other than `normal`.
  * `contain`: `paint` and any other property/value combination that causes paint containment. This includes any property that affect the used value of the `contain` property, such as `content-visibility: hidden`.


## Examples
>
### Transform style demonstration
In this example we have a 3D cube created using transforms. The parent container of the cube faces has `transform-style: preserve-3d` set on it by default, so it is transformed in the 3D space and you can see it as intended.
We also provide a checkbox allowing you to toggle between this, and `transform-style: flat`. In this alternative state, the cube faces are all flattened onto the plane of their parent, and you might not be able to see them at all, depending on the browser you are using.
#### HTML
    
    <section id="example-element">
      <div class="face front">1</div>
      <div class="face back">2</div>
      <div class="face right">3</div>
      <div class="face left">4</div>
      <div class="face top">5</div>
      <div class="face bottom">6</div>
    </section>
    
    <div class="checkbox">
      <label for="preserve"><code>preserve-3d</code></label>
      <input type="checkbox" id="preserve" checked />
    </div>
    
#### CSS
    
    #example-element {
      margin: 50px;
      width: 100px;
      height: 100px;
      transform-style: preserve-3d;
      transform: rotate3d(1, 1, 1, 30deg);
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 70%);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 70%);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 70%);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 70%);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 70%);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 70%);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
#### JavaScript
    
    const cube = document.getElementById("example-element");
    const checkbox = document.getElementById("preserve");
    
    checkbox.addEventListener("change", () => {
      cube.style.transformStyle = checkbox.checked ? "preserve-3d" : "flat";
    });
    
#### Result
# border-inline-start
The `border-inline-start` CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet.
## Try it
    
    border-inline-start: solid;
    writing-mode: horizontal-tb;
    
    
    border-inline-start: dashed red;
    writing-mode: vertical-rl;
    
    
    border-inline-start: 1rem solid;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-inline-start-color`
  * `border-inline-start-style`
  * `border-inline-start-width`


## Syntax
    
    border-inline-start: 1px;
    border-inline-start: 2px dotted;
    border-inline-start: medium dashed green;
    
    /* Global values */
    border-inline-start: inherit;
    border-inline-start: initial;
    border-inline-start: revert;
    border-inline-start: revert-layer;
    border-inline-start: unset;
    
The physical border to which `border-inline-start` maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top`, `border-right`, `border-bottom`, or `border-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
Related properties are `border-block-start`, `border-block-end`, and `border-inline-end`, which define the other borders of the element.
### Values
The `border-inline-start` is specified with one or more of the following, in any order:
`<'border-width'>`
    
The width of the border. See `border-width`.
`<'border-style'>`
    
The line style of the border. See `border-style`.
`<color>`
    
The color of the border.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      border-inline-start: 5px dashed blue;
    }
    
# reading-flow
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `reading-flow` CSS property enables modifying the reading order of child elements of a block, flex, or grid layout. This affects the order in which they are rendered to speech and navigated to when using sequential navigation such as tabbing to links or buttons.
## Syntax
    
    /* Keyword values */
    reading-flow: normal;
    reading-flow: flex-visual;
    reading-flow: flex-flow;
    reading-flow: grid-columns;
    reading-flow: grid-rows;
    reading-flow: grid-order;
    reading-flow: source-order;
    
    /* Global values */
    reading-flow: inherit;
    reading-flow: initial;
    reading-flow: revert;
    reading-flow: revert-layer;
    reading-flow: unset;
    
### Value
The `reading-flow` property takes one of the following keywords as its value:
`normal`
    
The default value. The reading order follows the order of elements in the DOM.
`flex-visual`
    
Only affects flex containers. The reading order follows the visual order of the `flex` items, taking the `writing-mode` into account. Therefore, a document in English with `flex-direction: row-reverse` and `reading-flow: flex-visual` set would have a reading order of left-to-right.
`flex-flow`
    
Only affects flex containers. The reading order follows the `flex-flow` direction.
`grid-columns`
    
Only affects grid containers. The reading order follows the visual order of grid items, column by column, taking the writing mode into account.
`grid-rows`
    
Only affects grid containers. The reading order follows the visual order of grid items, row by row, taking the writing mode into account.
`grid-order`
    
Only affects grid containers. if the `order` property is applied to any of the container's children, the reading order follows the modified item order. If the `order` property is not applied to the grid items, `grid-order` behaves as `normal`.
`source-order`
    
Affects grid, flex, and block containers. Has no effect on its own — the container's reading order continues to follow the order of elements in the DOM — but allows the reading order to be modified by setting the `reading-order` property on the container's children.
## Description
The `reading-flow` property modifies the reading order of elements within a block, flex, or grid container when set to a value other than `normal`. Such a container is referred to as a reading flow container.
By default, web content is read out in DOM source order. Generally, the source order should express a sensible reading order for the content, and this should also be reflected by the visual order in the content layout. However, sometimes the visual order or tab order differs from the source order. For example, when applying multiple flexbox or grid layouts to a document via media queries to suit different device or user requirements, the content order may differ based on the viewport width. In such a case, the `reading-flow` can be used to ensure the reading and tabbing order reflect the visual order.
In some cases you may wish to further fine-tune the reading order within a reading flow container. You can use `reading-order` property values on the container's children, putting them into ordinal groups which are then read out in numerical order.
### Interaction with `tabindex`
If a set of reading flow container child elements that are not normally focusable are made focusable with `tabindex="0"` attributes, their reading order will be modified as expected by the `reading-flow` and `reading-order` properties, in just the same way as interactive elements such as `<a>` or `<button>`.
However, any attempt to modify the tabbing order of a reading flow container's content using positive `tabindex` values will be ignored — overridden by the effects of `reading-flow` and `reading-order`. You generally shouldn't be using these anyway; see Don't Use Tabindex Greater than 0. The `reading-flow` and `reading-order` properties provide a much better way to modify tabbing order if required.
## Examples
>
### Flex value comparison
In this example, we demonstrate the effects of different `reading-flow` values on a flex container with reversed flex items.
#### HTML
The markup includes a `<select>` element for selecting different `reading-flow` values, and a wrapper `<div>` containing three `<a>` elements.
    
    <form>
      <label for="reading-flow">Choose reading flow:</label>
      <select id="reading-flow">
        <option>normal</option>
        <option>flex-visual</option>
        <option>flex-flow</option>
      </select>
    </form>
    <div class="wrapper">
      <a href="#">Item 1</a>
      <a href="#">Item 2</a>
      <a href="#">Item 3</a>
    </div>
    
#### CSS
We use a `display` value of `flex` to turn the `<div>` into a flex container, and display the flex items in a row in reverse DOM order with a `flex-direction` value of `row-reverse`. Initially, we set a `reading-flow` of `normal` so the items are read or tabbed through in DOM source order.
We also set an `order` value of `1` on the first `<a>` element to cause it to display after the second and third item in the flex flow. The resulting visual order of the flex items from left to right is "Item 1", "Item 3", then "Item 2", but the DOM order remains unchanged.
    
    .wrapper {
      display: flex;
      flex-direction: row-reverse;
      reading-flow: normal;
      gap: 1em;
    }
    
    a:first-child {
      order: 1;
    }
    
#### JavaScript
In our script, we grab references to the `<select>` element and wrapper `<div>`, then add a `change` event listener to the `<select>` element. When a new value is selected, it is set as a `reading-flow` property value on the wrapper.
    
    const selectElem = document.getElementById("reading-flow");
    const wrapperElem = document.querySelector(".wrapper");
    
    selectElem.addEventListener("change", () => {
      wrapperElem.style.readingFlow = selectElem.value;
    });
    
#### Result
The demo renders like this:
First, try tabbing through the links with `reading-flow: normal` set. The tabbing order is "Item 1", "Item 2", then "Item 3", as that is the order of the elements in the DOM.
Now try changing the `reading-flow` value and tabbing through the links again:
  * A value of `flex-visual` causes the items to be tabbed through in the order "Item 1", "Item 3", then "Item 2", which is the visual display order resulting from the applied flexbox properties.
  * A value of `flex-flow` causes the items to be tabbed through in the order "Item 2", "Item 3", then "Item 1", which matches the direction of the `flex-flow` — in this case, `row-reverse`. Here, the tabbing order is the reverse of the display order.


### Grid value comparison
In this example, we demonstrate the effects of different `reading-flow` values on a grid container.
#### HTML
The markup includes a `<select>` element for selecting different `reading-flow` values, and a wrapper `<div>` containing four `<a>` elements.
    
    <form>
      <label for="reading-flow">Choose reading flow:</label>
      <select id="reading-flow">
        <option>normal</option>
        <option>grid-rows</option>
        <option>grid-columns</option>
        <option>grid-order</option>
      </select>
    </form>
    <div class="wrapper">
      <a class="a" href="#">Item A</a>
      <a class="b" href="#">Item B</a>
      <a class="c" href="#">Item C</a>
      <a class="d" href="#">Item D</a>
    </div>
    
#### CSS
We use a `display` value of `grid` to turn the `<div>` into a grid container, and display the grid items in three columns using `grid-template-columns`. We also set `grid-template-areas` to describe different placement areas in those columns, and place the `<a>` elements in those areas using `grid-area`. Initially, we set a `reading-flow` of `normal` so the items are read or tabbed through in the default DOM source order.
Finally, we set an `order` value of `1` on the first `<a>` element; this has no effect on the layout because it does not override the grid area placement, but it does have an effect when a certain `reading-flow` value is set, as you'll se later on.
Reading from left to right, the resulting display order of the grid items is "Item D", "Item B", "Item C", then "Item A".
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 150px);
      grid-template-areas:
        "d b b"
        "c c a";
      reading-flow: normal;
    }
    
    .a {
      grid-area: a;
    }
    .b {
      grid-area: b;
    }
    .c {
      grid-area: c;
    }
    .d {
      grid-area: d;
    }
    
    a:first-child {
      order: 1;
    }
    
#### JavaScript
In our script, we grab references to the `<select>` element and wrapper `<div>`, then add a `change` event listener to the `<select>` element. When a new value is selected, it is set as a `reading-flow` property value on the wrapper.
    
    const selectElem = document.getElementById("reading-flow");
    const wrapperElem = document.querySelector(".wrapper");
    
    selectElem.addEventListener("change", () => {
      wrapperElem.style.readingFlow = selectElem.value;
    });
    
#### Result
The demo renders like this:
First, try tabbing through the links with `reading-flow: normal` set. The tabbing order is "Item A", "Item B", "Item C", and "Item D", as that is the order of the elements in the DOM.
Now change the `reading-flow` value and then try tabbing through the links again:
  * A value of `grid-rows` causes the items to be tabbed through in the visual display order by row. This is "Item D", "Item B", "Item C", then "Item A".
  * A value of `grid-columns` causes the items to be tabbed through in the visual display order by column. This is "Item D", "Item C", "Item B", then "Item A".
  * A value of `grid-order` causes the items to be tabbed through in DOM order, but takes into account any `order` value changes. Since we have `order: 1;` set on the first `<a>` element, the tabbing order is "Item B", "Item C", "Item D", then "Item A".


### Reading order adjustment on block containers
In this example, we demonstrate the effects of the `reading-flow: source-order` value on a block container.
#### HTML
The markup includes a wrapper `<div>` containing four `<a>` elements.
    
    <div class="wrapper">
      <a class="a" href="#">Item A</a>
      <a class="b" href="#">Item B</a>
      <a class="c" href="#">Item C</a>
      <a class="d" href="#">Item D</a>
    </div>
    
#### CSS
We set a `reading-flow` of `source-order` so the items are read or tabbed through in DOM source order, but modifications are allowed to the reading order via `reading-order`. We set a `reading-order` value of `1` on the first `<a>` element.
    
    .wrapper {
      reading-flow: source-order;
    }
    
    a:first-child {
      reading-order: 1;
    }
    
#### Result
The demo renders like this:
Try tabbing through the links: the tabbing order is "Item B", "Item C", "Item D", then "Item A" — the order of the elements in the DOM is followed, but Item A has been put in a higher reading order ordinal group than the others (the default `reading-order` value is `0`), therefore it is tabbed to last.
# CSS backgrounds and borders
The CSS backgrounds and borders module provides properties for adding backgrounds, borders, rounded corners, and box shadows to elements.
You can add different types of border styles, including borders made of images of any image type, from raster images to CSS gradients. Borders can be square or rounded, and a different radius can be set for each corner. Elements can be rounded whether or not they have a visible border.
Box shadows include inset and outset shadow, single or multiple shadows, and solid or allowed to fade to transparent. An outer box-shadow casts a shadow as if the border-box of the element were opaque. An inner box-shadow casts a shadow as if everything outside the padding edge were opaque. The shadow can be solid or include a spread distance with the shadow color transitioning to transparent.
The properties in this module also let you define whether cells inside a `<table>` should have shared or separate borders.
### Backgrounds, borders, and box shadows in action
This sample of borders, backgrounds, and box shadows consists of centered background images made of linear and radial gradients. A series of box shadows make the border appear to "pop". The element on the left has a border image set. The element on the right has a rounded dotted border.
The background images are defined with `background-image`. The images are centered with `background-position`. Different values of the `background-clip` property for the multiple background images are used to make the background images stay within the content box. The background color gets clipped to the padding box preventing the background from appearing through the transparent sections for the `border-image` and the `dotted` `border`. The rounded corners in the element on the right are created using the `border-radius` property. A single `box-shadow` declaration is used to set all the shadows, both inset and outset.
Click "Play" in the example above to see or edit the code for the animation in the MDN Playground.
## Reference
>
### Properties
  * `background-attachment`
  * `background-clip`
  * `background-color`
  * `background-image`
  * `background-origin`
  * `background-position`
  * `background-repeat`
  * `background-size`
  * `background` shorthand
  * `background-position-x`
  * `background-position-y`
  * `border-bottom-color`
  * `border-bottom-style`
  * `border-bottom-width`
  * `border-bottom` shorthand
  * `border-left-color`
  * `border-left-style`
  * `border-left-width`
  * `border-left` shorthand
  * `border-right-color`
  * `border-right-style`
  * `border-right-width`
  * `border-right` shorthand
  * `border-top-color`
  * `border-top-style`
  * `border-top-width`
  * `border-top` shorthand
  * `border-color` shorthand
  * `border-style` shorthand
  * `border-width` shorthand
  * `border` shorthand
  * `border-bottom-left-radius`
  * `border-bottom-right-radius`
  * `border-top-left-radius`
  * `border-top-right-radius`
  * `border-radius` shorthand
  * `border-image-outset`
  * `border-image-repeat`
  * `border-image-slice`
  * `border-image-source`
  * `border-image-width`
  * `border-image` shorthand
  * `box-shadow`


The CSS backgrounds module level 4 also introduces the `background-position-block`, `background-position-inline`, `background-repeat-block`, `background-repeat-inline`, `background-repeat-x`, `background-repeat-y`, and `background-tbd` properties. Currently, no browsers support these features.
### Data types
  * `<line-style>` enumerated type


## Guides
Using multiple backgrounds
    
Setting one or more backgrounds on an element.
Resizing background images
    
Changing the size and repeating behavior of background images.
Scaling SVG backgrounds
    
How SVG aspect ratio, SVG dimension values, and the CSS `background-size` property impact the scaling of SVG background images.
Using CSS gradients
    
Creating CSS gradients and using them as background images.
Learn CSS: background and borders
    
Learn how to implement decorative images using CSS background images.
Learn CSS: the box model
    
Learn how borders and other box model properties impact the CSS box model.
## Related concepts
  * `border-block-end-color`
  * `border-block-start-color`
  * `border-inline-end-color`
  * `border-inline-start-color`
  * `border-block-end-style`
  * `border-block-start-style`
  * `border-inline-end-style`
  * `border-inline-start-style`
  * `border-block-end-width`
  * `border-block-start-width`
  * `border-inline-end-width`
  * `border-inline-start-width`
  * `border-start-start-radius`
  * `border-start-end-radius`
  * `border-end-start-radius`
  * `border-end-end-radius`
  * `box-sizing`
  * `box-decoration-break`
  * `text-shadow`
  * `<url>` data type
  * `<url>` data type
  * `<image>` data type
  * `position` data type
  * `currentColor` keyword


# flex-grow
The `flex-grow` CSS property sets the flex grow factor, which specifies how much of the flex container's positive free space, if any, should be assigned to the flex item's main size.
When the flex-container's main size is larger than the combined main sizes of its flex items, this positive free space can be distributed among the flex items, with each item's growth being their growth factor value as a proportion of the sum total of all the flex items' flex grow factors.
Note: It is recommended to use the `flex` shorthand with a keyword value like `auto` or `initial` instead of setting `flex-grow` on its own. The keyword values expand to reliable combinations of `flex-grow`, `flex-shrink`, and `flex-basis`, which help to achieve the commonly desired flex behaviors.
## Try it
    
    flex-grow: 1;
    
    
    flex-grow: 2;
    
    
    flex-grow: 3;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">I grow</div>
      <div>Item Two</div>
      <div>Item Three</div>
    </section>
    
    
    .default-example {
      border: 1px solid #c5c5c5;
      width: auto;
      max-height: 300px;
      display: flex;
    }
    
    .default-example > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex-grow: 1;
      flex-shrink: 1;
      flex-basis: 0;
    }
    
## Syntax
    
    /* <number> values */
    flex-grow: 3;
    flex-grow: 0.6;
    
    /* Global values */
    flex-grow: inherit;
    flex-grow: initial;
    flex-grow: revert;
    flex-grow: revert-layer;
    flex-grow: unset;
    
The `flex-grow` property is specified as a single `<number>`.
### Values
`<number>`
    
See `<number>`. Negative values are invalid. Defaults to 0, which prevents the flex item from growing.
## Description
This property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor).
The main size is either the width or height of the item, depending on the `flex-direction` value.
The remaining space, or positive free space, is the size of the flex container minus the size of all flex items' sizes together. If all sibling items have the same flex grow factor, then all items will receive the same share of remaining space. The common practice is to set `flex-grow: 1`, but setting the flex grow factor for all the flex items to `88`, `100`, `1.2`, or any other value greater than `0` will produce the same result: the value is a ratio.
If the `flex-grow` values differ, the positive free space is distributed according to the ratio defined by the different flex grow factors. The `flex-grow` factor values of all the sibling flex items are added together. The flex container's positive free space, if any, is then divided by that total. The main size of each flex item with a `flex-grow` value greater than `0` will grow by this quotient multiplied by its own growth factor.
For example, if four `100px` flex items are in a `700px` container and the flex items have `flex-grow` factors of `0`, `1`, `2`, and `3`, respectively, the total main size of the four items is `400px`, meaning there is `300px` of positive free space to be distributed. The sum of the four grow factors (`0 + 1 + 2 + 3 = 6`) is equal to six. Therefore, each grow factor is equal to `50px` (`(300px / 6 )`. Each flex item is given 50px of free space multiplied by its `flex-grow` factor — so `0`, `50px`, `100px`, and `150px` respectively. The total flex item sizes become `100px`, `150px`, `200px`, and `250px`, respectively.
`flex-grow` is generally used alongside the other `flex` shorthand properties, `flex-shrink` and `flex-basis`. Using the `flex` shorthand property is recommended to ensure all values are set.
## Examples
>
### Setting flex item grow factor
In this example, the sum of six flex-grow factors is equal to eight, meaning each growth-factor value is `12.5%` of the remaining space.
#### HTML
    
    <h1>This is a <code>flex-grow</code> example</h1>
    <p>
      A, B, C, and F have <code>flex-grow: 1</code> set. D and E have
      <code>flex-grow: 2</code> set.
    </p>
    <div id="content">
      <div class="box1">A</div>
      <div class="box2">B</div>
      <div class="box3">C</div>
      <div class="box4">D</div>
      <div class="box5">E</div>
      <div class="box6">F</div>
    </div>
    
#### CSS
    
    #content {
      display: flex;
    }
    
    div > div {
      border: 3px solid rgb(0 0 0 / 20%);
    }
    
    .box1,
    .box2,
    .box3,
    .box6 {
      flex-grow: 1;
    }
    
    .box4,
    .box5 {
      flex-grow: 2;
      border: 3px solid rgb(0 0 0 / 20%);
    }
    
    .box1 {
      background-color: red;
    }
    .box2 {
      background-color: lightblue;
    }
    .box3 {
      background-color: yellow;
    }
    .box4 {
      background-color: brown;
    }
    .box5 {
      background-color: lightgreen;
    }
    .box6 {
      background-color: brown;
    }
    
#### Result
When the six flex items are distributed along the container's main axis, if the sum of the main content of those flex items is less than the size of the container's main axis, the extra space is distributed among the size flex items, with `A`, `B`, `C`, and `F`, each getting `12.5%` of the remaining space and `D` and `E` each getting `25%` of the extra space.
# -webkit-text-fill-color
The `-webkit-text-fill-color` CSS property specifies the fill color of characters of text. If this property is not set, the value of the `color` property is used.
## Syntax
    
    /* <color> values */
    -webkit-text-fill-color: red;
    -webkit-text-fill-color: #123456;
    -webkit-text-fill-color: rgb(100 200 0);
    
    /* Global values */
    -webkit-text-fill-color: inherit;
    -webkit-text-fill-color: initial;
    -webkit-text-fill-color: revert;
    -webkit-text-fill-color: revert-layer;
    -webkit-text-fill-color: unset;
    
### Values
`<color>`
    
The foreground fill color of the element's text content.
## Examples
>
### Changing the fill color
#### CSS
    
    p {
      margin: 0;
      font-size: 3em;
      -webkit-text-fill-color: green;
    }
    
#### HTML
    
    <p>This text is green.</p>
    
#### Results
# margin-bottom
The `margin-bottom` CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
## Try it
    
    margin-bottom: 1em;
    
    
    margin-bottom: 10%;
    
    
    margin-bottom: 10px;
    
    
    margin-bottom: 0;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row"></div>
        <div class="row transition-all" id="example-element"></div>
        <div class="row"></div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
This property has no effect on non-replaced inline elements, such as `<span>` or `<code>`.
## Syntax
    
    /* <length> values */
    margin-bottom: 10px; /* An absolute length */
    margin-bottom: 1em; /* relative to the text size */
    margin-bottom: 5%; /* relative to the nearest block container's width */
    margin-bottom: anchor-size(width);
    margin-bottom: calc(anchor-size(--my-anchor self-block, 20px) / 3);
    
    /* Keyword values */
    margin-bottom: auto;
    
    /* Global values */
    margin-bottom: inherit;
    margin-bottom: initial;
    margin-bottom: revert;
    margin-bottom: revert-layer;
    margin-bottom: unset;
    
The `margin-bottom` property is specified as the keyword `auto`, or a `<length>`, or a `<percentage>`. Its value can be positive, zero, or negative.
### Values
`<length>`
    
The size of the margin as a fixed value.
  * For anchor-positioned elements, the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element margin based on anchor size).


`<percentage>`
    
The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
`auto`
    
The browser selects a suitable value to use. See `margin`.
## Examples
>
### Setting positive and negative bottom margins
#### HTML
    
    <div class="container">
      <div class="box0">Box 0</div>
      <div class="box1">Box 1</div>
      <div class="box2">Box one's negative margin pulls me up</div>
    </div>
    
#### CSS
CSS for divs to set margin-bottom and height
    
    .box0 {
      margin-bottom: 1em;
      height: 3em;
    }
    .box1 {
      margin-bottom: -1.5em;
      height: 4em;
    }
    .box2 {
      border: 1px dashed black;
      border-width: 1px 0;
      margin-bottom: 2em;
    }
    
Some definitions for container and divs so margins' effects can be seen more clearly
    
    .container {
      background-color: orange;
      width: 320px;
      border: 1px solid black;
    }
    div {
      width: 320px;
      background-color: gold;
    }
    
#### Result
# text-decoration-skip
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `text-decoration-skip` CSS property sets what parts of an element's content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors.
Note: Most other browsers are converging on supporting the simpler `text-decoration-skip-ink` property.
## Syntax
    
    /* Keyword values */
    text-decoration-skip: none;
    text-decoration-skip: objects;
    text-decoration-skip: spaces;
    text-decoration-skip: edges;
    text-decoration-skip: box-decoration;
    
    /* Multiple keywords */
    text-decoration-skip: objects spaces;
    text-decoration-skip: leading-spaces trailing-spaces;
    text-decoration-skip: objects edges box-decoration;
    
    /* Global values */
    text-decoration-skip: inherit;
    text-decoration-skip: initial;
    text-decoration-skip: revert;
    text-decoration-skip: revert-layer;
    text-decoration-skip: unset;
    
### Values
`none`
    
Nothing is skipped. Thus, text decoration is drawn for all text content and across atomic inline-level boxes.
`objects`
    
The entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block.
`spaces`
    
All spacing is skipped: all Unicode white space characters and all word separators, plus any adjacent `letter-spacing` or `word-spacing`.
`leading-spaces`
    
The same as `spaces`, except that only leading spaces are skipped.
`trailing-spaces`
    
The same as `spaces`, except that only trailing spaces are skipped.
`edges`
    
The start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the decorating box. Thus, adjacent elements receive separate underlines. (This is important in Chinese, where underlining is a form of punctuation.)
`box-decoration`
    
The text decoration is skipped over the box's margin, border, and padding areas. This only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration.
## Examples
>
### Skipping edges
#### HTML
    
    <p>Hey, grab a cup of <em>coffee!</em></p>
    
#### CSS
    
    p {
      margin: 0;
      font-size: 3em;
      text-decoration: underline;
      text-decoration-skip: edges;
    }
    
#### Result
# overflow-x
The `overflow-x` CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the `overflow` shorthand property.
## Try it
    
    overflow-x: visible;
    
    
    overflow-x: hidden;
    
    
    overflow-x: clip;
    
    
    overflow-x: scroll;
    
    
    overflow-x: auto;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">
        The value of Pi is 3.1415926535897932384626433832795029. The value of e is
        2.7182818284590452353602874713526625.
      </div>
    </section>
    
    
    #example-element {
      width: 15em;
      height: 9em;
      border: medium dotted;
      padding: 0.75em;
      text-align: left;
    }
    
## Syntax
    
    /* Keyword values */
    overflow-x: visible;
    overflow-x: hidden;
    overflow-x: clip;
    overflow-x: scroll;
    overflow-x: auto;
    
    /* Global values */
    overflow-x: inherit;
    overflow-x: initial;
    overflow-x: revert;
    overflow-x: revert-layer;
    overflow-x: unset;
    
The `overflow-x` property is specified as a single `<overflow>` keyword value.
If `overflow-y` is `hidden`, `scroll`, or `auto`, and the `overflow-x` property is `visible` (default), the value will be implicitly computed as `auto`.
### Values
`visible`
    
Overflow content is not clipped and may be visible outside the element's padding box on left and right edges. The element box is not a scroll container.
`hidden`
    
Overflow content is clipped if necessary to fit horizontally in the elements' padding box. No scroll bars are provided.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property. As a result, content overflows the element's padding box by the `<length>` value of `overflow-clip-margin` or by `0px` if not set. The difference between `clip` and `hidden` is that the `clip` keyword also forbids all scrolling, including programmatic scrolling. No new formatting context is created. To establish a formatting context, use `overflow: clip` along with `display: flow-root`. The element box is not a scroll container.
`scroll`
    
Overflow content is clipped if necessary to fit horizontally inside the element's padding box. Browsers display scroll bars in the horizontal direction whether or not any content is actually clipped. (This prevents scroll bars from appearing or disappearing when the content changes.) Printers may still print overflowing content.
`auto`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view. Unlike `scroll`, user agents display scroll bars only if the content is overflowing and hide scroll bars by default. If content fits inside the element's padding box, it looks the same as with `visible`, but still establishes a new block-formatting context. Desktop browsers provide scroll bars if content overflows.
Note: The keyword value `overlay` is a legacy value alias for `auto`. With `overlay`, the scroll bars are drawn on top of the content instead of taking up space.
## Examples
>
### HTML
    
    <ul>
      <li>
        <code>overflow-x:hidden</code> — hides the text outside the box
        <div id="div1">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-x:scroll</code> — always adds a scrollbar
        <div id="div2">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-x:visible</code> — displays the text outside the box if
        needed
        <div id="div3">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    
      <li>
        <code>overflow-x:auto</code> — on most browsers, equivalent to
        <code>scroll</code>
        <div id="div4">ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZ</div>
      </li>
    </ul>
    
### CSS
    
    #div1,
    #div2,
    #div3,
    #div4 {
      border: 1px solid black;
      width: 250px;
      margin-bottom: 12px;
    }
    
    #div1 {
      overflow-x: hidden;
    }
    #div2 {
      overflow-x: scroll;
    }
    #div3 {
      overflow-x: visible;
    }
    #div4 {
      overflow-x: auto;
    }
    
### Result
# :only-of-type
The `:only-of-type` CSS pseudo-class represents an element that has no siblings of the same type (tag name).
## Try it
    
    a:only-of-type {
      color: fuchsia;
    }
    
    dd:only-of-type {
      background-color: bisque;
    }
    
    
    <p>
      To find out more about <b>QUIC</b>, check <a href="#">RFC 9000</a> and
      <a href="#">RFC 9114</a>.
    </p>
    
    <dl>
      <dt>Published</dt>
      <dd>2021</dd>
      <dd>2022</dd>
    </dl>
    
    <p>Details about <b>QPACK</b> can be found in <a href="#">RFC 9204</a>.</p>
    
    <dl>
      <dt>Published</dt>
      <dd>2022</dd>
    </dl>
    
## Syntax
    
    :only-of-type {
      /* ... */
    }
    
## Examples
>
### Styling elements with no siblings of the same type
#### HTML
    
    <main>
      <div>I am `div` #1.</div>
      <p>I am the only `p` among my siblings.</p>
      <div>I am `div` #2.</div>
      <div>
        I am `div` #3.
        <i>I am the only `i` child.</i>
        <em>I am `em` #1.</em>
        <em>I am `em` #2.</em>
      </div>
    </main>
    
#### CSS
    
    main :only-of-type {
      color: red;
    }
    
#### Result
# background-position-x
The `background-position-x` CSS property sets the initial horizontal position for each background image. The position is relative to the position layer set by `background-origin`.
## Try it
    
    background-position-x: left;
    
    
    background-position-x: center;
    
    
    background-position-x: 25%;
    
    
    background-position-x: 2rem;
    
    
    background-position-x: right 32px;
    
    
    <section class="display-block" id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      background-color: navajowhite;
      background-image: url("/shared-assets/images/examples/star.png");
      background-repeat: no-repeat;
      height: 100%;
    }
    
The value of this property is overridden by any declaration of the `background` or `background-position` shorthand properties applied to the element after it.
## Syntax
    
    /* Keyword values */
    background-position-x: left;
    background-position-x: center;
    background-position-x: right;
    
    /* <percentage> values */
    background-position-x: 25%;
    
    /* <length> values */
    background-position-x: 0px;
    background-position-x: 1cm;
    background-position-x: 8em;
    
    /* Side-relative values */
    background-position-x: right 3px;
    background-position-x: left 25%;
    
    /* Multiple values */
    background-position-x: 0px, center;
    
    /* Global values */
    background-position-x: inherit;
    background-position-x: initial;
    background-position-x: revert;
    background-position-x: revert-layer;
    background-position-x: unset;
    
The `background-position-x` property is specified as one or more values, separated by commas.
### Values
`left`
    
Aligns the left edge of the background image with the left edge of the background position layer.
`center`
    
Aligns the center of the background image with the center of the background position layer.
`right`
    
Aligns the right edge of the background image with the right edge of the background position layer.
`<length>`
    
The offset of the given background image's left vertical edge from the background position layer's left vertical edge. (Some browsers allow assigning the right edge for offset).
`<percentage>`
    
The offset of the given background image's horizontal position relative to the container. A value of 0% means that the left edge of the background image is aligned with the left edge of the container, and a value of 100% means that the right edge of the background image is aligned with the right edge of the container, thus a value of 50% horizontally centers the background image.
## Examples
>
### Basic example
The following example shows a background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately.
#### HTML
    
    <div></div>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background-color: skyblue;
      background-image: url("https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png");
      background-repeat: no-repeat;
      background-position-x: center;
      background-position-y: bottom;
    }
    
#### Result
### Side-relative values
The following example shows support for side-relative offset syntax, which allows the developer to offset the background from any edge.
#### HTML
    
    <div></div>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background-color: seagreen;
      background-image: url("https://mdn.dev/archives/media/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png");
      background-repeat: no-repeat;
      background-position-x: right 20px;
      background-position-y: bottom 10px;
    }
    
#### Result
# border-inline-end-style
The `border-inline-end-style` CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-end-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-inline-end-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-inline-end-style: groove;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-style'> values */
    border-inline-end-style: dashed;
    border-inline-end-style: dotted;
    border-inline-end-style: groove;
    
    /* Global values */
    border-inline-end-style: inherit;
    border-inline-end-style: initial;
    border-inline-end-style: revert;
    border-inline-end-style: revert-layer;
    border-inline-end-style: unset;
    
Related properties are `border-block-start-style`, `border-block-end-style`, and `border-inline-start-style`, which define the other border styles of the element.
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### Setting inline-end-style
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-inline-end-style: dashed;
    }
    
#### Results
# align-items
The CSS `align-items` property sets the `align-self` value on all direct children as a group. In flexbox, it controls the alignment of items on the cross axis. In grid layout, it controls the alignment of items on the block axis within their grid areas.
## Try it
    
    align-items: stretch;
    
    
    align-items: center;
    
    
    align-items: start;
    
    
    align-items: end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      width: 200px;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 80px;
      grid-gap: 10px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
The interactive example below demonstrates some of the values for `align-items` using grid and flex layout.
## Syntax
    
    /* Basic keywords */
    align-items: normal;
    align-items: stretch;
    
    /* Positional alignment */
    /* align-items does not take left and right values */
    align-items: center;
    align-items: start;
    align-items: end;
    align-items: flex-start;
    align-items: flex-end;
    align-items: self-start;
    align-items: self-end;
    align-items: anchor-center;
    
    /* Baseline alignment */
    align-items: baseline;
    align-items: first baseline;
    align-items: last baseline;
    
    /* Overflow alignment (for positional alignment only) */
    align-items: safe center;
    align-items: unsafe center;
    
    /* Global values */
    align-items: inherit;
    align-items: initial;
    align-items: revert;
    align-items: revert-layer;
    align-items: unset;
    
### Values
`normal`
    
The effect of this keyword is dependent of the layout mode we are in:
  * In absolutely-positioned layouts, the keyword behaves like `start` on replaced absolutely-positioned boxes, and as `stretch` on all other absolutely-positioned boxes.
  * In static position of absolutely-positioned layouts, the keyword behaves as `stretch`.
  * For flex items, the keyword behaves as `stretch`.
  * For grid items, this keyword leads to a behavior similar to the one of `stretch`, except for boxes with an aspect ratio or an intrinsic size where it behaves like `start`.
  * The property doesn't apply to block-level boxes, and to table cells.


`center`
    
The flex items' margin boxes are centered within the line on the cross-axis. If the cross-size of an item is larger than the flex container, it will overflow equally in both directions.
`start`
    
The items are packed flush to each other toward the start edge of the alignment container in the appropriate axis.
`end`
    
The items are packed flush to each other toward the end edge of the alignment container in the appropriate axis.
`self-start`
    
The items are packed flush to the edge of the alignment container's start side of the item, in the appropriate axis.
`self-end`
    
The items are packed flush to the edge of the alignment container's end side of the item, in the appropriate axis.
`baseline`, `first baseline`, `last baseline`
    
All flex items are aligned such that their flex container baselines align. The item with the largest distance between its cross-start margin edge and its baseline is flushed with the cross-start edge of the line.
`stretch`
    
If the item's cross-size is `auto`, the used size is set to the length necessary to be as close to filling the container as possible, respecting the item's width and height limits. If the item is not auto-sized, this value falls back to `flex-start`, and to `self-start` or `self-end` if the container's `align-content` is `first baseline` (or `baseline`) or `last baseline`.
`anchor-center`
    
In the case of anchor-positioned elements, aligns the items to the center of the associated anchor element in the block direction. See Centering on the anchor using `anchor-center`.
`safe`
    
Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored.
There are also two values that were defined for flexbox, as they are base on flex model axes concepts, that work in grid layouts as well:
`flex-start`
    
Used in flex layout only, aligns the flex items flush against the flex container's main-start or cross-start side. When used outside of a flex formatting context, this value behaves as `start`.
`flex-end`
    
Used in flex layout only, aligns the flex items flush against the flex container's main-end or cross-end side. When used outside of a flex formatting context, this value behaves as `end`.
## Examples
In this example we have a container with six children. A `<select>` dropdown menu enables toggling the `display` of the container between `grid` and `flex`. A second menu enables changing the value of the container's `align-items` property.
### CSS
We style a the container and items in a manner that ensures we have two lines or rows or items. We defined `.flex` and `.grid` classes, which will be applied to the container with JavaScript. They set the `display` value of the container, and change its background and border colors providing an additional indicator that the layout has changed. The six flex items each have a different background color, with the 4th item being two lines long and the 6th item having an enlarged font.
    
    .flex,
    .grid {
      height: 200px;
      width: 500px;
      align-items: initial; /* Change the value in the live sample */
      border: solid 5px transparent;
      gap: 3px;
    }
    
    .flex {
      display: flex;
      flex-wrap: wrap;
      background-color: #8c8c9f;
      border-color: magenta;
    }
    
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, 100px);
      background-color: #9f8c8c;
      border-color: slateblue;
    }
    
    #item1 {
      background-color: #8cffa0;
      min-height: 30px;
    }
    
    #item2 {
      background-color: #a0c8ff;
      min-height: 50px;
    }
    
    #item3 {
      background-color: #ffa08c;
      min-height: 40px;
    }
    
    #item4 {
      background-color: #ffff8c;
      min-height: 60px;
    }
    
    #item5 {
      background-color: #ff8cff;
      min-height: 70px;
    }
    
    #item6 {
      background-color: #8cffff;
      min-height: 50px;
      font-size: 30px;
    }
    
### HTML
We include a container `<div>` with six nested `<div>` children. The HTML for the form and the JavaScript that changes the container's class have been hidden for the sake of brevity.
    
    <div id="container" class="flex">
      <div id="item1">1</div>
      <div id="item2">2</div>
      <div id="item3">3</div>
      <div id="item4">4<br />line 2</div>
      <div id="item5">5</div>
      <div id="item6">6</div>
    </div>
    
### Result
# flex-basis
The `flex-basis` CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with `box-sizing`.
Note: It is recommended to use the `flex` shorthand with a keyword value like `auto` or `initial` instead of setting `flex-basis` on its own. The keyword values expand to reliable combinations of `flex-grow`, `flex-shrink`, and `flex-basis`, which help to achieve the commonly desired flex behaviors.
## Try it
    
    flex-basis: auto;
    
    
    flex-basis: 0;
    
    
    flex-basis: 200px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Item One</div>
      <div>Item Two</div>
      <div>Item Three</div>
    </section>
    
    
    .default-example {
      border: 1px solid #c5c5c5;
      width: auto;
      max-height: 300px;
      display: flex;
    }
    
    .default-example > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex-grow: 1;
      flex-shrink: 1;
      flex-basis: auto;
    }
    
In this example, the `flex-grow` and `flex-shrink` properties are both set to `1` on all three items, indicating that the flex item can grow and shrink from the initial `flex-basis`.
The demo changes the `flex-basis` value set on the first flex item, causing it to grow or shrink to fill the available space. The other flex items will also change size; they will be at least `min-content`-sized. For example, when the `flex-basis` of the first item is set to `200px`, it will start at `200px` but then shrink to fit the space available.
If `flex-basis` is set to a value other than `auto` and there is a `width` (or `height` in case of `flex-direction: column`) set for that same flex item, the `flex-basis` value takes precedence.
## Syntax
    
    /* Specify <'width'> */
    flex-basis: 10em;
    flex-basis: 3px;
    flex-basis: 50%;
    flex-basis: auto;
    
    /* Intrinsic sizing keywords */
    flex-basis: max-content;
    flex-basis: min-content;
    flex-basis: fit-content;
    
    /* Automatically size based on the flex item's content */
    flex-basis: content;
    
    /* Global values */
    flex-basis: inherit;
    flex-basis: initial;
    flex-basis: revert;
    flex-basis: revert-layer;
    flex-basis: unset;
    
The `flex-basis` property is specified as either the keyword `content` or a `<'width'>`.
### Values
`content`
    
Indicates automatic sizing, based on the flex item's content.
`<'width'>`
    
Any of the following units:
  * `<length>` sets an absolute value.
  * `<percentage>` sets a percentage of the width or height of the containing block's content area. Percentage values of `flex-basis` are resolved against the flex container. If the flex container's size is indefinite, the used value for `flex-basis` is `content`.
  * `auto` uses the value of the `width` in horizontal writing mode, and the value of the `height` in vertical writing mode; when the corresponding value is also `auto`, the `content` value is used instead.
  * `max-content` sets the intrinsic preferred width.
  * `min-content` sets the intrinsic minimum width.
  * `fit-content` sets the maximum possible size of a containing block's content area, bounded by the `min-content` and `max-content` values, and calculated based on the content of the current element.


## Examples
>
### Setting flex item initial sizes
#### HTML
    
    <ul class="container">
      <li class="flex flex1">1: flex-basis test</li>
      <li class="flex flex2">2: flex-basis test</li>
      <li class="flex flex3">3: flex-basis test</li>
      <li class="flex flex4">4: flex-basis test</li>
      <li class="flex flex5">5: flex-basis test</li>
    </ul>
    
    <ul class="container">
      <li class="flex flex6">6: flex-basis test</li>
    </ul>
    
#### CSS
    
    .container {
      font-family: arial, sans-serif;
      margin: 0;
      padding: 0;
      list-style-type: none;
      display: flex;
      flex-wrap: wrap;
    }
    
    .flex {
      background: #6ab6d8;
      padding: 10px;
      margin-bottom: 50px;
      border: 3px solid #2e86bb;
      color: white;
      font-size: 14px;
      text-align: center;
      position: relative;
    }
    
    .flex::after {
      position: absolute;
      z-index: 1;
      left: 0;
      top: 100%;
      margin-top: 10px;
      width: 100%;
      color: #333333;
      font-size: 12px;
    }
    
    .flex1 {
      flex-basis: auto;
    }
    
    .flex1::after {
      content: "auto";
    }
    
    .flex2 {
      flex-basis: max-content;
    }
    
    .flex2::after {
      content: "max-content";
    }
    
    .flex3 {
      flex-basis: min-content;
    }
    
    .flex3::after {
      content: "min-content";
    }
    
    .flex4 {
      flex-basis: fit-content;
    }
    
    .flex4::after {
      content: "fit-content";
    }
    
    .flex5 {
      flex-basis: content;
    }
    
    .flex5::after {
      content: "content";
    }
    
#### Results
### Flex basis `0` vs `0%`
This example demonstrates the difference between a `flex-basis` of `0` versus a `flex-basis` of `0%` when `flex-direction` is set to `column` and the flex containers and flex items don't have a set height; while `0` is an absolute length, percentage flex-basis values resolve to `content` values.
#### HTML
We include two same-structure flex containers, which will be styled similarly except for their `flex-basis` values. The containers each have two children: a heading `<div>` and a `<section>`. The `<section>` element has a content `<div>` child, which will not be set as a flex item but will be given a height.
    
    <div class="container basis-0">
      <div>heading</div>
      <section>
        flex-basis: 0;
        <div class="content"></div>
      </section>
    </div>
    <div class="container basis-0-percent">
      <div>heading</div>
      <section>
        flex-basis: 0%;
        <div class="content"></div>
      </section>
    </div>
    
#### CSS
We style the containers as inline flex containers that will appear side by side to better enable comparing them. We set the `flex-direction` to `column`. The first container's flex items have a `flex-basis` value of `0`, while the second container's flex items have a `flex-basis` value of `0%`. Neither the flex containers nor their flex items have a height explicitly set, but the heights of `section` elements cannot exceed `200px` and their children have a height of `300px`.
    
    .container {
      width: 40vw;
      padding: 1rem;
      border: 1px dashed blue;
    
      display: inline-flex;
      flex-direction: column;
    }
    
    section {
      border: 1px solid red;
    
      overflow: auto;
      min-height: 200px;
    }
    
    .content {
      background: wheat;
      height: 300px;
    }
    
    .container.basis-0 > * {
      flex-basis: 0;
    }
    .container.basis-0-percent > * {
      flex-basis: 0%;
    }
    
#### Results
In the first container, with `flex-basis: 0`, the `<section>` element has an initial main size of zero, and it grows to the `200px` height limit. In the second container, with `flex-basis: 0%`, the `<section>` element has an initial main size of `300px` because, as the flex container doesn't have a set height, the percentage flex-basis values resolve to the `content` value.
# corner-left-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-left-shape` CSS property specifies the shape of both the corners on a box's left-hand edge, within their `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Constituent properties
The `corner-left-shape` property is a shorthand for the following physical properties:
  * `corner-top-left-shape`
  * `corner-bottom-left-shape`


## Syntax
    
    /* Single keyword value set for both corners */
    corner-left-shape: round;
    corner-left-shape: bevel;
    
    /* Single superellipse() value set for both corners */
    corner-left-shape: superellipse(1.2);
    corner-left-shape: superellipse(-2.5);
    
    /* Top corner, bottom corner */
    corner-left-shape: round bevel;
    corner-left-shape: bevel superellipse(1.2);
    
    /* Global values */
    corner-left-shape: inherit;
    corner-left-shape: initial;
    corner-left-shape: revert;
    corner-left-shape: revert-layer;
    corner-left-shape: unset;
    
### Values
The `corner-left-shape` property is specified using one or two `<corner-shape-value>` values:
  * If one value is used, it specifies the shape of both left-hand corners.
  * If two values are used, the first one specifies the shape of the top-left corner, and the second one specifies the shape of the bottom-left corner.


## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-left-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `20px 40px / 60px 80px`, and a `corner-left-shape` of `notch bevel`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 20px 40px / 60px 80px;
      corner-left-shape: notch bevel;
    }
    
#### Result
The rendered result looks like this:
# scroll-timeline-axis
The `scroll-timeline-axis` CSS property is used to specify the scrollbar direction that will be used to provide the timeline for a named scroll progress timeline animation, which is progressed through by scrolling a scrollable element (scroller) between top and bottom (or left and right). `scroll-timeline` is set on the scroller that will provide the timeline. See CSS scroll-driven animations for more details.
Note: If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.
The `scroll-timeline-axis` and `scroll-timeline-name` properties can also be set using the `scroll-timeline` shorthand property.
## Syntax
    
    /* Logical property values */
    scroll-timeline-axis: block;
    scroll-timeline-axis: inline;
    /* Non-logical property values */
    scroll-timeline-axis: y;
    scroll-timeline-axis: x;
    
### Values
Allowed values for `scroll-timeline-axis` are:
`block`
    
The scrollbar on the block axis of the scroller element, which is the axis in the direction perpendicular to the flow of text within a line. For horizontal writing modes, such as standard English, this is the same as `y`, while for vertical writing modes, it is the same as `x`. This is the default value.
`inline`
    
The scrollbar on the inline axis of the scroller element, which is the axis in the direction parallel to the flow of text in a line. For horizontal writing modes, this is the same as `x`, while for vertical writing modes, this is the same as `y`.
`y`
    
The scrollbar on the vertical axis of the scroller element.
`x`
    
The scrollbar on the horizontal axis of the scroller element.
## Examples
>
### Defining the axis of the scroll progress timeline
In this example, a scroll progress timeline named `--my-scroller` is defined using the `scroll-timeline-name` property on the `:root` element (`<html>`). This timeline is then applied to the animation on the element with the `animation` class using `animation-timeline: --my-scroller`.
To demonstrate the effect of `scroll-timeline-axis`, a horizontal (non-default) scrollbar is used in this example to drive the animation.
#### HTML
The HTML for the example is shown below.
    
    <body>
      <div class="content"></div>
      <div class="box animation"></div>
    </body>
    
#### CSS
The CSS for the container sets the `:root` as the source of a scroll progress timeline named `--my-scroller` using the `scroll-timeline-name` property. The scroll axis is set using `scroll-timeline-axis: x;` (Chromium) and `scroll-timeline-axis: horizontal;` (Firefox) — this causes the horizontal scrollbar position to determine the animation timeline.
The width of the `.content` element is set to a large value to make it overflow the `:root` element.
Also worth noting is that the `.animation` element has the timeline applied to it using `animation-timeline: --my-scroller;`, and it also has an `animation-duration` applied to it so that the example will work in Firefox.
    
    :root {
      scroll-timeline-name: --my-scroller;
    
      /* Chromium supports the new x/y syntax */
      scroll-timeline-axis: x;
      /* Firefox still supports the old horizontal/vertical syntax */
      scroll-timeline-axis: horizontal;
    }
    
    body {
      margin: 0;
      overflow-y: hidden;
    }
    
    .content {
      height: 100vh;
      width: 2000px;
    }
    
    .box {
      width: 100px;
      height: 100px;
      border-radius: 10px;
      background-color: rebeccapurple;
      position: fixed;
      top: 25px;
      left: 25px;
    }
    
    .animation {
      animation: rotate-appear;
      animation-timeline: --my-scroller;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes rotate-appear {
      from {
        rotate: 0deg;
        top: 0%;
      }
    
      to {
        rotate: 720deg;
        top: 100%;
      }
    }
    
#### Result
Scroll the horizontal bar at the bottom to see the square animate as you scroll.
# @font-feature-values
The `@font-feature-values` CSS at-rule lets you use a common name in the `font-variant-alternates` property for features activated differently in OpenType. This can help simplify your CSS when using multiple fonts.
The `@font-feature-values` at-rule may be used either at the top level of your CSS or inside any CSS conditional-group at-rule.
## Syntax
    
    @font-feature-values Font Name {
      font-display: swap;
      @styleset {
        nice-style: 12;
      }
      @swash {
        fancy: 2;
      }
    }
    
Each `@font-feature-values` block can contain a list of feature value blocks (listed below), as well as the `font-display` descriptor.
### Feature value blocks
`@swash`
    
Specifies a feature name that will work with the `swash()` functional notation of `font-variant-alternates`. A swash feature value definition allows only one value: `ident1: 2` is valid, but `ident2: 2 4` isn't.
`@annotation`
    
Specifies a feature name that will work with the `annotation()` functional notation of `font-variant-alternates`. An annotation feature value definition allows only one value: `ident1: 2` is valid, but `ident2: 2 4` isn't.
`@ornaments`
    
Specifies a feature name that will work with the `ornaments()` functional notation of `font-variant-alternates`. An ornaments feature value definition allows only one value: `ident1: 2` is valid, but `ident2: 2 4` isn't.
`@stylistic`
    
Specifies a feature name that will work with the `stylistic()` functional notation of `font-variant-alternates`. A stylistic feature value definition allows only one value: `ident1: 2` is valid, but `ident2: 2 4` isn't.
`@styleset`
    
Specifies a feature name that will work with the `styleset()` functional notation of `font-variant-alternates`. A styleset feature value definition allows an unlimited number of values: `ident1: 2 4 12 1` maps to the OpenType values `ss02`, `ss04`, `ss12`, and `ss01`. Note that values higher than `99` are valid, but don't map to any OpenType values and are ignored.
`@character-variant`
    
Specifies a feature name that will work with the `character-variant()` functional notation of `font-variant-alternates`. A character-variant feature value definition allows either one or two values: `ident1: 3` maps to `cv03=1`, and `ident2: 2 4` maps to `cv02=4`, but `ident2: 2 4 5` is invalid.
## Examples
>
### Using @styleset in a @font-feature-values rule
    
    /* At-rule for "nice-style" in Font One */
    @font-feature-values Font One {
      @styleset {
        nice-style: 12;
      }
    }
    
    /* At-rule for "nice-style" in Font Two */
    @font-feature-values Font Two {
      @styleset {
        nice-style: 4;
      }
    }
    
    /* Apply the at-rules with a single declaration */
    .nice-look {
      font-variant-alternates: styleset(nice-style);
    }
    
# :any-link
The `:any-link` CSS pseudo-class selector represents an element that acts as the source anchor of a hyperlink, independent of whether it has been visited. In other words, it matches every `<a>` or `<area>` element that has an `href` attribute. Thus, it matches all elements that match `:link` or `:visited`.
## Try it
    
    p {
      font-weight: bold;
    }
    
    a:any-link {
      color: forestgreen;
      text-decoration-color: hotpink;
    }
    
    
    <p>Pages that you might have visited:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org">MDN Web Docs</a>
      </li>
      <li>
        <a href="https://www.youtube.com/YouTube">Google</a>
      </li>
    </ul>
    <p>Pages unlikely to be in your history:</p>
    <ul>
      <li>
        <a href="https://developer.mozilla.org/missing-3">Random MDN page</a>
      </li>
      <li>
        <a href="https://example.com/missing-3">Random Example page</a>
      </li>
    </ul>
    
## Syntax
    
    :any-link {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <a href="https://example.com">External link</a><br />
    <a href="#">Internal target link</a><br />
    <a>Placeholder link (won't get styled)</a>
    
### CSS
    
    a:any-link {
      border: 1px solid blue;
      color: orange;
    }
    
    /* WebKit browsers */
    a:-webkit-any-link {
      border: 1px solid blue;
      color: orange;
    }
    
### Result
# margin-left
The `margin-left` CSS property sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
## Try it
    
    margin-left: 1em;
    
    
    margin-left: 10%;
    
    
    margin-left: 10px;
    
    
    margin-left: 0;
    
    
    <section id="default-example">
      <div id="container">
        <div class="col"></div>
        <div class="col transition-all" id="example-element"></div>
        <div class="col"></div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      justify-content: flex-start;
    }
    
    .col {
      width: 33.33%;
      border: solid #5b6dcd 10px;
      background-color: rgb(229 232 252 / 0.6);
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffc129;
      background-color: rgb(255 244 219 / 0.6);
    }
    
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
In the rare cases where width is overconstrained (i.e., when all of `width`, `margin-left`, `border`, `padding`, the content area, and `margin-right` are defined), `margin-left` is ignored, and will have the same calculated value as if the `auto` value was specified.
## Syntax
    
    /* <length> values */
    margin-left: 10px; /* An absolute length */
    margin-left: 1em; /* relative to the text size */
    margin-left: 5%; /* relative to the nearest block container's width */
    margin-left: anchor-size(self-inline);
    margin-left: calc(anchor-size(--my-anchor width, 20px) / 4);
    
    /* Keyword values */
    margin-left: auto;
    
    /* Global values */
    margin-left: inherit;
    margin-left: initial;
    margin-left: revert;
    margin-left: revert-layer;
    margin-left: unset;
    
The `margin-left` property is specified as the keyword `auto`, or a `<length>`, or a `<percentage>`. Its value can be positive, zero, or negative.
### Values
`<length>`
    
The size of the margin as a fixed value.
  * For anchor-positioned elements, the `anchor-size()` function resolves to a `<length>` value relative to the associated anchor element's width or height (see Setting element margin based on anchor size).


`<percentage>`
    
The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block.
`auto`
    
The left margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. If the values of `margin-left` and `margin-right` are both `auto`, the calculated space is evenly distributed. This table summarizes the different cases:
Value of `display` Value of `float` Value of `position` Computed value of `auto` Comment  
`inline`, `inline-block`, `inline-table` any `static` or `relative` `0` Inline layout mode  
`block`, `inline`, `inline-block`, `block`, `table`, `inline-table`, `list-item`, `table-caption` any `static` or `relative` `0`, except if both `margin-left` and `margin-right` are set to `auto`. In this case, it is set to the value centering the element inside its parent.  Block layout mode  
`block`, `inline`, `inline-block`, `block`, `table`, `inline-table`, `list-item`, `table-caption` `left` or `right` `static` or `relative` `0` Block layout mode (floating element)  
any `table-*`, except `table-caption` any any `0` Internal `table-*` elements don't have margins, use `border-spacing` instead   
any, except `flex`, `inline-flex`, or `table-*` any `fixed` or `absolute` `0`, except if both `margin-left` and `margin-right` are set to `auto`. In this case, it is set to the value centering the border area inside the available `width`, if fixed.  Absolutely positioned layout mode  
`flex`, `inline-flex` any any `0`, except if there is any positive horizontal free space. In this case, it is evenly distributed to all horizontal `auto` margins.  Flexbox layout mode  
## Examples
>
### Setting margin-left as a percentage
Percentage values for `margin-left` are relative to the container's inline size.
#### HTML
    
    <p>
      A large rose-tree stood near the entrance of the garden: the roses growing on
      it were white, but there were three gardeners at it, busily painting them red.
    </p>
    <p class="example">
      Alice thought this a very curious thing, and she went nearer to watch them,
      and just as she came up to them she heard one of them say, "Look out now,
      Five! Don't go splashing paint over me like that!"
    </p>
    <p>
      "I couldn't help it," said Five, in a sulky tone; "Seven jogged my elbow."
    </p>
    
#### CSS
    
    .example {
      margin-left: 50%;
    }
    
#### Result
# CSS environment variables
The CSS environment variables module defines the concept of environment variables and the `env()` function. Environment variables work similarly to custom properties and the `var()` function, except that they are globally defined; they are global variables scoped to the entire document. They are user agent values, provided by the browser or operating system, you can access using the `env()` function enabling you to adapt your styles to the user's device or context.
Environment variables provide values that can be used on the page based on information the user agent has access to, such as the size of the titlebar, dynamic keyboard, and safe area insets. Safe area insets define a rectangle that is guaranteed to be visible on non-rectangular displays, based on its distance from the edges of the viewport. You can include the user-agent sizes in your styles, enabling you to modify the layout of essential content based on the available space inside the safe area rectangle, next to a visible dynamic keyboard, or adjacent to a visible title bar.
## Reference
>
### Functions
  * `env()`


### Data types
  * `<environment-variable-name>`


## Guides
Using environment variables
    
An overview of what environment variables are, browser-defined environment variables, and how to use the `env()` function.
## Related concepts
  * custom properties
  * `var()`
  * `VirtualKeyboard` interface


# ::marker
The `::marker` CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to `display: list-item`, such as the `<li>` and `<summary>` elements.
## Try it
    
    li::marker {
      content: "✝ ";
      font-size: 1.2em;
    }
    
    
    <p>Group known as Mercury Seven:</p>
    <ul>
      <li>Malcolm Scott Carpenter</li>
      <li>Leroy Gordon (Gordo) Cooper Jr.</li>
      <li>John Herschel Glenn Jr.</li>
      <li>Virgil Ivan (Gus) Grissom</li>
      <li>Walter Marty (Wally) Schirra Jr.</li>
      <li>Alan Bartlett Shepard Jr.</li>
      <li>Donald Kent (Deke) Slayton</li>
    </ul>
    
## Allowable properties
The `::marker` pseudo-element supports a limited number of CSS properties, including:
  * All font properties
  * The `white-space` property
  * `color`
  * `text-combine-upright`, `unicode-bidi`, and `direction` properties
  * The `content` property
  * All animation and transition properties


Note: The specification states that additional CSS properties may be supported in the future.
## Syntax
    
    ::marker {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <ul>
      <li>Peaches</li>
      <li>Apples</li>
      <li>Plums</li>
    </ul>
    
### CSS
    
    ul li::marker {
      color: red;
      font-size: 1.5em;
    }
    
### Result
# border-right
The `border-right` shorthand CSS property sets all the properties of an element's right border.
## Try it
    
    border-right: solid;
    
    
    border-right: dashed red;
    
    
    border-right: 1rem solid;
    
    
    border-right: thick double #32a1ce;
    
    
    border-right: 4mm ridge rgb(211 220 50 / 0.6);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
As with all shorthand properties, `border-right` always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. Consider the following code:
    
    border-right-style: dotted;
    border-right: thick green;
    
It is actually the same as this one:
    
    border-right-style: dotted;
    border-right: none thick green;
    
The value of `border-right-style` given before `border-right` is ignored. Since the default value of `border-right-style` is `none`, not specifying the `border-style` part results in no border.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-right-color`
  * `border-right-style`
  * `border-right-width`


## Syntax
    
    border-right: 1px;
    border-right: 2px dotted;
    border-right: medium dashed green;
    
    /* Global values */
    border-right: inherit;
    border-right: initial;
    border-right: revert;
    border-right: revert-layer;
    border-right: unset;
    
The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.
### Values
`<br-width>`
    
See `border-right-width`.
`<br-style>`
    
See `border-right-style`.
`<color>`
    
See `border-right-color`.
## Examples
>
### Applying a right border
#### HTML
    
    <div>This box has a border on the right side.</div>
    
#### CSS
    
    div {
      border-right: 4px dashed blue;
      background-color: gold;
      height: 100px;
      width: 100px;
      font-weight: bold;
      text-align: center;
    }
    
#### Results
# max-inline-size
The `max-inline-size` CSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the `max-width` or the `max-height` property, depending on the value of `writing-mode`.
If the writing mode is vertically oriented, the value of `max-inline-size` relates to the maximal height of the element; otherwise, it relates to the maximal width of the element. A related property is `max-block-size`, which defines the other dimension of the element.
## Try it
    
    max-inline-size: 150px;
    writing-mode: horizontal-tb;
    
    
    max-inline-size: 150px;
    writing-mode: vertical-rl;
    
    
    max-inline-size: 20px;
    writing-mode: horizontal-tb;
    
    
    max-inline-size: 75%;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the max-inline-size.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    max-inline-size: 300px;
    max-inline-size: 25em;
    max-inline-size: anchor-size(width);
    max-inline-size: anchor-size(--my-anchor self-block, 200px);
    
    /* <percentage> values */
    max-inline-size: 75%;
    
    /* Keyword values */
    max-inline-size: none;
    max-inline-size: max-content;
    max-inline-size: min-content;
    max-inline-size: fit-content;
    max-inline-size: fit-content(20em);
    
    /* Global values */
    max-inline-size: inherit;
    max-inline-size: initial;
    max-inline-size: revert;
    max-inline-size: revert-layer;
    max-inline-size: unset;
    
### Values
The `max-inline-size` property takes the same values as the `max-width` and `max-height` properties.
## Examples
>
### Setting maximum inline size in pixels
#### HTML
    
    <p class="exampleText">Example text</p>
    
#### CSS
    
    .exampleText {
      writing-mode: vertical-rl;
      background-color: yellow;
      block-size: 100%;
      max-inline-size: 200px;
    }
    
#### Result
# break-before
The `break-before` CSS property sets how page, column, or region breaks should behave before a generated box. If there is no generated box, the property is ignored.
## Try it
    
    break-before: auto;
    
    
    break-before: page;
    
    
    <div>
      <p>
        The effect of this property can be noticed when the document is being
        printed or a preview of a print is displayed.
      </p>
      <button id="print-btn">Show Print Preview</button>
      <div class="box-container">
        <div class="box">Content before the property</div>
        <div class="box" id="example-element">Content with 'break-before'</div>
        <div class="box">Content after the property</div>
      </div>
    </div>
    
    
    .box {
      border: solid #5b6dcd 5px;
      background-color: #5b6dcd;
      margin: 10px 0;
      padding: 5px;
    }
    
    #example-element {
      border: solid 5px #ffc129;
      background-color: #ffc129;
      color: black;
    }
    
    
    const btn = document.getElementById("print-btn");
    
    btn.addEventListener("click", () => {
      window.print();
    });
    
## Syntax
    
    /* Generic break values */
    break-before: auto;
    break-before: avoid;
    break-before: always;
    break-before: all;
    
    /* Page break values */
    break-before: avoid-page;
    break-before: page;
    break-before: left;
    break-before: right;
    break-before: recto;
    break-before: verso;
    
    /* Column break values */
    break-before: avoid-column;
    break-before: column;
    
    /* Region break values */
    break-before: avoid-region;
    break-before: region;
    
    /* Global values */
    break-before: inherit;
    break-before: initial;
    break-before: revert;
    break-before: revert-layer;
    break-before: unset;
    
Each possible break point (in other words, each element boundary) is affected by three properties: the `break-after` value of the previous element, the `break-before` value of the next element, and the `break-inside` value of the containing element.
To determine if a break must be done, the following rules are applied:
  1. If any of the three concerned values is a forced break value (`always`, `left`, `right`, `page`, `column`, or `region`), it has precedence. If more than one of them are such a break, the one of the element that appears the latest in the flow is taken (i.e., the `break-before` value has precedence over the `break-after` value, which itself has precedence over the `break-inside` value).
  2. If any of the three concerned values is an avoid break value (`avoid`, `avoid-page`, `avoid-region`, or `avoid-column`), no such break will be applied at that point.


Once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding `avoid` value.
### Values
#### Generic break values
`auto`
    
Allows, but does not force, any break (page, column, or region) to be inserted right before the principal box.
`avoid`
    
Avoids any break (page, column, or region) from being inserted right before the principal box.
`always`
    
Forces a page break right after the principal box. The type of this break is that of the immediately-containing fragmentation context. If we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
`all`
    
Forces a page break right after the principal box. Breaking through all possible fragmentation contexts. So a break inside a multicol container, which was inside a page container would force a column and page break.
#### Page break values
`avoid-page`
    
Avoids any page break right before the principal box.
`page`
    
Forces a page break right before the principal box.
`left`
    
Forces one or two page breaks right before the principal box, whichever will make the next page into a left page. It's the page placed on the left side of the spine of the book or the back side of the page in duplex printing.
`right`
    
Forces one or two page breaks right before the principal box, whichever will make the next page into a right page. It's the page placed on the right side of the spine of the book or the front side of the page in duplex printing.
`recto`
    
Forces one or two page breaks right before the principal box, whichever will make the next page into a recto page. (A recto page is a right page in a left-to-right spread or a left page in a right-to-left spread.)
`verso`
    
Forces one or two page breaks right before the principal box, whichever will make the next page into a verso page. (A verso page is a left page in a left-to-right spread or a right page in a right-to-left spread.)
#### Column break values
`avoid-column`
    
Avoids any column break right before the principal box.
`column`
    
Forces a column break right before the principal box.
#### Region break values
`avoid-region`
    
Avoids any region break right before the principal box.
`region`
    
Forces a region break right before the principal box.
## Page break aliases
For compatibility reasons, the legacy `page-break-before` property should be treated by browsers as an alias of `break-before`. This ensures that sites using `page-break-before` continue to work as designed. A subset of values should be aliased as follows:
page-break-before break-before  
`auto` `auto`  
`left` `left`  
`right` `right`  
`avoid` `avoid`  
`always` `page`  
Note: The `always` value of `page-break-*` was implemented by browsers as a page break, and not as a column break. Therefore the aliasing is to `page`, rather than the `always` value in the Level 4 spec.
## Examples
>
### Breaking into neat columns
In the following example we have a container that contains an `<h1>` spanning all columns (achieved using `column-span: all`) and a series of `<h2>`s and paragraphs laid out in multiple columns using `column-width: 200px`.
By default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. However, we used `break-before: column` on the `<h2>` elements to force a column break before each one, meaning that you end up with an `<h2>` neatly at the top of each column.
#### HTML
    
    <article>
      <h1>Main heading</h1>
    
      <h2>Subheading</h2>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae
        fringilla mauris. Quisque commodo eget nisi sed pretium. Mauris luctus nec
        lacus in ultricies. Mauris vitae hendrerit arcu, ac scelerisque lacus.
        Aliquam lobortis in lacus sit amet posuere. Fusce iaculis urna id neque
        dapibus, eu lacinia lectus dictum.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        Praesent condimentum dui dui, sit amet rutrum diam tincidunt eu. Cras
        suscipit porta leo sit amet rutrum. Sed vehicula ornare tincidunt. Curabitur
        a ipsum ac diam mattis volutpat ac ut elit. Nullam luctus justo non
        vestibulum gravida. Morbi metus libero, pharetra non porttitor a, molestie
        nec nisi.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        Vivamus eleifend metus vitae neque placerat, eget interdum elit mattis.
        Donec eu vulputate nibh. Ut turpis leo, malesuada quis nisl nec, volutpat
        egestas tellus.
      </p>
    
      <h2>Subheading</h2>
    
      <p>
        In finibus viverra enim vel suscipit. Quisque consequat velit eu orci
        malesuada, ut interdum tortor molestie. Proin sed pellentesque augue. Nam
        risus justo, faucibus non porta a, congue vel massa. Cras luctus lacus nisl,
        sed tincidunt velit pharetra ac. Duis suscipit faucibus dui sed ultricies.
      </p>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
      letter-spacing: 2px;
      column-span: all;
    }
    
    h2 {
      font-size: 1.2rem;
      color: red;
      letter-spacing: 1px;
      break-before: column;
    }
    
    p {
      line-height: 1.5;
    }
    
    article {
      column-width: 200px;
      gap: 20px;
    }
    
### Result
# list-style
The `list-style` CSS shorthand property allows you to set all the list style properties at once.
## Try it
    
    list-style: square;
    
    
    list-style: inside;
    
    
    list-style: url("/shared-assets/images/examples/rocket.svg");
    
    
    list-style: none;
    
    
    list-style: georgian inside url("/shared-assets/images/examples/rocket.svg");
    
    
    list-style: georgian outside url("/non-existent.svg");
    
    
    <section class="default-example" id="default-example">
      <div>
        <p>NASA Notable Missions</p>
        <ul class="transition-all" id="example-element">
          <li>Apollo</li>
          <li>Hubble</li>
          <li>Chandra</li>
          <li>Cassini-Huygens</li>
          <li>Spitzer</li>
        </ul>
      </div>
    </section>
    
    
    .default-example {
      font-size: 1.2rem;
    }
    
    #example-element {
      width: 100%;
      background: #be094b;
      color: white;
    }
    
    section {
      text-align: left;
      flex-direction: column;
    }
    
    hr {
      width: 50%;
      color: lightgray;
      margin: 0.5em;
    }
    
    .note {
      font-size: 0.8rem;
    }
    
    .note a {
      color: #009e5f;
    }
    
    @counter-style space-counter {
      symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
      suffix: " ";
    }
    
The values of this property are applied to list items, including `<li>` elements and elements with ``display`: list-item;`. Because this property is inherited, it can be set on a parent element (normally `<ol>` or `<ul>`) to make the same list styling apply to all the nested items.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `list-style-image`
  * `list-style-position`
  * `list-style-type`


## Syntax
    
    /* type */
    list-style: square;
    
    /* image */
    list-style: url("../img/shape.png");
    
    /* position */
    list-style: inside;
    
    /* two values */
    list-style: georgian outside;
    list-style: url("img/pip.svg") inside;
    
    /* three values */
    list-style: lower-roman url("img/shape.png") outside;
    
    /* Keyword value */
    list-style: none;
    
    /* Global values */
    list-style: inherit;
    list-style: initial;
    list-style: revert;
    list-style: revert-layer;
    list-style: unset;
    
The `list-style` property is specified as one, two, or three values in any order. If `list-style-type` and `list-style-image` are both set, the `list-style-type` is used as a fallback if the image is unavailable.
### Values
`list-style-type`
    
A `<counter-style>`, `<string>`, or `none`. If omitted in the shorthand, the default `disc` value is used. See `list-style-type`.
`list-style-image`
    
An `<image>` or `none`. If omitted, the default `none` value is used. See `list-style-image`.
`list-style-position`
    
Either `inside` or `outside`. If omitted, the default `outside` value is used. See `list-style-position`.
`none`
    
No list style is used.
## Accessibility
Safari does not recognize ordered or unordered lists as lists in the accessibility tree if they have a `list-style` value of `none`, unless the list is nested within the `<nav>` navigation element. This behavior is intentional and is not considered a bug.
To ensure lists are announced as lists, include `role="list"` to `<ol>` and `<ul>` elements, especially if the list is not nested in a `<nav>`. This restores list semantics without affecting the design:
    
    <ul role="list">
      <li>An item</li>
      <li>Another item</li>
    </ul>
    
If an ARIA `role` is not an option for your code, CSS can be used instead. Adding non-empty pseudo-content such as text or images before each list item can restore list semantics, but impacts the visual appearance. Safari determines if the added pseudo-content suffices as accessible content, restoring list semantics if so. Generally, Safari considers text and images as sufficient, which is why the `content: "+ ";` shown below works (but requires additional styling to not affect the design).
    
    ul {
      list-style: none;
    }
    
    ul li::before {
      content: "+ ";
    }
    
A declaration of `content: "";` (an empty string) is ignored, as are `content` values that contain only spaces, such as `content: " ";`.
These CSS workarounds should only be used when an HTML solution is unavailable, and only after testing to ensure that they don't result in unexpected behaviors that may negatively impact user experience.
  * 'Fixing' Lists (2023)
  * VoiceOver and list-style-type: none (2017)
  * Understanding WCAG: Create content that can be presented in different ways
  * Understanding success criterion 1.3.1: Info and relationships | WCAG 2.1


## Examples
>
### Setting list style type and position
#### HTML
    
    List 1
    <ul class="one">
      <li>List Item1</li>
      <li>List Item2</li>
      <li>List Item3</li>
    </ul>
    List 2
    <ul class="two">
      <li>List Item A</li>
      <li>List Item B</li>
      <li>List Item C</li>
    </ul>
    
#### CSS
    
    .one {
      list-style: circle;
    }
    
    .two {
      list-style: square inside;
    }
    
#### Result
# math-depth
The `math-depth` property describes a notion of depth for each element of a mathematical formula, with respect to the top-level container of that formula. This is used to scale the computed value of the font-size of elements when `font-size: math` is applied.
Note: `font-size: math` is the default for `<math>` elements in the MathML Core User Agent stylesheet, so it's not necessary to specify it explicitly.
## Syntax
    
    /* Keyword values */
    math-depth: auto-add;
    
    /* Relative values */
    math-depth: add(2);
    math-depth: add(-2);
    
    /* Absolute value */
    math-depth: 4;
    
    /* Global values */
    math-depth: inherit;
    math-depth: initial;
    math-depth: revert;
    math-depth: revert-layer;
    math-depth: unset;
    
### Values
`auto-add`
    
Set to the inherited `math-depth` plus 1 when inherited math-style is `compact`.
`add(`<integer>`)`
    
Set to the inherited `math-depth` plus the specified integer.
`<integer>`
    
Set to the specified integer.
## Examples
>
### Specifying a math depth
The following example shows the effect of changing the `math-depth` property on the font size of subformulas. The numbers in each subformula indicate the `math-depth` and scale factor applied.
The first `<mtext>` element is used as a reference to other subformulas and has no specific styles applied. The second and third subformulas have `math-depth` set to `auto-add` and show the effect of scaling depending on the `math-style`.
The last two subformulas show the effect of setting `math-depth` to a specific value.
#### HTML
    
    <p>
      <math>
        <mtext>0</mtext>
    
        <!-- auto-add value has no effect when math-style is normal -->
        <mrow style="math-style: normal">
          <mrow style="math-depth: auto-add">
            <mtext>0</mtext>
          </mrow>
        </mrow>
    
        <!-- the inherited math-style is compact, so math-depth is set to 1 -->
        <mrow style="math-depth: auto-add">
          <mtext>1</mtext>
        </mrow>
    
        <mrow style="math-depth: add(2)">
          <mtext>2</mtext>
          <mrow style="math-depth: add(-1)">
            <mtext>1</mtext>
          </mrow>
          <mrow style="math-depth: 0">
            <mtext>0</mtext>
          </mrow>
        </mrow>
      </math>
    </p>
    
#### Result
# mod()
The `mod()` CSS function returns a modulus left over when the first parameter is divided by the second parameter, similar to the JavaScript remainder operator (`%`). The modulus is the value left over when one operand, the dividend, is divided by a second operand, the divisor. It always takes the sign of the divisor.
The calculation is `a - (Math.floor(a / b) * b)`. For example, the CSS `mod(21, -4)` function returns the remainder of `-3`. The full calculation is `21 - (Math.floor(21 / -4) * -4)`. When dividing `21` by `-4`, the result is `-5.25`. This is floored to `-6`. Multiplying `-6` by `-4` is `24`. Subtracting this `24` from the original `21`, the remainder is -3.
## Syntax
    
    /* Unitless <number> */
    line-height: mod(7, 2); /* 1 */
    line-height: mod(14, 5); /* 4 */
    line-height: mod(3.5, 2); /* 1.5 */
    
    /* Unit based <percentage> and <dimension> */
    margin: mod(15%, 2%); /* 1% */
    margin: mod(18px, 4px); /* 2px */
    margin: mod(19rem, 5rem); /* 4rem */
    margin: mod(29vmin, 6vmin); /* 5vmin */
    margin: mod(1000px, 29rem); /* 72px - if root font-size is 16px */
    
    /* Negative/positive values */
    rotate: mod(100deg, 30deg); /* 10deg */
    rotate: mod(135deg, -90deg); /* -45deg */
    rotate: mod(-70deg, 20deg); /* 10deg */
    rotate: mod(-70deg, -15deg); /* -10deg */
    
    /* Calculations */
    scale: mod(10 * 2, 1.7); /* 1.3 */
    rotate: mod(10turn, 18turn / 3); /* 4turn */
    transition-duration: mod(20s / 2, 3000ms * 2); /* 4s */
    
### Parameters
The `mod(dividend, divisor)` function accepts two comma-separated values as its parameters. Both parameters must have the same type, number, dimension, or `<percentage>`, for the function to be valid. While the units in the two parameters don't need to be the same, they do need of the same dimension type, such as `<length>`, `<angle>`, `<time>`, or `<frequency>` to be valid.
`dividend`
    
A calculation that resolves to a `<number>`, `<dimension>`, or `<percentage>` representing the dividend.
`divisor`
    
A calculation that resolves to a `<number>`, `<dimension>`, or `<percentage>` representing the divisor.
### Return value
Returns a `<number>`, `<dimension>`, or `<percentage>` (corresponds to the parameters' type) representing the modulus, that is, the operation left over.
  * If `divisor` is `0`, the result is `NaN`.
  * If `dividend` is `infinite`, the result is `NaN`.
  * If `divisor` is positive the result is positive (`0⁺`), and if `divisor` is negative the result is negative (`0⁻`).


# border-image-repeat
The `border-image-repeat` CSS property defines how the images for the sides and the middle part of the border image are scaled and tiled. The middle region can be displayed by using the keyword "fill" in the `border-image-slice` property.
## Try it
    
    border-image-repeat: stretch;
    
    
    border-image-repeat: repeat;
    
    
    border-image-repeat: round;
    
    
    border-image-repeat: space;
    
    
    border-image-repeat: round stretch;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
## Syntax
    
    /* Keyword value */
    border-image-repeat: stretch;
    border-image-repeat: repeat;
    border-image-repeat: round;
    border-image-repeat: space;
    
    /* top and bottom | left and right */
    border-image-repeat: round stretch;
    
    /* Global values */
    border-image-repeat: inherit;
    border-image-repeat: initial;
    border-image-repeat: revert;
    border-image-repeat: revert-layer;
    border-image-repeat: unset;
    
The `border-image-repeat` property may be specified using one or two values chosen from the list of values below.
  * When one value is specified, it applies the same behavior on all four sides.
  * When two values are specified, the first applies to the top, middle, and bottom, the second to the left and right.


### Values
`stretch`
    
The source image's edge regions are stretched to fill the gap between each border.
`repeat`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be clipped to achieve the proper fit.
`round`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be stretched to achieve the proper fit.
`space`
    
The source image's edge regions are tiled (repeated) to fill the gap between each border. Extra space will be distributed in between tiles to achieve the proper fit.
## Examples
>
### Repeating border images
#### CSS
    
    #bordered {
      width: 12rem;
      margin-bottom: 1rem;
      padding: 1rem;
      border: 40px solid;
      border-image: url("border.png") 27;
      border-image-repeat: stretch; /* Can be changed in the live sample */
    }
    
#### Results
# text-orientation
The `text-orientation` CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when `writing-mode` is not `horizontal-tb`). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers.
## Try it
    
    writing-mode: vertical-rl;
    text-orientation: mixed;
    
    
    writing-mode: vertical-rl;
    text-orientation: upright;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <p>
          In another moment down went Alice after it, never once considering how in
          the world she was to get out again.
        </p>
      </div>
    </section>
    
## Syntax
    
    /* Keyword values */
    text-orientation: mixed;
    text-orientation: upright;
    text-orientation: sideways-right;
    text-orientation: sideways;
    text-orientation: use-glyph-orientation;
    
    /* Global values */
    text-orientation: inherit;
    text-orientation: initial;
    text-orientation: revert;
    text-orientation: revert-layer;
    text-orientation: unset;
    
The `text-orientation` property is specified as a single keyword from the list below.
### Values
`mixed`
    
Rotates the characters of horizontal scripts 90° clockwise. Lays out the characters of vertical scripts naturally. Default value.
`upright`
    
Lays out the characters of horizontal scripts naturally (upright), as well as the glyphs for vertical scripts. Note that this keyword causes all characters to be considered as left-to-right: the used value of `direction` is forced to be `ltr`.
`sideways`
    
Causes characters to be laid out as they would be horizontally, but with the whole line rotated 90° clockwise.
`sideways-right`
    
An alias to `sideways` that is kept for compatibility purposes.
`use-glyph-orientation`
    
On SVG elements, this keyword leads to use the value of the deprecated SVG properties `glyph-orientation-vertical` and `glyph-orientation-horizontal`.
## Examples
>
### HTML
    
    <p>Lorem ipsum dolet semper quisquam.</p>
    
### CSS
    
    p {
      writing-mode: vertical-rl;
      text-orientation: upright;
    }
    
### Result
# overlay
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `overlay` CSS property specifies whether an element appearing in the top layer (for example, a shown popover or modal `<dialog>` element) is actually rendered in the top layer. This property is only relevant within a list of `transition-property` values, and only if `allow-discrete` is set as the `transition-behavior`.
It is important to note that `overlay` can only be set by the browser — author styles cannot change the `overlay` value of any element. You can, however, add `overlay` to the list of transition properties set on an element. This causes its removal from the top layer to be deferred so it can be animated instead of disappearing immediately.
Note: When transitioning `overlay`, you need to set `transition-behavior: allow-discrete` on the transition so that it will animate. `overlay` animations differ from normal discrete animations in that the visible (i.e., `auto`) state will always be shown for the full duration of the transition, regardless of whether it is the start or end state.
## Syntax
    
    /* Keyword values */
    overlay: auto;
    overlay: none;
    
    /* Global values */
    display: inherit;
    display: initial;
    display: revert;
    display: revert-layer;
    display: unset;
    
### Values
`auto`
    
The element is rendered in the top layer if it is promoted to the top layer.
`none`
    
The element is not rendered in the top layer.
## Examples
>
### Transitioning a popover
In this example, a popover is animated as it transitions from hidden to shown and back again.
#### HTML
The HTML contains a `<div>` element declared as a popover using the popover attribute, and a `<button>` element designated as the popover's display control using its popovertarget attribute.
    
    <button popovertarget="mypopover">Show the popover</button>
    <div popover="auto" id="mypopover">I'm a Popover! I should animate.</div>
    
#### CSS
The `overlay` property is only present in the list of transitioned properties. As `overlay` is a user-agent controlled property, it is not declared in the pre-transition or post-transition states.
    
    html {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    [popover]:popover-open {
      opacity: 1;
      transform: scaleX(1);
    }
    
    [popover] {
      font-size: 1.2rem;
      padding: 10px;
    
      /* Final state of the exit animation */
      opacity: 0;
      transform: scaleX(0);
    
      transition:
        opacity 0.7s,
        transform 0.7s,
        overlay 0.7s allow-discrete,
        display 0.7s allow-discrete;
      /* Equivalent to
      transition: all 0.7s allow-discrete; */
    }
    
    /* Needs to be included after the previous [popover]:popover-open
       rule to take effect, as the specificity is the same */
    @starting-style {
      [popover]:popover-open {
        opacity: 0;
        transform: scaleX(0);
      }
    }
    
    /* Transition for the popover's backdrop */
    
    [popover]::backdrop {
      background-color: transparent;
      transition:
        display 0.7s allow-discrete,
        overlay 0.7s allow-discrete,
        background-color 0.7s;
      /* Equivalent to
      transition: all 0.7s allow-discrete; */
    }
    
    [popover]:popover-open::backdrop {
      background-color: rgb(0 0 0 / 25%);
    }
    
    /* Nesting selectors (&) cannot represent pseudo-elements, so this 
       starting-style rule cannot be nested. */
    
    @starting-style {
      [popover]:popover-open::backdrop {
        background-color: transparent;
      }
    }
    
The two properties we want to animate are `opacity` and `transform`): we want the popover to fade in and out while growing and shrinking in the horizontal direction. We set a starting state for these properties on the default hidden state of the popover element (selected via `[popover]`), and an end state on the open state of the popover (selected via the `:popover-open` pseudo-class). We then set a `transition` property to animate between the two.
Because the animated element is being promoted to the top layer when shown and removed from the top layer when hidden, `overlay` is added to the list of transitioned elements. This ensures that the removal of the element from the top layer is deferred until the animation has ended. This doesn't make a huge difference for basic animations such as this one, but in more complex cases not doing this can result in the element being removed from the overlay too quickly, meaning the animation is not smooth or effective. Note that the `transition-behavior: allow-discrete` value is also set in the shorthand to enable discrete transitions.
The following steps are also required to get the animation working in both directions:
  * A starting state for the animation is set inside the `@starting-style` at-rule. This is needed to avoid unexpected behavior. By default transitions are not triggered on elements' first style updates, or when the `display` type changes from `none` to another type. `@starting-style` allows you to override that default in a specific controlled fashion. Without this, the entry animation would not occur and the popover would just appear.
  * `display` is also added to the list of transitioned elements so that the animated element is visible (set to `display: block`) throughout both the entry and exit animation. Without this, the exit animation would not be visible; in effect, the popover would just disappear. Again, `transition-behavior: allow-discrete` is required in this case for the animation to occur.


You'll note that we've also included a transition on the `::backdrop` that appears behind the popover when it opens, to provide a nice darkening animation. `[popover]:popover-open::backdrop` is needed to select the backdrop when the popover is open.
#### Result
The code renders as follows:
Note: Because popovers change from `display: none` to `display: block` each time they are shown, the popover transitions from its `@starting-style` styles to its `[popover]:popover-open` styles every time the entry transition occurs. When the popover closes, it transitions from its `[popover]:popover-open` state to the default `[popover]` state.
It is possible for the style transition on entry and exit to be different in such cases. See our Demonstration of when starting styles are used example for a proof of this.
# :checked
The `:checked` CSS pseudo-class selector represents any radio (`<input type="radio">`), checkbox (`<input type="checkbox">`), or option (`<option>` in a `<select>` element) that is checked or toggled to an `on` state.
## Try it
    
    label,
    input[type="submit"] {
      display: block;
      margin-top: 1em;
    }
    
    input:checked {
      border: none;
      outline: 2px solid deeppink;
    }
    
    
    <form>
      <p>How did you find out about us?</p>
      <label
        ><input name="origin" type="radio" value="google" checked /> Google</label
      >
      <label><input name="origin" type="radio" value="facebook" /> Facebook</label>
      <p>Please agree to our terms:</p>
    
      <label
        ><input name="newsletter" type="checkbox" checked /> I want to subscribe to
        a personalized newsletter.</label
      >
    
      <label
        ><input name="privacy" type="checkbox" /> I have read and I agree to the
        Privacy Policy.</label
      >
    
      <input type="submit" value="Submit form" />
    </form>
    
The user can engage this state by checking/selecting an element, or disengage it by unchecking/deselecting the element.
Note: Because browsers often treat `<option>`s as replaced elements, the extent to which they can be styled with the `:checked` pseudo-class varies from browser to browser. Customizable select element functionality can be used to enable full customization of `<option>` elements just like any regular DOM element, in supporting browsers.
## Syntax
    
    :checked {
      /* ... */
    }
    
## Examples
>
### Basic example
#### HTML
    
    <div>
      <input type="radio" name="my-input" id="yes" value="yes" />
      <label for="yes">Yes</label>
    
      <input type="radio" name="my-input" id="no" value="no" />
      <label for="no">No</label>
    </div>
    
    <div>
      <input type="checkbox" name="my-checkbox" id="opt-in" />
      <label for="opt-in">Check me!</label>
    </div>
    
    <select name="my-select" id="fruit">
      <option value="opt1">Apples</option>
      <option value="opt2">Grapes</option>
      <option value="opt3">Pears</option>
    </select>
    
#### CSS
    
    div,
    select {
      margin: 8px;
    }
    
    /* Labels for checked inputs */
    input:checked + label {
      color: red;
    }
    
    /* Radio element, when checked */
    input[type="radio"]:checked {
      box-shadow: 0 0 0 3px orange;
    }
    
    /* Checkbox element, when checked */
    input[type="checkbox"]:checked {
      box-shadow: 0 0 0 3px hotpink;
    }
    
    /* Option elements, when selected */
    option:checked {
      box-shadow: 0 0 0 3px lime;
      color: red;
    }
    
#### Result
### Toggling elements with a hidden checkbox
This example utilizes the `:checked` pseudo-class to let the user toggle content based on the state of a checkbox, all without using JavaScript.
#### HTML
    
    <input type="checkbox" id="expand-toggle" />
    
    <table>
      <thead>
        <tr>
          <th>Column #1</th>
          <th>Column #2</th>
          <th>Column #3</th>
        </tr>
      </thead>
      <tbody>
        <tr class="expandable">
          <td>[more text]</td>
          <td>[more text]</td>
          <td>[more text]</td>
        </tr>
        <tr>
          <td>[cell text]</td>
          <td>[cell text]</td>
          <td>[cell text]</td>
        </tr>
        <tr>
          <td>[cell text]</td>
          <td>[cell text]</td>
          <td>[cell text]</td>
        </tr>
        <tr class="expandable">
          <td>[more text]</td>
          <td>[more text]</td>
          <td>[more text]</td>
        </tr>
        <tr class="expandable">
          <td>[more text]</td>
          <td>[more text]</td>
          <td>[more text]</td>
        </tr>
      </tbody>
    </table>
    
    <label for="expand-toggle" id="expand-btn">Toggle hidden rows</label>
    
#### CSS
    
    /* Hide the toggle checkbox */
    #expand-toggle {
      display: none;
    }
    
    /* Hide expandable content by default */
    .expandable {
      visibility: collapse;
      background: #dddddd;
    }
    
    /* Style the button */
    #expand-btn {
      display: inline-block;
      margin-top: 12px;
      padding: 5px 11px;
      background-color: #ffff77;
      border: 1px solid;
      border-radius: 3px;
    }
    
    /* Show hidden content when the checkbox is checked */
    #expand-toggle:checked ~ * .expandable {
      visibility: visible;
    }
    
    /* Style the button when the checkbox is checked */
    #expand-toggle:checked ~ #expand-btn {
      background-color: #cccccc;
    }
    
#### Result
# border-block-end-width
The `border-block-end-width` CSS property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-end-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-block-end-width: thick;
    writing-mode: vertical-rl;
    
    
    border-block-end-width: 4px;
    writing-mode: horizontal-tb;
    
    
    border-block-end-width: 4px;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-width'> values */
    border-block-end-width: 5px;
    border-block-end-width: thick;
    
    /* Global values */
    border-block-end-width: inherit;
    border-block-end-width: initial;
    border-block-end-width: revert;
    border-block-end-width: revert-layer;
    border-block-end-width: unset;
    
Related properties are `border-block-start-width`, `border-inline-start-width`, and `border-inline-end-width`, which define the other border widths of the element.
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### Border width with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-block-end-width: 5px;
    }
    
#### Results
# accent-color
The `accent-color` CSS property sets the accent color for user-interface controls generated by some elements.
## Try it
    
    accent-color: red;
    
    
    accent-color: #74992e;
    
    
    accent-color: rgb(255 255 128);
    
    
    accent-color: hsl(250 100% 34%);
    
    
    <section class="default-example container" id="default-example">
      <div>
        <input checked="" id="example-element" type="checkbox" />
        <label for="example-element" id="example-label">Example Label</label>
      </div>
    </section>
    
    
    .container > div {
      display: flex;
      align-items: center;
    }
    
    #example-element {
      width: 40px;
      height: 40px;
    }
    
    #example-label {
      margin-left: 10px;
      font-size: x-large;
    }
    
Browsers that support `accent-color` currently apply it to the following HTML elements:
  * `<input type="checkbox">`
  * `<input type="radio">`
  * `<input type="range">`
  * `<progress>`


Each user agent has an accent color, with variations to ensure legibility and contrast. That accent color is not used by every user-interface control nor in every state of the control. The `accent-color` is only applied to user-interface controls that use an accent color in the states where it is applicable.
## Syntax
    
    /* Keyword values */
    accent-color: auto;
    
    /* <color> values */
    accent-color: darkred;
    accent-color: #5729e9;
    accent-color: rgb(0 200 0);
    accent-color: hsl(228 4% 24%);
    
    /* Global values */
    accent-color: inherit;
    accent-color: initial;
    accent-color: revert;
    accent-color: revert-layer;
    accent-color: unset;
    
### Values
`auto`
    
Represents a UA-chosen color, which should match the accent color of the platform, if any.
`<color>`
    
Specifies the color to be used as the accent color.
## Examples
>
### Setting a custom accent color
#### HTML
    
    <input type="checkbox" checked />
    <input type="checkbox" class="custom" checked />
    
#### CSS
    
    input {
      accent-color: auto;
      display: block;
      width: 30px;
      height: 30px;
    }
    
    input.custom {
      accent-color: rebeccapurple;
    }
    
#### Result
# inset-inline-start
The `inset-inline-start` CSS property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
This inset property has no effect on non-positioned elements.
## Try it
    
    writing-mode: horizontal-tb;
    
    
    writing-mode: vertical-rl;
    
    
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div class="example-container" id="example-element">
        <div id="abspos">
          I am absolutely positioned with inset-inline-start: 50px
        </div>
        <p>
          As much mud in the streets as if the waters had but newly retired from the
          face of the earth, and it would not be wonderful to meet a Megalosaurus,
          forty feet long or so, waddling like an elephantine lizard up Holborn
          Hill.
        </p>
      </div>
    </section>
    
    
    #example-element {
      border: 0.75em solid;
      padding: 0.75em;
      position: relative;
      width: 100%;
      min-height: 200px;
      unicode-bidi: bidi-override;
    }
    
    #abspos {
      background-color: yellow;
      color: black;
      border: 3px solid red;
      position: absolute;
      inset-inline-start: 50px;
      inline-size: 140px;
      min-block-size: 80px;
    }
    
## Syntax
    
    /* <length> values */
    inset-inline-start: 3px;
    inset-inline-start: 2.4em;
    inset-inline-start: calc(anchor(--my-anchor 50%) + 10px);
    inset-inline-start: anchor-size(width);
    
    /* <percentage>s of the width or height of the containing block */
    inset-inline-start: 10%;
    
    /* Keyword value */
    inset-inline-start: auto;
    
    /* Global values */
    inset-inline-start: inherit;
    inset-inline-start: initial;
    inset-inline-start: revert;
    inset-inline-start: revert-layer;
    inset-inline-start: unset;
    
The shorthand for `inset-inline-start` and `inset-inline-end` is `inset-inline`.
### Values
The `inset-inline-start` property takes the same values as the `left` property.
## Examples
>
### Setting inline start offset
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      position: relative;
      inset-inline-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# padding-right
The `padding-right` CSS property sets the width of the padding area on the right of an element.
## Try it
    
    padding-right: 1.5em;
    
    
    padding-right: 10%;
    
    
    padding-right: 20px;
    
    
    padding-right: 1ch;
    
    
    padding-right: 0;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
    }
    
An element's padding area is the space between its content and its border.
Note: The `padding` property can be used to set paddings on all four sides of an element with a single declaration.
## Syntax
    
    /* <length> values */
    padding-right: 0.5em;
    padding-right: 0;
    padding-right: 2cm;
    
    /* <percentage> value */
    padding-right: 10%;
    
    /* Global values */
    padding-right: inherit;
    padding-right: initial;
    padding-right: revert;
    padding-right: revert-layer;
    padding-right: unset;
    
The `padding-right` property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Examples
>
### Setting right padding using pixels and percentages
    
    .content {
      padding-right: 5%;
    }
    .side-box {
      padding-right: 10px;
    }
    
# <frequency-percentage>
The `<frequency-percentage>` CSS data type represents a value that can be either a `<frequency>` or a `<percentage>`. Frequency values, e.g., the pitch of a speaking voice, are not currently used in any CSS properties.
## Syntax
The value of a `<frequency-percentage>` is either a `<frequency>` or a `<percentage>`; see their individual reference pages for details about their syntaxes.
## Description
>
### Use in calc()
Where a `<frequency-percentage>` is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a `calc()` expression.
## Examples
>
### Valid percentage values
    
    90% Positive percentage
    +90% Positive percentage with leading +
    -90% Negative percentage — not valid for all properties that use percentages
    
### Invalid percentage values
    
    90 % No space is allowed between the number and the unit
    
### Valid frequency values
    
    12Hz     Positive integer
    4.3Hz    Non-integer
    14KhZ    The unit is case-insensitive, though non-SI capitalization is not recommended.
    +0Hz     Zero, with a leading + and a unit
    -0kHz    Zero, with a leading - and a unit
    
### Invalid frequency values
    
    12.0     This is a <number>, not an <frequency>, because it is missing a unit.
    7 Hz     No space is allowed between the number and the unit.
    0        Although unitless zero is an allowable <length>, it's an invalid <frequency>.
    
Currently, no browsers support this feature.
# <percentage>
The `<percentage>` CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent object. Numerous properties can use percentages, such as `width`, `height`, `margin`, `padding`, and `font-size`.
Note: Only calculated values can be inherited. Thus, even if a percentage value is used on the parent property, a real value (such as a width in pixels for a `<length>` value) will be accessible on the inherited property, not the percentage value.
## Syntax
The `<percentage>` data type consists of a `<number>` followed by the percentage sign (`%`). Optionally, it may be preceded by a single `+` or `-` sign, although negative values are not valid for all properties. As with all CSS dimensions, there is no space between the symbol and the number.
## Interpolation
When animated, values of the `<percentage>` data type are interpolated as real, floating-point numbers. The speed of the interpolation is determined by the easing function associated with the animation.
## Examples
>
### Width and margin-left
    
    <div class="container">
      <div class="box1">Width: 50%, Left margin: 20%</div>
      <div class="box2">Width: 30%, Left margin: 60%</div>
    </div>
    
    
    .container {
      background-color: navy;
    }
    
    .box1 {
      width: 50%;
      margin-left: 20%;
      background-color: chartreuse;
    }
    
    .box2 {
      width: 30%;
      margin-left: 60%;
      background-color: pink;
    }
    
### Font-size
    
    <div class="container">
      <p>Full-size text (18px)</p>
      <p><span class="half">50% (9px)</span></p>
      <p><span class="double">200% (36px)</span></p>
    </div>
    
    
    .container {
      font-size: 18px;
    }
    
    .half {
      font-size: 50%;
    }
    
    .double {
      font-size: 200%;
    }
    
# counter-increment
The `counter-increment` CSS property can be used to increase or decrease the value of the named CSS counters by the specified values, or to prevent all counters or an individual counter's value from being changed.
If a named counter in the list of space-separated counters and values doesn't exist, it will be created. If no value is provided for a counter in the list of counters, the counter will be increased by `1`.
The counter's value can be reset to any integer value with the `counter-reset` CSS property.
## Try it
    
    counter-increment: example-counter;
    
    
    counter-increment: example-counter 0;
    
    
    counter-increment: example-counter 5;
    
    
    counter-increment: example-counter -5;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Counter value:</div>
    </section>
    
    
    #default-example {
      text-align: left;
      counter-reset: example-counter;
    }
    
    #example-element::after {
      content: counter(example-counter);
    }
    
## Syntax
    
    /* Increases "my-counter" by 1 */
    counter-increment: my-counter;
    
    /* Decreases "my-counter" by 1 */
    counter-increment: my-counter -1;
    
    /* Increases "counter1" by 1 and decreases "counter2" by 4 */
    counter-increment: counter1 counter2 -4;
    
    /* Increases "page" by 1, "section" by 2, while "chapter" doesn't change */
    counter-increment: chapter 0 section 2 page;
    
    /* Do not increment/decrement anything: used to override less specific rules */
    counter-increment: none;
    
    /* Global values */
    counter-increment: inherit;
    counter-increment: initial;
    counter-increment: revert;
    counter-increment: revert-layer;
    counter-increment: unset;
    
### Values
The `counter-increment` property takes as its value either a list of space-separated counter names specified as `<custom-ident>` with an optional `<integer>` value or the keyword `none`. You may specify as many counters to increment as you want, with each name or name-number pair separated by a space.
`<custom-ident>`
    
Specifies the name of the counter to increase or decrease.
`<integer>`
    
Specifies the value to add to the counter. If the integer is preceded by a `-` sign, the value will be subtracted from the counter. Defaults to `1` if no value is specified.
`none`
    
Indicates that no counter must be increased or decreased. This value can also be used to cancel all counters from being increased or decreased in more specific rules. This is the default value of the property.
Note: Using the `none` value prevents all counters from being increased or decreased for the selected elements where this rule applies. To prevent only specific counters from being increased or decreased, set the `integer` value as `0` on the relevant counter(s).
## Examples
>
### Decreasing the counter value
In this example, we display a sequence of numbers counting backward. To do this, we use a counter to display numbers starting from 100 and decreasing by 7 each time.
#### HTML
    
    <div>
      <i></i><i></i><i></i><i></i><i></i><i></i><i></i> <i></i><i></i><i></i><i></i
      ><i></i><i></i><i></i> <i></i><i></i><i></i><i></i><i></i><i></i><i></i>
      <i></i><i></i><i></i><i></i><i></i><i></i><i></i>
    </div>
    
#### CSS
We set the initial value of the counter named `sevens` to `100` by using `counter-reset`. Then, for each `<i>`, we decrease the counter by `7`.
To set the first count at `100`, we target the first `<i>` element by using the `:first-of-type` pseudo-class and setting `counter-increment: none;`. Additionally, the `content` property is used in the `::before` pseudo-element to display the value of the counter using the `counter()` function.
    
    div {
      counter-reset: sevens 100;
    }
    i {
      counter-increment: sevens -7;
    }
    i:first-of-type {
      counter-increment: none;
    }
    i::before {
      content: counter(sevens);
    }
    
#### Result
Had we not used `counter-reset` (or `counter-set`) to create the counter and set the value to `100`, the `sevens` counter would still have been created, but with an initial value `0`.
# <overflow>
The `<overflow>` enumerated value type represents the keyword values for the `overflow-block`, `overflow-inline`, `overflow-x`, and `overflow-y` longhand properties and the `overflow` shorthand property. These properties apply to block containers, flex containers, and grid containers.
## Syntax
    
    <overflow> = visible | hidden | clip | scroll | auto
    
## Values
The `<overflow>` enumerated value type is specified using one of the values listed below.
`visible`
    
Overflow content is not clipped and may be visible outside the element's padding box. The element box is not a scroll container. This is the default value for all the properties that have the `<overflow>` enumerated value type.
`hidden`
    
Overflow content is clipped at the element's padding box. There are no scroll bars, and the clipped content is not visible (i.e., clipped content is hidden), but the content still exists. User agents do not add scrollbars and also do not allow users to view the content outside the clipped region by actions such as dragging on a touch screen or using the scroll wheel on a mouse. The content can be scrolled programmatically (for example, by setting the value of the `scrollLeft` property or the `scrollTo()` method). The content can also be scrolled via keyboard interaction; arrows enable scrolling through the content and tabbing to a focusable element within the hidden content enables scrolling the focused element into view. The element box on which this value is set is a scroll container.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property. As a result, content overflows the element's padding box by the `<length>` value of `overflow-clip-margin` or by `0px` if not set. Overflow content outside the clipped region is not visible, user agents do not add a scrollbar, and programmatic scrolling is also not supported. No new formatting context is created.
`scroll`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view using scrollbars. User agents display scrollbars in both horizontal and vertical directions if only one value is set, whether or not any content is overflowing or clipped. The use of this keyword value, therefore, can prevent scrollbars from appearing and disappearing as content changes. Printers may still print overflowing content. The element box on which this value is set is a scroll container.
`auto`
    
Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view. Unlike `scroll`, user agents display scrollbars only if the content is overflowing and hide scrollbars by default. If content fits inside the element's padding box, it looks the same as with `visible` but still establishes a new formatting context. The element box on which this value is set is a scroll container.
Note: The keyword value `overlay` is a legacy value alias for `auto`. With `overlay`, the scroll bars are drawn on top of the content instead of taking up space.
## Examples
This example demos all the `<overflow>` enumerated values for the `overflow` property.
### HTML
The HTML in this example contains some lyrics within the `<pre>` element. The HTML also contains a link text to enable testing the effects of keyboard focus on overflow and scroll behaviors. The same HTML code is repeated multiple times to show the effect of each `<overflow>` enumerated value.
    
    <pre>&nbsp;
    Oh, Rubber Duckie, you're the one
    You make bath time lots of fun
    Rubber Duckie, I'm awfully fond of you
    
    Rubber Duckie, joy of joys
    When I squeeze you, you make noise
    Rubber Duckie, you're my very best friend, it's true
    
    Oh, every day when I make my way to the tubby
    I find a little fella who's cute and yellow and chubby
    Rub-a-dub-dubby
    
    <a href="#">Rubber Duckie</a>, you're so fine
    And I'm lucky that you're mine
    Rubber Duckie, I'm awfully fond of you
    </pre>
    
### CSS
For the purpose of demonstration, the size of the `<pre>` element box has been defined to ensure that the content overflows its container in both the inline and block directions. A different `<overflow>` value is set for each of the repeating `<pre>` elements. For the `clip` value demonstration, a `overflow-clip-margin` has been added.
    
    pre {
      block-size: 100px;
      inline-size: 295px;
    }
    
    pre:nth-of-type(1) {
      overflow: hidden;
    }
    pre:nth-of-type(1)::before {
      content: "hidden: ";
    }
    
    pre:nth-of-type(2) {
      overflow: clip;
      overflow-clip-margin: 1em;
    }
    pre:nth-of-type(2)::before {
      content: "clip: ";
    }
    
    pre:nth-of-type(3) {
      overflow: scroll;
    }
    pre:nth-of-type(3)::before {
      content: "scroll: ";
    }
    
    pre:nth-of-type(4) {
      overflow: auto;
    }
    pre:nth-of-type(4)::before {
      content: "auto: ";
    }
    
    pre:nth-of-type(5) {
      overflow: clip;
      overflow: overlay;
      overflow-clip-margin: 3em;
    }
    pre:nth-of-type(5)::before {
      content: "overlay (or clip if not supported): ";
    }
    
    pre:nth-of-type(6) {
      overflow: visible;
    }
    pre:nth-of-type(6)::before {
      content: "visible: ";
    }
    
### Result
To see the effect of keyboard focus on overflow and scroll behaviors, try tabbing through all the links in the example. Notice that the `clip` box does not create a scroll container, and the link does not come into view when the link is focused. The `visible` value, which has the link always in view, is also not a scroll container.
# pointer-events
The `pointer-events` CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events.
## Try it
    
    pointer-events: auto;
    
    
    pointer-events: none;
    
    
    pointer-events: stroke; /* SVG-only */
    
    
    pointer-events: fill; /* SVG-only */
    
    
    <section class="flex-column" id="default-example">
      <div id="example-element">
        <p>
          <a href="#">example link</a>
        </p>
        <p>
          <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
            <a xlink:href="#">
              <circle
                cx="50"
                cy="50"
                fill="#3E6E84"
                r="40"
                stroke="#ffb500"
                stroke-width="5"></circle>
              <text fill="white" text-anchor="middle" x="50" y="55">SVG</text>
            </a>
          </svg>
        </p>
      </div>
    </section>
    
    
    #example-element {
      font-weight: bold;
    }
    
    #example-element a {
      color: #009e5f;
    }
    
    #example-element svg {
      width: 10em;
      height: 10em;
    }
    
## Syntax
    
    /* Keyword values */
    pointer-events: auto;
    pointer-events: none;
    
    /* Values used in SVGs */
    pointer-events: visiblePainted;
    pointer-events: visibleFill;
    pointer-events: visibleStroke;
    pointer-events: visible;
    pointer-events: painted;
    pointer-events: fill;
    pointer-events: stroke;
    pointer-events: bounding-box;
    pointer-events: all;
    
    /* Global values */
    pointer-events: inherit;
    pointer-events: initial;
    pointer-events: revert;
    pointer-events: revert-layer;
    pointer-events: unset;
    
The `pointer-events` property is specified as a single keyword chosen from the list of values below.
### Values
`auto`
    
The element behaves as it would if the `pointer-events` property were not specified. In SVG content, this value and the value `visiblePainted` have the same effect.
`none`
    
The element on its own is never the target of pointer events. However its subtree could be kept targetable by setting `pointer-events` to some other value. In these circumstances, pointer events will trigger event listeners on this parent element as appropriate on their way to or from the descendant during the event capture and bubble phases.
Note: The `pointerenter` and `pointerleave` events are fired when a pointing device is moved into an element or one of its descendants. So, even if `pointer-events: none` is set on the parent and not set on children, the events are triggered on the parent after the pointer is moved in or out of a descendant.
#### SVG only (experimental for HTML)
`visiblePainted`
    
SVG only (experimental for HTML). The element can only be the target of a pointer event when the `visibility` property is set to `visible` and e.g., when a mouse cursor is over the interior (i.e., 'fill') of the element and the `fill` property is set to a value other than `none`, or when a mouse cursor is over the perimeter (i.e., 'stroke') of the element and the `stroke` property is set to a value other than `none`.
`visibleFill`
    
SVG only. The element can only be the target of a pointer event when the `visibility` property is set to `visible` and when e.g., a mouse cursor is over the interior (i.e., fill) of the element. The value of the `fill` property does not affect event processing.
`visibleStroke`
    
SVG only. The element can only be the target of a pointer event when the `visibility` property is set to `visible` and e.g., when the mouse cursor is over the perimeter (i.e., stroke) of the element. The value of the `stroke` property does not affect event processing.
`visible`
    
SVG only (experimental for HTML). The element can be the target of a pointer event when the `visibility` property is set to `visible` and e.g., the mouse cursor is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the `fill` and `stroke` do not affect event processing.
`painted`
    
SVG only (experimental for HTML). The element can only be the target of a pointer event when e.g., the mouse cursor is over the interior (i.e., 'fill') of the element and the `fill` property is set to a value other than `none`, or when the mouse cursor is over the perimeter (i.e., 'stroke') of the element and the `stroke` property is set to a value other than `none`. The value of the `visibility` property does not affect event processing.
`fill`
    
SVG only. The element can only be the target of a pointer event when the pointer is over the interior (i.e., fill) of the element. The values of the `fill` and `visibility` properties do not affect event processing.
`stroke`
    
SVG only. The element can only be the target of a pointer event when the pointer is over the perimeter (i.e., stroke) of the element. The values of the `stroke` and `visibility` properties do not affect event processing.
`bounding-box`
    
SVG only. The element can only be the target of a pointer event when the pointer is over the bounding box of the element.
`all`
    
SVG only (experimental for HTML). The element can only be the target of a pointer event when the pointer is over the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the `fill`, `stroke`, and `visibility` properties do not affect event processing.
## Description
When this property is unspecified, the same characteristics of the `visiblePainted` value apply to SVG content.
In addition to indicating that the element is not the target of pointer events, the value `none` instructs the pointer event to go "through" the element and target whatever is "underneath" that element instead.
Note that preventing an element from being the target of pointer events by using `pointer-events` does not necessarily mean that pointer event listeners on that element cannot or will not be triggered. If one of the element's children has `pointer-events` explicitly set to allow that child to be the target of pointer events, then any events targeting that child will pass through the parent as the event travels along the parent chain, and trigger event listeners on the parent as appropriate. Of course any pointer activity at a point on the screen that is covered by the parent but not by the child will not be caught by either the child or the parent (it will go "through" the parent and target whatever is underneath).
Elements with `pointer-events: none` will still receive focus through sequential keyboard navigation using the `Tab` key.
## Examples
>
### Disabling pointer events on all images
This example disables pointer events (clicking, dragging, hovering, etc.) on all images.
    
    img {
      pointer-events: none;
    }
    
### Disabling pointer events on a single link
This example disables pointer events on the link to `http://example.com`.
#### HTML
    
    <ul>
      <li><a href="https://developer.mozilla.org">MDN</a></li>
      <li><a href="http://example.com">example.com</a></li>
    </ul>
    
#### CSS
    
    a[href="http://example.com"]
    {
      pointer-events: none;
    }
    
#### Result
# :-moz-first-node
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:-moz-first-node` CSS pseudo-class is a Mozilla extension that represents any element that is the first child node of some other element. It differs from `:first-child` because it does not match a first-child element with (non-whitespace) text before it.
Note: Any whitespace at the start of an element is ignored for the determination of `:-moz-first-node`.
## Syntax
    
    :-moz-first-node {
      /* ... */
    }
    
## Examples
>
### CSS
    
    span:-moz-first-node {
      background-color: lime;
    }
    
### HTML
    
    <p>
      <span>This matches!</span>
      <span>This doesn't match.</span>
    </p>
    
    <p>
      Blahblah.
      <span>This doesn't match because it's preceded by text.</span>
    </p>
    
### Result
Not part of any standard.
# stroke-linejoin
The `stroke-linejoin` CSS property defines the shape to be used at the corners of an SVG element's stroked paths. If present, it overrides the element's `stroke-linejoin` attribute.
This property applies to any SVG corner-generating shape or text-content element (see `stroke-linejoin` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements'
## Syntax
    
    /* keyword values */
    stroke-linejoin: bevel;
    stroke-linejoin: miter;
    stroke-linejoin: round;
    
    /* Global values */
    stroke-linejoin: inherit;
    stroke-linejoin: initial;
    stroke-linejoin: revert;
    stroke-linejoin: revert-layer;
    stroke-linejoin: unset;
    
### Values
`bevel`
    
Indicates that a bevelled corner is to be used to join path segments. The bevel is formed by truncating the corner by a line perpendicular to a line that bisects the difference in the subpath angles where they meet the join point.
`miter`
    
Indicates that a sharp corner is to be used to join path segments. The corner is formed by extending the outer edges of the stroke at the tangents of the path segments until they intersect. This is the default value.
`round`
    
Indicates that a round corner is to be used to join path segments. This is accomplished by cropping the join as per `bevel`, and then appending a filled arc tangent in order to round the corner.
The following values are defined, but not supported in any browser:
`arcs`
    
(Unsupported.) Indicates that an arcs corner is to be used to join path segments. The arc's shape is formed by extending the outer edges of the stroke at the join point with arcs that have the same curvature as the outer edges at the join point.
`crop`
    
(Unsupported.) Indicates the corner should extend past the join point by the minimum amount necessary to form a convex corner. This is functionally equivalent to `miter` (see above) with a `stroke-miterlimit` value of `1`.
`fallback`
    
(Unsupported; at risk.) behaves identically to `crop bevel` when the `stroke-miterlimit` value is exceeded.
## Examples
>
### Line-joining styles
This example demonstrates the three currently supported keyword values for `stroke-linejoin`.
#### HTML
We set up four identical paths, all of which have a black stroke with a width of one and no fill.
    
    <svg viewBox="0 0 15 12" xmlns="http://www.w3.org/2000/svg">
      <g stroke="black" stroke-width="1" fill="none">
        <path d="M2,5  a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" />
        <path d="M8,5  a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" />
        <path d="M2,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" />
        <path d="M8,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" />
      </g>
    </svg>
    
#### CSS
To each of the four paths, a supported line-joining value is applied. The first is beveled, the second rounded, the third mitered, and the fourth also mitered but with a `stroke-miterlimit` of `2`, which forces the corner to be beveled instead of mitered.
    
    path:nth-child(1) {
      stroke-linejoin: bevel;
    }
    path:nth-child(2) {
      stroke-linejoin: round;
    }
    path:nth-child(3) {
      stroke-linejoin: miter;
    }
    path:nth-child(4) {
      stroke-linejoin: miter;
      stroke-miterlimit: 2;
    }
    
#### Results
# offset-distance
The `offset-distance` CSS property specifies a position along an `offset-path` for an element to be placed.
## Try it
    
    offset-distance: 0%;
    
    
    offset-distance: 80%;
    
    
    offset-distance: 50px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #example-element {
      width: 24px;
      height: 24px;
      background: #2bc4a2;
      offset-path: path("M-70,-40 C-70,70 70,70 70,-40");
      clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
    }
    
    /* Provides a reference image of what path the element is following */
    #default-example {
      background-position: calc(50% - 12px) calc(50% + 14px);
      background-repeat: no-repeat;
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-75 -45 150 140" width="150" height="140"><path d="M-70,-40 C-70,70 70,70 70,-40" fill="none" stroke="lightgrey" stroke-width="2" stroke-dasharray="4.5"/></svg>');
    }
    
## Syntax
    
    /* Default value */
    offset-distance: 0;
    
    /* the middle of the offset-path */
    offset-distance: 50%;
    
    /* a fixed length positioned along the path */
    offset-distance: 40px;
    
    /* Global values */
    offset-distance: inherit;
    offset-distance: initial;
    offset-distance: revert;
    offset-distance: revert-layer;
    offset-distance: unset;
    
`<length-percentage>`
    
A length that specifies how far the element is along the path (defined with `offset-path`).
100% represents the total length of the path (when the `offset-path` is defined as a basic shape or `path()`).
## Examples
>
### Using offset-distance in an animation
The motion aspect in CSS Motion Path typically comes from animating the `offset-distance` property. If you want to animate an element along its full path, you would define its `offset-path` and then set up an animation that takes the `offset-distance` from `0%` to `100%`.
#### HTML
    
    <div id="motion-demo"></div>
    
#### CSS
    
    #motion-demo {
      offset-path: path("M20,20 C20,100 200,0 200,100");
      animation: move 3000ms infinite alternate ease-in-out;
      width: 40px;
      height: 40px;
      background: cyan;
    }
    
    @keyframes move {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
#### Result
# marker-end
The `marker-end` CSS property points to a marker that will be drawn on the last vertex of the element's path; that is, at its ending vertex. The marker must have been defined using an SVG `<marker>` element, and can only be referenced with a `<url>` value. The value of the CSS property overrides any values of the `marker-end` attribute in the SVG.
For many marker-supporting shapes, the first and last vertices are the same point: for example, the top left corner of a `<rect>`. In such shapes, if both the first and last markers are defined, two markers will be drawn at that point, though they may not face the same direction.
Note: The `marker-end` property will only have an effect for elements that can use SVG markers. See `marker-end` for a list.
## Syntax
    
    marker-end: none;
    marker-end: url("markers.svg#arrow");
    
    /* Global values */
    marker-end: inherit;
    marker-end: initial;
    marker-end: revert;
    marker-end: revert-layer;
    marker-end: unset;
    
### Values
`none`
    
This means no marker will be drawn at the last vertex of the element's path.
`<marker-ref>`
    
A `<url>` that refers to a marker defined by an SVG `<marker>` element, to be drawn at the last vertex of the element's path. If the URL reference is invalid, no marker will be drawn at the path's last vertex.
## Example
    
    <svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <marker
          id="triangle"
          viewBox="0 0 10 10"
          markerWidth="10"
          markerHeight="10"
          refX="1"
          refY="5"
          markerUnits="strokeWidth"
          orient="auto">
          <path d="M 0 0 L 10 5 L 0 10 z" fill="red" />
        </marker>
      </defs>
      <polyline
        id="test"
        fill="none"
        stroke="black"
        points="20,100 40,60 70,80 100,20" />
    </svg>
    
    
    polyline#test {
      marker-end: url("#triangle");
    }
    
# text-decoration-color
The `text-decoration-color` CSS property sets the color of decorations added to text by `text-decoration-line`.
The color applies to decorations, such as underlines, overlines, strikethroughs, and wavy lines like those used to mark misspellings, in the scope of the property's value.
## Try it
    
    text-decoration-color: red;
    
    
    text-decoration-color: #21ff21;
    
    
    text-decoration-color: rgb(255 90 255);
    
    
    text-decoration-color: hsl(70 100% 40%);
    
    
    text-decoration-color: currentColor;
    
    
    <section id="default-example">
      <p>
        I'd far rather be
        <span class="transition-all" id="example-element">happy than right</span>
        any day.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
    #example-element {
      text-decoration-line: underline;
    }
    
CSS does not provide a direct mechanism for specifying a unique color for each line type. This effect can nevertheless be achieved by nesting elements, applying a different line type to each element (with the `text-decoration-line` property), and specifying the line color (with `text-decoration-color`) on a per-element basis.
## Syntax
    
    /* <color> values */
    text-decoration-color: currentColor;
    text-decoration-color: red;
    text-decoration-color: #00ff00;
    text-decoration-color: rgb(255 128 128 / 50%);
    text-decoration-color: transparent;
    
    /* Global values */
    text-decoration-color: inherit;
    text-decoration-color: initial;
    text-decoration-color: revert;
    text-decoration-color: revert-layer;
    text-decoration-color: unset;
    
### Values
`<color>`
    
The color of the line decoration.
## Accessibility
It is important to ensure that the contrast ratio between the color of the text, the background the text is placed over, and the text decoration line is high enough that people experiencing low vision conditions will be able to read the content of the page. Color contrast ratio is determined by comparing the luminosity of the text and background color values.
Color alone should not be used to convey meaning. For example, change of text and text-decoration-color alone is not enough to indicate a link has focus.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


## Examples
>
### Basic example
    
    <p>
      This paragraph has <s>some erroneous text</s> inside it that I want to call
      attention to.
    </p>
    
    
    p {
      text-decoration-line: underline;
      text-decoration-color: cyan;
    }
    
    s {
      text-decoration-line: line-through;
      text-decoration-color: red;
      text-decoration-style: wavy;
    }
    
# border-block-end-color
The `border-block-end-color` CSS property defines the color of the logical block-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-end-color: red;
    writing-mode: horizontal-tb;
    
    
    border-block-end-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-block-end-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    
    
    border-block-end-color: hsl(60 90% 50% / 0.8);
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    border-block-end-color: yellow;
    border-block-end-color: #f5f6f7;
    
    /* Global values */
    border-block-end-color: inherit;
    border-block-end-color: initial;
    border-block-end-color: revert;
    border-block-end-color: revert-layer;
    border-block-end-color: unset;
    
Related properties are `border-block-start-color`, `border-inline-start-color`, and `border-inline-end-color`, which define the other border colors of the element.
### Values
`<color>`
    
The color of the border.
## Examples
>
### Border color with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-block-end-color: red;
    }
    
#### Results
# perspective
The `perspective` CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective.
## Try it
    
    perspective: none;
    
    
    perspective: 800px;
    
    
    perspective: 23rem;
    
    
    perspective: 5.5cm;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
      perspective: 800px;
      perspective-origin: 150% 150%;
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      perspective: 550px;
      transform-style: preserve-3d;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 0.7);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 0.7);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 0.7);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 0.7);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 0.7);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 0.7);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
## Syntax
    
    /* Keyword value */
    perspective: none;
    
    /* <length> values */
    perspective: 20px;
    perspective: 3.5em;
    
    /* Global values */
    perspective: inherit;
    perspective: initial;
    perspective: revert;
    perspective: revert-layer;
    perspective: unset;
    
### Values
`none`
    
Indicates that no perspective transform is to be applied.
`<length>`
    
A `<length>` giving the distance from the user to the z=0 plane. It is used to apply a perspective transform to the children of the element. Negative values are syntax errors. If the value is smaller than `1px`, it is clamped to `1px`.
## Description
Each 3D element with z>0 becomes larger; each 3D-element with z<0 becomes smaller. The strength of the effect is determined by the value of this property. Large values of `perspective` cause a small transformation; small values of `perspective` cause a large transformation.
The parts of the 3D elements that are behind the user — i.e., their z-axis coordinates are greater than the value of the `perspective` CSS property — are not drawn.
The vanishing point is by default placed at the center of the element, but its position can be changed using the `perspective-origin` property.
Using this property with a value other than `none` creates a new stacking context. Also, in that case, the object will act as a containing block for `position: fixed` elements that it contains.
## Examples
>
### Setting perspective
An example showing how a cube varies if the `perspective` is set at different positions is given in Using CSS transforms > Setting perspective.
# :out-of-range
The `:out-of-range` CSS pseudo-class represents an `<input>` element whose current value is outside the range limits specified by the `min` and `max` attributes.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:out-of-range {
      background-color: orangered;
    }
    
    
    <form>
      <label for="amount">How many tickets? (You can buy 2-6 tickets)</label>
      <input id="amount" name="amount" type="number" min="2" max="6" value="4" />
    
      <label for="dep">Departure Date: (Whole year 2022 is acceptable)</label>
      <input
        id="dep"
        name="dep"
        type="date"
        min="2022-01-01"
        max="2022-12-31"
        value="2025-05-05" />
    
      <label for="ret">Return Date: (Whole year 2022 is acceptable)</label>
      <input id="ret" name="ret" type="date" min="2022-01-01" max="2022-12-31" />
    </form>
    
This pseudo-class is useful for giving the user a visual indication that a field's current value is outside the permitted limits.
Note: This pseudo-class only applies to elements that have (and can take) a range limitation. In the absence of such a limitation, the element can neither be "in-range" nor "out-of-range."
## Syntax
    
    :out-of-range {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <form action="" id="form1">
      <p>Values between 1 and 10 are valid.</p>
      <ul>
        <li>
          <input
            id="value1"
            name="value1"
            type="number"
            placeholder="1 to 10"
            min="1"
            max="10"
            value="12" />
          <label for="value1">Your value is </label>
        </li>
      </ul>
    </form>
    
### CSS
    
    li {
      list-style: none;
      margin-bottom: 1em;
    }
    
    input {
      border: 1px solid black;
    }
    
    input:in-range {
      background-color: rgb(0 255 0 / 25%);
    }
    
    input:out-of-range {
      background-color: rgb(255 0 0 / 25%);
      border: 2px solid red;
    }
    
    input:in-range + label::after {
      content: "okay.";
    }
    
    input:out-of-range + label::after {
      content: "out of range!";
    }
    
### Result
# border-block-start-style
The `border-block-start-style` CSS property defines the style of the logical block start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-start-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-block-start-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-block-start-style: groove;
    writing-mode: horizontal-tb;
    
    
    border-block-start-style: dashed;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-style'> values */
    border-block-start-style: dashed;
    border-block-start-style: dotted;
    border-block-start-style: groove;
    
    /* Global values */
    border-block-start-style: inherit;
    border-block-start-style: initial;
    border-block-start-style: revert;
    border-block-start-style: revert-layer;
    border-block-start-style: unset;
    
Related properties are `border-block-end-style`, `border-inline-start-style`, and `border-inline-end-style`, which define the other border styles of the element.
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### Dashed border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-block-start-style: dashed;
    }
    
#### Results
# <generic-family>
The `<generic-family>` CSS data type represents the keyword values for generic font families used in the `font` shorthand and `font-family` longhand properties. The `<generic-family>` represents one or more locally-installed fonts belonging to that category of fonts.
## Syntax
>
### Values
The `<generic-family>` enumerated type is specified using one of the values listed below:
`serif`
    
A serif is a small line or stroke attached to the end of a larger stroke in a letter. In serif fonts, glyphs have finishing strokes, flared or tapering ends. Examples include Lucida Bright, Lucida Fax, Palatino, Palatino Linotype, Palladio, and URW Palladio.
`sans-serif`
    
A font without serifs; glyphs have plain stroke endings, without ornamentation. Example sans-serif fonts include Open Sans, Fira Sans, Lucida Sans, Lucida Sans Unicode, Trebuchet MS, Liberation Sans, and Nimbus Sans L.
`monospace`
    
All glyphs have the same fixed width. Example monospace fonts include Fira Mono, DejaVu Sans Mono, Menlo, Consolas, Liberation Mono, Monaco, and Lucida Console.
`cursive`
    
Glyphs in cursive fonts generally use a cursive script or other handwriting style, and the result looks more like handwritten pen or brush writing than printed typesetting. CSS uses the term "cursive" to apply to a font for any script, including those that do not have joining strokes. Example cursive fonts include Brush Script MT, Brush Script Std, Lucida Calligraphy, Lucida Handwriting, and Apple Chancery.
`fantasy`
    
Fantasy fonts are primarily decorative fonts that contain playful representations of characters. Example fantasy fonts include Papyrus, Herculanum, Party LET, Curlz MT, Harrington, and Comic Sans MS.
`system-ui`
    
Glyphs are taken from the default user interface font on a given platform. Because typographic traditions vary widely across the world, this generic family is provided for typefaces that don't map cleanly into the others.
`ui-serif`
    
The default user interface serif font. See the definition of `serif` above.
`ui-sans-serif`
    
The default user interface sans-serif font. See the definition of `sans-serif` above.
`ui-monospace`
    
The default user interface monospace font. See the definition of `monospace` above.
`ui-rounded`
    
The default user interface font that has rounded features.
`math`
    
Fonts for displaying mathematical expressions, for example superscript and subscript, brackets that cross several lines, nesting expressions, and double-struck glyphs with distinct meanings.
`emoji`
    
Fonts that are specifically designed to render emoji.
`fangsong`
    
A particular style of Chinese characters that are between serif-style Song and cursive-style Kai forms. This style is often used for government documents.
## Examples
This example demos several of the `<generic-family>` enumerated values for the `font-family` property.
### HTML
    
    <ul>
      <li class="serif">serif</li>
      <li class="sans-serif">sans-serif</li>
      <li class="monospace">monospace</li>
      <li class="cursive">cursive</li>
      <li class="fantasy">fantasy</li>
      <li class="system-ui">system-ui</li>
    </ul>
    
### CSS
    
    ul {
      font-size: 1.5rem;
      line-height: 2;
    }
    .serif {
      font-family: serif;
    }
    .sans-serif {
      font-family: sans-serif;
    }
    .monospace {
      font-family: monospace;
    }
    .cursive {
      font-family: cursive;
    }
    .fantasy {
      font-family: fantasy;
    }
    .system-ui {
      font-family: system-ui;
    }
    
### Result
# flex-wrap
The `flex-wrap` CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked.
## Try it
    
    flex-wrap: nowrap;
    
    
    flex-wrap: wrap;
    
    
    flex-wrap: wrap-reverse;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div>Item One</div>
        <div>Item Two</div>
        <div>Item Three</div>
        <div>Item Four</div>
        <div>Item Five</div>
        <div>Item Six</div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 80%;
      display: flex;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      width: 60px;
      margin: 10px;
    }
    
The `flex-flow` property shorthand can be used to set both the `flex-direction` and `flex-wrap` properties, which define the flex container's main and cross axes, respectively.
## Syntax
    
    flex-wrap: nowrap; /* Default value */
    flex-wrap: wrap;
    flex-wrap: wrap-reverse;
    
    /* Global values */
    flex-wrap: inherit;
    flex-wrap: initial;
    flex-wrap: revert;
    flex-wrap: revert-layer;
    flex-wrap: unset;
    
### Values
The `flex-wrap` property is specified as a single keyword chosen from the following values below:
`nowrap`
    
The flex items are laid out in a single line which may cause the flex container to overflow. The cross-start is the equivalent of inline-start or block-start, depending on the `flex-direction` value. This is the default value.
`wrap`
    
The flex items break into multiple lines. The cross-start is the equivalent of inline-start or block-start, depending on the current writing mode, and the `flex-direction` value.
`wrap-reverse`
    
Behaves the same as `wrap`, but cross-start and cross-end are inverted.
## Examples
>
### Setting flex container wrap values
#### HTML
    
    <h4>This is an example for flex-wrap:wrap</h4>
    <div class="content">
      <div class="red">1</div>
      <div class="green">2</div>
      <div class="blue">3</div>
    </div>
    <h4>This is an example for flex-wrap:nowrap</h4>
    <div class="content1">
      <div class="red">1</div>
      <div class="green">2</div>
      <div class="blue">3</div>
    </div>
    <h4>This is an example for flex-wrap:wrap-reverse</h4>
    <div class="content2">
      <div class="red">1</div>
      <div class="green">2</div>
      <div class="blue">3</div>
    </div>
    
#### CSS
    
    /* Common Styles */
    .content,
    .content1,
    .content2 {
      color: white;
      font: 100 24px/100px sans-serif;
      height: 150px;
      width: 897px;
      text-align: center;
    }
    
    .content div,
    .content1 div,
    .content2 div {
      height: 50%;
      width: 300px;
    }
    .red {
      background: orangered;
    }
    .green {
      background: yellowgreen;
    }
    .blue {
      background: steelblue;
    }
    
    /* Flexbox Styles */
    .content {
      display: flex;
      flex-wrap: wrap;
    }
    .content1 {
      display: flex;
      flex-wrap: nowrap;
    }
    .content2 {
      display: flex;
      flex-wrap: wrap-reverse;
    }
    
#### Results
# :is()
The `:is()` CSS pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list. This is useful for writing large selectors in a more compact form.
Note: Originally named `:matches()` (and `:any()`), this selector was renamed to `:is()` in CSSWG issue #3258.
## Try it
    
    ol {
      list-style-type: upper-alpha;
      color: darkblue;
    }
    
    :is(ol, ul, menu:unsupported) :is(ol, ul) {
      color: green;
    }
    
    :is(ol, ul) :is(ol, ul) ol {
      list-style-type: lower-greek;
      color: chocolate;
    }
    
    
    <ol>
      <li>Saturn</li>
      <li>
        <ul>
          <li>Mimas</li>
          <li>Enceladus</li>
          <li>
            <ol>
              <li>Voyager</li>
              <li>Cassini</li>
            </ol>
          </li>
          <li>Tethys</li>
        </ul>
      </li>
      <li>Uranus</li>
      <li>
        <ol>
          <li>Titania</li>
          <li>Oberon</li>
        </ol>
      </li>
    </ol>
    
## Syntax
    
    :is(<forgiving-selector-list>) {
      /* ... */
    }
    
### Parameters
The `:is()` pseudo-class requires a selector list, a comma-separated list of one or more selectors as its argument. The list must not contain a pseudo-element, but any other simple, compound, and complex selectors are allowed.
### Difference between :is() and :where()
The difference between the two is that `:is()` counts towards the specificity of the overall selector (it takes the specificity of its most specific argument), whereas `:where()` has a specificity value of 0. This is demonstrated by the example on the `:where()` reference page.
### Forgiving Selector Parsing
The specification defines `:is()` and `:where()` as accepting a forgiving selector list.
In CSS when using a selector list, if any of the selectors are invalid then the whole list is deemed invalid. When using `:is()` or `:where()` instead of the whole list of selectors being deemed invalid if one fails to parse, the incorrect or unsupported selector will be ignored and the others used.
    
    :is(:valid, :unsupported) {
      /* … */
    }
    
Will still parse correctly and match `:valid` even in browsers which don't support `:unsupported`, whereas:
    
    :valid,
    :unsupported {
      /* … */
    }
    
Will be ignored in browsers which don't support `:unsupported` even if they support `:valid`.
## Examples
>
### Simplifying list selectors
The `:is()` pseudo-class can greatly simplify your CSS selectors. For example, take the following CSS:
    
    /* 3-deep (or more) unordered lists use a square */
    ol ol ul,
    ol ul ul,
    ol menu ul,
    ol dir ul,
    ol ol menu,
    ol ul menu,
    ol menu menu,
    ol dir menu,
    ol ol dir,
    ol ul dir,
    ol menu dir,
    ol dir dir,
    ul ol ul,
    ul ul ul,
    ul menu ul,
    ul dir ul,
    ul ol menu,
    ul ul menu,
    ul menu menu,
    ul dir menu,
    ul ol dir,
    ul ul dir,
    ul menu dir,
    ul dir dir,
    menu ol ul,
    menu ul ul,
    menu menu ul,
    menu dir ul,
    menu ol menu,
    menu ul menu,
    menu menu menu,
    menu dir menu,
    menu ol dir,
    menu ul dir,
    menu menu dir,
    menu dir dir,
    dir ol ul,
    dir ul ul,
    dir menu ul,
    dir dir ul,
    dir ol menu,
    dir ul menu,
    dir menu menu,
    dir dir menu,
    dir ol dir,
    dir ul dir,
    dir menu dir,
    dir dir dir {
      list-style-type: square;
    }
    
You can replace it with:
    
    /* 3-deep (or more) unordered lists use a square */
    :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) :is(ul, menu, dir) {
      list-style-type: square;
    }
    
### Simplifying section selectors
The `:is()` pseudo-class is particularly useful when dealing with HTML sections and headings. Since `<section>`, `<article>`, `<aside>`, and `<nav>` are commonly nested together, without `:is()`, styling them to match one another can be tricky.
For example, without `:is()`, styling all the h1 elements at different depths could be very complicated:
    
    /* Level 0 */
    h1 {
      font-size: 30px;
    }
    
    /* Level 1 */
    section h1,
    article h1,
    aside h1,
    nav h1 {
      font-size: 25px;
    }
    
    /* Level 2 */
    section section h1,
    section article h1,
    section aside h1,
    section nav h1,
    article section h1,
    article article h1,
    article aside h1,
    article nav h1,
    aside section h1,
    aside article h1,
    aside aside h1,
    aside nav h1,
    nav section h1,
    nav article h1,
    nav aside h1,
    nav nav h1 {
      font-size: 20px;
    }
    
    /* Level 3 */
    /* don't even think about it! */
    
Using `:is()`, though, it's much easier:
    
    /* Level 0 */
    h1 {
      font-size: 30px;
    }
    /* Level 1 */
    :is(section, article, aside, nav) h1 {
      font-size: 25px;
    }
    /* Level 2 */
    :is(section, article, aside, nav) :is(section, article, aside, nav) h1 {
      font-size: 20px;
    }
    /* Level 3 */
    :is(section, article, aside, nav)
      :is(section, article, aside, nav)
      :is(section, article, aside, nav)
      h1 {
      font-size: 15px;
    }
    
### :is() does not select pseudo-elements
The `:is()` pseudo-class does not match pseudo-elements. So rather than this:
    
    some-element:is(::before, ::after) {
      display: block;
    }
    
or this:
    
    :is(some-element::before, some-element::after) {
      display: block;
    }
    
instead do:
    
    some-element::before,
    some-element::after {
      display: block;
    }
    
# :disabled
The `:disabled` CSS pseudo-class represents any disabled element. An element is disabled if it can't be activated (selected, clicked on, typed into, etc.) or accept focus. The element also has an enabled state, in which it can be activated or accept focus.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    *:disabled {
      background-color: dimgrey;
      color: linen;
      opacity: 1;
    }
    
    
    <form>
      <label for="name">Name:</label>
      <input id="name" name="name" type="text" />
    
      <label for="emp">Employed:</label>
      <select id="emp" name="emp" disabled>
        <option>No</option>
        <option>Yes</option>
      </select>
    
      <label for="empDate">Employment Date:</label>
      <input id="empDate" name="empDate" type="date" disabled />
    
      <label for="resume">Resume:</label>
      <input id="resume" name="resume" type="file" />
    </form>
    
## Syntax
    
    :disabled {
      /* ... */
    }
    
## Examples
This example shows a basic shipping form. It uses the JavaScript `change` event to let the user enable/disable the billing fields.
### HTML
    
    <form action="#">
      <fieldset id="shipping">
        <legend>Shipping address</legend>
        <input type="text" placeholder="Name" />
        <input type="text" placeholder="Address" />
        <input type="text" placeholder="Zip Code" />
      </fieldset>
      <br />
      <fieldset id="billing">
        <legend>Billing address</legend>
        <label for="billing-checkbox">Same as shipping address:</label>
        <input type="checkbox" id="billing-checkbox" checked />
        <br />
        <input type="text" placeholder="Name" disabled />
        <input type="text" placeholder="Address" disabled />
        <input type="text" placeholder="Zip Code" disabled />
      </fieldset>
    </form>
    
### CSS
    
    input[type="text"]:disabled {
      background: #cccccc;
    }
    
### JavaScript
Toggle the disabled input fields when the checkbox is clicked
    
    const checkbox = document.querySelector("#billing-checkbox");
    const billingItems = document.querySelectorAll('#billing input[type="text"]');
    
    checkbox.addEventListener("change", () => {
      billingItems.forEach((item) => {
        item.disabled = !item.disabled;
      });
    });
    
### Result
Check/un-check the checkbox to change the styling on the billing fields.
# :focus-visible
The `:focus-visible` pseudo-class applies while an element matches the `:focus` pseudo-class and the UA (User Agent) determines via heuristics that the focus should be made evident on the element. (Many browsers show a "focus ring" by default in this case.)
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    input:focus-visible {
      outline: 2px solid crimson;
      border-radius: 3px;
    }
    
    select:focus-visible {
      border: 2px dashed crimson;
      border-radius: 3px;
      outline: none;
    }
    
    
    <form>
      <p>Which flavor would you like to order?</p>
      <label>Full Name: <input name="firstName" type="text" /></label>
      <label
        >Flavor:
        <select name="flavor">
          <option>Cherry</option>
          <option>Green Tea</option>
          <option>Moose Tracks</option>
          <option>Mint Chip</option>
        </select>
      </label>
    </form>
    
This selector is useful to provide a different focus indicator based on the user's input modality (mouse vs. keyboard).
## Syntax
    
    :focus-visible {
      /* ... */
    }
    
## :focus vs :focus-visible
Originally, user-agent CSS set focus styles based only on the `:focus` pseudo-class, styling most focused elements with a focus ring outline. This meant all elements, including all links and buttons, had a focus ring applied when focused, which many found ugly. Because of the appearance, some authors removed the user-agent outline focus styles. Changing focus style can decrease usability, while removing focus styles makes keyboard navigation inaccessible for sighted users.
Browsers no longer visibly indicate focus (such as by drawing a "focus ring"), around each element when it has focus. Instead, they use a variety of heuristics to provide focus indicators only when it would be most helpful to the user. For instance, when a button is clicked using a pointing device, the focus is generally not visually indicated, but when a text box needing user input has focus, focus is indicated. While focus styles are always required when users are navigating the page with the keyboard or when focus is managed via scripts, focus styles are not required when the user knows where they are putting focus, such as when they use a pointing device such as a mouse or finger to physically set focus on an element, unless that element continues to need user attention.
The `:focus` pseudo-class always matches the currently-focused element. The `:focus-visible` pseudo-class also matches the focused element, but only if the user needs to be informed where the focus currently is. Because the `:focus-visible` pseudo-class matches the focused element when needed, using the `:focus-visible` (instead of the `:focus` pseudo-class) allows authors to change the appearance of the focus indicator without changing when the focus indicator appears.
When the `:focus` pseudo-class is used, it always targets the currently focused element. This means that when a user employs a pointing device, a visible focus ring appears around the focused element, which some consider obtrusive. The `:focus-visible` pseudo-class respects user agents' selective focus indication behavior while still allowing focus indicator customization.
## Accessibility
>
### Low vision
Make sure the visual focus indicator can be seen by people with low vision. This will also benefit anyone use a screen in a brightly lit space (like outside in the sun). WCAG 2.1 SC 1.4.11 Non-Text Contrast requires that the visual focus indicator be at least 3 to 1.
  * Accessible Visual Focus Indicators: Give Your Site Some Focus! Tips for Designing Useful and Usable Focus Indicators


### Cognition
It may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed forms of input. For users with cognitive concerns, or who are less technologically literate, this lack of consistent behavior for interactive elements may be confusing.
## Examples
>
### Comparing :focus and :focus-visible
This example presents three pairs of controls. Each pair consists of a `text` input and a button.
  * The first pair does not add any custom styles for focus states, and shows the default case.
  * The second pair adds styles using the `:focus` pseudo-class.
  * The third pair adds styles using the `:focus-visible` pseudo-class.


    
    <input type="text" value="Default styles" /><br />
    <button>Default styles</button><br />
    
    <input class="focus-only" type="text" value=":focus" /><br />
    <button class="focus-only">:focus</button><br />
    
    <input class="focus-visible-only" type="text" value=":focus-visible" /><br />
    <button class="focus-visible-only">:focus-visible</button>
    
    
    input,
    button {
      margin: 10px;
    }
    
    .focus-only:focus {
      outline: 2px solid black;
    }
    
    .focus-visible-only:focus-visible {
      outline: 4px dashed darkorange;
    }
    
If you click each element in turn, you will see that when `:focus` is used to style the focus ring, the UA draws the focus ring when the user clicks the button. However, when `:focus-visible` is used to style the focus ring, the UA does not draw the focus ring when the user clicks the button, just like in the default case.
If you then tab through each element, you will see that in all three cases — default, `:focus`, and `:focus-visible` — the UA draws the focus ring around the button when the user navigates to it with the keyboard.
This shows how `:focus-visible` enables a designer to follow the browser's logic in determining when a focus ring should be shown.
### Providing a :focus fallback
If your code has to work in old browser versions that do not support `:focus-visible`, check supports of `:focus-visible` with `@supports` and repeat the same focus styling in it, but inside a `:focus` rule. Note that even if you do not specify anything at all for `:focus`, old browsers will simply display the native outline, which can be enough.
    
    <button class="button with-fallback" type="button">Button with fallback</button>
    <button class="button without-fallback" type="button">
      Button without fallback
    </button>
    
    
    .button {
      margin: 10px;
      border: 2px solid darkgray;
      border-radius: 4px;
    }
    
    .button:focus-visible {
      /* Draw the focus when :focus-visible is supported */
      outline: 3px solid deepskyblue;
      outline-offset: 3px;
    }
    
    @supports not selector(:focus-visible) {
      .button.with-fallback:focus {
        /* Fallback for browsers without :focus-visible support */
        outline: 3px solid deepskyblue;
        outline-offset: 3px;
      }
    }
    
# <display-inside>
These keywords specify the element's inner `display` type, which defines the type of formatting context that lays out its contents (assuming it is a non-replaced element). These keywords are used as values of the `display` property, and can be used for legacy purposes as a single keyword, or as defined in the Level 3 specification alongside a value from the `<display-outside>` keywords.
## Syntax
Valid `<display-inside>` values:
`flow`
    
The element lays out its contents using flow layout (block-and-inline layout).
If its outer display type is `inline`, and it is participating in a block or inline formatting context, then it generates an inline box. Otherwise it generates a block container box.
Depending on the value of other properties (such as `position`, `float`, or `overflow`) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (BFC) for its contents or integrates its contents into its parent formatting context.
`flow-root`
    
The element generates a block element box that establishes a new block formatting context, defining where the formatting root lies.
`table`
    
These elements behave like HTML `<table>` elements. It defines a block-level box.
`flex`
    
The element behaves like a block element and lays out its content according to the flexbox model.
`grid`
    
The element behaves like a block element and lays out its content according to the grid model.
`ruby`
    
The element behaves like an inline element and lays out its content according to the ruby formatting model. It behaves like the corresponding HTML `<ruby>` elements.
Note: Browsers that support the two value syntax, on finding the inner value only, such as when `display: flex` or `display: grid` is specified, will set their outer value to `block`. This will result in expected behavior; for example if you specify an element to be `display: grid`, you would expect that the box created on the grid container would be a block level box.
## Examples
In this example the parent box has been given `display: flow-root` and so establishes a new BFC and contains the floated item.
### HTML
    
    <div class="box">
      <div class="float">I am a floated box!</div>
      <p>I am content inside the container.</p>
    </div>
    
### CSS
    
    .box {
      background-color: rgb(224 206 247);
      border: 5px solid rebeccapurple;
      display: flow-root;
    }
    
    .float {
      float: left;
      width: 200px;
      height: 150px;
      background-color: white;
      border: 1px solid black;
      padding: 10px;
    }
    
### Result
>
### css.properties.display.flow-root
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-inside` 58 79 53 45 13 58 53 43 13 7.0 58 13  
### css.properties.display.table
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-inside` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.flex
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-inside` 2921 12 20Firefox 28 added multi-line flexbox support. 161512.1–15 97 2925 20Firefox for Android 28 added multi-line flexbox support. 161412.1–14 97 2.01.5 4.44.4 97  
### css.properties.display.grid
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-inside` 57 1612 52 44 10.1 57 52 43 10.3 6.0Samsung Internet added this earlier than the corresponding Chrome version would indicate. 57 10.3  
### css.properties.display.ruby
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-inside` 121 12–79 38 107 No 121 38 81 No 25.0 121 No  
# scroll-padding-block
The `scroll-padding-block` shorthand property sets the scroll padding of an element in the block dimension.
## Try it
    
    scroll-padding-block: 0;
    
    
    scroll-padding-block: 20px;
    
    
    scroll-padding-block: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-padding-block-end`
  * `scroll-padding-block-start`


## Syntax
    
    /* Keyword values */
    scroll-padding-block: auto;
    
    /* <length> values */
    scroll-padding-block: 10px;
    scroll-padding-block: 1em 0.5em;
    scroll-padding-block: 10%;
    
    /* Global values */
    scroll-padding-block: inherit;
    scroll-padding-block: initial;
    scroll-padding-block: revert;
    scroll-padding-block: revert-layer;
    scroll-padding-block: unset;
    
### Values
`<length-percentage>`
    
An inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.
`auto`
    
The offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
# <named-color>
The `<named-color>` CSS data type is the name of a color, such as `red`, `blue`, `black`, or `lightseagreen`. Syntactically, a `<named-color>` is an `<ident>`.
A `<named-color>` value can be used anywhere a `<color>` can be used.
## Syntax
    
    color: red;
    color: orange;
    color: tan;
    color: rebeccapurple;
    color: transparent;
    
### Value
Named colors consists of standard colors, the `transparent` and `currentColor` keywords.
#### Standard colors
Basic colors have standard, easy-to-remember names:
Keyword RGB hex value Sample  
`black` `#000000`  
`silver` `#c0c0c0`  
`gray` `#808080`  
`white` `#ffffff`  
`maroon` `#800000`  
`red` `#ff0000`  
`purple` `#800080`  
`fuchsia` `#ff00ff`  
`green` `#008000`  
`lime` `#00ff00`  
`olive` `#808000`  
`yellow` `#ffff00`  
`navy` `#000080`  
`blue` `#0000ff`  
`teal` `#008080`  
`aqua` `#00ffff`  
In addition to these 16 colors, about 150 other colors have a keyword associated to them:
Keyword RGB hex value Sample  
`aliceblue` `#f0f8ff`  
`antiquewhite` `#faebd7`  
`aqua` `#00ffff`  
`aquamarine` `#7fffd4`  
`azure` `#f0ffff`  
`beige` `#f5f5dc`  
`bisque` `#ffe4c4`  
`black` `#000000`  
`blanchedalmond` `#ffebcd`  
`blue` `#0000ff`  
`blueviolet` `#8a2be2`  
`brown` `#a52a2a`  
`burlywood` `#deb887`  
`cadetblue` `#5f9ea0`  
`chartreuse` `#7fff00`  
`chocolate` `#d2691e`  
`coral` `#ff7f50`  
`cornflowerblue` `#6495ed`  
`cornsilk` `#fff8dc`  
`crimson` `#dc143c`  
`cyan`  
`#00ffff` (synonym of `aqua`)  
`darkblue` `#00008b`  
`darkcyan` `#008b8b`  
`darkgoldenrod` `#b8860b`  
`darkgray` `#a9a9a9`  
`darkgreen` `#006400`  
`darkgrey` `#a9a9a9`  
`darkkhaki` `#bdb76b`  
`darkmagenta` `#8b008b`  
`darkolivegreen` `#556b2f`  
`darkorange` `#ff8c00`  
`darkorchid` `#9932cc`  
`darkred` `#8b0000`  
`darksalmon` `#e9967a`  
`darkseagreen` `#8fbc8f`  
`darkslateblue` `#483d8b`  
`darkslategray` `#2f4f4f`  
`darkslategrey` `#2f4f4f`  
`darkturquoise` `#00ced1`  
`darkviolet` `#9400d3`  
`deeppink` `#ff1493`  
`deepskyblue` `#00bfff`  
`dimgray` `#696969`  
`dimgrey` `#696969`  
`dodgerblue` `#1e90ff`  
`firebrick` `#b22222`  
`floralwhite` `#fffaf0`  
`forestgreen` `#228b22`  
`fuchsia` `#ff00ff`  
`gainsboro` `#dcdcdc`  
`ghostwhite` `#f8f8ff`  
`gold` `#ffd700`  
`goldenrod` `#daa520`  
`gray` `#808080`  
`green` `#008000`  
`greenyellow` `#adff2f`  
`grey` `#808080` (synonym of `gray`)  
`honeydew` `#f0fff0`  
`hotpink` `#ff69b4`  
`indianred` `#cd5c5c`  
`indigo` `#4b0082`  
`ivory` `#fffff0`  
`khaki` `#f0e68c`  
`lavender` `#e6e6fa`  
`lavenderblush` `#fff0f5`  
`lawngreen` `#7cfc00`  
`lemonchiffon` `#fffacd`  
`lightblue` `#add8e6`  
`lightcoral` `#f08080`  
`lightcyan` `#e0ffff`  
`lightgoldenrodyellow` `#fafad2`  
`lightgray` `#d3d3d3`  
`lightgreen` `#90ee90`  
`lightgrey` `#d3d3d3`  
`lightpink` `#ffb6c1`  
`lightsalmon` `#ffa07a`  
`lightseagreen` `#20b2aa`  
`lightskyblue` `#87cefa`  
`lightslategray` `#778899`  
`lightslategrey` `#778899`  
`lightsteelblue` `#b0c4de`  
`lightyellow` `#ffffe0`  
`lime` `#00ff00`  
`limegreen` `#32cd32`  
`linen` `#faf0e6`  
`magenta`  
`#ff00ff` (synonym of `fuchsia`)  
`maroon` `#800000`  
`mediumaquamarine` `#66cdaa`  
`mediumblue` `#0000cd`  
`mediumorchid` `#ba55d3`  
`mediumpurple` `#9370db`  
`mediumseagreen` `#3cb371`  
`mediumslateblue` `#7b68ee`  
`mediumspringgreen` `#00fa9a`  
`mediumturquoise` `#48d1cc`  
`mediumvioletred` `#c71585`  
`midnightblue` `#191970`  
`mintcream` `#f5fffa`  
`mistyrose` `#ffe4e1`  
`moccasin` `#ffe4b5`  
`navajowhite` `#ffdead`  
`navy` `#000080`  
`oldlace` `#fdf5e6`  
`olive` `#808000`  
`olivedrab` `#6b8e23`  
`orange` `#ffa500`  
`orangered` `#ff4500`  
`orchid` `#da70d6`  
`palegoldenrod` `#eee8aa`  
`palegreen` `#98fb98`  
`paleturquoise` `#afeeee`  
`palevioletred` `#db7093`  
`papayawhip` `#ffefd5`  
`peachpuff` `#ffdab9`  
`peru` `#cd853f`  
`pink` `#ffc0cb`  
`plum` `#dda0dd`  
`powderblue` `#b0e0e6`  
`purple` `#800080`  
`rebeccapurple` `#663399`  
`red` `#ff0000`  
`rosybrown` `#bc8f8f`  
`royalblue` `#4169e1`  
`saddlebrown` `#8b4513`  
`salmon` `#fa8072`  
`sandybrown` `#f4a460`  
`seagreen` `#2e8b57`  
`seashell` `#fff5ee`  
`sienna` `#a0522d`  
`silver` `#c0c0c0`  
`skyblue` `#87ceeb`  
`slateblue` `#6a5acd`  
`slategray` `#708090`  
`slategrey` `#708090`  
`snow` `#fffafa`  
`springgreen` `#00ff7f`  
`steelblue` `#4682b4`  
`tan` `#d2b48c`  
`teal` `#008080`  
`thistle` `#d8bfd8`  
`tomato` `#ff6347`  
`transparent` See transparent.  
`turquoise` `#40e0d0`  
`violet` `#ee82ee`  
`wheat` `#f5deb3`  
`white` `#ffffff`  
`whitesmoke` `#f5f5f5`  
`yellow` `#ffff00`  
`yellowgreen` `#9acd32`  
Initially, in CSS Level 1, only 16 basic colors were defined, with `orange` added in CSS Level 2. Web designers found this list too short, and browser vendors added numerous names for colors based on the X11 color names. In SVG 1, then in CSS Colors Level 3, these names got standardized, formally defined, and made uniform (some had different spellings that are now aliases). They are called extended color keywords, X11 colors, or SVG colors.
In CSS Colors Level 4, an additional color, `rebeccapurple` was added to honor web pioneer Eric Meyer.
### transparent
The `transparent` keyword represents a fully transparent color. This makes the background behind the colored item completely visible. Technically, `transparent` is a shortcut for `rgb(0 0 0 / 0%)`.
To prevent unexpected behavior, such as in a `<gradient>`, the current CSS spec states that `transparent` should be calculated in the alpha-premultiplied color space. However, be aware that older browsers may treat it as black with an alpha value of `0`.
The `transparent` keyword wasn't a true color in CSS Level 2 (Revision 1). It was a special keyword that could be used instead of a regular `<color>` value on two CSS properties: `background` and `border`. It was essentially added to allow developers to override an inherited solid color. With the advent of alpha channels in CSS Colors Level 3, `transparent` was redefined as a true color. It can now be used wherever a `<color>` value can be used.
## Description
All names specify a color in the sRGB color space. Although the names more or less describe their respective colors, they are essentially artificial, without a strict rationale behind the terms used.
The color keywords all represent plain, solid colors without transparency.
Several keywords are aliases for each other:
  * `aqua` / `cyan`
  * `fuchsia` / `magenta`
  * `darkgray` / `darkgrey`
  * `darkslategray` / `darkslategrey`
  * `dimgray` / `dimgrey`
  * `lightgray` / `lightgrey`
  * `lightslategray` / `lightslategrey`
  * `gray` / `grey`
  * `slategray` / `slategrey`


Though many keywords have been adapted from X11, their RGB values may differ from the corresponding color on X11 systems since manufacturers sometimes tailor X11 colors to their specific hardware.
## Examples
>
### Using named colors
#### HTML
    
    <div id="container">
      <div id="one"></div>
      <div id="two"></div>
      <div id="three"></div>
    </div>
    
#### CSS
    
    #container {
      display: flex;
      justify-content: space-around;
      background-color: darkslateblue;
      padding: 20px;
    }
    
    #container > div {
      height: 100px;
      width: 100px;
      margin: 3px;
      border: 2px solid black;
    }
    
    #one {
      background-color: red;
    }
    
    #two {
      background-color: lavender;
    }
    
    #three {
      background-color: transparent;
    }
    
#### Result
# CSS round display
The CSS round display module defines CSS extensions to support a round display, such as wrist-watches, to help developers build web pages suitable for those devices.
## Reference
>
### Properties
The CSS round display module introduces the `border-boundary` and `shape-inside` properties. Currently, no browsers support these features.
### Descriptors
  * `shape` (`@media` feature)


## Guides
Using media queries
    
Introduces media queries, their syntax, and the operators and media features used to construct media query expressions.
Overview of CSS Shapes
    
Defines basic shapes and how to debug them with developer tools.
Using environment variables
    
Overview of what environment variables are, browser defined environment variables, and how to use the `env()` function.
## Related concepts
  * `@media` at-rule
  * `offset-distance` property
  * `offset-path` property
  * `offset-position` property
  * `viewport-fit` value for `<meta>` `content` attribute


# CSS box model
The CSS box model module defines the `margin` and `padding` properties, which along with the height, width and border properties, make up the CSS box model.
Every visible element on a webpage is a box laid out according to the visual formatting model. CSS properties define their size, position, and stacking level, with the box model properties (and others) defining the extrinsic size of each box, and the space around them.
Each box has a rectangular content area, inside which any text, images, and other content is displayed. The content may be surrounded by padding, a border, and a margin, on one or more sides. The padding is around the content, the border is around the padding, and the margin sits outside the border. The box model describes how these features — the content, padding, border, and margin — work together to create a box as displayed by CSS.
The CSS box model module defines physical (or "page relative") properties such as `margin-top` and `padding-top`. Flow-relative properties such as `margin-block-start` and `margin-inline-start` (which relate to text direction) are defined in Logical Properties and Values. The box model module is extended by the CSS box sizing module, which introduces the intrinsic size value and enables defining aspect ratio for elements that are auto-sized in at least one dimension.
## Reference
>
### Properties
  * `margin` shorthand
  * `margin-bottom`
  * `margin-left`
  * `margin-right`
  * `margin-top`
  * `margin-trim`
  * `padding` shorthand
  * `padding-bottom`
  * `padding-left`
  * `padding-right`
  * `padding-top`


### Data types
  * `<box-edge>`
    * `<visual-box>`
    * `<layout-box>`
    * `<paint-box>`
    * `<coord-box>`
    * `<geometry-box>`


## Guides
Introduction to the CSS box model
    
Explains one of the fundamental concepts of CSS: the box model. This model defines how CSS lays out elements, including their content, padding, border, and margin areas.
Mastering margin collapsing
    
Sometimes, two adjacent margins are collapsed into one. This article describes the rules that govern when and why this happens, and how to control it.
Visual formatting model
    
Explains the visual formatting model.
## Related concepts
  * CSS backgrounds and borders module 
    * `border-width` shorthand
    * `border-bottom-width`
    * `border-left-width`
    * `border-right-width`
    * `border-top-width`
  * CSS logical properties module 
    * `block-size`
    * `inline-size`
    * `max-block-size`
    * `max-inline-size`
    * `min-block-size`
    * `min-inline-size`
    * `margin-block`
    * `margin-block-end`
    * `margin-block-start`
    * `margin-inline`
    * `margin-inline-end`
    * `margin-inline-start`
    * `padding-block`
    * `padding-block-end`
    * `padding-block-start`
    * `padding-inline`
    * `padding-inline-end`
    * `padding-inline-start`
    * `border-block`
    * `border-block-end`
    * `border-block-end-width`
    * `border-block-start`
    * `border-block-start-width`
    * `border-block-style`
    * `border-block-width`
    * `border-inline`
    * `border-inline-end`
    * `border-inline-end-width`
    * `border-inline-start`
    * `border-inline-start-width`
    * `border-inline-width`
  * CSS box sizing module 
    * `aspect-ratio`
    * `box-sizing`
    * `contain-intrinsic-block-size`
    * `contain-intrinsic-height`
    * `contain-intrinsic-inline-size`
    * `contain-intrinsic-size`
    * `contain-intrinsic-width`
    * `height`
    * `max-height`
    * `max-width`
    * `min-height`
    * `min-width`
    * `width`
  * CSS overflow module 
    * `overflow` shorthand
    * `overflow-block`
    * `overflow-clip-margin`
    * `overflow-inline`
    * `overflow-x`
    * `overflow-y`
    * `text-overflow`


# field-sizing
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
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.
This property is typically used to style text `<input>` and `<textarea>` elements to allow them to shrinkwrap their content as well as grow when more text is entered into the form control.
## Syntax
    
    /* Keyword values */
    field-sizing: content;
    field-sizing: fixed;
    
    /* Global values */
    field-sizing: inherit;
    field-sizing: initial;
    field-sizing: revert;
    field-sizing: revert-layer;
    field-sizing: unset;
    
### Values
`content`
    
Allows the element to adjust its size to fit its contents.
`fixed`
    
Sets a fixed size for the element. This is the default value.
## Description
`field-sizing: content` overrides the default preferred sizing of form elements. This setting provides an easy way to configure text inputs to shrinkwrap their content and grow as more text is entered. They stop expanding when they reach maximum size limits (defined by the size of their containing element or set via CSS), at which point scrolling is required to view all the content.
### Elements affected by `field-sizing: content`
Specifically, `field-sizing` to `content` affects the following elements:
  * Form input types that accept direct text input from users. This includes `email`, `number`, `password`, `search`, `tel`, `text`, and `url` types. 
    * If no minimum width is set on the control, it will only be as wide as the text cursor.
    * Controls with `placeholder` attributes will be rendered large enough to display the placeholder text.
    * The `size` attribute modifies the default preferred size of such `<input>` elements. As a result, `size` has no effect on `<input>` elements with `field-sizing: content` set.
  * `file` inputs. Direct text input is not possible; however, the displayed filename changes as the user selects a new file to upload. When `field-sizing: content` is set, the control will change size to shrinkwrap the filename.
  * `<textarea>` controls. It is worth noting that `<textarea>` elements with `field-sizing: content` set behave much like single-line text controls, with the following additions: 
    * If `<textarea>` elements are unable to grow due to a width constraint, they will start to grow in height to display additional rows of content. When a height constraint is then reached, they will then start to show a scrollbar to allow all the content to be viewed.
    * `rows` and `cols` attributes modify the default preferred size of a `<textarea>`. As a result, `rows`/`cols` have no effect on `<textarea>` elements with `field-sizing: content` set.
  * `<select>` controls. These behave a bit differently to what you might expect with `field-sizing: content` set. The effect depends on the type of `<select>` control you are creating: 
    * Regular drop-down boxes will change their width to always fit the displayed option value as new values are selected. (By default, the drop-down's size is set to be large enough to display the longest option value.)
    * List boxes (`<select>` elements with the `multiple` or `size` attribute) will be large enough to display all the options without needing to scroll. (By default, the drop-down box will require scrolling to view all the option values.)
    * The `size` attribute has very little effect on `<select>` elements that have `field-sizing: content` set. In such cases, the browser checks if the `size` is equal to `1` to determine whether the `<select>` control should appear as a drop-down or a listbox. However, it will always display all the options of a listbox, even if `size` is smaller than the number of options.


###  `field-sizing` interaction with other size settings
The sizing flexibility provided to form controls by `field-sizing: content` can be overridden if you use other CSS sizing properties. Avoid setting a fixed `width` and `height` when using `field-sizing: content` because they will reimpose a fixed size on the control. However, using properties like `min-width` and `max-width` alongside `field-sizing: content` is quite effective because they allow the control to grow and shrink with the entered text and also prevent the control from becoming too large or too small.
The `maxlength` attribute causes the control to stop growing in size when the maximum character limit is reached.
## Examples
>
### Growing and shrinking text fields
This example illustrates the effect of `field-sizing: content` on single- and multi-line text fields. The fields adjust their size as text is added or removed, effectively shrinkwrapping the contents, until a lower or upper size limit is reached.
#### HTML
The HTML in this example contains three form fields, each with an associated `<label>`: two `<input>` elements of types `text` and `email` and a `<textarea>` element.
    
    <div>
      <label for="name">Enter name:</label>
      <input type="text" id="name" maxlength="50" />
    </div>
    <div>
      <label for="email">Enter email:</label>
      <input type="email" id="email" maxlength="50" placeholder="e.g. a@b.com" />
    </div>
    <div>
      <label for="comment">Enter comment:</label>
      <textarea id="comment">This is a comment.</textarea>
    </div>
    
Note the following points about the HTML:
  * The first two fields have a `maxlength` attribute set, which stops the size of the field from increasing when the character limit is reached.
  * The `<textarea>` will grow in the inline direction until the edge of the `min-width` constraint (set in the CSS code below) is reached, then start to add new lines in the block direction to contain subsequent characters.
  * The `email` input has a placeholder set. This causes the field to render big enough to show the entire placeholder. Once the field is focused and the user starts typing, the field changes size to the `min-width` value. The `text` field, which doesn't have a placeholder, renders initially at `min-width`.


#### CSS
In the CSS, we set `field-sizing: content` on the three form fields, along with a `min-width` and `max-width` to constrain the input size. It is worth reiterating that, if no minimum width was set on the fields, they would be rendered only as wide as the text cursor.
We also give the `<label>`s some rudimentary styling so that they sit neatly next to the fields.
    
    input,
    textarea {
      field-sizing: content;
      min-width: 50px;
      max-width: 350px;
    }
    
    label {
      width: 150px;
      margin-right: 20px;
      text-align: right;
    }
    
#### Result
Try entering and removing text in the fields below to explore the effects of `field-sizing: content` alongside other sizing properties.
### Controlling `<select>` element display
This example illustrates the effect of `field-sizing: content` on `<select>` elements, both drop-down menu types and multiline listbox types.
#### HTML
The HTML contains two sets of `<select>` elements: one with `field-sizing: content` applied, and one without, allowing you to see the difference (though the effect may be less obvious than on text fields). Each set includes one drop-down menu type and one multiline listbox type (with the `multiple` attribute set).
    
    <div class="field-sizing">
      <h2>With <code>field-sizing: content</code></h2>
      <select>
        <option>Bananas</option>
        <option>Strawberries</option>
        <option selected>Apples</option>
        <option>Raspberries</option>
        <option>Pomegranate</option>
      </select>
      <select multiple>
        <option>Bananas</option>
        <option>Strawberries</option>
        <option>Apples</option>
        <option>Raspberries</option>
        <option>Pomegranate</option>
      </select>
    </div>
    <div>
      <h2>Without <code>field-sizing: content</code></h2>
      <select>
        <option>Bananas</option>
        <option>Strawberries</option>
        <option selected>Apples</option>
        <option>Raspberries</option>
        <option>Pomegranate</option>
      </select>
      <select multiple>
        <option>Bananas</option>
        <option>Strawberries</option>
        <option>Apples</option>
        <option>Raspberries</option>
        <option>Pomegranate</option>
      </select>
    </div>
    
Note: Best practice is to include a `<label>` element for each form control, to associate a meaningful text description with each field for accessibility purposes (see Use meaningful text labels for more information). We haven't done so in this example, as it focuses purely on aspects of the form controls' visual rendering, but you should make sure you include form labels in production code.
#### CSS
In the CSS, `field-sizing: content` is set only on the first set of `<select>` elements.
    
    .field-sizing select {
      field-sizing: content;
    }
    
#### Result
Note the following effects of `field-sizing: content`:
  * The drop-down menu always fits the size of the displayed option, changing size as different options are selected. Without `field-sizing: content`, the size is fixed as wide as the longest option.
  * The multi-select list box displays all of the options at once. Without `field-sizing: content`, the user has to scroll the box to view all the options.


# list-style-image
The `list-style-image` CSS property sets an image to be used as the list item marker.
It is often more convenient to use the shorthand `list-style`.
## Try it
    
    list-style-image: url("/shared-assets/images/examples/rocket.svg");
    
    
    list-style-image: none;
    
    
    <section class="default-example" id="default-example">
      <div>
        <p>NASA Notable Missions</p>
        <ul class="transition-all unhighlighted" id="example-element">
          <li>Apollo</li>
          <li>Hubble</li>
          <li>Chandra</li>
          <li>Cassini-Huygens</li>
          <li>Spitzer</li>
        </ul>
      </div>
    </section>
    
    
    .default-example {
      font-size: 1.2rem;
    }
    
    #example-element {
      width: 100%;
      background: #be094b;
      color: white;
    }
    
    section {
      text-align: left;
      flex-direction: column;
    }
    
    hr {
      width: 50%;
      color: lightgray;
      margin: 0.5em;
    }
    
    .note {
      font-size: 0.8rem;
    }
    
    .note a {
      color: #009e5f;
    }
    
    @counter-style space-counter {
      symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
      suffix: " ";
    }
    
Note: This property is applied to list items, i.e., elements with ``display`: list-item;` by default this includes `<li>` elements. Because this property is inherited, it can be set on the parent element (normally `<ol>` or `<ul>`) to let it apply to all list items.
## Syntax
    
    /* Keyword values */
    list-style-image: none;
    
    /* <url> values */
    list-style-image: url("star-solid.gif");
    
    /* valid image values */
    list-style-image: linear-gradient(to left bottom, red, blue);
    
    /* Global values */
    list-style-image: inherit;
    list-style-image: initial;
    list-style-image: revert;
    list-style-image: revert-layer;
    list-style-image: unset;
    
### Values
`<image>`
    
A valid image to use as the marker.
`none`
    
Specifies that no image is used as the marker. If this value is set, the marker defined in `list-style-type` will be used instead. This is the default value for `list-style`.
## Examples
>
### Using a url value
This example has a star as a marker, which we include using the `<url>` image function.
#### HTML
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>
    
#### CSS
    
    ul {
      list-style-image: url("star-solid.gif");
    }
    
#### Result
### Using a gradient
This example has a CSS gradient as a marker, which we create uses the `linear-gradient()` image function.
#### HTML
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>
    
#### CSS
    
    ul {
      font-size: 200%;
      list-style-image: linear-gradient(to left bottom, red, blue);
    }
    
#### Result
# background
The `background` shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. Component properties not set in the `background` shorthand property value declaration are set to their default values.
## Try it
    
    background: green;
    
    
    background: content-box radial-gradient(crimson, skyblue);
    
    
    background: no-repeat url("/shared-assets/images/examples/lizard.png");
    
    
    background: left 5% / 15% 60% repeat-x
      url("/shared-assets/images/examples/star.png");
    
    
    background:
      center / contain no-repeat
        url("/shared-assets/images/examples/firefox-logo.svg"),
      #eeeeee 35% url("/shared-assets/images/examples/lizard.png");
    
    
    <section id="default-example">
      <div id="example-element"></div>
    </section>
    
    
    #example-element {
      min-width: 100%;
      min-height: 100%;
      padding: 10%;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `background-attachment`
  * `background-clip`
  * `background-color`
  * `background-image`
  * `background-origin`
  * `background-position`
  * `background-repeat`
  * `background-size`


## Syntax
    
    /* Using a <background-color> */
    background: green;
    
    /* Using a <bg-image> and <repeat-style> */
    background: url("test.jpg") repeat-y;
    
    /* Using a <visual-box> and <'background-color'> */
    background: border-box red;
    
    /* A single image, centered and scaled */
    background: no-repeat center/80% url("../img/image.png");
    
    /* Global values */
    background: inherit;
    background: initial;
    background: revert;
    background: revert-layer;
    background: unset;
    
The `background` property is specified as one or more background layers, separated by commas.
The syntax of each layer is as follows:
  * Each layer may include zero or one occurrences of any of the following values:
    * `<attachment>`
    * `<bg-image>`
    * `<bg-position>`
    * `<bg-size>`
    * `<repeat-style>`
  * The `<bg-size>` value may only be included immediately after `<bg-position>`, separated with the '/' character, like this: `center/80%`.
  * The `<visual-box>` value may be included zero, one, or two times. If included once, it sets both `background-origin` and `background-clip`. If it is included twice, the first occurrence sets `background-origin`, and the second sets `background-clip`.
  * The `<'background-color'>` value may only be included in the last layer specified.


### Values
`<attachment>`
    
See `background-attachment`. Default: `scroll`.
`<visual-box>`
    
See `background-clip` and `background-origin`. Default: `border-box` and `padding-box` respectively.
`<'background-color'>`
    
See `background-color`. Default: `transparent`.
`<bg-image>`
    
See `background-image`. Default: `none`.
`<bg-position>`
    
See `background-position`. Default: 0% 0%.
`<repeat-style>`
    
See `background-repeat`. Default: `repeat`.
`<bg-size>`
    
See `background-size`. Default: `auto`.
The following three lines of CSS are equivalent:
    
    background: none;
    background: transparent;
    background: repeat scroll 0% 0% / auto padding-box border-box none transparent;
    
## Accessibility
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
  * MDN Understanding WCAG, Guideline 1.1 explanations
  * Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0


## Examples
>
### Setting backgrounds with color keywords and images
#### HTML
    
    <p class="top-banner">
      Starry sky<br />
      Twinkle twinkle<br />
      Starry sky
    </p>
    <p class="warning">Here is a paragraph</p>
    <p></p>
    
#### CSS
    
    .warning {
      background: pink;
    }
    
    .top-banner {
      background: url("star-solid.gif") #9999ff repeat-y fixed;
    }
    
#### Result
# ::-moz-range-thumb
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `::-moz-range-thumb` CSS pseudo-element is a Mozilla extension that represents the thumb (i.e., virtual knob) of an `<input>` of `type="range"`. The user can move the thumb along the input's track to alter its numerical value.
Note: Using `::-moz-range-thumb` with anything but an `<input type="range">` doesn't match anything and has no effect.
## Syntax
    
    ::-moz-range-thumb {
      /* ... */
    }
    
## Examples
>
### HTML
    
    <input type="range" min="0" max="100" step="5" value="50" />
    
### CSS
    
    input[type="range"]::-moz-range-thumb {
      background-color: green;
    }
    
### Result
A progress bar using this style might look something like this:
Not part of any standard.
# color-interpolation-filters
The `color-interpolation-filters` CSS property specifies the color space for imaging operations performed via SVG filter effects. If explicitly declared, the value of the CSS property overrides any value given in the element's `color-interpolation-filters` attribute.
Note: The `color-interpolation-filters` property is only relevant to SVG filter operations. It has no effect on filter primitives like `<feOffset>`, `<feImage>`, `<feTile>`, and `<feFlood>`, but instead applies to the various filter effect elements (e.g., `<feBlend>`); see the SVG `color-interpolation-filters` page for a full list.
Note: It is important to remember that the SVG `color-interpolation` attribute has an initial value of `sRGB`, while `color-interpolation-filters` has an initial value of `linearRGB`. This means, in the default case, filter effect interpolations occur in a different color space than all other color interpolations.
## Syntax
    
    color-interpolation-filters: auto;
    color-interpolation-filters: linearRGB;
    color-interpolation-filters: sRGB;
    
    /* Global values */
    color-interpolation-filters: inherit;
    color-interpolation-filters: initial;
    color-interpolation-filters: revert;
    color-interpolation-filters: revert-layer;
    color-interpolation-filters: unset;
    
### Values
`linearRGB`
    
Indicates that color interpolation should occur in the linearized RGB color space as described in the sRGB specification. This is the default property value.
`sRGB`
    
Indicates that color interpolation should occur in the gamma-encoded sRGB color space.
`auto`
    
Indicates that the user agent can choose either the `sRGB` or `linearRGB` spaces for color interpolation. This option indicates that the author doesn't require that color interpolation occur in a particular color space.
# border-bottom-style
The `border-bottom-style` CSS property sets the line style of an element's bottom `border`.
## Try it
    
    border-bottom-style: none;
    
    
    border-bottom-style: dotted;
    
    
    border-bottom-style: dashed;
    
    
    border-bottom-style: solid;
    
    
    border-bottom-style: groove;
    
    
    border-bottom-style: inset;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
    body {
      background-color: white;
    }
    
Note: The specification doesn't define how borders of different styles connect in the corners.
## Syntax
    
    /* Keyword values */
    border-bottom-style: none;
    border-bottom-style: hidden;
    border-bottom-style: dotted;
    border-bottom-style: dashed;
    border-bottom-style: solid;
    border-bottom-style: double;
    border-bottom-style: groove;
    border-bottom-style: ridge;
    border-bottom-style: inset;
    border-bottom-style: outset;
    
    /* Global values */
    border-bottom-style: inherit;
    border-bottom-style: initial;
    border-bottom-style: revert;
    border-bottom-style: revert-layer;
    border-bottom-style: unset;
    
The `border-bottom-style` property is specified as a single `<line-style>` keyword value.
## Examples
>
### Demonstrating all border styles
#### HTML
    
    <table>
      <tr>
        <td class="b1">none</td>
        <td class="b2">hidden</td>
        <td class="b3">dotted</td>
        <td class="b4">dashed</td>
      </tr>
      <tr>
        <td class="b5">solid</td>
        <td class="b6">double</td>
        <td class="b7">groove</td>
        <td class="b8">ridge</td>
      </tr>
      <tr>
        <td class="b9">inset</td>
        <td class="b10">outset</td>
      </tr>
    </table>
    
#### CSS
    
    /* Define look of the table */
    table {
      border-width: 3px;
      background-color: #52e385;
    }
    tr,
    td {
      padding: 3px;
    }
    
    /* border-bottom-style example classes */
    .b1 {
      border-bottom-style: none;
    }
    .b2 {
      border-bottom-style: hidden;
    }
    .b3 {
      border-bottom-style: dotted;
    }
    .b4 {
      border-bottom-style: dashed;
    }
    .b5 {
      border-bottom-style: solid;
    }
    .b6 {
      border-bottom-style: double;
    }
    .b7 {
      border-bottom-style: groove;
    }
    .b8 {
      border-bottom-style: ridge;
    }
    .b9 {
      border-bottom-style: inset;
    }
    .b10 {
      border-bottom-style: outset;
    }
    
#### Result
# ::view-transition-new()
The `::view-transition-new()` CSS pseudo-element represents the "new" view state of a view transition — a snapshot live representation of the state after the transition.
During a view transition, `::view-transition-new()` is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree. It is only ever a child of a `::view-transition-image-pair()`, and never has any children.
It is a replaced element and therefore can be manipulated with properties such as `object-fit` and `object-position`. It has natural dimensions equal to the content's size.
The following default styling is included in the UA stylesheet:
    
    :root::view-transition-old(*),
    :root::view-transition-new(*) {
      position: absolute;
      inset-block-start: 0;
      inline-size: 100%;
      block-size: auto;
    
      animation-duration: inherit;
      animation-fill-mode: inherit;
      animation-delay: inherit;
    }
    
    /* Keyframes for blending when there are 2 images */
    @keyframes -ua-mix-blend-mode-plus-lighter {
      from {
        mix-blend-mode: plus-lighter;
      }
      to {
        mix-blend-mode: plus-lighter;
      }
    }
    
    @keyframes -ua-view-transition-fade-in {
      from {
        opacity: 0;
      }
    }
    
Note: Additional view transition styles are also setup to animate `::view-transition-new()`. These are dynamically generated during the view transition; see the specification setup transition pseudo-elements and update pseudo-element styles sections for more details.
## Syntax
    
    ::view-transition-new([ <pt-name-selector> <pt-class-selector>? ] | <pt-class-selector>) {
      /* ... */
    }
    
### Parameters
`*`
    
The universal selector (`*`); selects all view transition groups on a page.
`root`
    
Causes the pseudo-element to match the default `root` view transition snapshot group created by the user agent to contain the view transition for the overall page. This group includes any element not assigned to its own specific view transition snapshot group via the `view-transition-name` property.
`<pt-name-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-name` property.
`<pt-class-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-class` property preceded by a period (`.`).
## Examples
    
    figcaption {
      view-transition-name: figure-caption;
    }
    
    @keyframes grow-x {
      from {
        transform: scaleX(0);
      }
      to {
        transform: scaleX(1);
      }
    }
    
    @keyframes shrink-x {
      from {
        transform: scaleX(1);
      }
      to {
        transform: scaleX(0);
      }
    }
    
    ::view-transition-old(figure-caption),
    ::view-transition-new(figure-caption) {
      height: auto;
      right: 0;
      left: auto;
      transform-origin: right center;
    }
    
    ::view-transition-old(figure-caption) {
      animation: 0.25s linear both shrink-x;
    }
    
    ::view-transition-new(figure-caption) {
      animation: 0.25s 0.25s linear both grow-x;
    }
    
# margin-block-start
The `margin-block-start` CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    margin-block-start: 20px;
    writing-mode: horizontal-tb;
    
    
    margin-block-start: 20px;
    writing-mode: vertical-rl;
    
    
    margin-block-start: 20%;
    writing-mode: horizontal-tb;
    
    
    margin-block-start: auto;
    writing-mode: vertical-lr;
    
    
    <section id="default-example">
      <div id="container">
        <div class="row">One</div>
        <div class="row transition-all" id="example-element">Two</div>
        <div class="row">Three</div>
      </div>
    </section>
    
    
    #container {
      width: 300px;
      height: 200px;
      display: flex;
      align-content: flex-start;
      flex-direction: column;
      justify-content: flex-start;
    }
    
    .row {
      height: 33.33%;
      display: inline-block;
      border: solid #ce7777 10px;
      background-color: #2b3a55;
      color: white;
      flex-shrink: 0;
    }
    
    #example-element {
      border: solid 10px #ffbf00;
      background-color: #2b3a55;
    }
    
## Syntax
    
    /* <length> values */
    margin-block-start: 10px; /* An absolute length */
    margin-block-start: 1em; /* relative to the text size */
    margin-block-start: 5%; /* relative to the nearest block container's width */
    margin-block-start: anchor-size(width);
    margin-block-start: calc(anchor-size(--my-anchor block, 20px) / 3);
    
    /* Keyword values */
    margin-block-start: auto;
    
    /* Global values */
    margin-block-start: inherit;
    margin-block-start: initial;
    margin-block-start: revert;
    margin-block-start: revert-layer;
    margin-block-start: unset;
    
It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
It relates to `margin-block-end`, `margin-inline-start`, and `margin-inline-end`, which define the other margins of the element.
### Values
The `margin-block-start` property takes the same values as the `margin-left` property.
## Examples
>
### Setting block start margin
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      margin-block-start: 20px;
      background-color: #c8c800;
    }
    
#### Result
# :volume-locked
The `:volume-locked` CSS pseudo-class selector represents an element that is capable of making sound, such as `<audio>` or `<video>`, but the audio volume of the media element is currently "locked" by the user.
User agents may set media `muted` or `volume` values according to user preferences (e.g., remembering the last set value across sessions, on a per-site basis, or otherwise). An element that is `:volume-locked` cannot be muted, un-muted, or have its volume changed via JavaScript. The locked status is an operating system or user agent preference.
## Syntax
    
    :volume-locked {
      /* ... */
    }
    
## Examples
>
### CSS
    
    :volume-locked {
      border: 5px solid green;
    }
    
    video:volume-locked {
      border: 5px solid aqua;
    }
    
# clip
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: Authors are encouraged to use the `clip-path` property instead.
The `clip` CSS property defines a visible portion of an element. The `clip` property applies only to absolutely positioned elements — that is, elements with `position:absolute` or `position:fixed`.
## Syntax
    
    /* Keyword value */
    clip: auto;
    
    /* <shape> values */
    clip: rect(1px, 10em, 3rem, 2ch);
    
    /* Global values */
    clip: inherit;
    clip: initial;
    clip: revert;
    clip: revert-layer;
    clip: unset;
    
### Values
`rect()`
    
A rectangle defined using a `rect()` function of the form `rect(<top>, <right>, <bottom>, <left>)`. The `<top>` and `<bottom>` values are offsets from the inside top border edge of the box, while `<right>` and `<left>` are offsets from the inside left border edge of the box — that is, the extent of the padding box.
The `<top>`, `<right>`, `<bottom>`, and `<left>` values may be either a `<length>` or `auto`. If any side's value is `auto`, the element is clipped to that side's inside border edge.
Note: The `rect()` `<shape>` function used in the deprecated `clip` property is different from the CSS `rect()` function used to define a CSS `<basic-shape>`.
`auto`
    
The element does not clip (default). This is different from `rect(auto, auto, auto, auto)`, which clips to the element's inside border edges.
## Examples
>
### Clipping an image
    
    <p class="dotted-border">
      <img src="macarons.png" alt="Original graphic" />
      <img id="top-left" src="macarons.png" alt="Graphic clipped to upper left" />
      <img id="middle" src="macarons.png" alt="Graphic clipped towards middle" />
      <img
        id="bottom-right"
        src="macarons.png"
        alt="Graphic clipped to bottom right" />
    </p>
    
    
    .dotted-border {
      border: dotted;
      position: relative;
      width: 390px;
      height: 400px;
    }
    
    #top-left,
    #middle,
    #bottom-right {
      position: absolute;
      top: 0;
    }
    
    #top-left {
      left: 400px;
      clip: rect(0, 130px, 90px, 0);
    }
    
    #middle {
      left: 270px;
      clip: rect(100px, 260px, 190px, 130px);
    }
    
    #bottom-right {
      left: 140px;
      clip: rect(200px, 390px, 290px, 260px);
    }
    
# text-wrap-mode
The `text-wrap-mode` CSS property controls whether the text inside an element is wrapped. The different values provide alternate ways of wrapping the content of a block element. It can also be set, and reset, using the `text-wrap` shorthand or the `white-space` shorthand.
Note: The `white-space-collapse` and `text-wrap-mode` properties can be declared together using the `white-space` shorthand property.
Note: The name of this property is a placeholder, pending the CSSWG finding a better name.
## Try it
    
    text-wrap-mode: wrap;
    
    
    text-wrap-mode: nowrap;
    
    
    <section class="default-example" id="default-example">
      <div class="whole-content-wrapper">
        <p>Edit the text in the box:</p>
        <div class="transition-all" id="example-element">
          <p contenteditable="">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut
            cum eum id quos est.
          </p>
        </div>
      </div>
    </section>
    
    
    .whole-content-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
    }
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 250px;
    }
    
## Syntax
    
    /* Keyword values */
    text-wrap-mode: wrap;
    text-wrap-mode: nowrap;
    
    /* Global values */
    text-wrap-mode: inherit;
    text-wrap-mode: initial;
    text-wrap-mode: revert;
    text-wrap-mode: revert-layer;
    text-wrap-mode: unset;
    
## Values
This property specifies whether lines may wrap at unforced soft wrap opportunities. Possible values:
`wrap`
    
Text is wrapped across lines at appropriate characters (for example spaces, in languages like English that use space separators) to minimize overflow. This is the default value.
`nowrap`
    
Text does not wrap across lines. It will overflow its containing element rather than breaking onto a new line.
## Examples
>
### Wrapping content
The default setting is to wrap the content so the `text-wrap-mode` property is not necessary. In this example the content will flow over to the next line so that it fits in the box, the last line is longer that the containing box so overflows.
#### HTML
    
    <div class="box">CSS IS AWESOME</div>
    
#### CSS
    
    .box {
      font-family: Arial, sans-serif;
      font-weight: bold;
      font-size: 64px;
      box-sizing: border-box;
      border: 4px solid black;
      padding: 0px 3px;
      width: 223px;
      text-wrap-mode: wrap;
    }
    
#### Result
### Not wrapping content
In this example the content will not flow over to the next line so that it fits in the box as the content has been specifically told not to wrap with `text-wrap-mode: nowrap;`, the content is longer that the containing box so overflows.
#### HTML
    
    <div class="box">CSS IS AWESOME</div>
    
#### CSS
    
    .box {
      font-family: Arial, sans-serif;
      font-weight: bold;
      font-size: 64px;
      box-sizing: border-box;
      border: 4px solid black;
      padding: 0px 3px;
      width: 223px;
      text-wrap-mode: nowrap;
    }
    
#### Result
# :focus-within
The `:focus-within` CSS pseudo-class matches an element if the element or any of its descendants are focused. In other words, it represents an element that is itself matched by the `:focus` pseudo-class or has a descendant that is matched by `:focus`. (This includes descendants in shadow trees.)
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    label:focus-within {
      font-weight: bold;
    }
    
    
    <form>
      <p>Which flavor would you like to order?</p>
      <label>Full Name: <input name="firstName" type="text" /></label>
      <label
        >Flavor:
        <select name="flavor">
          <option>Cherry</option>
          <option>Green Tea</option>
          <option>Moose Tracks</option>
          <option>Mint Chip</option>
        </select>
      </label>
    </form>
    
This selector is useful, to take a common example, for highlighting an entire `<form>` container when the user focuses on one of its `<input>` fields.
## Syntax
    
    :focus-within {
      /* ... */
    }
    
## Examples
In this example, the form will receive special coloring styles when either text input receives focus.
### HTML
    
    <p>Try typing into this form.</p>
    
    <form>
      <label for="given_name">Given Name:</label>
      <input id="given_name" type="text" />
      <br />
      <label for="family_name">Family Name:</label>
      <input id="family_name" type="text" />
    </form>
    
### CSS
    
    form {
      border: 1px solid;
      color: gray;
      padding: 4px;
    }
    
    form:focus-within {
      background: #ffff88;
      color: black;
    }
    
    input {
      margin: 4px;
    }
    
### Result
# CSS scroll snap
The CSS scroll snap module provides properties that let you control the panning and scrolling behavior by defining snap positions. Content can be snapped into position as the user scrolls overflowing content within a scroll container, providing paging and scroll positioning.
This module includes the scroll container scroll-padding properties to adjust the optimal viewing region of paging during scroll-into-view operations. It also includes scroll-margin and scroll-alignment, set on the scroll container's children, to adjust the children's visual area when that child is scrolled into view, as well as a property to force scrolling to stop on individual children.
## Scroll snap in action
To view scroll snapping in the box below, scroll up-and-down and left-and-right through the grid of 45 numbered boxes in the scrollable viewport. Click "Play" in the example below to view the or edit the source in the MDN Playground:
With scroll snap, one of the numbered boxes that you scroll to will snap into place. The initial CSS makes the numbered box snap into the center of the viewport. Use the sliders to change the block and inline snap positions.
Using snap properties, you can allow or block the scrolling past an element, a numbered box in this case. Select the "Prevent scrolling past boxes" checkbox to force all scrolling actions to be limited to scrolling to an adjacent box.
To compare scroll snapping to regular scrolling, check the "disable snapping" checkbox and try scrolling again.
## Reference
>
### Properties on containers
  * `scroll-snap-type`
  * `scroll-padding`
    * `scroll-padding-top`
    * `scroll-padding-right`
    * `scroll-padding-bottom`
    * `scroll-padding-left`
    * `scroll-padding-inline`
    * `scroll-padding-inline-start`
    * `scroll-padding-inline-end`
    * `scroll-padding-block`
    * `scroll-padding-block-start`
    * `scroll-padding-block-end`


### Properties on children
  * `scroll-snap-align`
  * `scroll-margin`
    * `scroll-margin-top`
    * `scroll-margin-right`
    * `scroll-margin-bottom`
    * `scroll-margin-left`
    * `scroll-margin-inline`
    * `scroll-margin-inline-start`
    * `scroll-margin-inline-end`
    * `scroll-margin-block`
    * `scroll-margin-block-start`
    * `scroll-margin-block-end`
  * `scroll-snap-stop`


### Events
  * `scrollsnapchange` Experimental
  * `scrollsnapchanging` Experimental


### Interfaces
  * `SnapEvent` Experimental
    * `SnapEvent.snapTargetBlock` Experimental
    * `SnapEvent.snapTargetInline` Experimental


## Guides
Basic concepts of CSS scroll snap
    
An overview and examples of CSS scroll snap features.
Using scroll snap events
    
A guide to using the `scrollsnapchanging` and `scrollsnapchange` scroll snap events that are fired when the browser determines a new snap target is pending or selected.
## Related concepts
  * `:target` pseudo-class
  * `overflow` CSS property
  * Element `scroll()` method
  * Element `scrollBy()` method
  * Element `scrollIntoView()` method
  * Element `scrollTo()` method
  * Element `scroll` event
  * Element `scrollend` event
  * `scrollbar` ARIA role
  * Scroll container glossary term


# text-shadow
The `text-shadow` CSS property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and any of its `decorations`. Each shadow is described by some combination of X and Y offsets from the element, blur radius, and color.
## Try it
    
    text-shadow: 1px 1px 2px pink;
    
    
    text-shadow: #ffcc00 1px 0 10px;
    
    
    text-shadow: 5px 5px #558abb;
    
    
    text-shadow: red 2px 5px;
    
    
    text-shadow: 5px 10px;
    
    
    text-shadow:
      1px 1px 2px red,
      0 0 1em blue,
      0 0 0.2em blue;
    
    
    <section id="default-example">
      <p id="example-element">
        Far out in the uncharted backwaters of the unfashionable end of the western
        spiral arm of the Galaxy...
      </p>
    </section>
    
    
    p {
      font:
        1.5em Georgia,
        serif;
    }
    
## Syntax
    
    /* offset-x | offset-y | blur-radius | color */
    text-shadow: 1px 1px 2px black;
    
    /* color | offset-x | offset-y | blur-radius */
    text-shadow: #ffcc00 1px 0 10px;
    
    /* offset-x | offset-y | color */
    text-shadow: 5px 5px #558abb;
    
    /* color | offset-x | offset-y */
    text-shadow: white 2px 5px;
    
    /* offset-x | offset-y
    /* Use defaults for color and blur-radius */
    text-shadow: 5px 10px;
    
    /* Global values */
    text-shadow: inherit;
    text-shadow: initial;
    text-shadow: revert;
    text-shadow: revert-layer;
    text-shadow: unset;
    
This property is specified as a comma-separated list of shadows.
Each shadow is specified as two or three `<length>` values, followed optionally by a `<color>` value. The first two `<length>` values are the `<offset-x>` and `<offset-y>` values. The third, optional, `<length>` value is the `<blur-radius>`. The `<color>` value is the shadow's color.
When more than one shadow is given, shadows are applied front-to-back, with the first-specified shadow on top.
This property applies to both `::first-line` and `::first-letter` pseudo-elements.
### Values
`<color>`
    
Optional. The color of the shadow. It can be specified either before or after the offset values. If unspecified, the color's value is left up to the user agent, so when consistency across browsers is desired you should define it explicitly.
`<offset-x> <offset-y>`
    
Required. These `<length>` values specify the shadow's distance from the text. `<offset-x>` specifies the horizontal distance; a negative value places the shadow to the left of the text. `<offset-y>` specifies the vertical distance; a negative value places the shadow above the text. If both values are `0`, the shadow is placed directly behind the text, although it may be partly visible due to the effect of `<blur-radius>`.
`<blur-radius>`
    
Optional. This is a `<length>` value. The higher the value, the bigger the blur; the shadow becomes wider and lighter. If not specified, it defaults to `0`.
## Examples
>
### Basic shadow
    
    .red-text-shadow {
      text-shadow: red 0 -2px;
    }
    
    
    <p class="red-text-shadow">
      Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
      doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore.
    </p>
    
### Multiple shadows
    
    .white-text-with-blue-shadow {
      text-shadow:
        1px 1px 2px black,
        0 0 1em blue,
        0 0 0.2em blue;
      color: white;
      font:
        1.5em Georgia,
        serif;
    }
    
    
    <p class="white-text-with-blue-shadow">
      Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
      doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore.
    </p>
    
# <display-internal>
Some layout models such as `table` and `ruby` have a complex internal structure, with several different roles that their children and descendants can fill. This page defines those "internal" display values, which only have meaning within that particular layout mode.
## Syntax
Valid `<display-internal>` values:
`table-row-group`
    
These elements behave like `<tbody>` HTML elements.
`table-header-group`
    
These elements behave like `<thead>` HTML elements.
`table-footer-group`
    
These elements behave like `<tfoot>` HTML elements.
`table-row`
    
These elements behave like `<tr>` HTML elements.
`table-cell`
    
These elements behave like `<td>` HTML elements.
`table-column-group`
    
These elements behave like `<colgroup>` HTML elements.
`table-column`
    
These elements behave like `<col>` HTML elements.
`table-caption`
    
These elements behave like `<caption>` HTML elements.
`ruby-base`
    
These elements behave like `<rb>` HTML elements.
`ruby-text`
    
These elements behave like `<rt>` HTML elements.
`ruby-base-container`
    
These elements are generated as anonymous boxes.
`ruby-text-container`
    
These elements behave like `<rtc>` HTML elements.
## Examples
>
### CSS tables example
The following example demonstrates laying out a form using CSS table layout.
#### HTML
    
    <main>
      <div>
        <label for="name">Name</label>
        <input type="text" id="name" name="name" />
      </div>
      <div>
        <label for="age">Age</label>
        <input type="text" id="age" name="age" />
      </div>
    </main>
    
#### CSS
    
    main {
      display: table;
    }
    
    div {
      display: table-row;
    }
    
    label,
    input {
      display: table-cell;
      margin: 5px;
    }
    
#### Result
This feature does not appear to be defined in any specification.> >
### css.properties.display.table-row-group
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-header-group
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-footer-group
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-row
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-cell
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-column-group
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-column
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 12 1 7 1 18 4 14 1 1.0 4.4 1  
### css.properties.display.table-caption
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 1 ≤15 1 15 ≤4 18 4 14 ≤3.2 1.0 4.4 ≤3.2  
### css.properties.display.ruby-base
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` No 12–79 38 No No No 38 No No No No No  
### css.properties.display.ruby-text
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` 121 12–79 38 107 No 121 38 81 No 25.0 121 No  
### css.properties.display.ruby-base-container
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` No 12–79 38 No No No 38 No No No No No  
### css.properties.display.ruby-text-container
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`display-internal` No 12–79 38 No No No 38 No No No No No  
# :where()
The `:where()` CSS pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list.
The difference between `:where()` and `:is()` is that `:where()` always has 0 specificity, whereas `:is()` takes on the specificity of the most specific selector in its arguments.
## Try it
    
    ol {
      list-style-type: upper-alpha;
      color: darkblue;
    }
    
    /* Not applied to ol, because of lower specificity */
    :where(ol, ul, menu:unsupported) :where(ol, ul) {
      color: green;
    }
    
    :where(ol, ul) :where(ol, ul) ol {
      list-style-type: lower-greek;
      color: chocolate;
    }
    
    
    <ol>
      <li>Saturn</li>
      <li>
        <ul>
          <li>Mimas</li>
          <li>Enceladus</li>
          <li>
            <ol>
              <li>Voyager</li>
              <li>Cassini</li>
            </ol>
          </li>
          <li>Tethys</li>
        </ul>
      </li>
      <li>Uranus</li>
      <li>
        <ol>
          <li>Titania</li>
          <li>Oberon</li>
        </ol>
      </li>
    </ol>
    
## Syntax
    
    :where(<complex-selector-list>) {
      /* ... */
    }
    
### Parameters
The `:where()` pseudo-class requires a selector list, a comma-separated list of one or more selectors, as its argument. The list must not contain a pseudo-element, but any other simple, compound, and complex selectors are allowed.
### Forgiving Selector Parsing
The specification defines `:is()` and `:where()` as accepting a forgiving selector list.
In CSS when using a selector list, if any of the selectors are invalid then the whole list is deemed invalid. When using `:is()` or `:where()` instead of the whole list of selectors being deemed invalid if one fails to parse, the incorrect or unsupported selector will be ignored and the others used.
    
    :where(:valid, :unsupported) {
      /* … */
    }
    
Will still parse correctly and match `:valid` even in browsers which don't support `:unsupported`, whereas:
    
    :valid,
    :unsupported {
      /* … */
    }
    
Will be ignored in browsers which don't support `:unsupported` even if they support `:valid`.
## Examples
>
### Comparing :where() and :is()
This example shows how `:where()` works, and also illustrates the difference between `:where()` and `:is()`.
Take the following HTML:
    
    <article>
      <h2>:is()-styled links</h2>
      <section class="is-styling">
        <p>
          Here is my main content. This
          <a href="https://mozilla.org">contains a link</a>.
        </p>
      </section>
    
      <aside class="is-styling">
        <p>
          Here is my aside content. This
          <a href="https://developer.mozilla.org">also contains a link</a>.
        </p>
      </aside>
    
      <footer class="is-styling">
        <p>
          This is my footer, also containing
          <a href="https://github.com/mdn">a link</a>.
        </p>
      </footer>
    </article>
    
    <article>
      <h2>:where()-styled links</h2>
      <section class="where-styling">
        <p>
          Here is my main content. This
          <a href="https://mozilla.org">contains a link</a>.
        </p>
      </section>
    
      <aside class="where-styling">
        <p>
          Here is my aside content. This
          <a href="https://developer.mozilla.org">also contains a link</a>.
        </p>
      </aside>
    
      <footer class="where-styling">
        <p>
          This is my footer, also containing
          <a href="https://github.com/mdn">a link</a>.
        </p>
      </footer>
    </article>
    
In this somewhat-contrived example, we have two articles that each contain a section, an aside, and a footer. They differ by the classes used to mark the child elements.
To group the selection of links, while keeping the `is-styling` and `where-styling` styles distinct, we could use `:is()` or `:where()`, in the following manner:
    
    html {
      font-family: sans-serif;
      font-size: 150%;
    }
    
    :is(section.is-styling, aside.is-styling, footer.is-styling) a {
      color: red;
    }
    
    :where(section.where-styling, aside.where-styling, footer.where-styling) a {
      color: orange;
    }
    
However, what if we later want to override the color of links in the footers using a compound selector made up of low-specificity type selectors?
    
    footer a {
      color: blue;
    }
    
This won't work for the red links, because the selectors inside `:is()` count towards the specificity of the overall selector, and class selectors have a higher specificity than element selectors.
However, selectors inside `:where()` have specificity 0, so the orange footer link will be overridden by our type-only compound selector.
Note: You can also find this example on GitHub; see is-where.
# mask-border-slice
The `mask-border-slice` CSS property divides the image set by `mask-border-source` into regions. These regions are used to form the components of an element's mask border.
## Syntax
    
    /* All sides */
    mask-border-slice: 30%;
    
    /* top and bottom | left and right */
    mask-border-slice: 10% 30%;
    
    /* top | left and right | bottom */
    mask-border-slice: 30 30% 45;
    
    /* top | right | bottom | left */
    mask-border-slice: 7 12 14 5;
    
    /* Using the `fill` keyword */
    mask-border-slice: 10% fill 7 12;
    
    /* Global values */
    mask-border-slice: inherit;
    mask-border-slice: initial;
    mask-border-slice: revert;
    mask-border-slice: revert-layer;
    mask-border-slice: unset;
    
The `mask-border-slice` property may be specified using one to four `<number-percentage>` values to represent the position of each image slice. Negative values are invalid; values greater than their corresponding dimension are clamped to `100%`.
  * When one position is specified, it creates all four slices at the same distance from their respective sides.
  * When two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right.
  * When three positions are specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom.
  * When four positions are specified, they create slices measured from the top, right, bottom, and left in that order (clockwise).


The optional `fill` value, if used, can be placed anywhere in the declaration.
### Values
`<number>`
    
Represents an edge offset in pixels for raster images and coordinates for vector images. For vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.
`<percentage>`
    
Represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets.
`fill`
    
Preserves the middle image region. Its width and height are sized to match the top and left image regions, respectively.
## Description
The slicing process creates nine regions in total: four corners, four edges, and a middle region. Four slice lines, set a given distance from their respective sides, control the size of the regions.
The above diagram illustrates the location of each region.
  * Zones 1-4 are corner regions. Each one is used a single time to form the corners of the final border image.
  * Zones 5-8 are edge regions. These are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element.
  * Zone 9 is the middle region. It is discarded by default, but is used like a background image if the keyword `fill` is set.


The `mask-border-repeat`, `mask-border-width`, and `mask-border-outset` properties determine how these regions are used to form the final mask border.
## Examples
>
### Basic usage
`mask-border-slice` serves to define the size of the slices taken from the source image, and is used to create the border mask.
    
    mask-border-slice: 30 fill;
    
Chromium-based browsers support an outdated version of this property — `mask-box-image-slice` — with a prefix:
    
    -webkit-mask-box-image-slice: 30 fill;
    
Note: The `mask-border` page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect.
Note: The fill keyword needs to be included if you want the element's content to be visible.
# @position-try
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `@position-try` CSS at-rule is used to define a custom position try fallback option, which can be used to define positioning and alignment for anchor-positioned elements. One or more sets of position try fallback options can be applied to the anchored element via the `position-try-fallbacks` property or `position-try` shorthand. When the positioned element is moved to a position where it starts to overflow its containing block or the viewport, the browser will select the first position try fallback option it finds that places the positioned element fully back on-screen.
Each position option is named with a `<dashed-ident>` and contains a descriptor list specifying declarations that define information such as inset position, margin, sizing, and self-alignment. The `<dashed-ident>` is used to reference the custom position option in the `position-try-fallbacks` property and `position-try` shorthand.
For detailed information on anchor features and position try fallback usage, see the CSS anchor positioning module landing page and the Fallback options and conditional hiding for overflow guide.
## Syntax
    
    @position-try --try-option-name {
      descriptor-list
    }
    
Note: The `--try-option-name` is a `<dashed-ident>` specifying an identifying name for the custom position option, which can then be used to add that fallback option to the `position-try-fallbacks` list.
### Descriptors
The descriptors specify property values that define the behavior of the custom position option, i.e., where it will result in the positioned element being placed.
`position-anchor`
    
Specifies a `position-anchor` property value that defines the anchor element that the positioned element is tethered to, by specifying a `<dashed-ident>` value equal to the anchor element's `anchor-name` property value.
`position-area`
    
Specifies a `position-area` property value that defines the position of the anchor-positioned element relative to the anchor.
Inset property descriptors
    
Specify `anchor()` function values that define the position of the anchor-positioned element's edges relative to the anchor element's edge. Inset property descriptors can be set that represent the following properties:
  * `top`
  * `left`
  * `bottom`
  * `right`.
  * `inset-block-start`
  * `inset-block-end`
  * `inset-inline-start`
  * `inset-inline-end`
  * `inset-block`
  * `inset-inline`
  * `inset`


Margin property descriptors
    
Specify the margin set on the anchor-positioned element. Margin property descriptors can be set that represent the following properties:
  * `margin-top`
  * `margin-left`
  * `margin-bottom`
  * `margin-right`
  * `margin-block-start`
  * `margin-block-end`
  * `margin-inline-start`
  * `margin-inline-end`
  * `margin`
  * `margin-block`
  * `margin-inline`


Sizing property descriptors
    
Specify `anchor-size()` function values that define the size of the anchor-positioned element relative to the anchor element size. Sizing property descriptors can be set that represent the following properties:
  * `width`
  * `height`
  * `min-width`
  * `min-height`
  * `max-width`
  * `max-height`
  * `block-size`
  * `inline-size`
  * `min-block-size`
  * `min-inline-size`
  * `max-block-size`
  * `max-inline-size`


Self-alignment property descriptors
    
Specify the `anchor-center` value to align the anchor-positioned element relative to the anchor element's center, in the block or inline direction. `align-self` and `justify-self` property descriptors can take the `anchor-center` value.
Note: When a custom position option is applied to an element, the property values defined in the `@position-try` at-rule descriptor takes precedence over the values set on the element via standard CSS properties.
## Examples
>
### Custom position option usage
In this example, we define an anchor element and an anchor-positioned element, then create four named custom position try fallback options. These options are applied to the positioned element to ensure its contents are always visible no matter where the anchor element is within the viewport.
#### HTML
We include two `<div>` elements that will become an anchor and an anchor-positioned element:
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
#### CSS
We first style the `<body>` element to be very large, so that we can scroll the anchor and the positioned element around in the viewport, both horizontally and vertically:
    
    body {
      width: 1500px;
      height: 500px;
    }
    
The anchor is given an `anchor-name` and has a `position` value of `absolute` set on it. We then position it somewhere near the center of the initial `<body>` rendering using `top` and `left` values:
    
    .anchor {
      anchor-name: --my-anchor;
      position: absolute;
      top: 100px;
      left: 350px;
    }
    
Next, we use the `@position-try` at-rule to define four custom position options, with descriptive `<dashed-ident>` names to identify them and describe their purpose. Each one places the positioned element in a specific position around the anchor element and gives it an appropriate `10px` margin between the positioned element and its anchor. The positioning is handled in a variety of ways, to demonstrate the different techniques available:
  * The first and last position options use a `position-area`.
  * The second position option uses `top` with an `anchor()` value and `justify-self: anchor-center` to center the positioned element on the anchor in the inline direction.
  * The third position option uses `left` with an `anchor()` value, wrapped inside a `calc()` function that adds `10px` of spacing (rather than creating the spacing with `margin` like the other options do). It then uses `align-self: anchor-center` to center the positioned element on the anchor in the block direction.


Finally, the left and right position options are given a narrower `width`
    
    @position-try --custom-left {
      position-area: left;
      width: 100px;
      margin-right: 10px;
    }
    
    @position-try --custom-bottom {
      top: anchor(bottom);
      justify-self: anchor-center;
      margin-top: 10px;
      position-area: none;
    }
    
    @position-try --custom-right {
      left: calc(anchor(right) + 10px);
      align-self: anchor-center;
      width: 100px;
      position-area: none;
    }
    
    @position-try --custom-bottom-right {
      position-area: bottom right;
      margin: 10px 0 0 10px;
    }
    
The infobox is given fixed positioning, a `position-anchor` property that references the anchor's `anchor-name` to associate the two together, and it is tethered to the anchor's top edge using an `position-area`. We also give it a fixed `width` and some bottom `margin`. The custom position options are then referenced in the `position-try-fallbacks` property to prevent the positioned element from overflowing, or being scrolled out of view, when the anchor gets near the edge of the viewport.
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
      position-area: top;
      width: 200px;
      margin-bottom: 10px;
      position-try-fallbacks:
        --custom-left, --custom-bottom, --custom-right, --custom-bottom-right;
    }
    
#### Result
Scroll the page and notice the change in the positioned element's placement as the anchor nears the different edges of the viewport. This is due to different fallback position options being applied.
Let's talk through how these position options work:
  * First of all, note that our default position is defined by `position-area: top`. When the infobox isn't overflowing the page in any direction, the infobox sits above the anchor, and the position try fallback options set in the `position-try-fallbacks` property are ignored. Also note that the infobox has a fixed width and bottom margin set. These values will change as different position try fallback options are applied.
  * If the infobox starts to overflow, the browser first tries the `--custom-left` position. This moves the infobox to the left of the anchor using `position-area: left`, adjusts the margin to suit, and also gives the infobox a different width.
  * Next, the browser tries the `--custom-bottom` position. This moves the infobox to the bottom of the anchor using `top` and `justify-self` instead of a `position-area`, and sets an appropriate margin. It doesn't include a `width` descriptor, so the infobox returns to its default width of `200px` set by the `width` property.
  * The browser next tries the `--custom-right` position. This works much the same as the `--custom-left` position, with the same `width` descriptor value applied. However, we are using `left` and `align-self` to place the positioned element instead of a `position-area`. And we are wrapping the `left` value in a `calc()` function inside which we are adding `10px` to create spacing, instead of using `margin`.
  * If none of the other try fallback options succeed in stopping the positioned element from overflowing, the browser tries the `--custom-bottom-right` position as a last resort. This places the positioned element to the bottom-right of the anchor using `position-area: bottom right`.


When a position option is applied, its values override the initial values set on the positioned element. For example, the `width` initially set on the positioned element is `200px`, but when the `--custom-right` position option is applied, its width is set to `100px`.
In some cases, we need to set values inside the custom position options to turn off the initial values. The `--custom-bottom` and `--custom-right` options use inset property and `*-self: anchor-center` values to place the positioned element, therefore we remove the previously-set `position-area` value in each case by setting `position-area: none`. If we didn't do this, the initially set `position-area: top` value would still take effect and interfere with the other positioning information.
# CSS motion path
The CSS motion path module allows authors to animate any graphical object along a custom path.
The idea is that when you want to animate an element moving along a path, you previously only had animating translation, position, etc. at your disposal, which wasn't ideal and only allowed for simple movements. With `offset-path` you can define a specific path of any shape you want. You then animate it along that path by animating `offset-distance`, and can choose to rotate it at any point using `offset-rotate`.
## Basic example
    
    <div id="motion-demo"></div>
    
    
    #motion-demo {
      offset-path: path("M20,20 C20,100 200,0 200,100");
      animation: move 3000ms infinite alternate ease-in-out;
      width: 40px;
      height: 40px;
      background: cyan;
    }
    
    @keyframes move {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
## Reference
>
### Properties
  * `offset`
  * `offset-anchor`
  * `offset-distance`
  * `offset-path`
  * `offset-position`
  * `offset-rotate`


### Functions
  * `ray()`


# border-inline-end-width
The `border-inline-end-width` CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-end-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-inline-end-width: thick;
    writing-mode: vertical-rl;
    
    
    border-inline-end-width: 4px;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-width'> values */
    border-inline-end-width: 2px;
    border-inline-end-width: thick;
    
    /* Global values */
    border-inline-end-width: inherit;
    border-inline-end-width: initial;
    border-inline-end-width: revert;
    border-inline-end-width: revert-layer;
    border-inline-end-width: unset;
    
Related properties are `border-block-start-width`, `border-block-end-width`, and `border-inline-start-width`, which define the other border widths of the element.
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### Applying a border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-inline-end-width: 5px;
    }
    
#### Results
# text-underline-position
The `text-underline-position` CSS property specifies the position of the underline which is set using the `text-decoration` property's `underline` value.
## Try it
    
    text-underline-position: auto;
    
    
    text-underline-position: under;
    
    
    <section id="default-example">
      <p>
        <span class="transition-all" id="example-element"
          >C<sub>8</sub>H<sub>10</sub>N<sub>4</sub>O<sub>2</sub></span
        >
        is the chemical formula for caffeine.
      </p>
    </section>
    
    
    p {
      font: 1.5em sans-serif;
    }
    
    #example-element {
      text-decoration-line: underline;
    }
    
## Syntax
    
    /* Single keyword */
    text-underline-position: auto;
    text-underline-position: under;
    text-underline-position: left;
    text-underline-position: right;
    
    /* Multiple keywords */
    text-underline-position: under left;
    text-underline-position: right under;
    
    /* Global values */
    text-underline-position: inherit;
    text-underline-position: initial;
    text-underline-position: revert;
    text-underline-position: revert-layer;
    text-underline-position: unset;
    
### Values
`auto`
    
The user agent uses its own algorithm to place the line at or under the alphabetic baseline.
`from-font`
    
If the font file includes information about a preferred position, use that value. If the font file doesn't include this information, behave as if `auto` was set, with the browser choosing an appropriate position.
`under`
    
Forces the line to be set below the alphabetic baseline, at a position where it won't cross any descenders. This is useful for ensuring legibility with chemical and mathematical formulas, which make a large use of subscripts.
`left`
    
In vertical writing-modes, this keyword forces the line to be placed on the left side of the text. In horizontal writing-modes, it is a synonym of `auto`.
`right`
    
In vertical writing-modes, this keyword forces the line to be placed on the right side of the text. In horizontal writing-modes, it is a synonym of `auto`.
## Examples
>
### A basic example
We create two example paragraphs:
    
    <p class="horizontal">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam consectetur ac
      turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor
      volutpat quis. Nam eget sodales quam. Aliquam accumsan tellus ac erat posuere.
    </p>
    
    <p class="vertical">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam consectetur ac
      turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor
      volutpat quis. Nam eget sodales quam. Aliquam accumsan tellus ac erat posuere.
    </p>
    
Our CSS looks like this:
    
    p {
      font-size: 1.5rem;
      text-transform: capitalize;
      text-decoration: underline;
      text-decoration-thickness: 2px;
    }
    
    .horizontal {
      text-underline-position: under;
    }
    
    .vertical {
      writing-mode: vertical-rl;
      text-underline-position: left;
    }
    
In this example we set both the paragraphs to have a thick underline. In the horizontal text we use `text-underline-position: under;` to put the underline below all the descenders.
In the text with a vertical `writing-mode` set, we can then use values of `left` or `right` to make the underline appear on the left or right of the text as required.
The live example looks like this:
### Setting text-underline-position globally
Because the `text-underline-position` property inherits and is not reset by the `text-decoration` shorthand property, it may be appropriate to set its value at a global level. For example, the `under` value may be appropriate for a document with lots of chemical and mathematical formulas, which make a large use of subscripts.
    
    :root {
      text-underline-position: under;
    }
    
# position-try-fallbacks
The `position-try-fallbacks` CSS property enables you to specify a list of one or more alternative position try fallback options for anchor-positioned elements to be placed relative to their associated anchor elements. When the element would otherwise overflow its inset-modified containing block, the browser will try placing the positioned element in these different fallback positions, in the order provided, until it finds a value that stops it from overflowing its container or the viewport.
Note: The `position-try` shorthand property can be used to specify `position-try-order` and `position-try-fallbacks` values in a single declaration.
Note: This property was originally named and supported in Chromium browsers as `position-try-options`, with the same property values. Until `position-try-fallbacks` is supported, use the `position-try` shorthand instead.
## Syntax
    
    /* Default value: no try fallback options */
    position-try-fallbacks: none;
    
    /* Single try option */
    position-try-fallbacks: flip-block;
    position-try-fallbacks: top;
    position-try-fallbacks: --custom-try-option;
    
    /* Multiple value combination option */
    position-try-fallbacks: flip-block flip-inline;
    
    /* Multiple values */
    position-try-fallbacks: flip-block, flip-inline;
    position-try-fallbacks: top, right, bottom;
    position-try-fallbacks: --custom-try-option1, --custom-try-option2;
    position-try-fallbacks:
      flip-block,
      flip-inline,
      flip-block flip-inline;
    position-try-fallbacks:
      flip-block,
      --custom-try-option,
      --custom-try-option flip-inline,
      right;
    
    /* Global values */
    position-try-fallbacks: inherit;
    position-try-fallbacks: initial;
    position-try-fallbacks: revert;
    position-try-fallbacks: revert-layer;
    position-try-fallbacks: unset;
    
The `position-try-fallbacks` property may be specified as either the keyword value `none` or as a comma-separated list of one or more space-separated custom position option names or `<try-tactic>`s or a `position-area` value.
### Values
`none`
    
The default value. There are no position try fallback options set.
`<try-tactic>`
    
Predefined fallback options move the positioned element by taking its computed position and transforming it across a particular axis of the anchor, mirroring any margin offsets. Possible values are:
`flip-block`
    
Flips the element's position along the block axis.
`flip-inline`
    
Flips the element's position along the inline axis.
`flip-start`
    
Flips both the inline and block axis values, swapping the `start` properties with each other, and the `end` properties with each other.
`position-area` value
    
Positions the element relative to the edges of its associated anchor element by placing the positioned element on one or more tiles of an implicit 3x3 position area grid based on the specified `<position-area>` value; the effect is the same as a custom `@position-try` fallback option containing only a `position-area` descriptor.
`<dashed-ident>`
    
Adds a custom `@position-try` option to the fallback options list, the identifying name of which matches the specified `dashed-ident`. If no custom position option exists with that name, the option is ignored.
Note: Multiple options can be specified, separated by commas.
## Description
Anchor-positioned elements should always appear in a convenient place for the user to interact with, if at all possible, regardless of where their anchor is positioned. To stop the positioned element from overflowing the viewport, it is often necessary to change its location when its anchor gets close to the edge of its containing element or the viewport.
This is achieved by providing one or more position-try fallback options in the `position-try-fallbacks` property. If the positioned element's initial position would overflow, the browser will try each fallback position option; the first fallback option that doesn't cause the element to overflow its containing block is applied. By default, the browser will try them in the order they appear in the list, applying the first one it finds that will stop the positioned element from overflowing.
If no option can be found that will place the positioned element completely on-screen, the browser will revert to displaying the positioned element at its default position before any try fallback options were applied.
Note: In some situations you might want to just hide overflowing positioned elements, which can be achieved using the `position-visibility` property. In most cases however it is better to keep them on-screen and usable.
For detailed information on anchor features and position try fallback usage, see the CSS anchor positioning module landing page and the Fallback options and conditional hiding for overflow guide.
### Predefined <try-tactic> values
Referred to as a `<try-tactic>` in the specification, the predefined values move the positioned element by taking its computed position and transforming it across a particular axis of the anchor. The predefined values are:
`flip-block`
    
Flips the element's position along the block axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across an inline axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the top of the anchor, this value would flip the position to the bottom.
`flip-inline`
    
Flips the element's position along the inline axis so that it appears the same distance away from the anchor but on the opposite side of it. To put it another way, it mirrors the element's position across a block axis drawn through the center of the anchor. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip the position to the right.
`flip-start`
    
Mirrors the element's position across an axis drawn diagonally through the center of the anchor, passing through the point at the intersection of the block axis start and the inline axis start, and the point at the intersection of the block axis end and the inline axis end. As an example, if the positioned element started to overflow at the left of the anchor, this value would flip the positioned element to the top.
### Combination options
A single position-try fallback option can include more than one `<try-tactic>` or `dashed-ident` options, or a combination of both by declaring them as a single space-separated option:
  * In the case of multiple predefined `<try-tactic>` options, their transformations are composed together.
  * In the case of declaring a predefined `<try-tactic>` and a `<dashed-ident>` named `@position-try` option, the custom position option is applied first, then the `<try-tactic>` transformation is applied.


`position-area` values cannot be combined like this.
## Examples
>
### Basic usage
This example shows the basic usage of a couple of predefined `<try-tactic>` fallback options.
#### HTML
The HTML includes two `<div>` elements that will become an anchor and an anchor-positioned element:
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
#### CSS
We style the `<body>` element to be very large, to enable both horizontal and vertical scrolling.
The anchor is given an `anchor-name` and large margins to place it somewhere near the center of the visible section of the `<body>`:
    
    body {
      width: 1500px;
      height: 500px;
    }
    
    .anchor {
      anchor-name: --my-anchor;
      margin: 100px 350px;
    }
    
The infobox is given fixed positioning, a `position-anchor` property that references the anchor's `anchor-name`, to associate the two together, and it is tethered to the anchor's top-left corner using a `position-area`.
We include a `position-try-fallbacks` list (and re-declare it with the `position-try` shorthand in case the longhand property name is not yet supported), providing two predefined position-try fallback options to prevent it from overflowing when the anchor gets near the edge of the viewport, by flipping it along the inline or block axis of the anchor.
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
      position-area: top left;
    
      position-try-fallbacks: flip-block, flip-inline;
      position-try: flip-block, flip-inline;
    }
    
#### Result
This gives us the following result:
Try scrolling so the anchor nears the edges:
  * If you move the anchor near the top of the viewport, you will see the positioned element flip to the bottom-left of the anchor to avoid overflowing.
  * If you move the anchor near the left of the viewport, you will see the positioned element flip to the top-right of the anchor to avoid overflowing.


However, if you move the anchor towards the top-left corner of the viewport, you'll notice a problem — as the positioned element starts to overflow in the block and inline direction, it flips back to its default top-left position and overflows in both directions, which is not what we want.
This is because we only gave the browser position options of `flip-block` or `flip-inline`. We didn't give it the option of trying both at the same time. The next example will show you how to fix this issue.
### Combining multiple values into one option
Let's use a combined try fallback option to fix the problem we found with the previous demo.
#### HTML and CSS
All of the HTML and CSS in this demo is the same, except for the positioned element code. In this case, it is given a third position try fallback option: `flip-block flip-inline`:
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
      position-area: top left;
    
      position-try:
        flip-block,
        flip-inline,
        flip-block flip-inline;
      position-try-fallbacks:
        flip-block,
        flip-inline,
        flip-block flip-inline;
    }
    
#### Result
The third position-try fallback option means that the browser will try `flip-block` then `flip-inline` to avoid overflow, and if those fallbacks fail, it will combine the two, flipping the element's position in the block and inline directions at the same time. Now when you scroll the anchor towards the top and left edges of the viewport, the positioned element will flip over to the bottom-right.
###  `position-area` try fallback options
This example shows some `position-area` position-try fallback options in action.
#### HTML and CSS
All of the HTML and CSS in this demo is the same, except for the positioned element code. In this case, our position try fallback options are all `position-area` values — `top`, `top right`, `right`, `bottom right`, `bottom`, `bottom left`, and `left`.
This means that the positioned element will find a reasonable position to display in, whatever viewport edges the anchor is near. This approach is a bit more longwinded than the predefined values approach, but it is also more granular and flexible.
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
      position-area: top left;
    
      position-try:
        top, top right, right,
        bottom right, bottom,
        bottom left, left;
    
      position-try-fallbacks:
        top, top right, right,
        bottom right, bottom,
        bottom left, left;
    }
    
#### Result
Scroll the page and check out the effect of these position-try fallback options as the anchor nears the edge of the viewport.
### Custom try option examples
See the `@position-try` reference page.
# -webkit-text-stroke-width
The `-webkit-text-stroke-width` CSS property specifies the width of the stroke for text.
## Syntax
    
    /* Keyword values */
    -webkit-text-stroke-width: thin;
    -webkit-text-stroke-width: medium;
    -webkit-text-stroke-width: thick;
    
    /* <length> values */
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-width: 0.1em;
    -webkit-text-stroke-width: 1mm;
    -webkit-text-stroke-width: 5pt;
    
    /* Global values */
    -webkit-text-stroke-width: inherit;
    -webkit-text-stroke-width: initial;
    -webkit-text-stroke-width: revert;
    -webkit-text-stroke-width: revert-layer;
    -webkit-text-stroke-width: unset;
    
### Values
`<line-width>`
    
The width of the stroke.
## Examples
>
### Varying stroke widths
#### CSS
    
    p {
      margin: 0;
      font-size: 4em;
      -webkit-text-stroke-color: red;
    }
    
    #thin {
      -webkit-text-stroke-width: thin;
    }
    
    #medium {
      -webkit-text-stroke-width: 3px;
    }
    
    #thick {
      -webkit-text-stroke-width: 1.5mm;
    }
    
#### HTML
    
    <p id="thin">Thin stroke</p>
    <p id="medium">Medium stroke</p>
    <p id="thick">Thick stroke</p>
    
#### Results
# justify-content
The CSS `justify-content` property defines how the browser distributes space between and around content items along the main axis of a flex container and the inline axis of grid and multicol containers.
The interactive example below demonstrates some `justify-content` values using grid layout.
## Try it
    
    justify-content: start;
    
    
    justify-content: center;
    
    
    justify-content: space-between;
    
    
    justify-content: space-around;
    
    
    justify-content: space-evenly;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 220px;
      display: grid;
      grid-template-columns: 60px 60px;
      grid-auto-rows: 40px;
      row-gap: 10px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Syntax
    
    /* Positional alignment */
    justify-content: center;
    justify-content: start;
    justify-content: end;
    justify-content: flex-start;
    justify-content: flex-end;
    justify-content: left;
    justify-content: right;
    
    /* Normal alignment */
    justify-content: normal;
    
    /* Distributed alignment */
    justify-content: space-between;
    justify-content: space-around;
    justify-content: space-evenly;
    justify-content: stretch;
    
    /* Overflow alignment (for positional alignment only)*/
    justify-content: safe center;
    justify-content: unsafe center;
    
    /* Global values */
    justify-content: inherit;
    justify-content: initial;
    justify-content: revert;
    justify-content: revert-layer;
    justify-content: unset;
    
### Values
`start`
    
The items are packed flush to each other toward the start edge of the alignment container in the main axis.
`end`
    
The items are packed flush to each other toward the end edge of the alignment container in the main axis.
`flex-start`
    
The items are packed flush to each other toward the start edge of the alignment container on the flex container's main-start side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `start`.
`flex-end`
    
The items are packed flush to each other at the end edge of the alignment container on the flex container's main-end side. This only applies to flex layout items. For items that are not children of a flex container, this value is treated like `end`.
`center`
    
The items are packed flush to each other toward the center of the alignment container along the main axis.
`left`
    
The items are packed flush to each other toward the left edge of the alignment container. When the property's horizontal axis is not parallel with the inline axis, such as when `flex-direction: column;` is set, this value behaves like `start`.
`right`
    
The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis (in a grid container) or the main-axis (in a flexbox container), this value behaves like `start`.
`normal`
    
Behaves as `stretch`, except in the case of multi-column containers with a non-`auto` `column-width`, in which case the columns take their specified `column-width` rather than stretching to fill the container. As `stretch` behaves as `start` in flex containers, `normal` also behaves as `start`.
`space-between`
    
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge.
`space-around`
    
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The empty space before the first and after the last item equals half of the space between each pair of adjacent items. If there is only one item, it will be centered.
`space-evenly`
    
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same.
`stretch`
    
If the combined size of the items along the main axis is less than the size of the alignment container, any `auto`-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis.
Note: For flexboxes, the `stretch` value behaves as `flex-start` or `start`. This is because, in flexboxes, stretching is controlled using the `flex-grow` property.
`safe`
    
If the item overflows the alignment container, then the item is aligned as if the alignment mode is `start`. The desired alignment will not be implemented.
`unsafe`
    
Even if the item overflows the alignment container, the desired alignment will be implemented. Unlike `safe`, which will ignore the desired alignment in favor of preventing overflow.
## Description
Defined in the CSS box alignment module, `justify-content` applies to multicol containers, flex containers, and grid containers. The property does not apply to and has no effect on block containers.
This property shares many keyword values with the `align-content` property, but not all! `justify-content` isn't involved in baseline alignment, and therefore does not take baseline values.
In flex layouts, the property defines how positive free space is distributed between or around flex items along the main axis. This property impacts the space between elements in a line, not the space between lines. The alignment is done after the lengths and auto margins are applied, which means that when one or more flex items in a line have a `flex-grow` factor greater than `0`, the property has no effect as there is no space to distribute along that line. Also, as stretching along the main axis is controlled by `flex`, the `stretch` value behaves as `flex-start`.
With grid layout, this property distributes available space between or around grid columns, not grid items. If the grid container is larger than the grid itself, the `justify-content` property can be used to justify the grid along the inline axis, aligning the grid columns.
Grid `auto` track sizes (and only `auto` track sizes) can be stretched by the `align-content` and `justify-content` properties. Therefore by default, an `auto` sized track will take up any remaining space in the grid container. As the grid's inline size has to be less than the grid container's inline size for there to be space to distribute, the property has no effect in this case.
## Examples
>
### Basic grid example
In this example, we have a grid that is narrower than its grid container, and we use `justify-content` to distribute the available space evenly around and between the grid columns.
#### HTML
The `<section>` container, our grid container to-be, has 16 nested `<div>`s that will become grid items.
    
    <section class="container">
      <div>A</div>
      <div>B</div>
      <div>C</div>
      <div>D</div>
      <div>E</div>
      <div>F</div>
      <div>G</div>
      <div>H</div>
      <div>I</div>
      <div>J</div>
      <div>K</div>
      <div>L</div>
      <div>M</div>
      <div>N</div>
      <div>O</div>
      <div>P</div>
    </section>
    
#### CSS
We set the container width to `500px` and specify three columns, each `80px` wide, meaning there is `260px` of available space to distribute between or around them. We then set `justify-content: space-evenly`, which means there will be `65px` of space before, between, and after each column.
We set different widths (and background colors) to demonstrate how the justification is applied to the columns.
    
    .container {
      display: grid;
      grid: auto-flow / repeat(3, 80px);
      width: 500px;
      justify-content: space-evenly;
    }
    
    div {
      background-color: pink;
      width: 80px;
    }
    
    div:nth-of-type(n + 9) {
      width: 35px;
      background-color: lightgreen;
    }
    
    div:nth-last-of-type(3) {
      width: 250px;
      background-color: lightblue;
    }
    
#### Result
Note that `justify-contents` aligns the columns and has no effect on the items or alignment in grid areas. Grid items, even those that overflow their grid cell, do not impact column justification.
### The safe keyterm
This example demonstrates the `safe` keyterm. We specify four centered flex items that are not allowed to wrap, and as a result, overflow their single flex-line container. By adding `safe` to `center` in the `justify-content` property, overflowing content behaves as if the alignment mode is `start`
The container is set to `center`, with every container other than the first having the `safe` keyword added:
    
    .container {
      align-items: baseline;
      display: flex;
      width: 350px;
      height: 2em;
    }
    
    .safe {
      justify-content: center;
    }
    
    .safe-center {
      justify-content: safe center;
    }
    
    div {
      flex: 0 0 100px;
    }
    
#### Result
As an item overflows the alignment container, with `safe` included the alignment mode behaves as `start` and the `center` alignment is not implemented. The `safe` keyterm has no effect if the items do not overflow the container.
### Visualizing flex item distribution
This example includes a multi-line wrapping flex layout. The second flex item has a positive flex growth factor, consuming all the available free space in the first flex line.
#### CSS
    
    #container {
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between; /* Can be changed in the live sample */
      width: 510px;
    }
    
    div {
      line-height: 2em;
      flex: 0 0 120px;
      background-color: pink;
    }
    
    div:nth-of-type(2) {
      flex-grow: 1;
      background-color: yellow;
    }
    
    div:nth-of-type(n + 9) {
      flex: 0 0 35px;
      background-color: lightgreen;
    }
    div:last-of-type {
      flex: 0 0 300px;
      background-color: lightblue;
    }
    
#### Result
Select different keywords from the drop-down menu to visualize the different `justify-content` keyword values. Because an item on the first line can grow, there is no available space on that line for the `justify-content` property to distribute. With the `space-between` value, the first item on each line is flush with the main-start edge, and the last item is flush with the main-end edge. As a result, if a line has only one item, it will be aligned with the main-start edge (as seen in the last line). This is not the case for other `space-*` values, such as `space-evenly` and `space-around`, which center one-item flex-lines.
# @scope
The `@scope` CSS at-rule enables you to select elements in specific DOM subtrees, targeting elements precisely without writing overly-specific selectors that are hard to override, and without coupling your selectors too tightly to the DOM structure.
In JavaScript, `@scope` can be accessed via the CSS object model interface `CSSScopeRule`.
## Syntax
The `@scope` at-rule contains one or more rulesets (termed scoped style rules) and defines a scope in which to apply them to selected elements. `@scope` can be used in two ways:
  1. As a standalone block inside your CSS, in which case it includes a prelude section that includes scope root and optional scope limit selectors — these define the upper and lower bounds of the scope.
         @scope (scope root) to (scope limit) {
           /* … */
         }
         
  2. As inline styles included inside a `<style>` element in your HTML, in which case the prelude is omitted, and the enclosed ruleset is automatically scoped to the `<style>` element's enclosing parent element.
         <parent-element>
           <style>
             @scope {
               /* rulesets */
             }
           </style>
         </parent-element>
         
It is also possible to combine an inline `@scope` with a scope limit selector, as in `@scope to (scope limit) { ... }`.


## Description
A complex web document might include components such as headers, footers, news articles, maps, media players, ads, and others. As complexity increases, effectively managing the styling for these components becomes more of a concern, and effective scoping of styles helps us manage this complexity. Let's consider the following DOM tree:
    
    body
    └─ article.feature
       ├─ section.article-hero
       │  ├─ h2
       │  └─ img
       │
       ├─ section.article-body
       │  ├─ h3
       │  ├─ p
       │  ├─ img
       │  ├─ p
       │  └─ figure
       │     ├─ img
       │     └─ figcaption
       │
       └─ footer
          ├─ p
          └─ img
    
If you wanted to select the `<img>` element inside the `<section>` with a class of `article-body`, you could do the following:
  * Write a selector like `.feature > .article-body > img`. However, that has high specificity so is hard to override, and is also tightly coupled to the DOM structure. If your markup structure changes in the future, you might need to rewrite your CSS.
  * Write something less specific like `.article-body img`. However, that will select all images inside the `section`.


This is where `@scope` is useful. It allows you to define a precise scope inside which your selectors are allowed to target elements. For example, you could solve the above problem using a standalone `@scope` block like the following:
    
    @scope (.article-body) to (figure) {
      img {
        border: 5px solid black;
        background-color: goldenrod;
      }
    }
    
The `.article-body` scope root selector defines the upper bound of the DOM tree scope in which the ruleset will be applied, and the `figure` scope limit selector defines the lower bound. As a result, only `<img>` elements inside a `<section>` with a class of `article-body`, but not inside `<figure>` elements, will be selected.
Note: This kind of scoping — with an upper and lower bound — is commonly referred to as a donut scope.
The scope's upper bound is inclusive and its lower bound is exclusive. To change this behavior, you can combine either selector with a universal child selector. For example, `@scope (scope root) to (scope limit > *)` would make both bounds inclusive, `@scope (scope root > *) to (scope limit)` would make both bounds exclusive, while `@scope (scope root > *) to (scope limit > *)` would give an exclusive upper bound and an inclusive lower bound.
If you want to select all images inside a `<section>` with a class of `article-body`, you can omit the scope limit:
    
    @scope (.article-body) {
      img {
        border: 5px solid black;
        background-color: goldenrod;
      }
    }
    
Or you could include your `@scope` block inline inside a `<style>` element, which in turn is inside the `<section>` with a class of `article-body`:
    
    <section class="article-body">
      <style>
        @scope {
          img {
            border: 5px solid black;
            background-color: goldenrod;
          }
        }
      </style>
    
      <!-- ... -->
    </section>
    
Note: It is important to understand that, while `@scope` allows you to isolate the application of selectors to specific DOM subtrees, it does not completely isolate the applied styles to within those subtrees. This is most noticeable with inheritance — properties that are inherited by children (for example `color` or `font-family`) will still be inherited, beyond any set scope limit.
###  `:scope` pseudo-class within `@scope` blocks
In the context of an `@scope` block, the `:scope` pseudo-class provides a convenient way to directly apply styles to the scope root, like so:
    
    @scope (.feature) {
      :scope {
        background: rebeccapurple;
        color: antiquewhite;
        font-family: sans-serif;
      }
    }
    
Here's some considerations for `:scope` within `@scope` blocks:
  * `:scope` adds class-level specificity (see Specificity in @scope for details).
  * A scope limit can use `:scope` to specify a specific relationship requirement between the scope limit and root. For example:
        /* figure is only a limit when it is a direct child of the :scope */
        @scope (.article-body) to (:scope > figure) {
          /* … */
        }
        
  * A scope limit can reference elements outside the scope root using `:scope`. For example:
        /* figure is only a limit when the :scope is inside .feature */
        @scope (.article-body) to (.feature :scope figure) {
          /* … */
        }
        
  * Scoped style rules can't escape the subtree. Selections like `:scope + p` are invalid because that selection would be outside the subtree.
  * It is perfectly valid to define the scope root and limit as a selector list, in which case multiple scopes will be defined. In the following example the styles are applied to any `<img>` inside a `<section>` with a class of `article-hero` or `article-body`, but not if it is nested inside a `<figure>`:
        @scope (.article-hero, .article-body) to (figure) {
          img {
            border: 5px solid black;
            background-color: goldenrod;
          }
        }
        


### Specificity in `@scope`
Inside an `@scope` rule, both bare selectors and the `&` nesting selector behave as if `:where(:scope)` were prepended to the selector. Because `:where()` has zero specificity, bare selectors and `&` add zero weight. The specificity weight is determined by the rest of the selector. For example, the specificity of the `& img` selector is equivalent to the specificity of `:where(:scope) img` (0-0-1).
Warning: The specificity of `&` inside `@scope` blocks is handled differently according to the browser engine and release version. Check Browser compatibility for details.
In both cases in the following code block, the only specificity comes from `img`:
    
    @scope (.article-body) {
      /* img has a specificity of 0-0-1, as expected */
      img {
        /* … */
      }
    
      /* & img also has a specificity of 0-0-1 */
      & img {
        /* … */
      }
    }
    
By contrast, using `:scope` explicitly selects the scope root and adds class-level specificity (0-1-0), since `:scope` is a pseudo-class. In the following code block, `:scope img` has a specificity of 0-1-1:
    
    @scope (.article-body) {
      /* :scope img has a specificity of 0-1-0 + 0-0-1 = 0-1-1 */
      :scope img {
        /* … */
      }
    }
    
### How `@scope` conflicts are resolved
`@scope` adds a new criterion to the CSS cascade: scoping proximity. This states that when two scopes have conflicting styles, the style that has the smallest number of hops up the DOM tree hierarchy to the scope root is applied. Let's look at an example to see what this means.
Take the following HTML snippet, where different-themed cards are nested inside one another:
    
    <div class="light-theme">
      <p>Light theme text</p>
      <div class="dark-theme">
        <p>Dark theme text</p>
        <div class="light-theme">
          <p>Light theme text</p>
        </div>
      </div>
    </div>
    
If you wrote the theme CSS like so, you'd run into trouble:
    
    .light-theme {
      background: #cccccc;
    }
    
    .dark-theme {
      background: #333333;
    }
    
    .light-theme p {
      color: black;
    }
    
    .dark-theme p {
      color: white;
    }
    
The innermost paragraph is supposed to be colored black because it is inside a light theme card. However, it's targeted by both `.light-theme p` and `.dark-theme p`. Because the `.dark-theme p` rule appears later in the source order, it is applied, and the paragraph ends up being wrongly colored white.
To fix this, you can use `@scope` as follows:
    
    @scope (.light-theme) {
      :scope {
        background: #cccccc;
      }
      p {
        color: black;
      }
    }
    
    @scope (.dark-theme) {
      :scope {
        background: #333333;
      }
      p {
        color: white;
      }
    }
    
Now the innermost paragraph is correctly colored black. This is because it is only one DOM tree hierarchy level away from the `.light-theme` scope root, but two levels away from the `.dark-theme` scope root. Therefore, the light style wins.
Note: Scoping proximity overrules source order but is itself overridden by other, higher-priority criteria such as importance, layers, and specificity.
## Examples
>
### Basic style inside scope roots
In this example, we use two separate `@scope` blocks to match links inside elements with a `.light-scheme` and `.dark-scheme` class respectively. Note how `:scope` is used to select and provide styling to the scope roots themselves. In this example, the scope roots are the `<div>` elements that have the classes applied to them.
#### HTML
    
    <div class="light-scheme">
      <p>
        MDN contains lots of information about
        <a href="/en-US/docs/Web/HTML">HTML</a>,
        <a href="/en-US/docs/Web/CSS">CSS</a>, and
        <a href="/en-US/docs/Web/JavaScript">JavaScript</a>.
      </p>
    </div>
    
    <div class="dark-scheme">
      <p>
        MDN contains lots of information about
        <a href="/en-US/docs/Web/HTML">HTML</a>,
        <a href="/en-US/docs/Web/CSS">CSS</a>, and
        <a href="/en-US/docs/Web/JavaScript">JavaScript</a>.
      </p>
    </div>
    
#### CSS
    
    @scope (.light-scheme) {
      :scope {
        background-color: plum;
      }
    
      a {
        color: darkmagenta;
      }
    }
    
    @scope (.dark-scheme) {
      :scope {
        background-color: darkmagenta;
        color: antiquewhite;
      }
    
      a {
        color: plum;
      }
    }
    
#### Result
The above code renders like this:
### Scope roots and scope limits
In this example, we have an HTML snippet that matches the DOM structure we talked about earlier in the Description section. This structure represents a typical article summary. The key features to note are the `<img>` elements, which are nested at various levels in the structure.
The aim of this example is to show how to use a scope root and limit to style `<img>` elements starting at the top of the hierarchy, but only down as far as (and not including) the `<img>` inside the `<figure>` element — in effect creating a donut scope.
#### HTML
    
    <article class="feature">
      <section class="article-hero">
        <h2>Article heading</h2>
        <img alt="image" />
      </section>
    
      <section class="article-body">
        <h3>Article subheading</h3>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam euismod
          consectetur leo, nec eleifend quam volutpat vitae. Duis quis felis at
          augue imperdiet aliquam. Morbi at felis et massa mattis lacinia. Cras
          pharetra velit nisi, ac efficitur magna luctus nec.
        </p>
    
        <img alt="image" />
    
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    
        <figure>
          <img alt="image" />
          <figcaption>My infographic</figcaption>
        </figure>
      </section>
    
      <footer>
        <p>Written by Chris Mills.</p>
        <img alt="image" />
      </footer>
    </article>
    
#### CSS
In our CSS, we have two `@scope` blocks:
  * The first `@scope` block defines its scope root as elements with a class of `.feature` (in this case, the outer `<article>` only), demonstrating how `@scope` can be used to theme a specific HTML subset.
  * The second `@scope` block also defines its scope root as elements with a class of `.feature`, but also defines a scope limit of `figure`. This ensures that contained rulesets will only be applied to matching elements within the scope root (`<article class="feature"> ... </article>` in this case) that are not nested inside descendant `<figure>` elements. This `@scope` block contains a single ruleset that styles `<img>` elements with a thick black border and a golden background color.


    
    /* Scoped CSS */
    
    @scope (.feature) {
      :scope {
        background: rebeccapurple;
        color: antiquewhite;
        font-family: sans-serif;
      }
    
      figure {
        background-color: white;
        border: 2px solid black;
        color: black;
        padding: 10px;
      }
    }
    
    /* Donut scope */
    
    @scope (.feature) to (figure) {
      img {
        border: 5px solid black;
        background-color: goldenrod;
      }
    }
    
#### Result
In the rendered code, note how all of the `<img>` elements are styled with the thick border and golden background, except for the one inside the `<figure>` element (labeled "My infographic").
>
### css.at-rules.scope
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`@scope` 118 118 128 104 17.4 118 No 79 17.4 25.0 118 17.4  
### css.selectors.nesting.at-scope
Desktop Mobile  
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS  
`@scope` No No 142 No No No 142 No No No No No  
# :first-of-type
The `:first-of-type` CSS pseudo-class represents the first element of its type (tag name) among a group of sibling elements.
## Try it
    
    dt {
      font-weight: bold;
    }
    
    dd {
      margin: 3px;
    }
    
    dd:first-of-type {
      border: 2px solid orange;
    }
    
    
    <dl>
      <dt>Vegetables:</dt>
      <dd>1. Tomatoes</dd>
      <dd>2. Cucumbers</dd>
      <dd>3. Mushrooms</dd>
      <dt>Fruits:</dt>
      <dd>4. Apples</dd>
      <dd>5. Mangos</dd>
      <dd>6. Pears</dd>
      <dd>7. Oranges</dd>
    </dl>
    
## Syntax
    
    :first-of-type {
      /* ... */
    }
    
## Examples
>
### Styling the first paragraph
#### HTML
    
    <h2>Heading</h2>
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
    
#### CSS
    
    p:first-of-type {
      color: red;
      font-style: italic;
    }
    
#### Result
### Nested elements
This example shows how nested elements can also be targeted. Note that the universal selector (`*`) is implied when no type selector is written.
#### HTML
    
    <article>
      <div>This `div` is first!</div>
      <div>This <span>nested `span` is first</span>!</div>
      <div>
        This <em>nested `em` is first</em>, but this <em>nested `em` is last</em>!
      </div>
      <div>This <span>nested `span` gets styled</span>!</div>
      <p>This `p` qualifies!</p>
      <div>This is the final `div`.</div>
    </article>
    
#### CSS
    
    article :first-of-type {
      background-color: pink;
    }
    
#### Result
# CSS multi-column layout
The CSS multi-column layout module lets you divide content across multiple columns. By using the properties in this module, you can define the preferred number and width of columns, the gap size between columns, and the visual appearance of the optional column dividing lines (known as column rules). You can also define how content should flow from column to column and how to break content between columns.
## Multi-column layout in action
In this example, the 1967 speech from Canada's centennial, A Lament for Confederation, by Chief Dan George, is displayed across multiple columns, similar to the way articles are displayed in printed newspapers. If you have JavaScript enabled, controls enable changing the preferred column number and width, the width of the gap between columns, whether the title and a sample blockquote should be contained in a single column or made to span all columns, and whether breaking within the paragraphs should be avoided.
Note: Multiple-column layout is closely related to paged media. Each column box is a fragment, much like each printed page is a fragment of a document. Using the properties defined in the CSS fragmentation module, you can control how content breaks between columns and pages.
## Reference
>
### Properties
  * `column-fill`
  * `column-gap`
  * `column-span`
  * `column-rule` shorthand 
    * `column-rule-color`
    * `column-rule-style`
    * `column-rule-width`
  * `columns` shorthand 
    * `column-count`
    * `column-width`


Note: Bear in mind that setting container height and line length can pose challenges for people with visual or cognitive disabilities. WCAG Success Criterion 1.4.8 states that even when the text size is doubled, content should not need to be scrolled.
## Selectors and pseudo-elements
  * `::column`


## Guides
Basic concepts of multi-column layouts
    
Overview of the multiple-column layout specification.
Using multi-column layouts
    
Guide to using multi-column properties for laying out text.
Styling columns
    
Guide to styling columns and managing spacing between columns.
Spanning and balancing
    
How to make elements span across all columns and control the way columns are filled.
Handling overflow in multi-column layout
    
What happens when an item overflows the column it is in and what happens when there is too much columned content to fit a container.
Handling content breaks in multi-column layout
    
Introduction to the fragmentation specification and how to control where column content breaks.
Creating CSS carousels
    
Create pure-CSS carousel UI features using scroll buttons, scroll markers, and generated columns.
## Related concepts
CSS fragmentation module
  * `break-after`
  * `break-before`
  * `break-inside`
  * `orphans`
  * `widows`


CSS box alignment module
  * `gap`


CSS box sizing module
  * `height`
  * `max-height`
  * `block-size`
  * `width`
  * `max-width`


CSS overflow module
  * `overflow`
  * `::scroll-marker`
  * `::scroll-marker-group`
  * Scroll container glossary term


CSS display module
  * Block formatting context guide


# atan2()
The `atan2()` CSS function is a trigonometric function that returns the inverse tangent of two values between `-infinity` and `infinity`. The function accepts two arguments and returns the number of radians representing an `<angle>` between `-180deg` and `180deg`.
## Syntax
    
    /* Two <number> values */
    transform: rotate(atan2(3, 2));
    
    /* Two <dimension> values */
    transform: rotate(atan2(1rem, -0.5rem));
    
    /* Two <percentage> values */
    transform: rotate(atan2(20%, -30%));
    
    /* Other values */
    transform: rotate(atan2(pi, 45));
    transform: rotate(atan2(e, 30));
    
### Parameters
The `atan2(y, x)` function accepts two comma-separated values as its parameters. Each value can be a `<number>`, a `<dimension>`, or a `<percentage>`. Both values must be of the same type, although if they are `<dimension>` they can be of different units (example: `atan2(100px, 5vw)` is valid).
`y`
    
The y-coordinate of the point. A calculation which resolves to a `<number>`, a `<dimension>`, or a `<percentage>`.
`x`
    
The x-coordinate of the point. A calculation which resolves to a `<number>`, a `<dimension>`, or a `<percentage>`.
### Return value
Given two values `x` and `y`, the function `atan2(y, x)` calculates and returns the `<angle>` between the positive x-axis and the ray from the origin to the point `(x, y)`.
## Examples
>
### Rotate elements
The `atan2()` function can be used to `rotate` elements as it return an `<angle>`.
#### HTML
    
    <div class="box box-1"></div>
    <div class="box box-2"></div>
    <div class="box box-3"></div>
    <div class="box box-4"></div>
    <div class="box box-5"></div>
    
#### CSS
    
    div.box {
      width: 100px;
      height: 100px;
      background: linear-gradient(orange, red);
    }
    div.box-1 {
      transform: rotate(atan2(3, 2));
    }
    div.box-2 {
      transform: rotate(atan2(3%, -2%));
    }
    div.box-3 {
      transform: rotate(atan2(-1, 0.5));
    }
    div.box-4 {
      transform: rotate(atan2(1, 0.5));
    }
    div.box-5 {
      transform: rotate(atan2(1rem, -0.5rem));
    }
    
#### Result
# y
The `y` CSS property defines the y-axis coordinate of the top left corner of the SVG `<rect>` shape, `<image>` image, `<foreignObject>` viewport and nested `<svg>` viewport relative to the nearest `<svg>` ancestor's user coordinate system. If present, it overrides the element's `y` attribute.
Note: The `y` property only applies to `<rect>`, `<image>`, `<foreignObject>`, and `<svg>` elements nested in an `<svg>`. It has no effect on outermost `<svg>` elements and does not apply to other SVG elements nor to HTML elements or pseudo-elements.
## Syntax
    
    /* length and percentage values */
    y: 10px;
    y: 10%;
    
    /* Global values */
    y: inherit;
    y: initial;
    y: revert;
    y: revert-layer;
    y: unset;
    
### Values
The `<length>` and `<percentage>` values denote the y-axis coordinate position of the top left corner of the SVG element.
`<length>`
    
As an absolute or relative length, it can be expressed in any unit allowed by the CSS `<length>` data type.
`<percentage>`
    
Percentages refer to the height of the SVG `viewBox`, if declared, otherwise, the percentage refers to the height of the current SVG viewport.
## Examples
>
### Defining the y-axis coordinates of SVG shapes
This example demonstrates the basic use case of `y`, and how the CSS `y` property takes precedence over the `y` attribute.
#### HTML
We include four identical SVG `<rect>` elements; their `x` and `y` attributes values are all `10`, meaning the four rectangles are all in the same location, `10px` from the top and left corner of the SVG viewport.
    
    <svg>
      <rect width="40" height="40" x="10" y="10" />
      <rect width="40" height="40" x="10" y="10" />
      <rect width="40" height="40" x="10" y="10" />
      <rect width="40" height="40" x="10" y="10" />
    </svg>
    
#### CSS
We style all the rectangles to have a black border and be slightly transparent, so overlapping rectangles are visible. We provide the rectangle with different `fill` and `y` values.
    
    svg {
      border: 1px solid;
    }
    
    rect {
      fill: none;
      stroke: black;
      opacity: 0.8;
    }
    
    rect:nth-of-type(2) {
      y: -20px;
      fill: red;
    }
    
    rect:nth-of-type(3) {
      y: 4em;
      fill: yellow;
    }
    
    rect:nth-of-type(4) {
      y: 60%;
      fill: orange;
    }
    
#### Results
The top edges of the rectangles are at `10` (from the attribute), `-20px`, `4em`, and `60%`, respectively. The rectangle is `40px` tall, so the `-20px` places half the red rectangle outside the viewport. The SVG is `150px` tall, so the orange rectangle's top side is `90px` from the top of the SVG viewport.
# border-inline-end-color
The `border-inline-end-color` CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-end-color: red;
    writing-mode: horizontal-tb;
    
    
    border-inline-end-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-inline-end-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    border-inline-end-color: rebeccapurple;
    border-inline-end-color: #663399;
    
    /* Global values */
    border-inline-end-color: inherit;
    border-inline-end-color: initial;
    border-inline-end-color: revert;
    border-inline-end-color: revert-layer;
    border-inline-end-color: unset;
    
Related properties are `border-block-start-color`, `border-block-end-color`, and `border-inline-start-color`, which define the other border colors of the element.
### Values
`<color>`
    
The color of the border.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-inline-end-color: red;
    }
    
# superellipse()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `superellipse()` CSS function defines the curvature of an ellipse, and is used to specify corner shapes either directly, or via `<corner-shape-value>` keywords.
## Syntax
    
    superellipse(infinity)
    superellipse(4)
    superellipse(1.7)
    superellipse(0)
    superellipse(-2.8)
    superellipse(-3)
    superellipse(-infinity)
    
### Parameters
`<number>`
    
A number in the range of `-infinity` to `infinity`, inclusive.
### Return value
A superellipse shape.
## Description
The `superellipse()` function returns a superellipse shape, which is used to specify `corner-shape` values. A superellipse is a closed curve symmetric shape between a rectangle and an ellipse. It resembles an ellipse that retains the geometric features of its two axes.
The superellipse shape is calculated using a modified version of an ellipse. The following equation defines an ellipse centered at the origin:
x 2 a 2 + y 2 b 2 = 1
The `a` and `b` variables refer to the radii of the ellipse, while the `x` and `y` coordinates are points on the ellipse's circumference.
A circle is an ellipse where the radii, the `a` and `b` in the previous equation, are the same length. With `a` and `b` both equal to `r`, the equation for a circle can be written as:
x 2 + y 2 = r 2
In this equation, the `x` and `y` are coordinates of points on the circle's circumference, and the `r` is the radius of the circle, with the center of the circle being `(0, 0)`. The ellipse is produced by scaling a circle shape along the `x` and/or `y` axis.
A superellipse shape is created by replacing the `2` exponent in each case with 2K, `K` being the argument passed to the `superellipse()` function, which modifies the curvature of the ellipse:
x 2 K + y 2 K = 1
The following diagram illustrates different `superellipse()` values for the top right corner of a container: `infinity`, `1`, `0`, `-1`, and `-infinity`:
  * A `K` value of `0` creates a straight line. This value can be used to create bevelled corners and corresponds to the `<corner-shape-value>` `bevel` keyword.
  * A `K` value of `1` creates an ordinary ellipse, corresponding to the `round` keyword.
  * A `K` value of `>1` makes the ellipse shape more square; `2` corresponds to the `squircle` keyword.
  * A `K` value of `infinity` creates a perfect square (corresponding to the `square` keyword), although `K` values of `10` or more are virtually indistinguishable from a square.
  * Negative `K` values result in a concave curve, resulting in corner shapes that are curved inward, or "scooped out". A `K` value of `-1` corresponds to the `scoop` keyword and `-infinity` corresponds to the `notch` keyword.


A negative or positive superellipse would appear symmetrical to a superellipse with its inverse value.
Note: For any `K` parameter value passed, the `superellipse()` function's return value will always be the same for that `K` value. When that value is applied to two elements, the appearance of the corner shape may differ if the box size or `border-radius` values differ.
## Examples
>
###  `superellipse()` value comparison
In this example, two `<input type="range">` sliders allow you to cycle through many different `corner-shape` `superellipse()` values and `border-radius` values enabling you to compare the effects of each on a container. The code is hidden for brevity, but the full explanation of the superellipse value comparison is provided on the `corner-shape` reference page.
Note: See also the `<corner-shape-value>` value comparison example.
# grid-row-end
The `grid-row-end` CSS property specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area.
## Try it
    
    grid-row-end: auto;
    
    
    grid-row-end: 3;
    
    
    grid-row-end: -1;
    
    
    grid-row-end: span 3;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">One</div>
        <div>Two</div>
        <div>Three</div>
      </div>
    </section>
    
    
    .example-container {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1.5fr 1fr;
      grid-template-rows: repeat(3, minmax(40px, auto));
      grid-gap: 10px;
      width: 200px;
    }
    
    .example-container > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
    #example-element {
      background-color: rgb(255 0 200 / 0.2);
      border: 3px solid rebeccapurple;
    }
    
## Syntax
    
    /* Keyword value */
    grid-row-end: auto;
    
    /* <custom-ident> values */
    grid-row-end: some-grid-area;
    
    /* <integer> + <custom-ident> values */
    grid-row-end: 2;
    grid-row-end: some-grid-area 4;
    
    /* span + <integer> + <custom-ident> values */
    grid-row-end: span 3;
    grid-row-end: span some-grid-area;
    grid-row-end: 5 some-grid-area span;
    
    /* Global values */
    grid-row-end: inherit;
    grid-row-end: initial;
    grid-row-end: revert;
    grid-row-end: revert-layer;
    grid-row-end: unset;
    
### Values
`auto`
    
Is a keyword indicating that the property contributes nothing to the grid item's placement, indicating auto-placement, an automatic span, or a default span of `1`.
`<custom-ident>`
    
If there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item's placement.
Note: Named grid areas automatically generate implicit named lines of this form, so specifying `grid-row-end: foo;` will choose the end edge of that named grid area (unless another line named `foo-end` was explicitly specified before it).
Otherwise, this is treated as if the integer `1` had been specified along with the `<custom-ident>`.
The `<custom-ident>` cannot take the `span` and `auto` values.
`<integer> && <custom-ident>?`
    
Contributes the nth grid line to the grid item's placement. If a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position.
An `<integer>` value of `0` is invalid.
`span && [ <integer> || <custom-ident> ]`
    
Contributes a grid span to the grid item's placement such that the row end edge of the grid item's grid area is n lines from the start edge.
If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span.
If the <integer> is omitted, it defaults to `1`. Negative integers or 0 are invalid.
## Examples
>
### Setting row end for a grid item
#### HTML
    
    <div class="wrapper">
      <div class="box1">One</div>
      <div class="box2">Two</div>
      <div class="box3">Three</div>
      <div class="box4">Four</div>
      <div class="box5">Five</div>
    </div>
    
#### CSS
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-rows: 100px;
    }
    
    .box1 {
      grid-column-start: 1;
      grid-column-end: 4;
      grid-row-start: 1;
      grid-row-end: 3;
    }
    
    .box2 {
      grid-column-start: 1;
      grid-row-start: 3;
      grid-row-end: 5;
    }
    
#### Result
# justify-items
The CSS `justify-items` property defines the default `justify-self` for all items of the box, giving them all a default way of justifying each box along the appropriate axis.
## Try it
    
    justify-items: stretch;
    
    
    justify-items: center;
    
    
    justify-items: start;
    
    
    justify-items: end;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
The effect of this property is dependent of the layout mode we are in:
  * In block-level layouts, it aligns the items inside their containing block on the inline axis.
  * For absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
  * In table cell layouts, this property is ignored (see Box alignment for block, absolutely positioned, and table layouts)
  * In flexbox layouts, this property is ignored (see Box alignment in flexbox)
  * In grid layouts, it aligns the items inside their grid areas on the inline axis (see Box alignment in grid layout)


## Syntax
    
    /* Basic keywords */
    justify-items: normal;
    justify-items: stretch;
    
    /* Positional alignment */
    justify-items: center; /* Pack items around the center */
    justify-items: start; /* Pack items from the start */
    justify-items: end; /* Pack items from the end */
    justify-items: flex-start; /* Equivalent to 'start'. Note that justify-items is ignored in flexbox layouts. */
    justify-items: flex-end; /* Equivalent to 'end'. Note that justify-items is ignored in flexbox layouts. */
    justify-items: self-start;
    justify-items: self-end;
    justify-items: left; /* Pack items from the left */
    justify-items: right; /* Pack items from the right */
    justify-items: anchor-center;
    
    /* Baseline alignment */
    justify-items: baseline;
    justify-items: first baseline;
    justify-items: last baseline;
    
    /* Overflow alignment (for positional alignment only) */
    justify-items: safe center;
    justify-items: unsafe center;
    
    /* Legacy alignment */
    justify-items: legacy right;
    justify-items: legacy left;
    justify-items: legacy center;
    
    /* Global values */
    justify-items: inherit;
    justify-items: initial;
    justify-items: revert;
    justify-items: revert-layer;
    justify-items: unset;
    
This property can take one of four different forms:
  * Basic keywords: one of the keyword values `normal` or `stretch`.
  * Baseline alignment: the `baseline` keyword, plus optionally one of `first` or `last`.
  * Positional alignment: one of: `center`, `start`, `end`, `flex-start`, `flex-end`, `self-start`, `self-end`, `left`, or `right`. Plus optionally `safe` or `unsafe`.
  * Legacy alignment: the `legacy` keyword, followed by one of `left` or `right`.


### Values
`normal`
    
The effect of this keyword is dependent of the layout mode we are in:
  * In block-level layouts, the keyword is a synonym of `start`.
  * In absolutely-positioned layouts, the keyword behaved like `start` on replaced absolutely-positioned boxes, and as `stretch` on all other absolutely-positioned boxes.
  * In table cell layouts, this keyword has no meaning as this property is ignored.
  * In flexbox layouts, this keyword has no meaning as this property is ignored. 
  * In grid layouts, this keyword leads to a behavior similar to the one of `stretch`, except for boxes with an aspect ratio or an intrinsic size where it behaves like `start`.


`start`
    
The item is packed flush to each other toward the start edge of the alignment container in the appropriate axis.
`end`
    
The item is packed flush to each other toward the end edge of the alignment container in the appropriate axis.
`flex-start`
    
For items that are not children of a flex container, this value is treated like `start`.
`flex-end`
    
For items that are not children of a flex container, this value is treated like `end`.
`self-start`
    
The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.
`self-end`
    
The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis.
`center`
    
The items are packed flush to each other toward the center of the alignment container.
`left`
    
The items are packed flush to each other toward the left edge of the alignment container. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`right`
    
The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like `start`.
`baseline`, `first baseline`, `last baseline`
    
Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group. The fallback alignment for `first baseline` is `start`, the one for `last baseline` is `end`.
`stretch`
    
If the combined size of the items is less than the size of the alignment container, any `auto`-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by `max-height`/`max-width` (or equivalent functionality), so that the combined size exactly fills the alignment container.
`anchor-center`
    
In the case of anchor-positioned elements, aligns the items to the center of the associated anchor element in the inline direction. See Centering on the anchor using `anchor-center`.
`safe`
    
If the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were `start`.
`unsafe`
    
Regardless of the relative sizes of the item and alignment container, the given alignment value is honored.
`legacy`
    
Makes the value inherited by the box descendants. Note that if a descendant has a `justify-self: auto` value, the `legacy` keyword is not considered by the descend, only the `left`, `right`, or `center` value associated to it.
## Examples
>
### Basic demonstration
In this example, we have a 2 x 2 grid layout. Initially the grid container is given a `justify-items` value of `stretch` (the default), which causes the grid items to stretch across the entire width of their cells.
If you hover or tab onto the grid container however, it is given a `justify-items` value of `center`, which causes the grid items to span only as wide as their content width, and align in the center of their cells.
#### HTML
    
    <article class="container" tabindex="0">
      <span>First child</span>
      <span>Second child</span>
      <span>Third child</span>
      <span>Fourth child</span>
    </article>
    
#### CSS
    
    html {
      font-family: helvetica, arial, sans-serif;
      letter-spacing: 1px;
    }
    
    article {
      background-color: red;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 40px;
      grid-gap: 10px;
      margin: 20px;
      width: 300px;
      justify-items: stretch;
    }
    
    article:hover,
    article:focus {
      justify-items: center;
    }
    
    article span {
      background-color: black;
      color: white;
      margin: 1px;
      text-align: center;
    }
    
    article,
    span {
      padding: 10px;
      border-radius: 7px;
    }
    
#### Result
# revert-layer
The `revert-layer` CSS-wide keyword rolls back the value of a property in a cascade layer to the value of the property in a CSS rule matching the element in a previous cascade layer. The value of a property with this keyword is recalculated as if no rules were specified on the target element in the current cascade layer.
If there is no other cascade layer to revert to for the matching CSS rule, the property value rolls back to the computed value derived from the current layer. Furthermore, if there is no matching CSS rule in the current layer, the property value for the element rolls back to the style defined in a previous style origin.
This keyword can be applied to any CSS property, including the CSS shorthand property `all`.
## Revert-layer vs. revert
The `revert-layer` keyword lets you rollback styles to those specified in previous cascade layers within the author origin. The `revert` keyword, in comparison, lets you roll back styles applied in the author origin to those specified in the user origin or user-agent origin.
The `revert-layer` keyword is ideally meant to be applied to properties within a cascade layer. However, if applied to properties outside a cascade layer, it rolls back property values to any values set by presentational hints (such as `width` and `height` attributes or the `<s>` element in HTML), defaulting to the values established by the user agent's stylesheet or user styles. Unlike the `revert` keyword, which considers presentational hints as part of the author origin and reverts them as well, the `revert-layer` keyword ignores presentational hints outside the cascade layer, so it does not revert them.
## Examples
>
### Default cascade layer behavior
In the example below, two cascade layers are defined in the CSS, `base` and `special`. By default, rules in the `special` layer will override competing rules in the `base` layer because `special` is listed after `base` in the `@layer` declaration statement.
#### HTML
    
    <p>This example contains a list.</p>
    
    <ul>
      <li class="item feature">Item one</li>
      <li class="item">Item two</li>
      <li class="item">Item three</li>
    </ul>
    
#### CSS
    
    @layer base, special;
    
    @layer special {
      .item {
        color: red;
      }
    }
    
    @layer base {
      .item {
        color: blue;
      }
      .feature {
        color: green;
      }
    }
    
#### Result
All the `<li>` elements match the `item` rule in the `special` layer and are red. This is the default cascade layer behavior, where rules in the `special` layer take precedence over rules in the `base` layer.
### Revert to style in previous cascade layer
Let's examine how the `revert-layer` keyword changes the default cascade layer behavior. For this example, the `special` layer contains an additional `feature` rule targeting the first `<li>` element. The `color` property in this rule is set to `revert-layer`.
#### HTML
    
    <p>This example contains a list.</p>
    
    <ul>
      <li class="item feature">Item one</li>
      <li class="item">Item two</li>
      <li class="item">Item three</li>
    </ul>
    
#### CSS
    
    @layer base, special;
    
    @layer special {
      .item {
        color: red;
      }
      .feature {
        color: revert-layer;
      }
    }
    
    @layer base {
      .item {
        color: blue;
      }
      .feature {
        color: green;
      }
    }
    
#### Result
With `color` set to `revert-layer`, the `color` property value rolls back to the value in the matching `feature` rule in the previous layer `base`, and so 'Item one' is now green.
### Revert to style in previous origin
This example shows the `revert-layer` keyword behavior when there is no cascade layer to revert to and there is no matching CSS rule in the current layer to inherit the property value.
#### HTML
    
    <p>This example contains a list.</p>
    
    <ul>
      <li class="item feature">Item one</li>
      <li class="item">Item two</li>
      <li class="item">Item three</li>
    </ul>
    
#### CSS
    
    @layer base {
      .item {
        color: revert-layer;
      }
    }
    
#### Result
The style for all `<li>` elements rolls back to the defaults in the user-agent origin.
# @page
The `@page` at-rule is a CSS at-rule used to modify different aspects of printed pages. It targets and modifies the page's dimensions, orientation, and margins. The `@page` at-rule can be used to target all pages in a print-out or a subset using its various pseudo-classes.
## Syntax
    
    /* Targets all the pages */
    @page {
      size: 8.5in 9in;
      margin-top: 4in;
    }
    
    /* Targets all even-numbered pages */
    @page :left {
      margin-top: 4in;
    }
    
    /* Targets all odd-numbered pages */
    @page :right {
      size: 11in;
      margin-top: 4in;
    }
    
    /* Targets all selectors with `page: wide;` set */
    @page wide {
      size: a4 landscape;
    }
    
    @page {
      /* margin box at top right showing page number */
      @top-right {
        content: "Page " counter(pageNumber);
      }
    }
    
### Page properties
The `@page` at-rule can contain only page descriptors and margin at-rules. The following descriptors have been implemented by at least one browser:
`margin`
    
Specifies the page margins. Individual margin properties `margin-top`, `margin-right`, `margin-bottom`, and `margin-left` can also be used.
`page-orientation`
    
Specifies the orientation of the page. This does not affect the layout of the page; the rotation is applied after the layout in the output medium.
`size`
    
Specifies the target size and orientation of the page box's containing block. In the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet.
The specification mentions following CSS properties to be applicable to page boxes via @page at-rule. But these have not been supported by any user agent yet.
Remaining page properties
Feature CSS properties  
bidi properties direction  
background properties background-color  
background-image  
background-repeat  
background-attachment  
background-position  
background  
border properties border-top-width  
border-right-width  
border-bottom-width  
border-left-width  
border-width  
border-top-color  
border-right-color  
border-bottom-color  
border-left-color  
border-color  
border-top-style  
border-right-style  
border-bottom-style  
border-left-style  
border-short-style  
border-top  
border-right  
border-bottom  
border-left  
border  
counter properties counter-reset  
counter-increment  
color color  
font properties font-family  
font-size  
font-style  
font-variant  
font-weight  
font  
height properties height  
min-height  
max-height  
line height line-height  
margin properties margin-top  
margin-right  
margin-bottom  
margin-left  
margin  
outline properties outline-width  
outline-style  
outline-color  
outline  
padding properties padding-top  
padding-right  
padding-bottom  
padding-left  
padding  
quotes quotes  
text properties letter-spacing  
text-align  
text-decoration  
text-indent  
text-transform  
white-space  
word-spacing  
visibility visibility  
width properties width  
min-width  
max-width  
## Description
The @page rule defines properties of the page box. The `@page` at-rule can be accessed via the CSS object model interface `CSSPageRule`.
Note: The W3C is discussing how to handle viewport-related `<length>` units, `vh`, `vw`, `vmin`, and `vmax`. Meanwhile do not use them within a `@page` at-rule.
### Related properties
The `@page` at-rule, allows the user to assign a name to the rule, which is then called in a declaration using the `page` property.
`page`
    
Allows a selector to use a user defined named page
## Margin at-rules
The margin at-rules are used inside of the `@page` at-rule. They each target a different section of the document printed page, styling the area of the printed page based on the property values set in the style block:
    
    @page {
      @top-left {
        /* page-margin-properties */
      }
    }
    
`@top-left` targets the top-left of the document and applies the changes based on the page-margin-properties set.
Other margin-at rules include:
    
    @top-left-corner
    @top-left
    @top-center
    @top-right
    @top-right-corner
    @bottom-left-corner
    @bottom-left
    @bottom-center
    @bottom-right
    @bottom-right-corner
    @left-top
    @left-middle
    @left-bottom
    @right-top
    @right-middle
    @right-bottom
    
### Page-margin properties
The page-margin properties are the set of CSS properties can be set in any individual margin at-rule. They include:
Page-margin properties
Feature CSS properties  
bidi properties direction  
background properties background-color  
background-image  
background-repeat  
background-attachment  
background-position  
background  
border properties border-top-width  
border-right-width  
border-bottom-width  
border-left-width  
border-width  
border-top-color  
border-right-color  
border-bottom-color  
border-left-color  
border-color  
border-top-style  
border-right-style  
border-bottom-style  
border-left-style  
border-short-style  
border-top  
border-right  
border-bottom  
border-left  
border  
counter properties counter-reset  
counter-increment  
content content  
color color  
font properties font-family  
font-size  
font-style  
font-variant  
font-weight  
font  
height properties height  
min-height  
max-height  
line height line-height  
margin properties margin-top  
margin-right  
margin-bottom  
margin-left  
margin  
outline properties outline-width  
outline-style  
outline-color  
outline  
padding properties padding-top  
padding-right  
padding-bottom  
padding-left  
padding  
quotes quotes  
text properties letter-spacing  
text-align  
text-decoration  
text-indent  
text-transform  
white-space  
word-spacing  
vertical alignment vertical-align  
visibility visibility  
width properties width  
min-width  
max-width  
z-index z-index  
## Named pages
Named pages enable performing per-page layout and adding page-breaks in a declarative manner when printing.
Named pages can be applied using the `page` property. This allows the user to create different page configurations for use in print layouts.
An example of this can be found on the `page` examples.
## Examples
>
### Using the size property to change the page orientation
This example shows how to split the `<section>`s into individual pages in `landscape` format with each page having a 20% margin when printed. Clicking the print button will launch a print dialog with the HTML sections split into individual pages.
    
    <button>Print page</button>
    <article>
      <section>
        <h2>Header one</h2>
        <p>Paragraph one.</p>
      </section>
      <section>
        <h2>Header two</h2>
        <p>Paragraph two.</p>
      </section>
      <section>
        <h2>Header three</h2>
        <p>Paragraph three.</p>
      </section>
    </article>
    
    
    const button = document.querySelector("button");
    
    button.addEventListener("click", () => {
      window.print();
    });
    
    
    @page {
      size: landscape;
      margin: 2cm;
    }
    
    section {
      page-break-after: always;
      break-after: page;
    }
    
    @media print {
      button {
        display: none;
      }
    }
    
### @page pseudo-class examples
See the various pseudo-classes of `@page` for examples.
  * `:blank`
  * `:first`
  * `:left`
  * `:right`


# mask-border-mode
The `mask-border-mode` CSS property specifies the blending mode used in a mask border.
## Syntax
    
    /* Keyword values */
    mask-border-mode: luminance;
    mask-border-mode: alpha;
    
    /* Global values */
    mask-border-mode: inherit;
    mask-border-mode: initial;
    mask-border-mode: revert;
    mask-border-mode: revert-layer;
    mask-border-mode: unset;
    
### Values
`luminance`
    
The luminance values of the mask border image are used as the mask values.
`alpha`
    
The alpha values of the mask border image are used as the mask values.
Currently, no browsers support this feature.
# shape-margin
The `shape-margin` CSS property sets a margin for a CSS shape created using `shape-outside`.
## Try it
    
    shape-margin: 0;
    
    
    shape-margin: 20px;
    
    
    shape-margin: 1em;
    
    
    shape-margin: 5%;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element"></div>
        We had agreed, my companion and I, that I should call for him at his house,
        after dinner, not later than eleven o’clock. This athletic young Frenchman
        belongs to a small set of Parisian sportsmen, who have taken up “ballooning”
        as a pastime. After having exhausted all the sensations that are to be found
        in ordinary sports, even those of “automobiling” at a breakneck speed, the
        members of the “Aéro Club” now seek in the air, where they indulge in all
        kinds of daring feats, the nerve-racking excitement that they have ceased to
        find on earth.
      </div>
    </section>
    
    
    .example-container {
      text-align: left;
      padding: 20px;
    }
    
    #example-element {
      float: left;
      margin: 20px;
      width: 180px;
      height: 180px;
      border-radius: 50%;
      background-color: rebeccapurple;
      shape-outside: circle(50%);
    }
    
The margin lets you adjust the distance between the edges of the shape (the float element) and the surrounding content.
## Syntax
    
    /* <length> values */
    shape-margin: 10px;
    shape-margin: 20mm;
    
    /* <percentage> value */
    shape-margin: 60%;
    
    /* Global values */
    shape-margin: inherit;
    shape-margin: initial;
    shape-margin: revert;
    shape-margin: revert-layer;
    shape-margin: unset;
    
### Values
`<length-percentage>`
    
Sets the margin of the shape to a `<length>` value or to a `<percentage>` of the width of the element's containing block.
## Examples
>
### Adding a margin to a polygon
#### HTML
    
    <section>
      <div class="shape"></div>
      We are not quite sure of any one thing in biology; our knowledge of geology is
      relatively very slight, and the economic laws of society are uncertain to
      every one except some individual who attempts to set them forth; but before
      the world was fashioned the square on the hypotenuse was equal to the sum of
      the squares on the other two sides of a right triangle, and it will be so
      after this world is dead; and the inhabitant of Mars, if one exists, probably
      knows its truth as we know it.
    </section>
    
#### CSS
    
    section {
      max-width: 400px;
    }
    
    .shape {
      float: left;
      width: 150px;
      height: 150px;
      background-color: maroon;
      clip-path: polygon(0 0, 150px 150px, 0 150px);
      shape-outside: polygon(0 0, 150px 150px, 0 150px);
      shape-margin: 20px;
    }
    
#### Result
# position-visibility
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `position-visibility` CSS property enables conditionally hiding an anchor-positioned element depending on, for example, whether it is overflowing its containing element or the viewport.
## Syntax
    
    /* Single values */
    position-visibility: always;
    position-visibility: anchors-visible;
    position-visibility: no-overflow;
    
    /* Global values */
    position-visibility: inherit;
    position-visibility: initial;
    position-visibility: revert;
    position-visibility: revert-layer;
    position-visibility: unset;
    
### Values
`always`
    
The positioned element is always displayed.
`anchors-visible`
    
If the anchor is completely hidden, either by overflowing its containing element (or the viewport) or being covered by other elements, the positioned element will be strongly hidden.
`no-overflow`
    
If the positioned element starts to overflow its containing element or the viewport, it will be strongly hidden.
The specification also defines the `anchors-valid` value, which has not yet been implemented in any browser.
## Description
In some situations you might not want to display an anchor-positioned element. For example, if its associated anchor has been scrolled offscreen but the anchor positioned element would otherwise still be partially or fully visible, it might be unclear what it refers to and take up space unnecessarily, so you may want to hide it altogether.
The `position-visibility` property can be used to `always` show the anchor-positioned element, or conditionally hide it if the associated anchor element is completely hidden (`anchors-visible`) or if the anchor-positioned element itself is partially hidden (`no-overflow`).
When an element is hidden due to `position-visibility`, it is referred to as strongly hidden. This means that it will act as though it and its descendant elements have a `visibility` value of `hidden` set, regardless of what their actual visibility value is.
`position-visibility` should only be used in situations in which hiding the positioned element altogether is preferred. In most cases, it makes more sense to attempt to change the placement of positioned elements when they start to overflow, to keep them on-screen and usable. This can be done with the `position-try-fallbacks` property and `@position-try` at-rule. See the Fallback options and conditional hiding for overflow guide for more information.
## Examples
>
### Basic usage
This example enables changing the value of an anchor positioned element's `position-visibility` property to demonstrate the effects of each value.
#### HTML
We specify two `<div>` elements; an anchor element with a class of `anchor` and a positioned element with a class of `infobox`.
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
The HTML also includes filler text to make the content taller than the viewport so scrolling is required. We've also included a `<fieldset>` with a group of radio inputs with different `position-visibility` values. The markup for these is not shown for the sake of brevity.
#### CSS
We style an `anchor` `<div>` as an anchor element and tether the `infobox` `<div>` to it. The relevant CSS is as follows:
    
    .anchor {
      anchor-name: --my-anchor;
    }
    
    .infobox {
      position-anchor: --my-anchor;
      position: fixed;
      position-area: top span-all;
      margin-bottom: 5px;
      position-visibility: always;
    }
    
#### JavaScript
We include a `change` event handler on the radio buttons so that, when a new value is selected, we update the infobox's `position-visibility` property value.
    
    const infobox = document.querySelector(".infobox");
    const radios = document.querySelectorAll('[name="position-visibility"]');
    
    for (const radio of radios) {
      radio.addEventListener("change", setPositionVisibility);
    }
    
    function setPositionVisibility(e) {
      infobox.style.positionVisibility = e.target.value;
    }
    
#### Result
Select different `position-visibility` values and then scroll the page up and down to see their effects. With `position-visibility: always` set, the positioned element will not be hidden. With `position-visibility: anchors-visible` set, the positioned element will only be visible when the anchor is partially or fully on-screen. With `position-visibility: no-overflow` set, the positioned element will be hidden as soon as it starts to overflow the viewport.
# -webkit-text-stroke-color
The `-webkit-text-stroke-color` CSS property specifies the stroke color of characters of text. If this property is not set, the value of the `color` property is used.
## Syntax
    
    /* <color> values */
    -webkit-text-stroke-color: red;
    -webkit-text-stroke-color: #e08ab4;
    -webkit-text-stroke-color: rgb(200 100 0);
    
    /* Global values */
    -webkit-text-stroke-color: inherit;
    -webkit-text-stroke-color: initial;
    -webkit-text-stroke-color: revert;
    -webkit-text-stroke-color: revert-layer;
    -webkit-text-stroke-color: unset;
    
### Values
`<color>`
    
The color of the stroke.
## Examples
>
### Varying the stroke color
#### HTML
    
    <p>Text with stroke</p>
    <input type="color" value="#ff0000" />
    
#### CSS
    
    p {
      margin: 0;
      font-size: 4em;
      -webkit-text-stroke-width: 3px;
      -webkit-text-stroke-color: red; /* Can be changed in the live sample */
    }
    
#### Results
# acos()
The `acos()` CSS function is a trigonometric function that returns the inverse cosine of a number between `-1` and `1`. The function contains a single calculation that returns the number of radians representing an `<angle>` between `0deg` and `180deg`.
## Syntax
    
    /* Single <number> values */
    transform: rotate(acos(-0.2));
    transform: rotate(acos(2 * 0.125));
    
    /* Other values */
    transform: rotate(acos(pi / 5));
    transform: rotate(acos(e / 3));
    
### Parameters
The `acos(number)` function accepts only one value as its parameter.
`number`
    
A calculation which resolves to a `<number>` between `-1` and `1`.
### Return value
The inverse cosine of an `number` will always return an `<angle>` between `0deg` and `180deg`.
  * If `number` is less than `-1` or greater than `1`, the result is `NaN`.
  * If `number` is exactly `1`, the result is `0`.


## Examples
>
### Rotate elements
The `acos()` function can be used to `rotate` elements as it return an `<angle>`.
#### HTML
    
    <div class="box box-1"></div>
    <div class="box box-2"></div>
    <div class="box box-3"></div>
    <div class="box box-4"></div>
    <div class="box box-5"></div>
    
#### CSS
    
    div.box {
      width: 100px;
      height: 100px;
      background: linear-gradient(orange, red);
    }
    div.box-1 {
      transform: rotate(acos(1));
    }
    div.box-2 {
      transform: rotate(acos(0.5));
    }
    div.box-3 {
      transform: rotate(acos(0));
    }
    div.box-4 {
      transform: rotate(acos(-0.5));
    }
    div.box-5 {
      transform: rotate(acos(-1));
    }
    
#### Result
# :nth-child()
The `:nth-child()` CSS pseudo-class matches elements based on the indexes of the elements in the child list of their parents. In other words, the `:nth-child()` selector selects child elements according to their position among all the sibling elements within a parent element.
## Try it
    
    p {
      font-weight: bold;
    }
    
    li:nth-child(-n + 3) {
      border: 2px solid orange;
      margin-bottom: 1px;
    }
    
    li:nth-child(even) {
      background-color: lightyellow;
    }
    
    
    <p>Track &amp; field champions:</p>
    <ul>
      <li>Adhemar da Silva</li>
      <li>Wang Junxia</li>
      <li>Wilma Rudolph</li>
      <li>Babe Didrikson-Zaharias</li>
      <li>Betty Cuthbert</li>
      <li>Fanny Blankers-Koen</li>
      <li>Florence Griffith-Joyner</li>
      <li>Irena Szewinska</li>
      <li>Jackie Joyner-Kersee</li>
      <li>Shirley Strickland</li>
      <li>Carl Lewis</li>
      <li>Emil Zatopek</li>
      <li>Haile Gebrselassie</li>
      <li>Jesse Owens</li>
      <li>Jim Thorpe</li>
      <li>Paavo Nurmi</li>
      <li>Sergei Bubka</li>
      <li>Usain Bolt</li>
    </ul>
    
Note: In the `element:nth-child()` syntax, the child count includes sibling children of any element type; but it is considered a match only if the element at that child position matches the other components of the selector.
## Syntax
    
    :nth-child([ <An+B> | even | odd ] [of <complex-selector-list>]?) {
      /* ... */
    }
    
### Parameters
`:nth-child()` takes a single argument that describes a pattern for matching element indices in a list of siblings. Element indices are 1-based.
#### Keyword values
`odd`
    
Represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc.
`even`
    
Represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc.
#### Functional notation
`<An+B>`
    
Represents elements whose numeric position in a series of siblings matches the pattern `An+B`, for every positive integer or zero value of `n`, where:
  * `A` is an integer step size,
  * `B` is an integer offset,
  * `n` is all nonnegative integers, starting from 0.


It can be read as the `An+B`-th element of a list. The `A` and `B` must both have `<integer>` values.
#### The `of <selector>` syntax
By passing a selector argument, we can select the nth element that matches that selector. For example, the following selector matches the first three list items which have a `class="important"` set.
    
    :nth-child(-n + 3 of li.important) {
    }
    
This is different from moving the selector outside of the function, like:
    
    li.important:nth-child(-n + 3) {
    }
    
This selector selects list items if they are among the first three children and match the selector `li.important`.
## Examples
>
### Example selectors
`tr:nth-child(odd)` or `tr:nth-child(2n+1)`
    
Represents the odd rows of an HTML table: 1, 3, 5, etc.
`tr:nth-child(even)` or `tr:nth-child(2n)`
    
Represents the even rows of an HTML table: 2, 4, 6, etc.
`:nth-child(7)`
    
Represents the seventh element.
`:nth-child(5n)`
    
Represents elements 5 [=5×1], 10 [=5×2], 15 [=5×3], etc. The first one to be returned as a result of the formula is 0 [=5x0], resulting in a no-match, since the elements are indexed from 1, whereas `n` starts from 0. This may seem weird at first, but it makes more sense when the `B` part of the formula is `>0`, like in the next example.
`:nth-child(n+7)`
    
Represents the seventh and all following elements: 7 [=0+7], 8 [=1+7], 9 [=2+7], etc.
`:nth-child(3n+4)`
    
Represents elements 4 [=(3×0)+4], 7 [=(3×1)+4], 10 [=(3×2)+4], 13 [=(3×3)+4], etc.
`:nth-child(-n+3)`
    
Represents the first three elements. [=-0+3, -1+3, -2+3]
`p:nth-child(n)`
    
Represents every `<p>` element in a group of siblings. This selects the same elements as a simple `p` selector (although with a higher specificity).
`p:nth-child(1)` or `p:nth-child(0n+1)`
    
Represents every `<p>` that is the first element in a group of siblings. This is the same as the `:first-child` selector (and has the same specificity).
`p:nth-child(n+8):nth-child(-n+15)`
    
Represents the eighth through the fifteenth `<p>` elements of a group of siblings.
### Detailed example
#### HTML
    
    <h3>
      <code>span:nth-child(2n+1)</code>, WITHOUT an <code>&lt;em&gt;</code> among
      the child elements.
    </h3>
    <p>Children 1, 3, 5, and 7 are selected.</p>
    <div class="first">
      <span>Span 1!</span>
      <span>Span 2</span>
      <span>Span 3!</span>
      <span>Span 4</span>
      <span>Span 5!</span>
      <span>Span 6</span>
      <span>Span 7!</span>
    </div>
    
    <br />
    
    <h3>
      <code>span:nth-child(2n+1)</code>, WITH an <code>&lt;em&gt;</code> among the
      child elements.
    </h3>
    <p>
      Children 1, 5, and 7 are selected.<br />
      3 is used in the counting because it is a child, but it isn't selected because
      it isn't a <code>&lt;span&gt;</code>.
    </p>
    <div class="second">
      <span>Span!</span>
      <span>Span</span>
      <em>This is an `em`.</em>
      <span>Span</span>
      <span>Span!</span>
      <span>Span</span>
      <span>Span!</span>
      <span>Span</span>
    </div>
    
    <br />
    
    <h3>
      <code>span:nth-of-type(2n+1)</code>, WITH an <code>&lt;em&gt;</code> among the
      child elements.
    </h3>
    <p>
      Children 1, 4, 6, and 8 are selected.<br />
      3 isn't used in the counting or selected because it is an
      <code>&lt;em&gt;</code>, not a <code>&lt;span&gt;</code>, and
      <code>nth-of-type</code> only selects children of that type. The
      <code>&lt;em&gt;</code> is completely skipped over and ignored.
    </p>
    <div class="third">
      <span>Span!</span>
      <span>Span</span>
      <em>This is an `em`.</em>
      <span>Span!</span>
      <span>Span</span>
      <span>Span!</span>
      <span>Span</span>
      <span>Span!</span>
    </div>
    
#### CSS
    
    .first span:nth-child(2n + 1),
    .second span:nth-child(2n + 1),
    .third span:nth-of-type(2n + 1) {
      background-color: tomato;
    }
    
#### Result
### Using 'of <selector>'
In this example there is an unordered list of names, some of them have been marked as noted using `class="noted"`. These have been highlighted with a thick bottom border.
#### HTML
    
    <ul>
      <li class="noted">Diego</li>
      <li>Shilpa</li>
      <li class="noted">Caterina</li>
      <li>Jayla</li>
      <li>Tyrone</li>
      <li>Ricardo</li>
      <li class="noted">Gila</li>
      <li>Sienna</li>
      <li>Titilayo</li>
      <li class="noted">Lexi</li>
      <li>Aylin</li>
      <li>Leo</li>
      <li>Leyla</li>
      <li class="noted">Bruce</li>
      <li>Aisha</li>
      <li>Veronica</li>
      <li class="noted">Kyouko</li>
      <li>Shireen</li>
      <li>Tanya</li>
      <li class="noted">Marlene</li>
    </ul>
    
#### CSS
In the following CSS we are targeting the even list items that are marked with `class="noted"`.
    
    li:nth-child(even of .noted) {
      background-color: tomato;
      border-bottom-color: seagreen;
    }
    
#### Result
Items with `class="noted"` have a thick bottom border and items 3, 10 and 17 have a solid background as they are the even list items with `class="noted"`.
### of selector syntax vs selector nth-child
In this example, there are two unordered lists of names. The first list shows the effect of `li:nth-child(-n + 3 of .noted)` and the second list shows the effect of `li.noted:nth-child(-n + 3)`.
#### HTML
    
    <ul class="one">
      <li class="noted">Diego</li>
      <li>Shilpa</li>
      <li class="noted">Caterina</li>
      <li>Jayla</li>
      <li>Tyrone</li>
      <li>Ricardo</li>
      <li class="noted">Gila</li>
      <li>Sienna</li>
      <li>Titilayo</li>
      <li class="noted">Lexi</li>
    </ul>
    <ul class="two">
      <li class="noted">Diego</li>
      <li>Shilpa</li>
      <li class="noted">Caterina</li>
      <li>Jayla</li>
      <li>Tyrone</li>
      <li>Ricardo</li>
      <li class="noted">Gila</li>
      <li>Sienna</li>
      <li>Titilayo</li>
      <li class="noted">Lexi</li>
    </ul>
    
#### CSS
    
    ul.one > li:nth-child(-n + 3 of .noted) {
      background-color: tomato;
      border-bottom-color: seagreen;
    }
    
    ul.two > li.noted:nth-child(-n + 3) {
      background-color: tomato;
      border-bottom-color: seagreen;
    }
    
#### Result
The first case applies a style to the first three list items with `class="noted"` whether or not they are the first three items in the list.
The second case applies a style to the items with `class="noted"` if they are within the first 3 items in the list.
### Using of selector to fix striped tables
A common practice for tables is to use zebra-stripes which alternates between light and dark background colors for rows, making tables easier to read and more accessible. If a row is hidden, the stripes will appear merged and alter the desired effect. In this example, you can see two tables with a `hidden` row. The second table handles hidden rows using `of :not([hidden])`.
#### HTML
    
    <table class="broken">
      <thead>
        <tr><th>Name</th><th>Age</th><th>Country</th></tr>
      </thead>
      <tbody>
        <tr><td>Mamitiana</td><td>23</td><td>Madagascar</td></tr>
        <tr><td>Yuki</td><td>48</td><td>Japan</td></tr>
        <tr hidden><td>Tlayolotl</td><td>36</td><td>Mexico</td></tr>
        <tr><td>Adilah</td><td>27</td><td>Morocco</td></tr>
        <tr><td>Vieno</td><td>55</td><td>Finland</td></tr>
        <tr><td>Ricardo</td><td>66</td><td>Brazil</td></tr>
      </tbody>
    </table>
    <table class="fixed">
      <thead>
        <tr><th>Name</th><th>Age</th><th>Country</th></tr>
      </thead>
      <tbody>
        <tr><td>Mamitiana</td><td>23</td><td>Madagascar</td></tr>
        <tr><td>Yuki</td><td>48</td><td>Japan</td></tr>
        <tr hidden><td>Tlayolotl</td><td>36</td><td>Mexico</td></tr>
        <tr><td>Adilah</td><td>27</td><td>Morocco</td></tr>
        <tr><td>Vieno</td><td>55</td><td>Finland</td></tr>
        <tr><td>Ricardo</td><td>66</td><td>Brazil</td></tr>
      </tbody>
    </table>
    
#### CSS
    
    .broken > tbody > tr:nth-child(even) {
      background-color: silver;
    }
    
    
    .fixed > tbody > tr:nth-child(even of :not([hidden])) {
      background-color: silver;
    }
    
#### Result
In the first table this is just using `:nth-child(even)` the third row has the `hidden` attribute applied to it. So in this instance the 3rd row is not visible and the 2nd & 4th rows are counted as even, which technically they are but visually they are not.
In the second table the of syntax is used to target only the `tr`s that are not hidden using `:nth-child(even of :not([hidden]))`.
### Styling a table column
To style a table column, you can't set the style on the `<col>` element as table cells are not children of it (as you can with the row element, `<tr>`). Pseudo-classes like `:nth-child()` are handy to select the column cells.
In this example, we set different styles for each of the column.
#### HTML
    
    <table>
    <caption>Student roster</caption>
    <colgroup>
      <col/>
      <col/>
      <col/>
    </colgroup>
      <thead>
        <tr><th>Name</th><th>Age</th><th>Country</th></tr>
      </thead>
      <tbody>
        <tr><td>Mamitiana</td><td>23</td><td>Madagascar</td></tr>
        <tr><td>Yuki</td><td>48</td><td>Japan</td></tr>
      </tbody>
    </table>
    
    
#### CSS
    
    td {
      padding: 0.125rem 0.5rem;
      height: 3rem;
      border: 1px solid black;
    }
    
    tr :nth-child(1) {
      text-align: left;
      vertical-align: bottom;
      background-color: silver;
    }
    
    tbody tr :nth-child(2) {
      text-align: center;
      vertical-align: middle;
    }
    
    tbody tr :nth-child(3) {
      text-align: right;
      vertical-align: top;
      background-color: tomato;
    }
    
#### Result
# letter-spacing
The `letter-spacing` CSS property sets the horizontal spacing behavior between text characters. This value is added to the natural spacing between characters while rendering the text. Positive values of `letter-spacing` causes characters to spread farther apart, while negative values of `letter-spacing` bring characters closer together.
## Try it
    
    letter-spacing: normal;
    
    
    letter-spacing: 0.2rem;
    
    
    letter-spacing: 1px;
    
    
    letter-spacing: -1px;
    
    
    <section id="default-example">
      <p id="example-element">
        As much mud in the streets as if the waters had but newly retired from the
        face of the earth, and it would not be wonderful to meet a Megalosaurus,
        forty feet long or so, waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.ttf");
      font-family: Amstelvar;
      font-style: normal;
    }
    
    section {
      font-size: 1.2em;
      font-family: Amstelvar, serif;
    }
    
## Syntax
    
    /* Keyword value */
    letter-spacing: normal;
    
    /* <length> values */
    letter-spacing: 0.3em;
    letter-spacing: 3px;
    letter-spacing: 0.3px;
    
    /* Global values */
    letter-spacing: inherit;
    letter-spacing: initial;
    letter-spacing: revert;
    letter-spacing: revert-layer;
    letter-spacing: unset;
    
### Values
`normal`
    
The normal letter spacing for the current font. Unlike a value of `0`, this keyword allows the user agent to alter the space between characters in order to justify text.
`<length>`
    
Specifies extra inter-character space in addition to the default space between characters. Values may be negative, but there may be implementation-specific limits. User agents may not further increase or decrease the inter-character space in order to justify text.
## Accessibility
A large positive or negative `letter-spacing` value will make the word(s) the styling is applied to unreadable. For text styled with a very large positive value, the letters will be so far apart that the word(s) will appear like a series of individual, unconnected letters. For text styled with a very large negative value, the letters will overlap each other to the point where the word(s) may be unrecognizable.
Legible letter-spacing must be determined on a case-by-case basis, as different font families have different character widths. There is no one value that can ensure all font families automatically maintain their legibility.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0


## Internationalization concerns
Some written languages should not have any letter spacing applied. For instance, languages that use the Arabic script expect connected letters to remain visually connected, as in the following example. Applying letter spacing will lead the text to look broken.
> شسيبتنمك
## Examples
>
### Setting letter spacing
#### HTML
    
    <p class="normal">letter spacing</p>
    <p class="em-wide">letter spacing</p>
    <p class="em-wider">letter spacing</p>
    <p class="em-tight">letter spacing</p>
    <p class="px-wide">letter spacing</p>
    
#### CSS
    
    .normal {
      letter-spacing: normal;
    }
    .em-wide {
      letter-spacing: 0.4em;
    }
    .em-wider {
      letter-spacing: 1em;
    }
    .em-tight {
      letter-spacing: -0.05em;
    }
    .px-wide {
      letter-spacing: 6px;
    }
    
#### Result
# CSS nesting
The CSS nesting module defines a syntax for nesting selectors, providing the ability to nest one style rule inside another, with the selector of the child rule relative to the selector of the parent rule.
CSS nesting is different from CSS preprocessors such as Sass in that it is parsed by the browser rather than being pre-compiled by a CSS preprocessor.
CSS nesting helps with the readability, modularity, and maintainability of CSS stylesheets. It also potentially helps reduce the size of CSS files, thereby decreasing the amount of data downloaded by users.
## Reference
>
### Selectors
  * `&` nesting selector


## Guides
Using CSS nesting
    
Explains how to use CSS nesting.
CSS nesting at-rules
    
Explains how to nest at-rules.
CSS nesting and specificity
    
Explains the differences in specificity when nesting CSS.
## Related concepts
  * Selectors and combinators
  * Pseudo-classes
  * CSS preprocessor


# :read-write
The `:read-write` CSS pseudo-class represents an element (such as `input` or `textarea`) that is editable by the user.
## Try it
    
    label,
    input[type="submit"] {
      display: block;
      margin-top: 1em;
    }
    
    *:read-write {
      background-color: ivory;
      border: 2px solid darkorange;
      border-radius: 5px;
    }
    
    
    <p>Please fill in your details:</p>
    
    <form>
      <label for="email">Email Address:</label>
      <input id="email" name="email" type="email" value="test@example.com" />
    
      <label for="note">Short note about yourself:</label>
      <textarea id="note" name="note">Don't be shy</textarea>
    
      <label for="pic">Your picture:</label>
      <input id="pic" name="pic" type="file" />
    
      <input type="submit" value="Submit form" />
    </form>
    
## Syntax
    
    :read-write {
      /* ... */
    }
    
## Examples
>
### Confirming form details using read-only controls
You can use `readonly` form controls when you want a user to verify information they entered earlier, which you want to submit with new data in read-write controls. In the example below, the `:read-only` pseudo-class is used to make the `<textarea>` (a user's address) look like a regular paragraph. The `:read-write` pseudo-class provides a way to highlight the editable `<textarea>` (the delivery instructions):
    
    textarea:read-only {
      border: 0;
    }
    
    textarea:read-write {
      box-shadow: inset 1px 1px 3px #cccccc;
      border-radius: 5px;
    }
    
    
    <form>
      <fieldset>
        <legend>Confirm details</legend>
        <div>
          <label for="address">Address:</label>
          <textarea id="address" name="address" readonly>
    123 Choco Mountain,
    Awesome Ridge,
    CA</textarea
          >
        </div>
        <div>
          <label for="instructions">Delivery instructions</label>
          <textarea id="instructions" name="instructions"></textarea>
        </div>
      </fieldset>
      <button type="submit">Confirm</button>
    </form>
    
### Styling read-write non-form controls
This selector doesn't just select `<input>`/`<textarea>` elements — it will select any element that can be edited by the user, such as a `<p>` element with `contenteditable` set on it.
    
    <p contenteditable>This paragraph is editable; it is read-write.</p>
    
    <p>This paragraph is not editable; it is read-only.</p>
    
    
    body {
      font-family: sans-serif;
    }
    
    p {
      font-size: 150%;
      padding: 5px;
      border-radius: 5px;
    }
    
    p:read-only {
      background-color: red;
      color: white;
    }
    
    p:read-write {
      background-color: lime;
    }
    
# CSS colors
The CSS colors module defines colors, color types, color blending, opacity, and how you can apply these colors and effects to HTML content.
While this module has only two CSS properties, `color` and `opacity`, over 20 CSS and SVG properties, CSS images, at-rules, and @media rules depend on these two properties.
## Colors in action
The color syntax converter below shows the values of the currently selected color in red-green-blue (RGB), hexadecimal (HEX), hue, saturation, and lightness (HSL), and hue, whiteness, and blackness (HWB) CSS color formats. All the RGB, HEX, HSL, and HWB color values here, while written differently, represent the same color value.
Selecting a color via the color picker and an opacity via the slider updates the RGB, HEX, HSL, and HWB values. When you choose a new color or opacity value, the color of the background and the slider update via the CSS properties `background-color` and `accent-color`, respectively.
To see the code for this color syntax converter, view the source on GitHub.
## Reference
>
### Properties
  * `color`
  * `opacity`


### At-rules and descriptors
The CSS colors module also introduces the `@color-profile` at-rule, along with its `components`, `rendering-intent` and `src` descriptors. Currently, no browsers support these features.
### Functions
  * Color functions: 
    * `rgb()`
    * `hsl()`
    * `hwb()`
    * `lab()`
    * `lch()`
    * `oklab()`
    * `oklch()`
    * `color()`
  * `color-mix()`
  * `contrast-color()`
  * `light-dark()`


The CSS color module also introduces the `device-cmyk()` and `contrast-color()` functions. Currently, no browsers support these features.
### Data types
  * `<color>`
  * `<color-function>`
  * `<hex-color>`
  * `<named-color>`
  * `<alpha-value>`
  * `<hue>`
  * `<system-color>`
  * `<colorspace-params>`


### Glossary terms and keywords
  * color space
  * `currentColor`
  * interpolation
  * RGB
  * `transparent`


### Interfaces
The CSS color module also introduces the `CSSColorProfileRule` interface. Currently, no browsers support this feature.
## Guides
Applying color to HTML elements using CSS
    
A guide to using CSS to apply color to a variety of types of content, including all CSS properties that accept `<color>` as a value.
CSS color values
    
An overview of color spaces and the different `<color>` functional notations available in CSS.
Using color wisely
    
Color theory and resources, including finding the right colors to create an accessible color palette, contrast, and printing in color.
Using relative colors
    
This article explains relative CSS color syntax, shows what the different options are, and looks at some illustrative examples.
Color picker tool
    
A tool that lets you pick a color in the sRGB color space and converts it between various CSS color formats, helping you understand the syntax of the different color notations.
Understanding color and luminance
    
Color perception and using colors with color insensitive (color blind) users, reduced vision users and users with vestibular disorders or other neurological disorders in mind.
WCAG 1.4.1: Color contrast
    
Explanation of contrast requirements between background and foreground content to ensure legibility.
## Related concepts
  * CSS properties that are part of other specifications: 
    * `accent-color`
    * `background-color`
    * `background-image`
    * `border-color`
    * `box-shadow`
    * `caret-color`
    * `color`
    * `color-scheme`
    * `column-rule-color`
    * `outline-color`
    * `scrollbar-color`
    * `text-decoration-color`
    * `text-emphasis-color`
    * `text-shadow`
    * `-webkit-tap-highlight-color`
  * SVG color properties that are part of other specifications: 
    * `fill`
    * `flood-color`
    * `lighting-color`
    * `stop-color`
    * `stroke`
  * SVG `color` attribute
  * Color wheel glossary term
  * Interpolation glossary term
  * The `@font-palette-values` at-rule `override-colors` descriptor
  * The `@color-profile` at-rule
  * The `color-gamut` @media feature
  * The `forced-colors` @media feature


# marker
The `marker` CSS property points to a marker that will be drawn on the first, middle, and last vertices of the element's path; that is, at all of its vertices. The marker must have been defined using an SVG `<marker>` element, and can only be referenced with a `<url>` value. The value of the CSS property overrides any values of the `marker-start`, `marker`, and `marker-end` attributes in the SVG.
For many marker-supporting shapes, the first and last vertices are in the same place: for example, the top left corner of a `<rect>`. In such shapes, if both the first and last markers are defined, two markers will be drawn at that point, though they may not point in the same direction.
For the middle vertices, the direction each marker points is defined as the direction halfway between the direction at the end of the preceding path segment and the direction of the start of the following path segment. This can be thought of as the cross product of the vectors defined by the two path directions.
Note: The `marker` property will only have an effect for elements that can use SVG markers. See `marker-start` for a list.
## Syntax
    
    marker: none;
    marker: url("markers.svg#arrow");
    
    /* Global values */
    marker: inherit;
    marker: initial;
    marker: revert;
    marker: revert-layer;
    marker: unset;
    
### Values
`none`
    
This means no marker will be drawn at each vertex of the element's path.
`<marker-ref>`
    
A `<url>` that refers to a marker defined by an SVG `<marker>` element, to be drawn at each vertex of the element's path. If the URL reference is invalid, no marker will be drawn at the path's vertices.
## Example
    
    <svg viewBox="0 0 240 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <marker
          id="triangle"
          viewBox="0 0 10 10"
          markerWidth="10"
          markerHeight="10"
          refX="1"
          refY="5"
          markerUnits="strokeWidth"
          orient="auto">
          <path d="M 0 0 L 10 5 L 0 10 z" fill="red" />
        </marker>
      </defs>
      <polyline
        id="test"
        fill="none"
        stroke="black"
        points="20,100 40,60 70,80 100,20 130,10 150,10 170,20 170,100 120,100" />
    </svg>
    
    
    polyline#test {
      marker: url("#triangle");
    }
    
# font-variant-ligatures
The `font-variant-ligatures` CSS property controls which ligatures and contextual forms are used in the textual content of the elements it applies to. This leads to more harmonized forms in the resulting text.
## Try it
    
    font-variant-ligatures: normal;
    
    
    font-variant-ligatures: no-common-ligatures;
    
    
    font-variant-ligatures: common-ligatures;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>Difficult waffles</p>
      </div>
    </section>
    
    
    @font-face {
      font-family: "Fira Sans";
      src:
        local("FiraSans-Regular"),
        url("/shared-assets/fonts/FiraSans-Regular.woff2") format("woff2");
      font-weight: normal;
      font-style: normal;
    }
    
    section {
      font-family: "Fira Sans", sans-serif;
      margin-top: 10px;
      font-size: 1.5em;
    }
    
## Syntax
    
    /* Keyword values */
    font-variant-ligatures: normal;
    font-variant-ligatures: none;
    font-variant-ligatures: common-ligatures; /* <common-lig-values> */
    font-variant-ligatures: no-common-ligatures; /* <common-lig-values> */
    font-variant-ligatures: discretionary-ligatures; /* <discretionary-lig-values> */
    font-variant-ligatures: no-discretionary-ligatures; /* <discretionary-lig-values> */
    font-variant-ligatures: historical-ligatures; /* <historical-lig-values> */
    font-variant-ligatures: no-historical-ligatures; /* <historical-lig-values> */
    font-variant-ligatures: contextual; /* <contextual-alt-values> */
    font-variant-ligatures: no-contextual; /* <contextual-alt-values> */
    
    /* Two keyword values */
    font-variant-ligatures: no-contextual common-ligatures;
    
    /* Four keyword values */
    font-variant-ligatures: common-ligatures no-discretionary-ligatures
      historical-ligatures contextual;
    
    /* Global values */
    font-variant-ligatures: inherit;
    font-variant-ligatures: initial;
    font-variant-ligatures: revert;
    font-variant-ligatures: revert-layer;
    font-variant-ligatures: unset;
    
The `font-variant-ligatures` property is specified as `normal`, `none`, or one or more of the other value types listed below. Spaces separate multiple values.
### Values
`normal`
    
This keyword activates the usual ligatures and contextual forms needed for correct rendering. The ligatures and forms activated depend on the font, language, and kind of script. This is the default value.
`none`
    
This keyword specifies that all ligatures and contextual forms are disabled, even common ones.
`<common-lig-values>`
    
These values control the most common ligatures, like for `fi`, `ffi`, `th`, or similar. They correspond to the OpenType values `liga` and `clig`. Two values are possible:
  * `common-ligatures` activating these ligatures. Note that the keyword `normal` activates these ligatures.
  * `no-common-ligatures` deactivating these ligatures.


`<discretionary-lig-values>`
    
These values control specific ligatures, specific to the font and defined by the type designer. They correspond to the OpenType values `dlig`. Two values are possible:
  * `discretionary-ligatures` activating these ligatures.
  * `no-discretionary-ligatures` deactivating the ligatures. Note that the keyword `normal` usually deactivates these ligatures.


`<historical-lig-values>`
    
These values control the ligatures used historically, in old books, like the German tz digraph being displayed as ꜩ. They correspond to the OpenType values `hlig`. Two values are possible:
  * `historical-ligatures` activating these ligatures.
  * `no-historical-ligatures` deactivating the ligatures. Note that the keyword `normal` usually deactivates these ligatures.


`<contextual-alt-values>`
    
These values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters. These values correspond to the OpenType values `calt`. Two values are possible:
  * `contextual` specifies that the contextual alternates are to be used. Note that the keyword `normal` usually activates these ligatures too.
  * `no-contextual` prevents their use.


## Examples
>
### Setting font ligatures and contextual forms
#### HTML
    
    <link href="//fonts.googleapis.com/css?family=Lora" rel="stylesheet" />
    <p class="normal">
      normal<br />
      if fi ff tf ft jf fj
    </p>
    <p class="none">
      none<br />
      if fi ff tf ft jf fj
    </p>
    <p class="common-ligatures">
      common-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="no-common-ligatures">
      no-common-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="discretionary-ligatures">
      discretionary-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="no-discretionary-ligatures">
      no-discretionary-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="historical-ligatures">
      historical-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="no-historical-ligatures">
      no-historical-ligatures<br />
      if fi ff tf ft jf fj
    </p>
    <p class="contextual">
      contextual<br />
      if fi ff tf ft jf fj
    </p>
    <p class="no-contextual">
      no-contextual<br />
      if fi ff tf ft jf fj
    </p>
    
#### CSS
    
    p {
      font-family: Lora, serif;
    }
    .normal {
      font-variant-ligatures: normal;
    }
    
    .none {
      font-variant-ligatures: none;
    }
    
    .common-ligatures {
      font-variant-ligatures: common-ligatures;
    }
    
    .no-common-ligatures {
      font-variant-ligatures: no-common-ligatures;
    }
    
    .discretionary-ligatures {
      font-variant-ligatures: discretionary-ligatures;
    }
    
    .no-discretionary-ligatures {
      font-variant-ligatures: no-discretionary-ligatures;
    }
    
    .historical-ligatures {
      font-variant-ligatures: historical-ligatures;
    }
    
    .no-historical-ligatures {
      font-variant-ligatures: no-historical-ligatures;
    }
    
    .contextual {
      font-variant-ligatures: contextual;
    }
    
    .no-contextual {
      font-variant-ligatures: no-contextual;
    }
    
#### Result
# list-style-type
The `list-style-type` CSS property sets the marker (such as a disc, character, or custom counter style) of a list item element.
## Try it
    
    list-style-type: space-counter;
    
    
    list-style-type: disc;
    
    
    list-style-type: circle;
    
    
    list-style-type: "\1F44D";
    
    
    <section class="default-example" id="default-example">
      <div>
        <p>NASA Notable Missions</p>
        <ul class="transition-all unhighlighted" id="example-element">
          <li>Apollo</li>
          <li>Hubble</li>
          <li>Chandra</li>
          <li>Cassini-Huygens</li>
        </ul>
      </div>
      <hr />
      <div class="note">
        <p>
          <code>space-counter</code> is defined with
          <a
            href="//developer.mozilla.org/docs/Web/CSS/@counter-style"
            target="_parent"
            ><code>@counter-style</code></a
          >
        </p>
      </div>
    </section>
    
    
    .default-example {
      font-size: 1.2rem;
    }
    
    #example-element {
      width: 100%;
      background: #be094b;
      color: white;
    }
    
    section {
      text-align: left;
      flex-direction: column;
    }
    
    hr {
      width: 50%;
      color: lightgray;
      margin: 0.5em;
    }
    
    .note {
      font-size: 0.8rem;
    }
    
    .note a {
      color: #009e5f;
    }
    
    @counter-style space-counter {
      symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
      suffix: " ";
    }
    
The marker will be `currentColor`, the same as the computed color of the element it applies to.
Only a few elements (`<li>` and `<summary>`) have a default value of `display: list-item`. However, the `list-style-type` property may be applied to any element whose `display` value is set to `list-item`. Moreover, because this property is inherited, it can be set on a parent element (commonly `<ol>` or `<ul>`) to make it apply to all list items.
## Syntax
    
    /* Partial list of types */
    list-style-type: disc;
    list-style-type: circle;
    list-style-type: square;
    list-style-type: decimal;
    list-style-type: georgian;
    list-style-type: trad-chinese-informal;
    list-style-type: kannada;
    
    /* <string> value */
    list-style-type: "-";
    
    /* Identifier matching an @counter-style rule */
    list-style-type: custom-counter-style;
    
    /* Keyword value */
    list-style-type: none;
    
    /* Global values */
    list-style-type: inherit;
    list-style-type: initial;
    list-style-type: revert;
    list-style-type: revert-layer;
    list-style-type: unset;
    
The `list-style-type` property may be defined as any one of:
  * a `<custom-ident>` value,
  * a `symbols()` value,
  * a `<string>` value, or
  * the keyword `none`.


Note that:
  * Some types require a suitable font installed to display as expected.
  * The `cjk-ideographic` is identical to `trad-chinese-informal`; it exists for legacy reasons.


### Values
`<custom-ident>`
    
An identifier matching the value of a `@counter-style` or one of the predefined styles:
`symbols()`
    
Defines an anonymous style of the list.
`<string>`
    
The specified string will be used as the item's marker.
`none`
    
No item marker is shown.
`disc`
    
A filled circle (default value).
`circle`
    
A hollow circle.
`square`
    
A filled square.
`decimal`
    
Decimal numbers, beginning with 1.
`cjk-decimal`
    
Han decimal numbers.
`decimal-leading-zero`
    
Decimal numbers, padded by initial zeros.
`lower-roman`
    
Lowercase roman numerals.
`upper-roman`
    
Uppercase roman numerals.
`lower-greek`
    
Lowercase classical Greek.
`lower-alpha`, `lower-latin`
    
Lowercase ASCII letters.
`upper-alpha`, `upper-latin`
    
Uppercase ASCII letters.
`arabic-indic`, `-moz-arabic-indic`
    
Arabic-Indic numbers.
`armenian`
    
Traditional Armenian numbering.
`bengali`, `-moz-bengali`
    
Bengali numbering.
`cambodian`/`khmer`
    
Cambodian/Khmer numbering.
`cjk-earthly-branch`, `-moz-cjk-earthly-branch`
    
Han "Earthly Branch" ordinals.
`cjk-heavenly-stem`, `-moz-cjk-heavenly-stem`
    
Han "Heavenly Stem" ordinals.
`cjk-ideographic`
    
Identical to `trad-chinese-informal`.
`devanagari`, `-moz-devanagari`
    
Devanagari numbering.
`ethiopic-numeric`
    
Ethiopic numbering.
`georgian`
    
Traditional Georgian numbering.
`gujarati`, `-moz-gujarati`
    
Gujarati numbering.
`gurmukhi`, `-moz-gurmukhi`
    
Gurmukhi numbering.
`hebrew`
    
Traditional Hebrew numbering.
`hiragana`
    
Dictionary-order hiragana lettering.
`hiragana-iroha`
    
Iroha-order hiragana lettering.
`japanese-formal`
    
Japanese formal numbering to be used in legal or financial documents. The kanjis are designed so that they can't be modified to look like another correct one.
`japanese-informal`
    
Japanese informal numbering.
`kannada`, `-moz-kannada`
    
Kannada numbering.
`katakana`
    
Dictionary-order katakana lettering.
`katakana-iroha`
    
Iroha-order katakana lettering.
`korean-hangul-formal`
    
Korean hangul numbering.
`korean-hanja-formal`
    
Formal Korean Han numbering.
`korean-hanja-informal`
    
Korean hanja numbering.
`lao`, `-moz-lao`
    
Laotian numbering.
`lower-armenian`
    
Lowercase Armenian numbering.
`malayalam`, `-moz-malayalam`
    
Malayalam numbering.
`mongolian`
    
Mongolian numbering.
`myanmar`, `-moz-myanmar`
    
Myanmar (Burmese) numbering.
`oriya`, `-moz-oriya`
    
Oriya numbering.
`persian`, `-moz-persian`
    
Persian numbering.
`simp-chinese-formal`
    
Simplified Chinese formal numbering.
`simp-chinese-informal`
    
Simplified Chinese informal numbering.
`tamil`, `-moz-tamil`
    
Tamil numbering.
`telugu`, `-moz-telugu`
    
Telugu numbering.
`thai`, `-moz-thai`
    
Thai numbering.
`tibetan`
    
Tibetan numbering.
`trad-chinese-formal`
    
Traditional Chinese formal numbering.
`trad-chinese-informal`
    
Traditional Chinese informal numbering.
`upper-armenian`
    
Traditional uppercase Armenian numbering.
`disclosure-open`
    
Symbol indicating that a disclosure widget such as `<details>` is opened.
`disclosure-closed`
    
Symbol indicating that a disclosure widget, like `<details>` is closed.
Refer to the All list style types example to see the above values in action. Details of all the available counter styles used by various cultures around the world can be found in Ready-made Counter Styles.
### Non-standard extensions
A few predefined types are supported by Mozilla (Firefox) with a `-moz-` prefix.
  * `ethiopic-halehame`: `-moz-ethiopic-halehame`
  * `ethiopic-halehame-am`: `-moz-ethiopic-halehame-am`
  * `ethiopic-halehame-ti-er`: `-moz-ethiopic-halehame-ti-er`
  * `ethiopic-halehame-ti-et`: `-moz-ethiopic-halehame-ti-et`
  * `ethiopic-numeric`: `-moz-ethiopic-numeric`
  * `hangul`: `-moz-hangul`
  * `hangul-consonant`: `-moz-hangul-consonant`
  * `urdu`: `-moz-urdu`


See the compatibility table to check which browsers support which extension.
## Accessibility
Safari will not recognize an ordered or unordered list as a list in the accessibility tree if it has a `list-style-type` value of `none`. This can be resolved by adding `role="list"` to the list's opening tag. To learn more about this and potential workarounds, see `list-style`.
## Examples
>
### Setting list item markers
#### HTML
    
    List 1
    <ol class="normal">
      <li>Hello</li>
      <li>World</li>
      <li>What's up?</li>
    </ol>
    
    List 2
    <ol class="shortcut">
      <li>Looks</li>
      <li>Like</li>
      <li>The</li>
      <li>Same</li>
    </ol>
    
#### CSS
    
    ol.normal {
      list-style-type: upper-alpha;
    }
    
    /* or use the shortcut "list-style": */
    ol.shortcut {
      list-style: upper-alpha;
    }
    
#### Result
### All list style types
#### HTML
    
    <ol>
      <li>Apollo</li>
      <li>Hubble</li>
      <li>Chandra</li>
      <li>Cassini-Huygens</li>
      <li>Spitzer</li>
    </ol>
    
    <h2>Choose a list style type:</h2>
    
    <div class="container">
      <label for="disc">
        <input type="radio" id="disc" name="type" value="disc" />disc
      </label>
    
      <label for="circle">
        <input type="radio" id="circle" name="type" value="circle" />circle
      </label>
    
      <label for="square">
        <input type="radio" id="square" name="type" value="square" />square
      </label>
    
      <label for="decimal">
        <input type="radio" id="decimal" name="type" value="decimal" />decimal
      </label>
    
      <label for="cjk-decimal">
        <input
          type="radio"
          id="cjk-decimal"
          name="type"
          value="cjk-decimal" />cjk-decimal
      </label>
    
      <label for="decimal-leading-zero">
        <input
          type="radio"
          id="decimal-leading-zero"
          name="type"
          value="decimal-leading-zero" />decimal-leading-zero
      </label>
    
      <label for="lower-roman">
        <input
          type="radio"
          id="lower-roman"
          name="type"
          value="lower-roman" />lower-roman
      </label>
    
      <label for="upper-roman">
        <input
          type="radio"
          id="upper-roman"
          name="type"
          value="upper-roman" />upper-roman
      </label>
    
      <label for="lower-greek">
        <input
          type="radio"
          id="lower-greek"
          name="type"
          value="lower-greek" />lower-greek
      </label>
    
      <label for="lower-alpha">
        <input
          type="radio"
          id="lower-alpha"
          name="type"
          value="lower-alpha" />lower-alpha, lower-latin
      </label>
    
      <label for="upper-alpha">
        <input
          type="radio"
          id="upper-alpha"
          name="type"
          value="upper-alpha" />upper-alpha, upper-latin
      </label>
    
      <label for="arabic-indic">
        <input
          type="radio"
          id="arabic-indic"
          name="type"
          value="arabic-indic" />arabic-indic
      </label>
    
      <label for="armenian">
        <input type="radio" id="armenian" name="type" value="armenian" />armenian
      </label>
    
      <label for="bengali">
        <input type="radio" id="bengali" name="type" value="bengali" />bengali
      </label>
    
      <label for="cambodian">
        <input type="radio" id="cambodian" name="type" value="cambodian" />cambodian
      </label>
    
      <label for="cjk-earthly-branch">
        <input
          type="radio"
          id="cjk-earthly-branch"
          name="type"
          value="cjk-earthly-branch" />cjk-earthly-branch
      </label>
    
      <label for="cjk-heavenly-stem">
        <input
          type="radio"
          id="cjk-heavenly-stem"
          name="type"
          value="cjk-heavenly-stem" />cjk-heavenly-stem
      </label>
    
      <label for="cjk-ideographic">
        <input
          type="radio"
          id="cjk-ideographic"
          name="type"
          value="cjk-ideographic" />cjk-ideographic
      </label>
    
      <label for="devanagari">
        <input
          type="radio"
          id="devanagari"
          name="type"
          value="devanagari" />devanagari
      </label>
    
      <label for="ethiopic-numeric">
        <input
          type="radio"
          id="ethiopic-numeric"
          name="type"
          value="ethiopic-numeric" />ethiopic-numeric
      </label>
    
      <label for="georgian">
        <input type="radio" id="georgian" name="type" value="georgian" />georgian
      </label>
    
      <label for="gujarati">
        <input type="radio" id="gujarati" name="type" value="gujarati" />gujarati
      </label>
    
      <label for="gurmukhi">
        <input type="radio" id="gurmukhi" name="type" value="gurmukhi" />gurmukhi
      </label>
    
      <label for="hebrew">
        <input type="radio" id="hebrew" name="type" value="hebrew" />hebrew
      </label>
    
      <label for="hiragana">
        <input type="radio" id="hiragana" name="type" value="hiragana" />hiragana
      </label>
    
      <label for="hiragana-iroha">
        <input
          type="radio"
          id="hiragana-iroha"
          name="type"
          value="hiragana-iroha" />hiragana-iroha
      </label>
    
      <label for="japanese-formal">
        <input
          type="radio"
          id="japanese-formal"
          name="type"
          value="japanese-formal" />japanese-formal
      </label>
    
      <label for="japanese-informal">
        <input
          type="radio"
          id="japanese-informal"
          name="type"
          value="japanese-informal" />japanese-informal
      </label>
    
      <label for="kannada">
        <input type="radio" id="kannada" name="type" value="kannada" />kannada
      </label>
    
      <label for="katakana">
        <input type="radio" id="katakana" name="type" value="katakana" />katakana
      </label>
    
      <label for="katakana-iroha">
        <input
          type="radio"
          id="katakana-iroha"
          name="type"
          value="katakana-iroha" />katakana-iroha
      </label>
    
      <label for="khmer">
        <input type="radio" id="khmer" name="type" value="khmer" />khmer
      </label>
    
      <label for="korean-hangul-formal">
        <input
          type="radio"
          id="korean-hangul-formal"
          name="type"
          value="korean-hangul-formal" />korean-hangul-formal
      </label>
    
      <label for="korean-hanja-formal">
        <input
          type="radio"
          id="korean-hanja-formal"
          name="type"
          value="korean-hanja-formal" />korean-hanja-formal
      </label>
    
      <label for="korean-hanja-informal">
        <input
          type="radio"
          id="korean-hanja-informal"
          name="type"
          value="korean-hanja-informal" />korean-hanja-informal
      </label>
    
      <label for="lao">
        <input type="radio" id="lao" name="type" value="lao" />lao
      </label>
    
      <label for="lower-armenian">
        <input
          type="radio"
          id="lower-armenian"
          name="type"
          value="lower-armenian" />lower-armenian
      </label>
    
      <label for="malayalam">
        <input type="radio" id="malayalam" name="type" value="malayalam" />malayalam
      </label>
    
      <label for="mongolian">
        <input type="radio" id="mongolian" name="type" value="mongolian" />mongolian
      </label>
    
      <label for="myanmar">
        <input type="radio" id="myanmar" name="type" value="myanmar" />myanmar
      </label>
    
      <label for="oriya">
        <input type="radio" id="oriya" name="type" value="oriya" />oriya
      </label>
    
      <label for="persian">
        <input type="radio" id="persian" name="type" value="persian" />persian
      </label>
    
      <label for="simp-chinese-formal">
        <input
          type="radio"
          id="simp-chinese-formal"
          name="type"
          value="simp-chinese-formal" />simp-chinese-formal
      </label>
    
      <label for="simp-chinese-informal">
        <input
          type="radio"
          id="simp-chinese-informal"
          name="type"
          value="simp-chinese-informal" />simp-chinese-informal
      </label>
    
      <label for="tamil">
        <input type="radio" id="tamil" name="type" value="tamil" />tamil
      </label>
    
      <label for="telugu">
        <input type="radio" id="telugu" name="type" value="telugu" />telugu
      </label>
    
      <label for="thai">
        <input type="radio" id="thai" name="type" value="thai" />thai
      </label>
    
      <label for="tibetan">
        <input type="radio" id="tibetan" name="type" value="tibetan" />tibetan
      </label>
    
      <label for="trad-chinese-formal">
        <input
          type="radio"
          id="trad-chinese-formal"
          name="type"
          value="trad-chinese-formal" />trad-chinese-formal
      </label>
    
      <label for="trad-chinese-informal">
        <input
          type="radio"
          id="trad-chinese-informal"
          name="type"
          value="trad-chinese-informal" />trad-chinese-informal
      </label>
    
      <label for="upper-armenian">
        <input
          type="radio"
          id="upper-armenian"
          name="type"
          value="upper-armenian" />upper-armenian
      </label>
    
      <label for="disclosure-open">
        <input
          type="radio"
          id="disclosure-open"
          name="type"
          value="disclosure-open" />disclosure-open
      </label>
    
      <label for="disclosure-closed">
        <input
          type="radio"
          id="disclosure-closed"
          name="type"
          value="disclosure-closed" />disclosure-closed
      </label>
    
      <label for="-moz-ethiopic-halehame">
        <input
          type="radio"
          id="-moz-ethiopic-halehame"
          name="type"
          value="-moz-ethiopic-halehame" />-moz-ethiopic-halehame
      </label>
    
      <label for="-moz-ethiopic-halehame-am">
        <input
          type="radio"
          id="-moz-ethiopic-halehame-am"
          name="type"
          value="-moz-ethiopic-halehame-am" />-moz-ethiopic-halehame-am
      </label>
    
      <label for="ethiopic-halehame-ti-er">
        <input
          type="radio"
          id="ethiopic-halehame-ti-er"
          name="type"
          value="ethiopic-halehame-ti-er" />ethiopic-halehame-ti-er
      </label>
    
      <label for="ethiopic-halehame-ti-et">
        <input
          type="radio"
          id="ethiopic-halehame-ti-et"
          name="type"
          value="ethiopic-halehame-ti-et" />ethiopic-halehame-ti-et
      </label>
    
      <label for="hangul">
        <input type="radio" id="hangul" name="type" value="hangul" />hangul
      </label>
    
      <label for="hangul-consonant">
        <input
          type="radio"
          id="hangul-consonant"
          name="type"
          value="hangul-consonant" />hangul-consonant
      </label>
    
      <label for="urdu">
        <input type="radio" id="urdu" name="type" value="urdu" />urdu
      </label>
    
      <label for="-moz-ethiopic-halehame-ti-er">
        <input
          type="radio"
          id="-moz-ethiopic-halehame-ti-er"
          name="type"
          value="-moz-ethiopic-halehame-ti-er" />-moz-ethiopic-halehame-ti-er
      </label>
    
      <label for="-moz-ethiopic-halehame-ti-et">
        <input
          type="radio"
          id="-moz-ethiopic-halehame-ti-et"
          name="type"
          value="-moz-ethiopic-halehame-ti-et" />-moz-ethiopic-halehame-ti-et
      </label>
    
      <label for="-moz-hangul">
        <input
          type="radio"
          id="-moz-hangul"
          name="type"
          value="-moz-hangul" />-moz-hangul
      </label>
    
      <label for="-moz-hangul-consonant">
        <input
          type="radio"
          id="-moz-hangul-consonant"
          name="type"
          value="-moz-hangul-consonant" />-moz-hangul-consonant
      </label>
    
      <label for="-moz-urdu">
        <input type="radio" id="-moz-urdu" name="type" value="-moz-urdu" />-moz-urdu
      </label>
    </div>
    
#### CSS
    
    ol {
      font-size: 1.2rem;
    }
    
    .container {
      column-count: 3;
    }
    
    label {
      display: block;
    }
    
    input {
      margin: 0.4rem;
    }
    
#### JavaScript
    
    const container = document.querySelector(".container");
    const list = document.querySelector("ol");
    
    container.addEventListener("change", (event) => {
      list.setAttribute("style", `list-style-type: ${event.target.value}`);
    });
    
#### Result
We're not limited to the list style types defined on this page or the specification. The `@counter-style` at-rule enables creating counters using any alphabet.
# CSS paged media
The CSS paged media module defines the properties that control the presentation of content for print or any other media that splits content into discrete pages. It allows you to set page breaks, control printable areas, and style left and right pages differently.
The CSS paged media module specifies how pages are generated and laid out to hold fragmented content in a paged presentation, including content that is printed or represented as a print preview. The module defines functionality for controlling page margins, size, orientation, and headers and footers. It extends generated content to provide functionality for generating page numbers and running headers and footers.
The process of paginating content into generated pages and controlling breaks inside elements is covered in the CSS fragmentation module.
## Reference
>
### Properties
  * `page`


### At-rules
  * `@page`
    * `page-orientation` descriptor
    * `size` descriptor
    * Margin descriptors
  * Margin at-rules


The CSS paged media module also introduces the `bleeds` and `marks` descriptors of the `@page` at-rule. Currently, no browsers support these features.
### Pseudo-classes
  * `:blank`
  * `:first`
  * `:left`
  * `:right`


## Guides
Printing
    
Tips and techniques for helping improve web content printer output.
## Related concepts
  * CSS fragmentation module 
    * `break-after` property
    * `break-before` property
    * `break-inside` property
    * `orphans` property
    * `widows` property


# <flex>
The `<flex>` CSS data type denotes a flexible length within a grid container. It is used in `grid-template-columns`, `grid-template-rows` and other related properties.
## Syntax
The `<flex>` data type is specified as a `<number>` followed by the unit `fr`. The `fr` unit represents a fraction of the leftover space in the grid container. As with all CSS dimensions, there is no space between the unit and the number.
## Examples
>
### Examples of correct values for the fr data type
    
    1fr    /* Using an integer value */
    2.5fr  /* Using a float value */
    
### Example of use in a track listing for CSS grid layout
    
    .grid {
      display: grid;
      grid-template-columns: 1fr 1fr 2.5fr 1.5fr;
    }
    
# border-top-right-radius
The `border-top-right-radius` CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
## Try it
    
    border-top-right-radius: 80px 80px;
    
    
    border-top-right-radius: 250px 100px;
    
    
    border-top-right-radius: 50%;
    
    
    border-top-right-radius: 50%;
    border: black 10px double;
    background-clip: content-box;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a top right rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
The rounding can be a circle or an ellipse, or if one of the value is `0` no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the `background-clip` property.
Note: If the value of this property is not set in a `border-radius` shorthand property that is applied to the element after the `border-top-right-radius` CSS property, the value of this property is then reset to its initial value by the shorthand property.
## Syntax
    
    /* the corner is a circle */
    /* border-top-right-radius: radius */
    border-top-right-radius: 3px;
    
    /* the corner is an ellipse */
    /* border-top-right-radius: horizontal vertical */
    border-top-right-radius: 0.5em 1em;
    
    border-top-right-radius: inherit;
    
    /* Global values */
    border-top-right-radius: inherit;
    border-top-right-radius: initial;
    border-top-right-radius: revert;
    border-top-right-radius: revert-layer;
    border-top-right-radius: unset;
    
With one value:
  * the value is a `<length>` or a `<percentage>` denoting the radius of the circle to use for the border in that corner.


With two values:
  * the first value is a `<length>` or a `<percentage>` denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
  * the second value is a `<length>` or a `<percentage>` denoting the vertical semi-major axis of the ellipse to use for the border in that corner.


### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Arc of a circle
A single `<length>` value produces an arc of a circle.
    
    div {
      border-top-right-radius: 40px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Arc of an ellipse
Two different `<length>` values produce an arc of an ellipse.
    
    div {
      border-top-right-radius: 40px 20px;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Square element with percentage radius
A square element with a single `<percentage>` value produces an arc of a circle.
    
    div {
      border-top-right-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 100px;
      height: 100px;
    }
    
### Non-square element with percentage radius
A non-square element with a single `<percentage>` value produces an arc of an ellipse.
    
    div {
      border-top-right-radius: 40%;
      background-color: lightgreen;
      border: solid 1px black;
      width: 200px;
      height: 100px;
    }
    
# sibling-index()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `sibling-index()` CSS function returns an integer representing the position of the current element in the DOM tree relative to all its sibling elements. The returned value is the index number of the contextual child's position among all the sibling elements within a parent element, with the first child returning `1` and the last child, returning `Element.children`.length.
## Try it
    
    --width: calc(sibling-index() * 30px);
    
    
    --width: calc(sibling-index() * 20px);
    
    
    --width: calc(sibling-index() * 10px);
    
    
    --width: 100px;
    
    
    <ul id="example-element">
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
      <li>5</li>
      <li>6</li>
      <li>7</li>
      <li>8</li>
      <li>9</li>
      <li>10</li>
    </ul>
    
    
    #example-element {
      list-style-type: none;
      padding: 0;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }
    
    #example-element > li {
      text-align: center;
      padding: 2px;
      border-radius: 8px;
      width: var(--width, calc(sibling-index() * 30px));
      color: white;
      background-color: hsl(
        calc(360deg / sibling-count() * sibling-index()) 50% 50%
      );
    }
    
Note: Like the `:nth-child()` pseudo-class, `sibling-index()` starts from 1, not 0.
## Syntax
    
    sibling-index()
    
### Parameters
The `sibling-index()` function doesn't accept parameters.
### Return value
An integer; the position of the current element in the DOM tree's sibling order.
## Examples
>
### Dynamic list width
This example demonstrates how to dynamically increase the width of each `<li>` item in the `<ul>` by `50px`.
#### HTML
    
    <ul>
      <li>One</li>
      <li>Two</li>
      <li>Three</li>
      <li>Four</li>
    </ul>
    
#### CSS
    
    li {
      width: calc(sibling-index() * 50px);
      background-color: #ffaaaa;
    }
    
#### Results
### Ordered list
This example demonstrates how to create an ordered list using `sibling-index()`, without using the `<ol>` element. Always use the most semantic element for the context; this example is included to demonstrate what can be done with CSS when you don't have the ability to change the HTML.
#### HTML
We include a `<nav>` container and several children `<div>` elements.
    
    <nav aria-label="Ordered list">
      <div>One</div>
      <div>Two</div>
      <div>Three</div>
      <div>Four</div>
    </nav>
    
#### CSS
We make it visually appear as a numbered list by displaying the sibling-index before each `<div>` element using the `::before` pseudo-element, setting the `content` to be the integer returned by the `sibling-index()` function.
    
    div {
      --list-index: sibling-index();
      display: flex;
      gap: 1ch;
    }
    
    div::before {
      content: var(--list-index);
    }
    
#### Results
### Sequential animations
Combining `sibling-index()` with CSS animations opens new possibilities. In this example, the opacity of elements in sequential order by setting an `animation-delay` based on their order in the DOM.
#### HTML
We include a container element with four children:
    
    <ul>
      <li>One</li>
      <li>Two</li>
      <li>Three</li>
      <li>Four</li>
    </ul>
    
#### CSS
We apply the `fade-in` animation to each element. We use the `sibling-index()` function within a `calc()` function to set the duration of the `animation-delay` based on the source element's position in the source order. The `animation-fill-mode` applies the animation's `0%` keyframe until the `animation-duration` expires.
    
    ul {
      list-style-type: none;
      padding: 0;
      margin: 0;
    }
    
    li {
      animation-name: fade-in;
      animation-duration: 1s;
      animation-iteration-count: 1;
      animation-timing-function: linear;
      animation-fill-mode: backwards;
      animation-delay: calc(1s * sibling-index());
    }
    
    @keyframes fade-in {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }
    
#### Results
# CSS syntax
The CSS syntax module describes, in general terms, the structure and syntax of cascading stylesheets, or CSS. It defines CSS as the language for describing the rendering of structured documents (such as HTML and XML), on the web and elsewhere.
This module doesn't define any properties, data types, functions, or at-rules. Rather, it elaborates on how all of these features should be defined and how user agents should parse CSS.
## At-rules
  * none


Note: The module explicitly states that `@charset` is not an actual at-rule, but rather an unrecognized legacy rule that should be omitted when a stylesheet is grammar-checked. The only valid `@charset` usage is at the very beginning of a stylesheet, where it is interpreted as a special byte sequence stripped before processing the content.
## Reference
>
### Key concepts
  * `at-rule`
  * character escaping
  * CSS comments
  * CSS declaration
  * CSS declaration block
  * CSS function
  * invalid
  * style rule


### Glossary terms
  * CSS descriptor
  * parse
  * stylesheet
  * whitespace


## Guides
Introduction to CSS syntax: declarations, rulesets, and statements
    
Explains the overall CSS syntax and how declarations, declaration blocks, rulesets, and statements form the style rules.
Value definition syntax
    
Explains the formal grammar for defining valid values for CSS properties and functions, along with semantic constraints. A guide for understanding CSS component value types, combinators, and multipliers.
CSS error handling
    
Overview of how browsers handle invalid CSS.
Learn CSS first steps: CSS syntax
    
Introductory guide to CSS, including an introduction to CSS syntax.
## Related concepts
CSS selectors module:
  * CSS specificity


CSS cascading and inheritance module:
  * `@import` at-rule
  * `important` flag
  * Initial values
  * Computed values
  * Used values
  * Actual values
  * CSS inheritance
  * CSS property


CSS custom properties for cascading variables module:
  * custom property (`--*`)
  * `var()` function


CSS conditional rules module:
  * `@media` at-rule
  * `@supports` at-rule


CSS Object Model (CSSOM) API:
  * `cssText` property
  * `insertRule(rule)` method
  * `replace(text)` method


WHATWG specification:
  * `<style>` element
  * `<link>` element
  * `class` attribute
  * `rel` attribute


# ::picker-icon
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
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 {
      /* ... */
    }
    
## Description
The `::picker-icon` pseudo-element targets the picker icon of form controls, that is, the icon shown on the control button. It is only available to target when the originating element has a picker and has base appearance set on it via the `appearance` property `base-select` value. Its generated box appears after any boxes generated by the `::after` pseudo-element, with the icon specified in default browser stylesheet; you can customize it using the `content` property.
The `::picker-icon` selector can be used to select the down-facing arrow on the inline-end side of a customizable select element. This is useful for example if you want to customize the color or size of the icon, use a different icon (using `content` or SVG), or animate it when the picker is opened and closed.
Selecting customizable `<select>` picker icons is the only current use case for `::picker-icon`, but more may be added in the future.
Note: The `::picker-icon` pseudo-element is not included in the accessibility tree, so any generated `content` set on it will not be announced by assistive technologies. You should still make sure that any new icon you set visually makes sense for its intended purpose.
## Examples
>
### Animating the picker icon
To opt-in to customizable select functionality, the `<select>` element and its picker both need to have an `appearance` value of `base-select` set on them:
    
    select,
    ::picker(select) {
      appearance: base-select;
    }
    
You could then, for example, target the `::picker-icon` and give it a custom `color` and a `transition` so that changes to its `rotate` property are smoothly animated:
    
    select::picker-icon {
      color: #999999;
      transition: 0.4s rotate;
    }
    
In the next rule, `::picker-icon` is combined with the `:open` pseudo-class — which targets the icon only when the picker is open — transitioning it to a `rotate` value of `180deg` when the `<select>` is opened.
    
    select:open::picker-icon {
      rotate: 180deg;
    }
    
See Styling the picker icon for a full example that uses this code, along with a live example rendering.
# CSS box sizing
The CSS box sizing module enables you to specify how elements fit their content or fit into a particular layout context. It defines sizing, minimum sizing, and maximum sizing properties, and also extends the CSS sizing properties with keywords that represent content-based intrinsic size and context-based extrinsic size.
Elements can either be extrinsically or intrinsically sized. The CSS box model defines page-relative properties to explicitly, or "extrinsically" set an element's size, including `width`, `height`, `padding`, and `margin` properties (along with `border` properties defined in the CSS backgrounds and borders module). This CSS box sizing module extends the CSS box model module to enable an element to be sized intrinsically — setting element size based on the size of its content.
The sizing values introduced in this module allow elements with size containment to take explicit intrinsic sizes, as if their in-flow content's width and height match the specified explicit intrinsic size, rather than being sized as if they were empty.
This module also introduced the ability to define an aspect ratio for an element's box, meaning the browser can automatically adjust an element's dimensions to maintain a specified aspect ratio as long as one of the dimensions is automatically sized.
The logical properties and values module expanded the properties available in the box model and box sizing modules to include writing-mode-relative equivalents of the corresponding physical box model and intrinsic box sizing properties.
## Reference
>
### Properties
  * `aspect-ratio`
  * `box-sizing`
  * `contain-intrinsic-block-size`
  * `contain-intrinsic-height`
  * `contain-intrinsic-inline-size`
  * `contain-intrinsic-size`
  * `contain-intrinsic-width`
  * `height`
  * `max-height`
  * `max-width`
  * `min-height`
  * `min-width`
  * `width`


The CSS box sizing module also introduces the `min-intrinsic-sizing` property. Currently, no browsers support this feature.
### Data types and values
  * `<ratio>` data type
  * `min-content` value
  * `max-content` value
  * `fit-content` value


### Functions
  * `fit-content()`


### Glossary terms
  * Intrinsic size
  * Extrinsic size


## Guides
Understanding aspect ratios
    
Learn about the `aspect-ratio` property, discuss aspect ratios for replaced and non-replaced elements, and examine some common aspect ratio use cases.
Introduction to the CSS box model
    
Explains one of the fundamental concepts of CSS: the box model. This model defines how CSS lays out elements, including their content, padding, border, and margin areas.
Mastering margin collapsing
    
Sometimes, two adjacent margins are collapsed into one. This article describes the rules that govern when and why this happens, and how to control it.
Visual formatting model
    
Explains the visual formatting model.
Controlling ratios of flex items along the main axis
    
Explains intrinsic sizing as a precursor to understanding how to control the size and flexibility of flex items along the main axis using `flex-grow`, `flex-shrink`, and `flex-basis`.
## Related concepts
  * CSS logical properties module 
    * `min-inline-size`
    * `block-size`
    * `inline-size`
    * `max-block-size`
    * `max-inline-size`
    * `min-block-size`
    * `min-inline-size`
    * `margin-block`
    * `margin-inline`
    * `padding-block`
    * `padding-inline`
    * `border-block`
    * `border-inline`
    * `contain-intrinsic-block-size`
    * `contain-intrinsic-inline-size`
    * `overflow-block`
    * `overflow-inline`
    * `overscroll-behavior-block`
    * `overscroll-behavior-inline`
  * CSS box model module 
    * `margin` shorthand
    * `margin-bottom`
    * `margin-left`
    * `margin-right`
    * `margin-top`
    * `margin-trim`
    * `padding` shorthand
    * `padding-bottom`
    * `padding-left`
    * `padding-right`
    * `padding-top`
  * CSS backgrounds and borders module 
    * `border` shorthand
    * `border-width` shorthand
    * `border-bottom-width`
    * `border-left-width`
    * `border-right-width`
    * `border-top-width`
  * CSS overflow module 
    * `overflow` shorthand
    * `overflow-block`
    * `overflow-clip-margin`
    * `overflow-inline`
    * `overflow-x`
    * `overflow-y`
    * `text-overflow`
  * CSS grid layout module 
    * `grid`
    * `grid-auto-columns`
    * `grid-auto-rows`
    * `grid-template-columns`
    * `grid-template-rows`
    * `repeat()`
    * `minmax()` function
  * CSS flexible box layout module 
    * `flex-basis`
    * `flex`


# marker-mid
The `marker-mid` CSS property points to a marker that will be drawn on the middle vertices of the element's path; that is, at each of its vertices between the start and end vertices. The marker must have been defined using an SVG `<marker>` element, and can only be referenced with a `<url>` value. The value of the CSS property overrides any values of the `marker-mid` attribute in the SVG.
The direction each marker points is defined as the direction halfway between the direction at the end of the preceding path segment and the direction of the start of the following path segment. This can be thought of as the cross product of the vectors defined by the two path directions.
Note: The `marker-mid` property will only have an effect for elements that can use SVG markers. See `marker-mid` for a list.
## Syntax
    
    marker-mid: none;
    marker-mid: url("markers.svg#arrow");
    
    /* Global values */
    marker-mid: inherit;
    marker-mid: initial;
    marker-mid: revert;
    marker-mid: revert-layer;
    marker-mid: unset;
    
### Values
`none`
    
This means no marker will be drawn at each middle vertex of the element's path.
`<marker-ref>`
    
A `<url>` that refers to a marker defined by an SVG `<marker>` element, to be drawn at each middle vertex of the element's path. If the URL reference is invalid, no marker will be drawn at the path's middle vertices.
## Example
    
    <svg viewBox="0 0 240 120" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <marker
          id="triangle"
          viewBox="0 0 10 10"
          markerWidth="10"
          markerHeight="10"
          refX="1"
          refY="5"
          markerUnits="strokeWidth"
          orient="auto">
          <path d="M 0 0 L 10 5 L 0 10 z" fill="red" />
        </marker>
      </defs>
      <polyline
        id="test"
        fill="none"
        stroke="black"
        points="20,100 40,60 70,80 100,20 130,10 150,10 170,20 170,100 120,100" />
    </svg>
    
    
    polyline#test {
      marker-mid: url("#triangle");
    }
    
# padding-inline-end
The `padding-inline-end` CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-inline-end: 20px;
    writing-mode: horizontal-tb;
    
    
    padding-inline-end: 20px;
    writing-mode: vertical-rl;
    
    
    padding-inline-end: 5em;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <length> values */
    padding-inline-end: 10px; /* An absolute length */
    padding-inline-end: 1em; /* A length relative to the text size */
    
    /* <percentage> value */
    padding-inline-end: 5%; /* A padding relative to the block container's width */
    
    /* Global values */
    padding-inline-end: inherit;
    padding-inline-end: initial;
    padding-inline-end: revert;
    padding-inline-end: revert-layer;
    padding-inline-end: unset;
    
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline-size (width in a horizontal language) of the containing block. Must be nonnegative.
## Description
The `padding-inline-end` property takes the same values as physical padding properties such as `padding-top`. However, it can be equivalent to `padding-right`, `padding-left`, `padding-top`, or `padding-bottom` depending on the values set for `writing-mode`, `direction`, and `text-orientation`.
It relates to `padding-block-start`, `padding-block-end`, and `padding-inline-start`, which define the other padding values of the element.
## Examples
>
### Setting inline end padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      padding-inline-end: 20px;
      background-color: #c8c800;
    }
    
#### Result
# scroll-margin-inline
The `scroll-margin-inline` shorthand property sets the scroll margins of an element in the inline dimension.
## Try it
    
    scroll-margin-inline: 0;
    
    
    scroll-margin-inline: 40px 20px;
    
    
    scroll-margin-inline: 4em 0;
    
    
    scroll-margin-inline: 0px 3em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example {
      flex-wrap: wrap;
    }
    
    .default-example .info {
      width: 100%;
      padding: 0.5em 0;
      font-size: 90%;
    }
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-margin-inline-end`
  * `scroll-margin-inline-start`


## Syntax
    
    /* <length> values */
    scroll-margin-inline: 10px;
    scroll-margin-inline: 1em 0.5em;
    
    /* Global values */
    scroll-margin-inline: inherit;
    scroll-margin-inline: initial;
    scroll-margin-inline: revert;
    scroll-margin-inline: revert-layer;
    scroll-margin-inline: unset;
    
### Values
`<length>`
    
An outset from the corresponding edge of the scroll container.
## Description
The scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
## Examples
>
### Basic demonstration
This example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented.
The aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block.
#### HTML
The HTML includes a scroller with four children:
    
    <div class="scroller">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
    </div>
    
#### CSS
Let's walk through the CSS. The outer container is styled like this:
    
    .scroller {
      text-align: left;
      width: 250px;
      height: 250px;
      overflow-x: scroll;
      display: flex;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: x mandatory;
    }
    
The main parts relevant to the scroll snapping are `overflow-x: scroll`, which makes sure the contents will scroll and not be hidden, and `scroll-snap-type: x mandatory`, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
The child elements are styled as follows:
    
    .scroller > div {
      flex: 0 0 250px;
      width: 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: end;
    }
    
    .scroller > div:nth-child(2n) {
      background-color: white;
      color: rebeccapurple;
    }
    
The most relevant part here is `scroll-snap-align: end`, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points.
Last of all we specify the scroll margin values, a different one for the second and third child elements:
    
    .scroller > div:nth-child(2) {
      scroll-margin-inline: 1rem;
    }
    
    .scroller > div:nth-child(3) {
      scroll-margin-inline: 2rem;
    }
    
This means that when scrolling past the middle child elements, the scrolling will snap to `1rem` outside the inline end edge of the second `<div>`, and `2rems` outside the inline end edge of the third `<div>`.
Note: Here we are setting `scroll-margin` on the start and end of the inline axis (x in our case), but only the end edge is really relevant. It would work just as well here to only set a scroll margin on that one edge, for example with `scroll-margin-inline: 0 1rem`, or `scroll-margin-inline-end: 1rem`.
#### Result
Try it for yourself:
# :right
The `:right` CSS pseudo-class, used with the `@page` at-rule, represents all right-hand pages of a printed document.
    
    /* Selects any right-hand pages when printing */
    @page :right {
      margin: 2in 3in;
    }
    
Whether a given page is "left" or "right" is determined by the major writing direction of the document. For example, if the first page has a major writing direction of left-to-right then it will be a `:right` page; if it has a major writing direction of right-to-left then it will be a `:left` page.
Note: This pseudo-class can be used to change only the `margin`, `padding`, `border`, and `background` properties of the page box. All other properties will be ignored, and only the page box, not the document content on the page, will be affected.
## Syntax
    
    :right {
      /* ... */
    }
    
## Examples
>
### Setting margins for right-hand pages
    
    @page :right {
      margin: 2in 3in;
    }
    
# flex-flow
The `flex-flow` CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior.
## Try it
    
    flex-flow: row wrap;
    
    
    flex-flow: row-reverse nowrap;
    
    
    flex-flow: column wrap-reverse;
    
    
    flex-flow: column wrap;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div>Item One</div>
        <div>Item Two</div>
        <div>Item Three</div>
        <div>Item Four</div>
        <div>Item Five</div>
        <div>Item Six</div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      width: 80%;
      max-height: 300px;
      display: flex;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      width: 60px;
      margin: 10px;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `flex-direction`
  * `flex-wrap`


## Syntax
    
    /* flex-flow: <'flex-direction'> */
    flex-flow: row;
    flex-flow: row-reverse;
    flex-flow: column;
    flex-flow: column-reverse;
    
    /* flex-flow: <'flex-wrap'> */
    flex-flow: nowrap;
    flex-flow: wrap;
    flex-flow: wrap-reverse;
    
    /* flex-flow: <'flex-direction'> and <'flex-wrap'> */
    flex-flow: row nowrap;
    flex-flow: column wrap;
    flex-flow: column-reverse wrap-reverse;
    
    /* Global values */
    flex-flow: inherit;
    flex-flow: initial;
    flex-flow: revert;
    flex-flow: revert-layer;
    flex-flow: unset;
    
### Values
See `flex-direction` and `flex-wrap` for details on the values.
## Examples
>
### Setting column-reverse and wrap
In this example, the main-axis is the block direction with a reversed main-start and main-end. The flex items are allowed to wrap, creating new lines if needed.
    
    .container {
      flex-flow: column-reverse wrap;
    }
    
# Animatable CSS properties
CSS Animations and Transitions rely on the concept of animatable properties, and all CSS properties are animatable unless otherwise specified. Each property's animation type determines how values combine \- interpolate, add, or accumulate - for this property. Transitions only involve interpolation, whereas animations may use all three combination methods.
Note: The animation type for each CSS property is listed in its "Formal definition" table (E.g., `color`).
Note: The interpolation method for each CSS data type is described in its "Interpolation" section (E.g., `<length>`).
## Animation types
There are mainly four animation types as defined in the Web Animations specification:
Not animatable
    
The property is not animatable. It is not processed when listed in an animation keyframe and is unaffected by transitions.
Note: An animation effect targeting only properties that are not animatable will still exhibit the usual behavior for an animation effect (E.g., firing the `animationstart` event).
Discrete
    
The property's values are not additive, and interpolation swaps from the start value to the end value at `50%`. Specifically, denoting by `p` the progress value:
  * If `p < 0.5`, then `V_result = V_start`;
  * If `p ≥ 0.5`, then `V_result = V_end`.


By computed value
    
Corresponding individual components of the computed values are combined using the indicated procedure for that value type. If the number of components or the types of corresponding components do not match, or if any component value uses discrete animation and the two corresponding values do not match, then the property values combine as discrete.
Repeatable list
    
Same as by computed value except that if the two lists have differing numbers of items, they are first repeated to the least common multiple numbers of items. Each item is then combined by computed value. If a pair of values cannot be combined or any component value uses discrete animation, then the property values combine as discrete.
Some properties have specific interpolation behavior not covered by these four types. In this case, refer to the property's "Interpolation" section (E.g., `visibility`).
## Animating custom properties
For custom properties registered using the `registerProperty()` method, the animation type is by computed value, with the computed value type determined by the property's syntax definition.
For unregistered custom properties, the animation type is discrete.
# font-synthesis
The `font-synthesis` shorthand CSS property lets you specify whether or not the browser may synthesize the bold, italic, small-caps, and/or subscript and superscript typefaces when they are missing in the specified font-family.
## Try it
    
    font-synthesis: weight style small-caps;
    
    
    font-synthesis: none;
    
    
    font-synthesis: weight;
    
    
    font-synthesis: style;
    
    
    font-synthesis: small-caps;
    
    
    font-synthesis: position;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <p class="english">
          This font does not include <span class="bold">bold</span>,
          <span class="italic">italic</span>,
          <span class="small-caps">small-caps</span>, and
          <span class="sub">subscript</span> or
          <span class="sup">superscript</span> variants.
        </p>
        <p class="chinese">
          中文排版通常不运用<span class="bold">粗体</span>或<span class="italic"
            >斜体</span
          ><span class="sub">常不</span><span class="sup">运用</span>。
        </p>
      </div>
    </section>
    
    
    @font-face {
      font-family: Oxygen;
      font-style: normal;
      font-weight: 400;
      src: url("https://fonts.gstatic.com/s/oxygen/v14/2sDfZG1Wl4LcnbuKjk0m.woff2")
        format("woff2");
    }
    
    /* [108] */
    @font-face {
      font-family: "Ma Shan Zheng";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url("https://fonts.gstatic.com/s/mashanzheng/v10/NaPecZTRCLxvwo41b4gvzkXaRMGEFoZJFdX0wQ5Xo5Hr21L9zCcRFhbSe5Nk0pIMuUkHEA.108.woff2")
        format("woff2");
    }
    /* [110] */
    @font-face {
      font-family: "Ma Shan Zheng";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url("https://fonts.gstatic.com/s/mashanzheng/v10/NaPecZTRCLxvwo41b4gvzkXaRMGEFoZJFdX0wQ5Xo5Hr21L9zCcRFhbSe5Nk0pIMuUkHEA.110.woff2")
        format("woff2");
    }
    /* [117] */
    @font-face {
      font-family: "Ma Shan Zheng";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url("https://fonts.gstatic.com/s/mashanzheng/v10/NaPecZTRCLxvwo41b4gvzkXaRMGEFoZJFdX0wQ5Xo5Hr21L9zCcRFhbSe5Nk0pIMuUkHEA.117.woff2")
        format("woff2");
    }
    /* [118] */
    @font-face {
      font-family: "Ma Shan Zheng";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url("https://fonts.gstatic.com/s/mashanzheng/v10/NaPecZTRCLxvwo41b4gvzkXaRMGEFoZJFdX0wQ5Xo5Hr21L9zCcRFhbSe5Nk0pIMuUkHEA.118.woff2")
        format("woff2");
    }
    /* [119] */
    @font-face {
      font-family: "Ma Shan Zheng";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url("https://fonts.gstatic.com/s/mashanzheng/v10/NaPecZTRCLxvwo41b4gvzkXaRMGEFoZJFdX0wQ5Xo5Hr21L9zCcRFhbSe5Nk0pIMuUkHEA.119.woff2")
        format("woff2");
    }
    
    .english {
      font-size: 1.2em;
      font-family: Oxygen, sans-serif;
    }
    
    .chinese {
      font-size: 1.2em;
      font-family: "Ma Shan Zheng", cursive;
    }
    
    .bold {
      font-weight: bold;
    }
    
    .italic {
      font-style: italic;
    }
    
    .small-caps {
      font-variant: small-caps;
    }
    
    .sub {
      font-variant: sub;
    }
    
    .sup {
      font-variant: super;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * font-synthesis-weight
  * font-synthesis-style
  * font-synthesis-small-caps
  * font-synthesis-position


## Syntax
    
    /* none or one or more of the other keyword values */
    font-synthesis: none;
    font-synthesis: weight;
    font-synthesis: style;
    font-synthesis: position;
    font-synthesis: small-caps style; /* property values can be in any order */
    font-synthesis: style small-caps weight position; /* property values can be in any order */
    
    /* Global values */
    font-synthesis: inherit;
    font-synthesis: initial;
    font-synthesis: revert;
    font-synthesis: revert-layer;
    font-synthesis: unset;
    
### Values
`none`
    
Indicates that no bold, italic, or small-caps typeface may be synthesized by the browser.
`weight`
    
Indicates that the missing bold typeface may be synthesized by the browser if needed.
`style`
    
Indicates that the italic typeface may be synthesized by the browser if needed.
`small-caps`
    
Indicates that the small-caps typeface may be synthesized by the browser if needed.
`position`
    
Indicates that the subscript and superscript typeface may be synthesized by the browser, if needed, when using `font-variant-position`.
## Description
Most standard Western fonts include italic and bold variants, and some fonts include a small-caps and subscript/superscript variants. However, many fonts do not. Fonts used for Chinese, Japanese, Korean and other logographic scripts tend not to include these variants and synthesizing them might impede the legibility or change the meaning of the text. In these cases, it may be desirable to switch off the browser's default font-synthesis.
For example, using the :lang() pseudo-class, you can disable the browser from synthesizing bold and oblique characters for a language, in this case Arabic:
    
    *:lang(ar) {
      font-synthesis: none;
    }
    
The table below shows how a value of the shorthand `font-synthesis` property maps to the constituent longhand properties.
font-synthesis value font-synthesis-weight value font-synthesis-style value font-synthesis-small-caps value font-synthesis-position value  
`none` `none` `none` `none` `none`  
`weight` `auto` `none` `none` `none`  
`style` `none` `auto` `none` `none`  
`small-caps` `none` `none` `auto` `none`  
`position` `none` `none` `none` `auto`  
`weight style` `auto` `auto` `none` `none`  
`weight small-caps` `auto` `none` `auto` `none`  
`weight position` `auto` `none` `none` `auto`  
`style small-caps` `none` `auto` `auto` `none`  
`style position` `none` `auto` `none` `auto`  
`weight style small-caps` `auto` `auto` `auto` `none`  
`weight style position` `auto` `auto` `none` `auto`  
`weight small-caps position` `auto` `none` `auto` `auto`  
`style small-caps position` `none` `auto` `auto` `auto`  
`weight style small-caps position` `auto` `auto` `auto` `auto`  
## Examples
>
### Disabling font synthesis
This example shows the browser's default font-synthesis behavior and compares it with when the synthesis behavior is turned off. Notice that the example uses two imported fonts to demonstrate this behavior. You might not be able to replicate turning off of font-synthesis on fonts available on your operating system by default.
#### HTML
    
    <pre> DEFAULT </pre>
    <p class="english">
      This font supports <strong>bold</strong> and <em>italic</em>.
    </p>
    <p class="chinese">这个字体支持<strong>加粗</strong>和<em>斜体</em></p>
    <br />
    
    <pre> SYNTHESIS IS DISABLED </pre>
    <p class="english no-syn">
      This font supports <strong>bold</strong> and <em>italic.</em>
    </p>
    <p class="chinese no-syn">这个字体支持<strong>加粗</strong>和<em>斜体</em></p>
    <br />
    
    <pre> SYNTHESIS IS ENABLED </pre>
    <p class="english">
      This font supports <strong>bold</strong> and <em>italic</em>.
    </p>
    <p class="chinese syn">这个字体支持<strong>加粗</strong>和<em>斜体</em></p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
    @import "https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap";
    
    .english {
      font-family: "Montserrat", sans-serif;
    }
    .chinese {
      font-family: "Ma Shan Zheng", cursive;
    }
    .no-syn {
      font-synthesis: none;
    }
    .syn {
      font-synthesis: style weight;
    }
    
#### Result
# @font-palette-values
The `@font-palette-values` CSS at-rule allows you to customize the default values of font-palette created by the font-maker.
## Syntax
    
    @font-palette-values --identifier {
      font-family: Bixa;
    }
    .my-class {
      font-palette: --identifier;
    }
    
The <dashed-ident> is a user defined identifier, that while it looks like a CSS custom property behaves in a different way and is not wrapped in a CSS var() function.
### Descriptors
`base-palette`
    
Specifies the name or index of the base-palette, created by the font-maker, to use.
`font-family`
    
Specifies the name of the font family that this palette can be applied to. A `font-family` name is required for the `@font-palette-values` rule to be valid.
`override-colors`
    
Specifies the colors in the base palette to override.
## Examples
>
### Overriding colors in an existing palette
This example shows how you can change some or all of the colors in a color font.
#### HTML
    
    <p>default colors</p>
    <p class="alternate">alternate colors</p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Bungee+Spice";
    p {
      font-family: "Bungee Spice", fantasy;
      font-size: 2rem;
    }
    @font-palette-values --Alternate {
      font-family: "Bungee Spice";
      override-colors:
        0 #00ffbb,
        1 #007744;
    }
    .alternate {
      font-palette: --Alternate;
    }
    
#### Result
When overriding colors of the normal or base-palette at index 0 you do not need to declare which base-palette to use. This should only be done when overriding a different base-palette. If you are overriding all the colors then there is also no need to specify the base-palette to use.
# CSS masking
The CSS masking module defines masking and clipping, two different graphical operations that are used to partially or fully hide portions of visual elements.
Clipping involves defining a closed vector path, shape, or polygon as a clipping path. Everything inside the clipping path region remains visible while everything outside is hidden, or "clipped out". The `clip-path` property specifies a `<basic-shape>` or references an SVG `<clipPath>` element to be used as a clipping path.
CSS masking properties are used to apply a mask to an element or its border. A graphical object is then painted onto the background or border, completely or partially masking out parts of the element or its border, depending on the opacity or luminance of the mask.
The image used as the mask is specified by the `mask-image` or `mask-border-source` properties. The specified mask can be an `<image>`, a `<gradient>`, or an SVG `<mask>` element. The mask can be sized and positioned similarly to background and border images.
Clipping and masking in CSS behaves the same way as it does with SVG: First, the element is styled without filter effects, masking, clipping, and opacity. Then, any effects are applied to the element in the following order: filter effects, clipping, masking, and opacity.
While masking provides more control and options, clipping can perform better if a basic shape is all that's required — they are easier to interpolate.
## Reference
>
### Properties
  * `clip` Deprecated
  * `clip-path`
  * `clip-rule`
  * `mask` shorthand
  * `mask-clip`
  * `mask-composite`
  * `mask-image`
  * `mask-mode`
  * `mask-origin`
  * `mask-position`
  * `mask-repeat`
  * `mask-size`
  * `mask-type`
  * `mask-border` shorthand
  * `mask-border-outset`
  * `mask-border-repeat`
  * `mask-border-slice`
  * `mask-border-source`
  * `mask-border-width`
  * `mask-border-mode`


### Data types
  * `<geometry-box>`


### Functions
  * `rect()` function


### Interfaces
  * `SVGClipPathElement`
  * `SVGMaskElement`
    * `SVGMaskElement.maskContentUnits`


## Guides
Introduction to CSS clipping
    
Introduction to clipping in CSS, including the `clip-path` property with examples.
Introduction to CSS masking
    
Introduction to masking in CSS, the various mask image types, and the effects of luminance and alpha-transparency in masking.
Declaring multiple masks
    
Introduction to mask layers and how to declare multiple mask images.
CSS mask properties
    
An exploration of CSS masking and the `mask` shorthand component properties, with explanations and examples.
## Related concepts
  * `<coord-box>`
  * `<image>`
  * `<position>`
  * `<url>`
  * CSS backgrounds and borders module
    * `background` shorthand
    * `background-origin`
    * `background-position`
    * `background-repeat`
    * `background-size`
    * `border-image` shorthand
    * `border-image-repeat`
    * `border-image-slice`
    * `border-image-source`
    * `border-image-width`
    * `<repeat-style>` data type
  * CSS shapes module
    * `<basic-shape>` data type
    * `polygon()` function
    * `<shape-box>` data type


# column-rule-style
The `column-rule-style` CSS property sets the style of the line drawn between columns in a multi-column layout.
## Try it
    
    column-rule-style: none;
    
    
    column-rule-style: dotted;
    
    
    column-rule-style: solid;
    
    
    column-rule-style: double;
    
    
    column-rule-style: ridge;
    column-rule-color: #8888ff;
    
    
    <section id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      columns: 3;
      column-rule: solid;
      text-align: left;
    }
    
## Syntax
    
    /* <'border-style'> values */
    column-rule-style: none;
    column-rule-style: hidden;
    column-rule-style: dotted;
    column-rule-style: dashed;
    column-rule-style: solid;
    column-rule-style: double;
    column-rule-style: groove;
    column-rule-style: ridge;
    column-rule-style: inset;
    column-rule-style: outset;
    
    /* Global values */
    column-rule-style: inherit;
    column-rule-style: initial;
    column-rule-style: revert;
    column-rule-style: revert-layer;
    column-rule-style: unset;
    
The `column-rule-style` property is specified as a single `<'border-style'>` value.
### Values
`<'border-style'>`
    
Is a keyword defined by `border-style` describing the style of the rule. The styling must be interpreted as in the collapsing border model.
## Examples
>
### Setting a dashed column rule
#### HTML
    
    <p>
      This is a bunch of text split into three columns. The `column-rule-style`
      property is used to change the style of the line that is drawn between
      columns. Don't you think that's wonderful?
    </p>
    
#### CSS
    
    p {
      column-count: 3;
      column-rule-style: dashed;
    }
    
#### Result
# border-spacing
The `border-spacing` CSS property sets the distance between the borders of adjacent cells in a `<table>`. This property applies only when `border-collapse` is `separate`.
## Try it
    
    border-spacing: 0;
    
    
    border-spacing: 5px;
    
    
    border-spacing: 5px 1rem;
    
    
    <section class="default-example" id="default-example">
      <table class="transition-all" id="example-element">
        <tr>
          <td>Cell 1.1</td>
          <td>Cell 1.2</td>
        </tr>
        <tr>
          <td>Cell 2.1</td>
          <td>Cell 2.2</td>
        </tr>
        <tr>
          <td>Cell 3.1</td>
          <td>Cell 3.2</td>
        </tr>
      </table>
    </section>
    
    
    table {
      width: 15rem;
      table-layout: fixed;
    }
    
    td {
      border: 5px solid;
      border-color: crimson dodgerblue;
      padding: 0.75rem;
    }
    
The `border-spacing` value is also used along the outside edge of the table, where the distance between the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or vertical) `border-spacing` and the relevant (top, right, bottom, or left) `padding` on the table.
Note: The `border-spacing` property is equivalent to the deprecated `cellspacing` attribute of the `<table>` element, except that `border-spacing` has an optional second value that can be used to set different horizontal and vertical spacing.
## Syntax
    
    /* <length> */
    border-spacing: 2px;
    
    /* horizontal <length> | vertical <length> */
    border-spacing: 1cm 2em;
    
    /* Global values */
    border-spacing: inherit;
    border-spacing: initial;
    border-spacing: revert;
    border-spacing: revert-layer;
    border-spacing: unset;
    
The `border-spacing` property may be specified as either one or two values.
  * When one `<length>` value is specified, it defines both the horizontal and vertical spacings between cells.
  * When two `<length>` values are specified, the first value defines the horizontal spacing between cells (i.e., the space between cells in adjacent columns), and the second value defines the vertical spacing between cells (i.e., the space between cells in adjacent rows).


### Values
`<length>`
    
The size of the spacing as a fixed value.
## Examples
>
### Spacing and padding table cells
This example applies a spacing of `.5em` vertically and `1em` horizontally between a table's cells. Note how, along its outside edges, the table's `padding` values are added to its `border-spacing` values.
#### HTML
    
    <table>
      <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
      </tr>
      <tr>
        <td>4</td>
        <td>5</td>
        <td>6</td>
      </tr>
      <tr>
        <td>7</td>
        <td>8</td>
        <td>9</td>
      </tr>
    </table>
    
#### CSS
    
    table {
      border-spacing: 1em 0.5em;
      padding: 0 2em 1em 0;
      border: 1px solid orange;
    }
    
    td {
      width: 1.5em;
      height: 1.5em;
      background: #d2d2d2;
      text-align: center;
      vertical-align: middle;
    }
    
#### Result
# <system-color>
The `<system-color>` CSS data type usually reflects the default color choices used for the different parts of a web page.
However, user agents can provide an accessibility feature called forced colors mode, in which colors are restricted into a user- and user agent-defined palette, overriding the author's choice of colors in certain properties. In forced colors mode, `<system-color>` exposes the chosen colors, so that the rest of the page can integrate with them. An example of forced colors mode is high contrast mode on Windows.
In forced colors mode, authors should use colors from the `<system-color>` type for all properties that are not in the set of properties whose colors are overridden. This ensures that the page consistently uses the same color palette across all properties.
Authors can detect forced colors mode using the `forced-colors` media feature.
A `<system-color>` value can be used anywhere a `<color>` can be used.
## Syntax
Note that these keywords are case insensitive, but are listed here with mixed case for readability.
Depending on your settings, the sample colors displayed in the table may change. You can also view this page with different browsers, operating systems, and system settings, to check the differences.
Keyword Description Sample  
`AccentColor` Background of accented user interface controls.  
`AccentColorText` Text of accented user interface controls.  
`ActiveText` Text of active links.  
`ButtonBorder` Base border color of controls.  
`ButtonFace` Background color of controls.  
`ButtonText` Text color of controls.  
`Canvas` Background of application content or documents.  
`CanvasText` Text color in application content or documents.  
`Field` Background of input fields.  
`FieldText` Text in input fields.  
`GrayText` Text color for disabled items (for example, a disabled control).  
`Highlight` Background of selected items.  
`HighlightText` Text color of selected items.  
`LinkText` Text of non-active, non-visited links.  
`Mark` Background of text that has been specially marked (such as by the HTML `mark` element).  
`MarkText` Text that has been specially marked (such as by the HTML `mark` element).  
`SelectedItem` Background of selected items, for example, a selected checkbox.  
`SelectedItemText` Text of selected items.  
`VisitedText` Text of visited links.  
### Deprecated system color keywords
The following keywords were defined in earlier versions of the CSS Color Module. They are now deprecated for use on public web pages.
Keyword Description Replacement Sample  
`ActiveBorder` Active window border `ButtonBorder`  
`ActiveCaption` Active window caption. Should be used with `CaptionText` as foreground color. `Canvas`  
`AppWorkspace` Background color of multiple document interface. `Canvas`  
`Background` Desktop background. `Canvas`  
`ButtonHighlight` The color of the border facing the light source for 3-D elements that appear 3-D due to that layer of surrounding border. `ButtonFace`  
`ButtonShadow` The color of the border away from the light source for 3-D elements that appear 3-D due to that layer of surrounding border. `ButtonFace`  
`CaptionText` Text in caption, size box, and scrollbar arrow box. Should be used with the `ActiveCaption` background color. `CanvasText`  
`InactiveBorder` Inactive window border. `ButtonBorder`  
`InactiveCaption` Inactive window caption. Should be used with the `InactiveCaptionText` foreground color. `Canvas`  
`InactiveCaptionText` Color of text in an inactive caption. Should be used with the `InactiveCaption` background color. `GrayText`  
`InfoBackground` Background color for tooltip controls. Should be used with the `InfoText` foreground color. `Canvas`  
`InfoText` Text color for tooltip controls. Should be used with the `InfoBackground` background color. `CanvasText`  
`Menu` Menu background. Should be used with the `MenuText` or `-moz-MenuBarText` foreground color. `Canvas`  
`MenuText` Text in menus. Should be used with the `Menu` background color. `CanvasText`  
`Scrollbar` Background color of scroll bars. `Canvas`  
`ThreeDDarkShadow` The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border. `ButtonBorder`  
`ThreeDFace` The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border. Should be used with the `ButtonText` foreground color. `ButtonFace`  
`ThreeDHighlight` The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border. `ButtonBorder`  
`ThreeDLightShadow` The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border. `ButtonBorder`  
`ThreeDShadow` The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border. `ButtonBorder`  
`Window` Window background. Should be used with the `WindowText` foreground color. `Canvas`  
`WindowFrame` Window frame. `ButtonBorder`  
`WindowText` Text in windows. Should be used with the `Window` background color. `CanvasText`  
## Examples
>
### Using system colors
In this example we have a button that normally gets its contrast using the `box-shadow` property. In forced colors mode, `box-shadow` is forced to `none`, so the example uses the `forced-colors` media feature to ensure there is a border of the appropriate color (`ButtonBorder` in this case).
#### HTML
    
    <button class="button">Press me!</button>
    
#### CSS
    
    .button {
      border: 0;
      padding: 10px;
      box-shadow:
        -2px -2px 5px gray,
        2px 2px 5px gray;
    }
    
    @media (forced-colors: active) {
      .button {
        /* Use a border instead, since box-shadow
        is forced to 'none' in forced-colors mode */
        border: 2px ButtonBorder solid;
      }
    }
    
#### Result
# mask-border-outset
The `mask-border-outset` CSS property specifies the distance by which an element's mask border is set out from its border box.
## Syntax
    
    /* <length> value */
    mask-border-outset: 1rem;
    
    /* <number> value */
    mask-border-outset: 1.5;
    
    /* top and bottom | left and right */
    mask-border-outset: 1 1.2;
    
    /* top | left and right | bottom */
    mask-border-outset: 30px 2 45px;
    
    /* top | right | bottom | left */
    mask-border-outset: 7px 12px 14px 5px;
    
    /* Global values */
    mask-border-outset: inherit;
    mask-border-outset: initial;
    mask-border-outset: revert;
    mask-border-outset: revert-layer;
    mask-border-outset: unset;
    
The `mask-border-outset` property may be specified as one, two, three, or four values. Each value is a `<length>` or `<number>`. Negative values are invalid.
  * When one value is specified, it applies the same outset to all four sides.
  * When two values are specified, the first outset applies to the top and bottom, the second to the left and right.
  * When three values are specified, the first outset applies to the top, the second to the left and right, the third to the bottom.
  * When four values are specified, the outsets apply to the top, right, bottom, and left in that order (clockwise).


### Values
`<length>`
    
The size of the mask border outset as a dimension.
`<number>`
    
The size of the mask border outset as a multiple of the corresponding `border-width`.
## Examples
>
### Basic usage
This property doesn't appear to be supported anywhere yet. When it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across the border, rather than the inside of it.
    
    mask-border-outset: 1rem;
    
Chromium-based browsers support an outdated version of this property — `mask-box-image-outset` — with a prefix:
    
    -webkit-mask-box-image-outset: 1rem;
    
Note: The `mask-border` page features a working example (using the out-of-date prefixed border mask properties supported in Chromium), so you can get an idea of the effect.
# animation-iteration-count
The `animation-iteration-count` CSS property sets the number of times an animation sequence should be played before stopping.
## Try it
    
    animation-iteration-count: 0;
    
    
    animation-iteration-count: 2;
    
    
    animation-iteration-count: 1.5;
    
    
    <section class="flex-column" id="default-example">
      <div>Animation <span id="play-status"></span></div>
      <div id="example-element">Select a count to start!</div>
    </section>
    
    
    #example-element {
      align-items: center;
      background-color: #1766aa;
      border-radius: 50%;
      border: 5px solid #333333;
      color: white;
      display: flex;
      flex-direction: column;
      height: 150px;
      justify-content: center;
      margin: auto;
      margin-left: 0;
      width: 150px;
    }
    
    #play-status {
      font-weight: bold;
    }
    
    .animating {
      animation-name: slide;
      animation-duration: 3s;
      animation-timing-function: ease-in;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const status = document.getElementById("play-status");
    
    function update() {
      status.textContent = "delaying";
      el.className = "";
      window.requestAnimationFrame(() => {
        window.requestAnimationFrame(() => {
          el.className = "animating";
        });
      });
    }
    
    el.addEventListener("animationstart", () => {
      status.textContent = "playing";
    });
    
    el.addEventListener("animationend", () => {
      status.textContent = "finished";
    });
    
    const observer = new MutationObserver(() => {
      update();
    });
    
    observer.observe(el, {
      attributes: true,
      attributeFilter: ["style"],
    });
    
    update();
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Keyword value */
    animation-iteration-count: infinite;
    
    /* <number> values */
    animation-iteration-count: 3;
    animation-iteration-count: 2.4;
    
    /* Multiple values */
    animation-iteration-count: 2, 0, infinite;
    
    /* Global values */
    animation-iteration-count: inherit;
    animation-iteration-count: initial;
    animation-iteration-count: revert;
    animation-iteration-count: revert-layer;
    animation-iteration-count: unset;
    
The `animation-iteration-count` property is specified as one or more comma-separated values.
### Values
`infinite`
    
The animation will repeat forever.
`<number>`
    
The number of times the animation will repeat; this is `1` by default. You may specify non-integer values to play part of an animation cycle: for example, `0.5` will play half of the animation cycle. Negative values are invalid.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: When creating CSS scroll-driven animations, specifying an `animation-iteration-count` causes the animation to repeat that number of times over the course of the timeline's progression. If an `animation-iteration-count` is not provided, the animation will only occur once. `infinite` is a valid value for scroll-driven animations, but it results in an animation that doesn't work.
## Examples
>
### Setting iteration count
This animation will run 10 times.
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
    }
    
    .box:hover {
      animation-name: rotate;
      animation-duration: 0.7s;
      animation-iteration-count: 10;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
Hover over the rectangle to start the animation.
See CSS animations for examples.
# :required
The `:required` CSS pseudo-class represents any `<input>`, `<select>`, or `<textarea>` element that has the `required` attribute set on it.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    .req {
      color: red;
    }
    
    *:required {
      background-color: gold;
    }
    
    
    <form>
      <label for="name">Name: <span class="req">*</span></label>
      <input id="name" name="name" type="text" required />
    
      <label for="birth">Date of Birth:</label>
      <input id="birth" name="birth" type="date" />
    
      <label for="origin"
        >How did you find out about us? <span class="req">*</span></label
      >
      <select id="origin" name="origin" required>
        <option>Google</option>
        <option>Facebook</option>
        <option>Advertisement</option>
      </select>
      <p><span class="req">*</span> - Required field</p>
    </form>
    
This pseudo-class is useful for highlighting fields that must have valid data before a form can be submitted.
Note: The `:optional` pseudo-class selects optional form fields.
## Syntax
    
    :required {
      /* ... */
    }
    
## Accessibility
Mandatory `<input>`s should have the `required` attribute applied to them. This will ensure that people navigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful submission.
If the form also contains optional inputs, required inputs should be indicated visually using a treatment that does not rely solely on color to convey meaning. Typically, descriptive text and/or an icon are used.
  * MDN Understanding WCAG, Guideline 3.3 explanations
  * Understanding Success Criterion 3.3.2 | W3C Understanding WCAG 2.0


## Examples
>
### The required field has a red border
#### HTML
    
    <form>
      <div class="field">
        <label for="url_input">Enter a URL:</label>
        <input type="url" id="url_input" />
      </div>
    
      <div class="field">
        <label for="email_input">Enter an email address:</label>
        <input type="email" id="email_input" required />
      </div>
    </form>
    
#### CSS
    
    label {
      display: block;
      margin: 1px;
      padding: 1px;
    }
    
    .field {
      margin: 1px;
      padding: 1px;
    }
    
    input:required {
      border-color: maroon;
      border-width: 3px;
    }
    
    input:required:invalid {
      border-color: #c00000;
    }
    
#### Result
# background-attachment
The `background-attachment` CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.
## Try it
    
    background-attachment: scroll;
    
    
    background-attachment: fixed;
    
    
    background-attachment: local;
    
    
    background-attachment: local, scroll;
    
    
    background-attachment: scroll, local;
    
    
    <section id="default-example">
      <div id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill. London. Michaelmas term
        lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall.
        Implacable November weather. As much mud in the streets as if the waters had
        but newly retired from the face of the earth, and it would not be wonderful
        to meet a Megalosaurus, forty feet long or so, waddling like an elephantine
        lizard up Holborn Hill.
      </div>
    </section>
    
    
    body {
      overflow: scroll;
    }
    
    #default-example {
      height: 600px;
    }
    
    #example-element {
      max-width: 20rem;
      height: 100%;
      background:
        url("/shared-assets/images/examples/lizard.png") right 3rem top 1rem / 15rem
          no-repeat,
        url("/shared-assets/images/examples/moon.jpg") center / 10rem;
      color: #ff5454;
      font-size: 1.5em;
      font-weight: bold;
      overflow: auto;
      padding: 20px;
      text-shadow:
        0 0 0.6rem black,
        0 0 0.6rem black;
    }
    
## Syntax
    
    /* Keyword values */
    background-attachment: scroll;
    background-attachment: fixed;
    background-attachment: local;
    
    /* Global values */
    background-attachment: inherit;
    background-attachment: initial;
    background-attachment: revert;
    background-attachment: revert-layer;
    background-attachment: unset;
    
The `background-attachment` property is specified as one of the keyword values from the list below.
### Values
`fixed`
    
The background is fixed relative to the viewport. Even if an element has a scrolling mechanism, the background doesn't move with the element.
`local`
    
The background is fixed relative to the element's contents. If the element has a scrolling mechanism, the background scrolls with the element's contents, and the background painting area and background positioning area are relative to the scrollable area of the element rather than to the border framing them.
`scroll`
    
The background is fixed relative to the element itself and does not scroll with its contents. (It is effectively attached to the element's border.)
## Examples
>
### Basic example
#### HTML
    
    <p>
      There were doors all round the hall, but they were all locked; and when Alice
      had been all the way down one side and up the other, trying every door, she
      walked sadly down the middle, wondering how she was ever to get out again.
    </p>
    
#### CSS
    
    p {
      background-image: url("star-solid.gif");
      background-attachment: fixed;
    }
    
#### Result
### Multiple background images
This property supports multiple background images. You can specify a different `<attachment>` for each background, separated by commas. Each image is matched with the corresponding `<attachment>` type, from first specified to last.
#### HTML
    
    <p>
      There were doors all round the hall, but they were all locked; and when Alice
      had been all the way down one side and up the other, trying every door, she
      walked sadly down the middle, wondering how she was ever to get out again.
      Suddenly she came upon a little three-legged table, all made of solid glass;
      there was nothing on it except a tiny golden key, and Alice's first thought
      was that it might belong to one of the doors of the hall; but, alas! either
      the locks were too large, or the key was too small, but at any rate it would
      not open any of them. However, on the second time round, she came upon a low
      curtain she had not noticed before, and behind it was a little door about
      fifteen inches high: she tried the little golden key in the lock, and to her
      great delight it fitted!
    </p>
    
#### CSS
    
    p {
      background-image: url("star-solid.gif"), url("star-transparent.gif");
      background-attachment: fixed, scroll;
      background-repeat: no-repeat, repeat-y;
    }
    
#### Result
# <frequency>
The `<frequency>` CSS data type represents a frequency dimension, such as the pitch of a speaking voice. It is not currently used in any CSS properties.
## Syntax
The `<frequency>` data type consists of a `<number>` followed by one of the units listed below. As with all CSS dimensions, there is no space between the unit literal and the number.
### Units
`Hz`
    
Represents a frequency in hertz. Examples: `0Hz`, `1500Hz`, `10000Hz`.
`kHz`
    
Represents a frequency in kilohertz. Examples: `0kHz`, `1.5kHz`, `10kHz`.
Note: Although the number `0` is always the same regardless of unit, the unit may not be omitted. In other words, `0` is invalid and does not represent `0Hz` or `0kHz`. Though the units are case-insensitive, it is good practice to use a capital "H" for `Hz` and `kHz`, as specified in the SI.
## Examples
Valid frequency values:
    
    12Hz     Positive integer
    4.3Hz    Non-integer
    14KhZ    The unit is case-insensitive, though non-SI capitalization is not recommended.
    +0Hz     Zero, with a leading + and a unit
    -0kHz    Zero, with a leading - and a unit
    
Invalid frequency values:
    
    12.0     This is a <number>, not an <frequency>, because it is missing a unit.
    7 Hz     No space is allowed between the number and the unit.
    0        Although unitless zero is an allowable <length>, it's an invalid <frequency>.
    
Currently, no browsers support this feature.
# border-image
The `border-image` CSS property draws an image around a given element. It replaces the element's regular border.
## Try it
    
    border-image: url("/shared-assets/images/examples/border-diamonds.png") 30;
    
    
    border-image: url("/shared-assets/images/examples/border-diamonds.png") 30 /
      19px round;
    
    
    border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
      fill / 30px / 30px space;
    
    
    border-image: linear-gradient(#f6b73c, #4d9f0c) 30;
    
    
    border-image: repeating-linear-gradient(30deg, #4d9f0c, #9198e5, #4d9f0c 20px)
      60;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
Note: You should specify a separate `border-style` in case the border image fails to load. Although the specification doesn't strictly require it, some browsers don't render the border image if `border-style` is `none` or `border-width` is `0`.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-image-outset`
  * `border-image-repeat`
  * `border-image-slice`
  * `border-image-source`
  * `border-image-width`


## Syntax
    
    /* source | slice */
    border-image: linear-gradient(red, blue) 27;
    
    /* source | slice | repeat */
    border-image: url("/images/border.png") 27 space;
    
    /* source | slice | width */
    border-image: linear-gradient(red, blue) 27 / 35px;
    
    /* source | slice | width | outset | repeat */
    border-image: url("/images/border.png") 27 23 / 50px 30px / 1rem round space;
    
    /* Global values */
    border-image: inherit;
    border-image: initial;
    border-image: revert;
    border-image: revert-layer;
    border-image: unset;
    
The `border-image` property may be specified with anywhere from one to five of the values listed below.
Note: If the computed value of `border-image-source` is `none`, or if the image cannot be displayed, the `border-style` will be displayed instead.
### Values
`<'border-image-source'>`
    
The source image. See `border-image-source`.
`<'border-image-slice'>`
    
The dimensions for slicing the source image into regions. Up to four values may be specified. See `border-image-slice`.
`<'border-image-width'>`
    
The width of the border image. Up to four values may be specified. See `border-image-width`.
`<'border-image-outset'>`
    
The distance of the border image from the element's outside edge. Up to four values may be specified. See `border-image-outset`.
`<'border-image-repeat'>`
    
Defines how the edge regions of the source image are adjusted to fit the dimensions of the border image. Up to two values may be specified. See `border-image-repeat`.
## Accessibility
Assistive technology cannot parse border images. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
  * MDN Understanding WCAG, Guideline 1.1 explanations
  * Understanding Success Criterion 1.1.1 | Understanding WCAG 2.0


## Examples
>
### Bitmap
In this example, we will apply a diamond pattern to an element's borders. The source for the border image is a ".png" file of 81 by 81 pixels, with three diamonds going vertically and horizontally:
#### HTML
    
    <div id="bitmap">
      This element is surrounded by a bitmap-based border image!
    </div>
    
#### CSS
To match the size of a single diamond, we will use a value of 81 divided by 3, or `27`, for slicing the image into corner and edge regions. To center the border image on the edge of the element's background, we will make the outset values equal to half of the width values. Finally, a repeat value of `round` will make the border slices fit evenly, i.e., without clipping or gaps.
    
    #bitmap {
      width: 200px;
      background-color: #ffffaa;
      border: 36px solid orange;
      margin: 30px;
      padding: 10px;
    
      border-image: url("border.png") 27 / 36px 28px 18px 8px / 18px 14px 9px 4px
        round;
    }
    
#### Result
### Gradient
#### HTML
    
    <div id="gradient">
      This element is surrounded by a gradient-based border image!
    </div>
    
#### CSS
    
    #gradient {
      width: 200px;
      border: 30px solid;
      border-image: repeating-linear-gradient(45deg, #ff3333, #33bbff, #ff3333 30px)
        60;
      padding: 20px;
    }
    
#### Result
### Rounded borders
`border-radius` has no effect on the border image. This is because `border-image-outset` is able to place the image outside the border box, so it doesn't make sense for the border image to be clipped by the border area. To create rounded borders when using a border image, you should create the image itself with rounded corners, or, in the case of a gradient, draw it as the background instead. Below, we show one approach to do this, which is to use two `background-image`s: one that extends the border box, and another for the padding box.
#### HTML
    
    <div id="rounded">
      This element is surrounded by a border image with rounded corners!
    </div>
    
#### CSS
    
    #rounded {
      width: 200px;
      /* Use transparent so the background image is visible */
      border: 10px solid transparent;
      padding: 20px;
      border-radius: 20px;
      background-image:
        linear-gradient(white, white), linear-gradient(to right, cyan, lime);
      background-origin: border-box;
      background-clip: padding-box, border-box;
    }
    
#### Result
Note: There is a new ``background-clip`: border-area` value being proposed to address this use case.
# font-synthesis-style
The `font-synthesis-style` CSS property lets you specify whether or not the browser may synthesize the oblique typeface when it is missing in a font family.
It is often convenient to use the shorthand property `font-synthesis` to control all typeface synthesis values.
## Syntax
    
    /* Keyword values */
    font-synthesis-style: auto;
    font-synthesis-style: none;
    font-synthesis-style: oblique-only;
    
    /* Global values */
    font-synthesis-style: inherit;
    font-synthesis-style: initial;
    font-synthesis-style: revert;
    font-synthesis-style: revert-layer;
    font-synthesis-style: unset;
    
### Values
`auto`
    
Indicates that the missing oblique typeface may be synthesized by the browser if needed.
`none`
    
Indicates that the synthesis of the missing oblique typeface by the browser is not allowed.
`oblique-only`
    
Same as `auto`, but no font synthesis occurs if `font-style: italic` is set.
## Examples
>
### Disabling synthesis of oblique typeface
This example shows turning off synthesis of the oblique typeface by the browser in the `Montserrat` font.
#### HTML
    
    <p class="english">
      This is the default <em>oblique typeface</em> and
      <strong>bold typeface</strong>.
    </p>
    
    <p class="english no-syn">
      The <em>oblique typeface</em> is turned off here but not the
      <strong>bold typeface</strong>.
    </p>
    
#### CSS
    
    @import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
    
    .english {
      font-family: "Montserrat", sans-serif;
    }
    
    .no-syn {
      font-synthesis-style: none;
    }
    
#### Result
### Comparison of font-synthesis-style values
This example compares all the `font-synthesis-style` values using italic and oblique styled texts.
#### HTML
    
    <div class="fss-none">
      <h2>font-synthesis-style: none</h2>
      <p class="oblique">This text is set to <code>oblique</code></p>
      <p class="italic">This text is set to <code>italic</code></p>
    </div>
    
    <div class="fss-auto">
      <h2>font-synthesis-style: auto</h2>
      <p class="oblique">This text is set to <code>oblique</code></p>
      <p class="italic">This text is set to <code>italic</code></p>
    </div>
    
    <div class="fss-oblique-only">
      <h2>font-synthesis-style: oblique-only</h2>
      <p class="oblique">This text is set to <code>oblique</code></p>
      <p class="italic">This text is set to <code>italic</code></p>
    </div>
    
#### CSS
    
    /* Specify style of the font synthesis */
    .fss-none {
      font-synthesis-style: none;
    }
    
    .fss-auto {
      font-synthesis-style: auto;
    }
    
    .fss-oblique-only {
      font-synthesis-style: oblique-only;
    }
    
    /* Set font styles */
    .oblique {
      font-style: oblique;
    }
    
    .italic {
      font-style: italic;
    }
    
    /* Styles for the demonstration */
    .oblique::after {
      content: " (font-style: oblique)";
      font-size: 0.8rem;
      vertical-align: sub;
    }
    
    .italic::after {
      content: " (font-style: italic)";
      font-size: 0.8rem;
      vertical-align: sub;
    }
    
#### Result
# if()
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `if()` CSS function allows different values to be set for a property depending on the result of a conditional test. The test can be based on a style query, a media query, or a feature query.
## Syntax
    
    /* Single <if-test> */
    if(style(--scheme: dark): #eeeeee;)
    if(media(print): black;)
    if(media(width > 700px): 0 auto;)
    if(supports(color: lch(7.1% 60.23 300.16)): lch(7.1% 60.23 300.16);)
    
    /* <if-test> with else */
    if(style(--size: "2xl"): 1em; else: 0.25em;)
    if(media(print): white; else: black;)
    if(media(width < 700px): 0 auto; else: 20px auto)
    if(
      supports(color: lch(7.1% 60.23 300.16)): lch(7.1% 60.23 300.16);
      else: #03045e;
    )
    if(
      supports(color: lch(75% 0 0)): 3px solid lch(75% 0 0);
      else: 3px solid silver;
    )
    
    /* Multiple <if-test>s */
    if(
      style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
      style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971);
      else: none;
    )
    
    /* <if-test> within a shorthand */
    3px yellow if(
      style(--color: green): dashed;
      style(--color: yellow): inset;
      else: solid;
    )
    
### Parameters
The parameter is a semi-colon–separated list of `<if-branch>`es. Each `<if-branch>` is an `<if-condition>` followed by a colon and a `<value>`:
    
    <if-branch> = <if-condition> : <value>;
    
`<if-condition>`
    
An `<if-test>` or the `else` keyword.
`<if-test>`
    
A style query, media query, or feature query.
`else`
    
A keyword representing an `<if-condition>` that always evaluates to true.
`<value>`
    
A property value.
### Return value
A value or guaranteed-invalid.
## Description
The CSS `if()` function provides conditional logic to CSS property values, and works in a similar fashion to JavaScript `if...else` statements.
The `if()` function can be used inside the value of any property, and can contain zero or more semi-colon-separated `<if-condition>`s. Each `<if-condition>` is either an `<if-test> : <value>` pair or an `else : <value>` pair. The semi-colon after the last `<if-condition>` is optional.
The return value is calculated as follows:
  1. The `<if-condition>` expressions are evaluated, in the order they appear in the function.
  2. The first `<if-condition>` that evaluates to `true` has its associated `<value>` returned.
  3. If no `<if-condition>` evaluates to `true`, the function returns a <guaranteed-invalid>:. This behaves as invalid or `false` if the `if()` function is used in a value statement that has a fallback, such as a custom property or an `anchor()` function.


For example:
    
    div {
      background-image: if(
        style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
        style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971);
        else: none;
      );
    }
    
In this case, we are setting a different `linear-gradient()` as the `background-image` on `<div>` elements, depending on whether a `--scheme` custom property is set to `ice` or `fire`. If `--scheme` doesn't exist, or it exists and is set to any other value, the `else` value comes into play, and the `background-image` property is set to `none`.
Note: Each condition must be separated from its associated value with a colon, and each `<if-condition> : <value>` pair must be separated with a semi-colon. The semi-colon is optional for the last `<if-condition> : <value>` pair.
Warning: There must be no space between the `if` and the opening parenthesis (`(`). If there is, the whole declaration is invalid.
If a single `<if-condition>` or `<value>` is invalid, it does not invalidate the entire `if()` function; instead, the parser moves on to the next `<if-condition> : <value>` pair. If no `<if-condition>` nor `<value>` is valid, the function returns guaranteed-invalid.
### Frequency and position of `else : <value>` pairs
You can include multiple `else : <value>` pairs inside an `if()` function, in any position. However, in most cases, a single `else : <value>` pair at the end of the semi-colon-separated list is used to provide the default value that is always returned if none of the `<if-test>`s evaluate to true.
If you include an `else : <value>` pair before any `<if-test> : <value>` pairs, the conditions that follow it are not evaluated because `else` always evaluates to `true`. The following `if()` therefore always returns `none`, and the two `<if-test> : <value>` pairs are never evaluated:
    
    div {
      background-image: if(
        else: none;
        style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
        style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971)
      );
    }
    
Debugging a value that is not behaving as expected is one case where you might want to put an `else : <value>` in a position other than the end of the value list. In the following example, we are trying to work out whether the first `<if-test> : <value>` pair is working properly. If it isn't, the `else : <value>` pair returns a value of `url("debug.png")` to display an image indicating that the first `<if-test> : <value>` pair needs fixing. The last two `<if-test> : <value>` pairs are again never evaluated.
    
    div {
      background-image: if(
        style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
        else: url("debug.png");
        style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971);
        else: none;
      );
    }
    
Note that an `if()` function is still valid if it contains only an `else : <value>` pair, or nothing at all. The following property values are both valid:
    
    background-color: if(else: yellow);
    background-image: if();
    
These functions are not useful. They were included to demonstrate their validity. In this case, the `background-color` value will always be set to `yellow` and the `background-image` will be set to its initial value. You would be better off setting the `background-color` directly to `yellow`, and the `background-image` to `initial` or `none`.
### Types of if-tests
An `<if-test>` accepts one of three query types. This section looks at each one in detail.
#### Style queries
A style query `<if-test>` allows you to test whether a particular property value is set on an element, and apply a value to a different property as a result. We walked through several style query examples earlier on; let's look at another example:
    
    background-image: if(
      style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8);
      else: none;
    );
    
If the `--scheme` custom property is set to a value of `ice` on the same element, the provided `linear-gradient()` value is returned. If not, then `none` is returned.
Using style queries inside `if()` statements has an advantage over `@container` queries — you can target an element with styles directly, based on whether a custom property is set on it, rather than having to check set styles on a container parent element.
You can also use `and`, `or`, or `not` logic inside style queries. For example:
    
    background-color: if(
      style((--scheme: dark) or (--scheme: very-dark)): black;
    );
    
    background-color: if(
      style((--scheme: dark) and (--contrast: hi)): black;
    );
    
    background-color: if(
      not style(--scheme: light): black;
    );
    
A `@container` query does have some advantages — you can only set single property values at a time with `if()` style queries, whereas `@container` queries can be used to conditionally apply whole sets of rules. The two approaches are complementary, and have different uses.
Note that container style queries currently don't support regular CSS properties, just CSS custom properties. For example, the following won't work:
    
    if(
      background-color: if(style(color: white): black;);
    )
    
#### Media queries
A media query `<if-test>` can be used to set a value for a property depending on whether a media query test returns true.
You can use media types. For example, the following `<if-test> : <value>` pair returns a value of `white` on print media, while the `else` clause causes `#eeeeee` to be returned on non-print media.
    
    background-color: if(
      media(print): white;
      else: #eeeeee;
    )
    
You can also use media features — the following returns a value of `0 auto` if the current viewport width is less than `700px`, or `20px auto` if this is not the case:
    
    margin: if(
      media(width < 700px): 0 auto;
      else: 20px auto;
    )
    
This is really useful when you need to vary a single property value based on a media query result.
You can also use `and`, `or`, or `not` logic inside media queries. For example:
    
    border-color: if(
      media((width > 700px) and (width < 1000px)): blue;
    );
    
    border-color: if(
      media((width < 500px) or (orientation: landscape)): blue;
    );
    
    background-color: if(
      not media(width < 500px): blue;
      else: red
    );
    
When you want to set multiple declarations or rules based on one media query, a regular `@media` construct is needed. The two approaches are complementary, and have different uses.
#### Feature queries
A feature query `<if-test>` can be used to set a value for a property depending on whether the browser supports a particular property value.
For example, the following returns an `lch()` color if `lch()` colors are supported, or an `rgb()` color if not:
    
    color: if(
      supports(color: lch(75% 0 0)): lch(75% 0 0);
      else: rgb(185 185 185);
    )
    
Selector support queries also work. The following will return a value of `1em` if the browser supports the `:buffering` pseudo-class, or `initial` if not:
    
    margin-top: if(
      supports(selector(:buffering)): 1em;
      else: initial;
    )
    
You can also use `and`, `or`, or `not` logic inside feature queries. For example:
    
    margin-top: if(
      supports((selector(:buffering)) and (color: blue)): 1em;
    );
    
    margin-top: if(
      supports((selector(:buffering)) or (color: not-a-color)): 1em;
    );
    
    margin-top: if(
      supports(not selector(:buffering)): 1em;
    );
    
Feature queries are really useful inside `if()` statements when you need to vary a single property value based on support for a particular value or a separate property. When you want to set multiple declarations or rules based on one feature query, a regular `@supports` construct is better. The two approaches are complementary, and have different uses.
### Providing fallback values
The `if()` statement does not gracefully degrade; an explicit fallback needs to be provided for non-supporting browsers.
For example, in this case we provide a static `padding` value for browsers that don't support `if()`. Browsers that support `if()` will override the first declaration with the second one, which sets different padding values depending on whether or not the `--size: "2xl"` custom property is set.
    
    padding: 1em;
    padding: if(style(--size: "2xl"): 1em; else: 0.25em);
    
Note: Remember to include the `else` condition. In `if()`-supporting browsers, if no `else` value were included and `--size` was not equal to `"2xl"`, the padding would be set to `initial`.
### Whole and partial values
An `if()` function can be set as the value of any CSS property, but it can also be used to determine parts of property values. For example, the following sets a different `border-color` inside a `border` shorthand property, depending on whether `lch()` colors are supported:
    
    border: if(
      supports(color: lch(75% 0 0)): 3px solid lch(75% 0 0);
      else: 3px solid silver;
    );
    
However, we could use the `if()` function to determine the `border-color` component only:
    
    border: 3px solid
      if(
        supports(color: lch(75% 0 0)): lch(75% 0 0); else: silver;
      );
    
### Nesting if() functions
Because an `if()` function can take the place of whole property values or individual components, it is possible to nest `if()` functions within other `if()` functions, and inside other functions such as `calc()`.
For example, in this declaration we are using `if()` to set a `color` property value depending on various conditions. We have an outer `if()` function that returns a particular value depending on whether the `--scheme` custom property is set to `ice` or `fire` (with an `else` value of `black` that is returned if neither of the conditions return true).
However, the two `<value>`s are also `if()` functions. These inner `if()` functions return a light color value if the user prefers a dark color scheme (determined using the `prefers-color-scheme` media query), and a dark color value otherwise.
    
    color: if(
      style(--scheme: ice):
        if(
          media(prefers-color-scheme: dark): #caf0f8;
          else: #03045e;
        );
      style(--scheme: fire):
        if(
          media(prefers-color-scheme: dark): #ffc971;
          else: #621708;
        );
      else: black
    );
    
In the next example, we set the `width` property equal to a `calc()` function that subtracts `50px` from a percentage of the parent element's width. The percentage is represented by an `if()` function, which test whether the `--scheme: wide` custom property is set. If so, the percentage is `70%`, so the outer function resolves to `calc(70% - 50px)`. If not, the percentage is `50%`, so the outer function resolves to `calc(50% - 50px)`.
    
    width: calc(if(
        style(--scheme: wide): 70%;
        else: 50%;
      ) - 50px);
    
## Examples
>
### Basic `if()` usage
In this example, we'll show basic usage of each of the three types of `<if-test>`.
#### HTML
Our HTML features a `<section>` element with two `<article>` elements inside it, containing `<h2>` headings. The `<section>` has a custom property set on it inside its `style` attribute — `--show-apple:true` — which we use later on to conditionally set a property value.
    
    <section style="--show-apple:true">
      <article><h2>First article</h2></article>
      <article><h2>Second article</h2></article>
    </section>
    
#### CSS
In our CSS, we first target the `<section>` element, laying it out with flexbox and setting a `gap` between the two child `<article>` elements. We then use an `if()` function with an `orientation` media query `<if-test>` to set the value of the `flex-direction` property to `row` if the document is in landscape orientation, or `column` if it is in portrait orientation. This lays out the `article` elements side-by-side in wide screens, and top-to-bottom in narrow screens.
    
    section {
      display: flex;
      gap: 16px;
      flex-direction: if(
        media(orientation: landscape): row;
        else: column;
      )
    }
    
Next, we target the `<h2>` element's `::before` pseudo-element, setting its `content` property to an apple emoji, but only if `--show-apple: true` is set (we did this earlier with an inline `<style>` in our HTML). We achieve this using an `if()` function with a style query `<if-test>`:
    
    h2::before {
      content: if(
        style(--show-apple: true): "🍎 ";
      );
    }
    
Finally, we target the `<h2>` element itself. We use a feature query `<if-test>` to test whether the browser supports `lch()` colors, and set the `color` property to an `lch()` color if so, or a hex equivalent if not.
    
    h2 {
      color: if(
        supports(color: lch(29.57% 43.25 344.44)): lch(29.57% 43.25 344.44);
        else: #792359;
      )
    }
    
#### Result
Note how the styling is applied. Test out the conditional styling for the first two `if()` queries by modifying the rendered demo using your browser's devtools:
  * Remove the `<section>` element's `style` attribute and note how the apple emojis are no longer rendered.
  * Change the `height` attribute of the embedding `<iframe>` to `1200px`. This will change the orientation from landscape to portrait. Note how the layout changes as a result.


### Controlling a color scheme with `if()`
This demo shows how you can start to have some real fun with CSS `if()` functions. Amongst other things, we use `if()` functions to conditionally set the values of some custom properties, enabling us to control the entire color scheme!
#### HTML
Our HTML contains an `<article>` element with some content inside it — a top-level heading, a couple of `<p>` elements, and an `<aside>`. We also include a `<form>` containing a `<select>` drop-down that enables selecting a color scheme.
    
    <article>
      <h1>Main heading</h1>
      <p>
        Lorem ipsum dolor sit amet consectetur adipiscing elit.
        Quisque faucibus ex sapien vitae pellentesque sem placerat.
        In id cursus mi pretium tellus duis convallis.
      </p>
      <aside>
        <h2>An aside</h2>
        <p>
          Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus
          fringilla lacus nec metus bibendum egestas.
        </p>
      </aside>
      <p>
        Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut
        hendrerit semper vel class aptent taciti sociosqu. Ad litora
        torquent per conubia nostra inceptos himenaeos.
      </p>
    </article>
    <form>
      <label for="scheme">Choose color scheme:</label>
      <select id="scheme">
        <option value="">Default</option>
        <option value="ice">Ice</option>
        <option value="fire">Fire</option>
      </select>
    </form>
    
### JavaScript
Our JavaScript adds a `change` event listener to the `<select>` element. When a new value is selected, our script sets the `<article>` element's `class` attribute to equal that value.
    
    const articleElem = document.querySelector("article");
    const selectElem = document.querySelector("select");
    
    selectElem.addEventListener("change", () => {
      articleElem.className = selectElem.value;
    });
    
### CSS
In our CSS, we give the `<body>` element a `max-width` of `700px` and center it using `auto` `margin` values. However, we use an `if()` function with a media query `<if-test>` to set the `margin-top` component inside the `margin` shorthand to `0` if the viewport's width is less than `700px`, and `20px` if it is wider. This means that on wide screens we get a bit of margin at the top of the content, but this is removed on narrow screens, where it looks a bit weird.
    
    body {
      max-width: 700px;
      margin: if(
        media(width < 700px): 0;
        else: 20px;
      ) auto 0;
    }
    
We then set the `--scheme` custom property to match the `<article>` element's `class` name. The class will set by our JavaScript when a new value is selected in our `<select>` element. You'll see the significance of the custom element value in the next CSS block.
    
    .ice {
      --scheme: ice;
    }
    
    .fire {
      --scheme: fire;
    }
    
We can see the real power of CSS `if()` functions when we combine them with custom properties. Here we use `if()` functions to set our `--color1` and `--color2` custom properties to different color values depending on the value of the `--scheme` custom property. We then use the `--color1` and `--color2` values in our `<article>` element's `color`, `border`, and `background-image` properties, and our `<aside>` element's `color` and `background-color` properties.
We are controlling our entire color scheme via custom properties, with different values set via `if()` functions.
    
    article {
      padding: 20px;
      --color1: if(
        style(--scheme: ice): #03045e;
        style(--scheme: fire): #621708;
        else: black;
      );
      --color2: if(
        style(--scheme: ice): #caf0f8;
        style(--scheme: fire): #ffc971;
        else: white;
      );
    
      color: var(--color1);
      border: 3px solid var(--color1);
      background-image: linear-gradient(
        to left,
        var(--color2),
        white,
        var(--color2)
      );
    }
    
    aside {
      color: var(--color2);
      background-color: var(--color1);
      padding: 20px;
    }
    
Finally, we use `if()` functions in a couple more places:
  * We set our `<h1>` element's `font-size` to be `calc(3rem + 2vw)` if the viewport is wider than `700px`, and `3rem` otherwise. This means the font size updates dynamically with viewport width changes on wider screens, but stays the same on narrow screens.
  * We set a suitable emoji as the `content` of our `<h1>` element's `::before` pseudo-class, depending on the value of the `--scheme` custom property.


    
    h1 {
      margin: 0;
      font-size: if(
        media(width > 700px): calc(3rem + 2vw);
        else: 3rem;
      );
    }
    
    h1::before {
      content: if(
        style(--scheme: ice): "❄️ ";
        style(--scheme: fire): "🔥 ";
        else: "";
      );
    }
    
#### Result
This demo renders as follows:
Try selecting different color scheme values to see the effect on the look and feel.
# image-orientation
The `image-orientation` CSS property specifies a layout-independent correction to the orientation of an image.
## Try it
    
    image-orientation: none;
    
    
    image-orientation: from-image;
    
    
    <section id="default-example">
      <img
        class="transition-all"
        id="example-element"
        src="/shared-assets/images/examples/hummingbird.jpg" />
    </section>
    
    
    #example-element {
      height: inherit;
    }
    
## Syntax
    
    /* keyword values */
    image-orientation: none;
    image-orientation: from-image; /* Use EXIF data from the image */
    
    /* Global values */
    image-orientation: inherit;
    image-orientation: initial;
    image-orientation: revert;
    image-orientation: revert-layer;
    image-orientation: unset;
    
### Values
`none`
    
Does not apply any additional image rotation; the image is oriented as encoded or as other CSS property values dictate.
`from-image`
    
Default initial value. The EXIF information contained in the image is used to rotate the image appropriately.
Warning: `image-orientation: none;` does not override the orientation of non-secure-origin images as encoded by their EXIF information, due to security concerns. Find out more from the CSS working group draft issue.
## Description
This property is intended only to be used for the purpose of correcting the orientation of images which were shot with the camera rotated. It should not be used for arbitrary rotations. For any purpose other than correcting an image's orientation due to how it was shot or scanned, use a `transform` property with the `rotate` keyword to specify rotation. This includes any user-directed changes to the orientation of the image, or changes required for printing in portrait versus landscape orientation.
If used in conjunction with other CSS properties, such as a `<transform-function>`, any `image-orientation` rotation is applied before any other transformations.
## Examples
>
### Orienting image from image data
The following image has been rotated through 180 degrees, and the `image-orientation` property is used to correct its orientation based on the EXIF data in the image. By changing the `image-orientation` to `none` you can see the effect of the property.
#### CSS
    
    #image {
      image-orientation: from-image; /* Can be changed in the live sample */
    }
    
#### Result
# aspect-ratio
The `aspect-ratio` CSS property allows you to define the desired width-to-height ratio of an element's box. This means that even if the parent container or viewport size changes, the browser will adjust the element's dimensions to maintain the specified width-to-height ratio. The specified aspect ratio is used in the calculation of auto sizes and some other layout functions.
At least one of the box's sizes needs to be automatic in order for `aspect-ratio` to have any effect. If neither the width nor height is an automatic size, then the provided aspect ratio has no effect on the box's preferred sizes.
## Try it
    
    aspect-ratio: auto;
    
    
    aspect-ratio: 1 / 1;
    
    
    aspect-ratio: 16 / 9;
    
    
    aspect-ratio: 0.5;
    
    
    <section id="default-example">
      <img
        class="transition-all"
        height="640"
        id="example-element"
        src="/shared-assets/images/examples/plumeria.jpg"
        width="466" />
    </section>
    
    
    #example-element {
      height: 100%;
      width: auto;
    }
    
## Syntax
    
    aspect-ratio: 1 / 1;
    aspect-ratio: 1;
    
    /* fallback to 'auto' for replaced elements */
    aspect-ratio: auto 3/4;
    aspect-ratio: 9/6 auto;
    
    /* Global values */
    aspect-ratio: inherit;
    aspect-ratio: initial;
    aspect-ratio: revert;
    aspect-ratio: revert-layer;
    aspect-ratio: unset;
    
This property is specified as one or both of the keyword auto or a `<ratio>`. If both are given, and the element is a replaced element, such as `<img>`, then the given ratio is used until the content is loaded. After the content is loaded, the `auto` value is applied, so the intrinsic aspect ratio of the loaded content is used.
If the element is not a replaced element, then the given `ratio` is used.
### Values
`auto`
    
Replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. Size calculations involving intrinsic aspect ratio always work with the content box dimensions.
`<ratio>`
    
The box's preferred aspect ratio is the specified ratio of `width` / `height`. If `height` and the preceding slash character are omitted, `height` defaults to `1`. Size calculations involving preferred aspect ratio work with the dimensions of the box specified by `box-sizing`.
`auto && <ratio>`
    
When both `auto` and a `<ratio>` are specified together, `auto` is used if the element is a replaced element with a natural aspect ratio, like an `<img>` element. Otherwise, the specified ratio of `width` / `height` is used as the preferred aspect ratio.
## Examples
>
### Exploring aspect-ratio effects with fixed width
In this example, the width of the `<div>` elements has been set to `100px` and height to `auto`. Since the width value is fixed here, the `aspect-ratio` property affects only the height of the `<div>` elements to maintain the specified width-to-height ratio.
    
    div {
      width: 100px;
      height: auto;
    }
    div:nth-child(1) {
      aspect-ratio: 1/1;
    }
    div:nth-child(2) {
      aspect-ratio: 0.5;
    }
    div:nth-child(3) {
      aspect-ratio: 1;
    }
    div:nth-child(4) {
      aspect-ratio: 1/0.5;
    }
    div:nth-child(5) {
      aspect-ratio: 16/9;
    }
    
### Fallback to natural aspect ratio
In this example we are using two `<img>` elements. The first element does not have its `src` attribute set to an image file.
    
    <img src="" /> <img src="plumeria.jpg" />
    
The following code sets `3/2` as the preferred aspect ratio and `auto` as a fallback.
    
    img {
      display: inline;
      width: 200px;
      border: 2px dashed red;
      background-color: lime;
      vertical-align: top;
    
      aspect-ratio: 3/2 auto;
    }
    
Note how the first image without replaced content keeps the `3/2` aspect ratio, while the second image after the content is loaded uses the image's natural aspect ratio.
# :nth-last-child()
The `:nth-last-child()` CSS pseudo-class matches elements based on their position among a group of siblings, counting from the end.
## Try it
    
    p {
      font-weight: bold;
    }
    
    li:nth-last-child(-n + 3) {
      border: 2px solid orange;
      margin-top: 1px;
    }
    
    li:nth-last-child(even) {
      background-color: lightyellow;
    }
    
    
    <p>Eight deadliest wildfires:</p>
    <ol reversed>
      <li>Matheson Fire</li>
      <li>Miramichi Fire</li>
      <li>1997 Indonesian fires</li>
      <li>Thumb Fire</li>
      <li>Great Hinckley Fire</li>
      <li>Cloquet Fire</li>
      <li>Kursha-2 Fire</li>
      <li>Peshtigo Fire</li>
    </ol>
    
## Syntax
    
    :nth-last-child(<nth> [of <complex-selector-list>]?) {
      /* ... */
    }
    
### Parameters
The `:nth-last-child()` pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end.
#### Keyword values
`odd`
    
Represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end.
`even`
    
Represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc., counting from the end.
#### Functional notation
`<An+B>`
    
Represents elements whose numeric position in a series of siblings matches the pattern `An+B`, for every positive integer or zero value of `n`, where:
  * `A` is an integer step size,
  * `B` is an integer offset,
  * `n` is all nonnegative integers, starting from 0.


It can be read as the `An+B`-th element of a list. The index of the first element, counting from the end, is `1`. The `A` and `B` must both have `<integer>` values.
#### The `of <selector>` syntax
By passing a selector argument, we can select the nth-last element that matches that selector. For example, the following selector matches the last three important list items, which are assigned with `class="important"`.
    
    :nth-last-child(-n + 3 of li.important) {
    }
    
Note: This is different from moving the selector outside of the function, like:
    
    li.important:nth-last-child(-n + 3) {
    }
    
This selector applies a style to list items if they are also within the last three children.
## Examples
>
### Example selectors
`tr:nth-last-child(odd)` or `tr:nth-last-child(2n+1)`
    
Represents the odd rows of an HTML table: 1, 3, 5, etc., counting from the end.
`tr:nth-last-child(even)` or `tr:nth-last-child(2n)`
    
Represents the even rows of an HTML table: 2, 4, 6, etc., counting from the end.
`:nth-last-child(7)`
    
Represents the seventh element, counting from the end.
`:nth-last-child(5n)`
    
Represents elements 5, 10, 15, etc., counting from the end.
`:nth-last-child(3n+4)`
    
Represents elements 4, 7, 10, 13, etc., counting from the end.
`:nth-last-child(-n+3)`
    
Represents the last three elements among a group of siblings.
`p:nth-last-child(n)` or `p:nth-last-child(n+1)`
    
Represents every `<p>` element among a group of siblings. This is the same as a simple `p` selector. (Since `n` starts at zero, while the last element begins at one, `n` and `n+1` will both select the same elements.)
`p:nth-last-child(1)` or `p:nth-last-child(0n+1)`
    
Represents every `<p>` that is the first element among a group of siblings, counting from the end. This is the same as the `:last-child` selector.
### Table example
#### HTML
    
    <table>
      <tbody>
        <tr>
          <td>First line</td>
        </tr>
        <tr>
          <td>Second line</td>
        </tr>
        <tr>
          <td>Third line</td>
        </tr>
        <tr>
          <td>Fourth line</td>
        </tr>
        <tr>
          <td>Fifth line</td>
        </tr>
      </tbody>
    </table>
    
#### CSS
    
    table {
      border: 1px solid blue;
    }
    
    /* Selects the last three elements */
    tr:nth-last-child(-n + 3) {
      background-color: pink;
    }
    
    /* Selects every element starting from the second to last item */
    tr:nth-last-child(n + 2) {
      color: blue;
    }
    
    /* Select only the last second element */
    tr:nth-last-child(2) {
      font-weight: 600;
    }
    
#### Result
### Quantity query
A quantity query styles elements depending on how many of them there are. In this example, list items turn red when there are at least three of them in a given list. This is accomplished by combining the capabilities of the `nth-last-child` pseudo-class and the subsequent-sibling combinator.
#### HTML
    
    <h4>A list of four items (styled):</h4>
    <ol>
      <li>One</li>
      <li>Two</li>
      <li>Three</li>
      <li>Four</li>
    </ol>
    
    <h4>A list of two items (unstyled):</h4>
    <ol>
      <li>One</li>
      <li>Two</li>
    </ol>
    
#### CSS
    
    /* If there are at least three list items,
       style them all */
    li:nth-last-child(n + 3),
    li:nth-last-child(3) ~ li {
      color: red;
    }
    
#### Result
###  `of <selector>` syntax example
In this example, there is an unordered list of names. Some items have a `noted` class applied and are then highlighted with a thick bottom border.
#### HTML
    
    <ul>
      <li class="noted">Diego</li>
      <li>Shilpa</li>
      <li class="noted">Caterina</li>
      <li>Jayla</li>
      <li>Tyrone</li>
      <li>Ricardo</li>
      <li class="noted">Gila</li>
      <li>Sienna</li>
      <li>Titilayo</li>
      <li class="noted">Lexi</li>
      <li>Aylin</li>
      <li>Leo</li>
      <li>Leyla</li>
      <li class="noted">Bruce</li>
      <li>Aisha</li>
      <li>Veronica</li>
      <li class="noted">Kyouko</li>
      <li>Shireen</li>
      <li>Tanya</li>
      <li class="noted">Marlene</li>
    </ul>
    
#### CSS
    
    * {
      font-family: sans-serif;
    }
    
    ul {
      display: flex;
      flex-wrap: wrap;
      list-style: none;
      font-size: 1.2rem;
      padding-left: 0;
    }
    
    li {
      margin: 0.125rem;
      padding: 0.25rem;
      border: 1px solid tomato;
    }
    
    .noted {
      border-bottom: 5px solid tomato;
    }
    
In the following CSS we are targeting the odd list items that are marked with `class="noted"`.
    
    li:nth-last-child(odd of .noted) {
      background-color: tomato;
      border-bottom-color: seagreen;
    }
    
#### Result
Items with `class="noted"` have a thick bottom border and items 1, 7, 14, and 20 have a solid background as they are the odd list items with `class="noted"`.
# opacity
The `opacity` CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency.
## Try it
    
    opacity: 0;
    
    
    opacity: 0.33;
    
    
    opacity: 1;
    
    
    <section class="default-example" id="default-example">
      <p id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    #example-element {
      background-color: #963770;
      color: white;
      padding: 1em;
    }
    
## Syntax
    
    opacity: 0.9;
    opacity: 90%;
    
    /* Global values */
    opacity: inherit;
    opacity: initial;
    opacity: revert;
    opacity: revert-layer;
    opacity: unset;
    
### Values
`<alpha-value>`
    
A `<number>` in the range `0.0` to `1.0`, inclusive, or a `<percentage>` in the range `0%` to `100%`, inclusive, representing the opacity of the channel (that is, the value of its alpha channel). Any value outside the interval, though valid, is clamped to the nearest limit in the range.
Value Meaning  
`0` The element is fully transparent (that is, invisible).  
Any `<number>` strictly between `0` and `1` The element is translucent (that is, content behind the element can be seen).  
`1` (default value) The element is fully opaque (visually solid).  
## Description
`opacity` applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another.
To change the opacity of a background only, use the `background` property with a color value that allows for an alpha channel. For example:
    
    background: rgb(0 0 0 / 40%);
    
When `opacity` value is set to `0`, the element and all of its children appear invisible, but they are still part of the DOM. That means they still register pointer events and, if the elements are in a tabbing order, they do get focus. For good usability, make sure to make such elements visible when they receive user interactions or use the CSS `pointer-events` property to disable pointer events and take the element out of the tab order by disabling with the `disabled` attribute or setting `tab-index="-1"` for non-form-related interactive elements.
Using `opacity` with a value other than `1` places the element in a new stacking context.
Opacity alone should not be used to provide information to screen readers. Use the HTML `hidden` attribute, CSS `visibility`, or CSS `display` style properties. It's best to avoid using `aria-hidden` attribute, but if the element is hidden with opacity, then hide it from screen readers as well.
### Transitioning opacity
When transitioning the opacity of elements as you add them to the page when content was formerly hidden with `visibility: hidden`, `display: none`, or `content-visibility: hidden`, you need to include both a `@starting-style` and `transition-behavior: allow-discrete`:
    
    .card {
      transition:
        opacity 5s,
        display 5s;
      background-color: orange;
    
      transition-behavior: allow-discrete;
      @starting-style {
        opacity: 0;
      }
    }
    
    .card.hidden {
      display: none;
      opacity: 0;
    }
    
To enable first-style transitions, `@starting-style` rules are needed. In the above code, setting `opacity: 0` in `@starting-style` provides a starting point for the transition when the element receives its initial style update. For more details, see `@starting-style`.
Setting `transition-behavior: allow-discrete` is required to transition to `display: none`. See the `transition-behavior` property for more details.
## Accessibility
If text opacity is adjusted, it is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page.
Color contrast ratio is determined by comparing the luminosity of the opacity-adjusted text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


Various operating systems provide a preference for reducing transparency. To set the `opacity` based on the user's operating systems transparency preferences, use the `prefers-reduced-transparency` media query.
## Examples
>
### Setting opacity
The following example demonstrates how the `opacity` property changes the opacity of the entire element and content, thus making the text very hard to read.
#### HTML
    
    <div class="light">You can barely see this.</div>
    <div class="medium">This is easier to see.</div>
    <div class="heavy">This is very easy to see.</div>
    
#### CSS
    
    div {
      background-color: yellow;
      font-weight: bold;
      font-size: 130%;
    }
    .light {
      opacity: 0.2; /* Barely see the text over the background */
    }
    .medium {
      opacity: 0.5; /* See the text more clearly over the background */
    }
    .heavy {
      opacity: 0.9; /* See the text very clearly over the background */
    }
    
#### Result
### Setting opacity on hover
In the following example opacity is changed on hover, so the striped background image on the parent element shows through the image.
#### HTML
    
    <div class="wrapper">
      <img
        src="/shared-assets/images/examples/dino.svg"
        alt="MDN Dino"
        width="128"
        height="146"
        class="opacity" />
    </div>
    
#### CSS
    
    img.opacity {
      opacity: 1;
    }
    
    img.opacity:hover {
      opacity: 0.5;
    }
    
    .wrapper {
      width: 200px;
      height: 160px;
      background-color: #f03cc3;
      background-image: linear-gradient(
        90deg,
        transparent 50%,
        rgb(255 255 255 / 50%) 50%
      );
      background-size: 20px 20px;
    }
    
#### Result
### Styling based on user preferences
To style elements based on user's operating systems transparency preferences, use the `prefers-reduced-transparency` media query. The following example demonstrates how to use the `prefers-color-scheme` media query to specify the desired `opacity` based on the user's preferences.
    
    .element {
      opacity: 0.5;
    }
    
    @media (prefers-reduced-transparency) {
      .element {
        opacity: 1;
      }
    }
    
# corner-start-start-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-start-start-shape` CSS property specifies the shape of a box's block-start and inline-start corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-start-start-shape: notch;
    corner-start-start-shape: squircle;
    
    /* superellipse() function values */
    corner-start-start-shape: superellipse(3);
    corner-start-start-shape: superellipse(-1.5);
    
    /* Global values */
    corner-start-start-shape: inherit;
    corner-start-start-shape: initial;
    corner-start-start-shape: revert;
    corner-start-start-shape: revert-layer;
    corner-start-start-shape: unset;
    
### Values
The `corner-start-start-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-start-start-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `40% 10px 10px`, and a `corner-start-start-shape` of `scoop`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 40% 10px 10px;
      corner-start-start-shape: scoop;
    }
    
#### Result
The rendered result looks like this:
# overflow-anchor
The `overflow-anchor` CSS property provides a way to opt out of the browser's scroll anchoring behavior, which adjusts scroll position to minimize content shifts.
Scroll anchoring behavior is enabled by default in any browser that supports it. Therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off.
## Try it
    
    overflow-anchor: auto;
    
    
    overflow-anchor: none;
    
    
    <section class="default-example" id="default-example">
      <div class="whole-content-wrapper">
        <button id="playback" type="button">Start lottery</button>
        <p>Magic numbers for today are:</p>
        <div id="example-element"></div>
      </div>
    </section>
    
    
    .whole-content-wrapper {
      display: flex;
      flex-direction: column;
      height: 100%;
      width: 100%;
    }
    
    #example-element {
      height: 100%;
      border: 2px dashed dodgerblue;
      padding: 0.75em;
      text-align: left;
      overflow: scroll;
    }
    
    #playback {
      font-size: 1em;
      width: 10em;
      height: 4em;
      font-weight: bold;
      margin: 1em auto;
      background-color: aliceblue;
      border: solid 2px dodgerblue;
      border-radius: 5px;
    }
    
    #playback:hover {
      border-color: lightseagreen;
    }
    
    #playback:active {
      filter: brightness(0.9);
    }
    
    
    const example = document.getElementById("example-element");
    const button = document.getElementById("playback");
    let intervalId;
    
    function setInitialState() {
      example.innerHTML = "";
      Array.from({ length: 10 }, (_, i) => i).forEach(addContent);
      example.scrollTop = example.scrollHeight;
    }
    
    function addContent() {
      console.log("adding content");
      const magicNumber = Math.floor(Math.random() * 10000);
      example.insertAdjacentHTML(
        "afterbegin",
        `<div class="new-content-container">New Magic Number: ${magicNumber}</div>`,
      );
    }
    
    button.addEventListener("click", () => {
      if (example.classList.contains("running")) {
        example.classList.remove("running");
        button.textContent = "Start lottery";
        clearInterval(intervalId);
      } else {
        example.classList.add("running");
        button.textContent = "Stop lottery";
        setInitialState();
        intervalId = setInterval(addContent, 1000);
      }
    });
    
## Syntax
    
    /* Keyword values */
    overflow-anchor: auto;
    overflow-anchor: none;
    
    /* Global values */
    overflow-anchor: inherit;
    overflow-anchor: initial;
    overflow-anchor: revert;
    overflow-anchor: revert-layer;
    overflow-anchor: unset;
    
### Values
`auto`
    
The element becomes a potential anchor when adjusting scroll position.
`none`
    
The element won't be selected as a potential anchor.
## Examples
>
### Prevent scroll anchoring
To prevent scroll anchoring in a document, use the `overflow-anchor` property.
    
    * {
      overflow-anchor: none;
    }
    
# CSS viewport
The CSS viewport module enables specifying the size, zoom factor, and orientation of the user-agent's initial containing block, or viewport.
Content designed for large viewports may exhibit a variety of bugs when viewed in smaller viewports, including unintended wrapping, clipped content, and incorrectly sized scroll containers. HTML provides a viewport meta tag, `<meta name="viewport">`, to provide hints about the initial size of the viewport. If the site isn't designed to work well on small viewports and this tag is omitted, some mobile browsers render the site using a fixed initial containing block width, typically `980px`. The content is then scaled down, making the CSS pixel size smaller than an actual pixel. The resulting page fits into the available screen space but is illegible, requiring the user to zoom and pan to view the content.
The viewport initial containing block for continuous media has the dimensions of the viewport. Since the viewport is generally no larger than the display, devices with smaller displays, such as phones or tablets, typically present a smaller viewport than larger devices like desktops or laptops.
## Reference
>
### Properties
  * `zoom`


### Interfaces
  * `Window.Viewport`
  * `Viewport`
    * `Viewport.segments`
  * `Viewport Segments`


### Glossary terms and definitions
  * Viewport
  * Actual viewport
  * Initial viewport


## Guides
Viewport concepts
    
The concept of the viewport — what it is, its impact in terms of CSS, SVG, and mobile devices — and the difference between the visual viewport and the layout viewport.
Using environment variables
    
An overview of what environment variables are, browser-defined environment variables, and how to use the `env()` function.
Using the Viewport Segments API
    
Create responsive designs optimized for different viewport segment sizes and arrangements with the API and environment variables.
## Related concepts
  * CSS media queries module
    * `@media`
    * `horizontal-viewport-segments` descriptor
    * `vertical-viewport-segments` descriptor
  * CSS enviroment variables
    * `env()`
    * `<environment-variable-name>`
  * Device Posture API


# background-image
The `background-image` CSS property sets one or more background images on an element.
## Try it
    
    background-image: url("/shared-assets/images/examples/lizard.png");
    
    
    background-image:
      url("/shared-assets/images/examples/lizard.png"),
      url("/shared-assets/images/examples/star.png");
    
    
    background-image:
      url("/shared-assets/images/examples/star.png"),
      url("/shared-assets/images/examples/lizard.png");
    
    
    background-image:
      linear-gradient(rgb(0 0 255 / 0.5), rgb(255 255 0 / 0.5)),
      url("/shared-assets/images/examples/lizard.png");
    
    
    <section id="default-example">
      <div id="example-element"></div>
    </section>
    
    
    #example-element {
      min-width: 100%;
      min-height: 100%;
      padding: 10%;
    }
    
The background images are drawn on stacking context layers on top of each other. The first layer specified is drawn as if it is closest to the user.
The borders of the element are then drawn on top of them, and the `background-color` is drawn beneath them. How the images are drawn relative to the box and its borders is defined by the `background-clip` and `background-origin` CSS properties.
If a specified image cannot be drawn (for example, when the file denoted by the specified URI cannot be loaded), browsers handle it as they would a `none` value.
Note: Even if the images are opaque and the color won't be displayed in normal circumstances, web developers should always specify a `background-color`. If the images cannot be loaded—for instance, when the network is down—the background color will be used as a fallback.
## Syntax
    
    /* single image */
    background-image: linear-gradient(black, white);
    background-image: url("cat-front.png");
    
    /* multiple images */
    background-image:
      radial-gradient(circle, transparent 45%, black 48%),
      radial-gradient(ellipse farthest-corner, #fc1c14 20%, #cf15cf 80%);
    
    /* Global values */
    background-image: inherit;
    background-image: initial;
    background-image: revert;
    background-image: revert-layer;
    background-image: unset;
    
Each background image is specified either as the keyword `none` or as an `<image>` value.
To specify multiple background images, supply multiple values, separated by a comma.
### Values
`none`
    
Is a keyword denoting the absence of images.
`<image>`
    
Is an `<image>` denoting the image to display. There can be several of them, separated by commas, as multiple backgrounds are supported.
## Accessibility
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
  * MDN Understanding WCAG, Guideline 1.1 explanations
  * Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0


Additionally, it is important to ensure that the contrast ratio between the background image and the foreground text is high enough that people with low vision can read the page content.
Color contrast ratio is determined by comparing the luminance of the text and background color values. To meet Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for body text content and 3:1 for larger text such as headings. Large text is defined as 24px or larger, or bolded 18.66px or larger.
  * WebAIM: Color Contrast Checker
  * Understanding WCAG, Guideline 1.4 explanation
  * Understanding Success Criterion 1.4.3 | Understanding WCAG 2.0, W3C (2023)


## Examples
>
### Layering background images
Note that the star image is partially transparent and is layered over the cat image.
#### HTML
    
    <div>
      <p class="cats-and-stars">This paragraph is full of cats<br />and stars.</p>
      <p>This paragraph is not.</p>
      <p class="cats-and-stars">Here are more cats for you.<br />Look at them!</p>
      <p>And no more.</p>
    </div>
    
#### CSS
    
    p {
      font-weight: bold;
      font-size: 1.5em;
      color: white;
      text-shadow: 0.07em 0.07em 0.05em black;
      background-image: none;
      background-color: transparent;
    }
    
    div {
      background-image: url("mdn_logo_only_color.png");
    }
    
    .cats-and-stars {
      background-image: url("star-transparent.gif"), url("cat-front.png");
      background-color: transparent;
    }
    
#### Result
# CSS animations
The CSS animations module lets you animate the values of CSS properties, such as background-position and transform, over time by using keyframes. Each keyframe describes how the animated element should render at a given time during the animation sequence. You can use the properties in the animations module to control the duration, number of repetitions, delayed start, and other aspects of an animation.
## Animations in action
To view the animation in the box below, click the checkbox 'Play the animation' or hover the cursor over the box. When the animating is active, the cloud at the top changes shape, snowflakes fall, and the snow level at the bottom rises. To pause the animation, uncheck the checkbox or move your cursor away from the box.
This sample animation uses `animation-iteration-count` to make the flakes fall repeatedly, `animation-direction` to make the cloud move back and forth, `animation-fill-mode` to raise the snow level in response to the cloud movement, and `animation-play-state` to pause the animation.
Click "Play" in the example above to see or edit the code for the animation in the MDN Playground.
## Reference
>
### Properties
  * `animation` shorthand
  * `animation-composition`
  * `animation-delay`
  * `animation-direction`
  * `animation-duration`
  * `animation-fill-mode`
  * `animation-iteration-count`
  * `animation-name`
  * `animation-play-state`
  * `animation-timeline`
  * `animation-timing-function`


The CSS animations module level 2 also introduces the `animation-trigger`, `animation-trigger-exit-range`, `animation-trigger-exit-range-end`, `animation-trigger-exit-range-start`, `animation-trigger-range`, `animation-trigger-range-end`, `animation-trigger-range-start`, `animation-trigger-timeline`, and `animation-trigger-type` properties. Currently, no browsers support these features.
### At-rules
  * `@keyframes`


### Events
All animations, even those with 0 seconds duration, throw animation events.
  * `animationstart`
  * `animationend`
  * `animationcancel`
  * `animationiteration`


### Interfaces
  * Web Animations API
  * `AnimationEvent`
  * `CSSAnimation`
  * `CSSKeyframeRule`
  * `CSSKeyframesRule`


## Guides
Using CSS animations
    
Step-by-step tutorial on how to create animations using CSS. This article describes the animation-related CSS properties and at-rule and how they interact with each other.
Using the Web Animations API
    
Common animation requirements that can be solved with a few lines of JavaScript.
## Related concepts
  * `will-change` CSS property
  * `<easing-function>` data type
  * `prefers-reduced-motion` media query
  * Bezier curve glossary term


# overscroll-behavior
The `overscroll-behavior` CSS property sets what a browser does when reaching the boundary of a scrolling area.
## Try it
    
    overscroll-behavior: auto;
    
    
    overscroll-behavior: contain;
    
    
    overscroll-behavior: none;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="box">
          This is a scrollable container. Michaelmas term lately over, and the Lord
          Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As
          much mud in the streets as if the waters had but newly retired from the
          face of the earth.
          <br /><br />
          Lorem Ipsum has been the industry's standard dummy text ever since the
          1500s, when an unknown printer took a galley of type and scrambled it to
          make a type specimen book. It has survived not only five centuries, but
          also the leap into electronic typesetting, remaining essentially
          unchanged.
        </div>
        <div id="example-element">
          This is the inner container. Focus on this container, scroll to the bottom
          and when you reach the bottom keep scrolling.
          <p>
            If you have
            <code class="language-css">overscroll-behavior: auto;</code> selected
            the outer container will start to scroll.
          </p>
          If you have
          <code class="language-css">overscroll-behavior: contain;</code> selected,
          the outer container will not scroll unless you move your cursor out of the
          inner container and try to perform scroll on the outer container.
        </div>
      </div>
    </section>
    
    
    .example-container {
      width: 35em;
      height: 18em;
      border: medium dotted;
      padding: 0.75em;
      text-align: left;
      overflow: auto;
      display: flex;
    }
    
    .box {
      width: 50%;
    }
    
    #example-element {
      width: 50%;
      height: 12em;
      border: medium dotted #1b76c4;
      padding: 0.3em;
      margin: 0 0.3em;
      text-align: left;
      overflow: auto;
      overscroll-behavior: contain;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `overscroll-behavior-x`
  * `overscroll-behavior-y`


## Syntax
    
    /* Keyword values */
    overscroll-behavior: auto; /* default */
    overscroll-behavior: contain;
    overscroll-behavior: none;
    
    /* Two values */
    overscroll-behavior: auto contain;
    
    /* Global values */
    overscroll-behavior: inherit;
    overscroll-behavior: initial;
    overscroll-behavior: revert;
    overscroll-behavior: revert-layer;
    overscroll-behavior: unset;
    
The `overscroll-behavior` property is specified as one or two keywords chosen from the list of values below.
Two keywords specifies the `overscroll-behavior` value on the `x` and `y` axes respectively. If only one value is specified, both x and y are assumed to have the same value.
### Values
`auto`
    
The default scroll overflow behavior occurs as normal.
`contain`
    
Default scroll overflow behavior (e.g., "bounce" effects) is observed inside the element where this value is set. However, no scroll chaining occurs on neighboring scrolling areas; the underlying elements will not scroll. The `contain` value disables native browser navigation, including the vertical pull-to-refresh gesture and horizontal swipe navigation.
`none`
    
No scroll chaining occurs to neighboring scrolling areas, and default scroll overflow behavior is prevented.
## Description
By default, mobile browsers tend to provide a "bounce" effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached. You may also have noticed that when you have a dialog box with scrolling content at the top of a page that also has scrolling content, once the dialog box's scroll boundary is reached, the underlying page will then start to scroll — this is called scroll chaining.
In some cases, these behaviors are not desirable. You can use `overscroll-behavior` to get rid of unwanted scroll chaining and the browser's Facebook/Twitter app-inspired "pull to refresh"-type behavior.
Note that this property applies only to scroll containers. In particular, since an `<iframe>` is not a scroll container, setting this property on an iframe has no effect. To control scroll chaining from an iframe, set `overscroll-behavior` on both the `<html>` and the `<body>` elements of the iframe's document.
## Examples
>
### Preventing an underlying element from scrolling
In our overscroll-behavior example (see the source code also), we present a full-page list of fake contacts, and a dialog box containing a chat window.
Both of these areas scroll; normally if you scrolled the chat window until you hit a scroll boundary, the underlying contacts window would start to scroll too, which is not desirable. This can be stopped using `overscroll-behavior-y` (`overscroll-behavior` would also work) on the chat window, like this:
    
    .messages {
      height: 220px;
      overflow: auto;
      overscroll-behavior-y: contain;
    }
    
We also wanted to get rid of the standard overscroll effects when the contacts are scrolled to the top or bottom (e.g., Chrome on Android refreshes the page when you scroll past the top boundary). This can be prevented by setting `overscroll-behavior: none` on the `<html>` element:
    
    html {
      margin: 0;
      overscroll-behavior: none;
    }
    
# ::target-text
The `::target-text` CSS pseudo-element represents the text that has been scrolled to if the browser supports text fragments. It allows authors to choose how to highlight that section of text.
The `::target-text` pseudo-element follows a special inheritance model common to all highlight pseudo-elements. For more details on how this inheritance works, see the Highlight pseudo-elements inheritance section.
## Syntax
    
    ::target-text {
      /* ... */
    }
    
## Examples
>
### Highlighting text fragments
    
    ::target-text {
      background-color: rebeccapurple;
      color: white;
    }
    
To see this CSS in action follow the link to scroll-to-text demo.
# mask-origin
The `mask-origin` CSS property sets the origin of a mask. This property determines the mask positioning area: the area within which a mask image is positioned. HTML elements can have masks contained within their content border box, padding box, or content box, whereas SVG elements (which don't have the associated CSS layout boxes) can have masks contained inside their fill, stroke, or view box. For elements rendered as multiple boxes, such as a `<span>` of text that spans more than one line, the `mask-origin` property specifies which boxes the `box-decoration-break` property operates on to determine the mask positioning area.
## Syntax
    
    /* Keyword values */
    mask-origin: content-box;
    mask-origin: padding-box;
    mask-origin: border-box;
    mask-origin: fill-box;
    mask-origin: stroke-box;
    mask-origin: view-box;
    
    /* Multiple values */
    mask-origin: padding-box, content-box;
    mask-origin: view-box, fill-box, border-box;
    
    /* Global values */
    mask-origin: inherit;
    mask-origin: initial;
    mask-origin: revert;
    mask-origin: revert-layer;
    mask-origin: unset;
    
### Values
The `mask-origin` property is a comma-separated list of `<coord-box>` keyword values, including:
`content-box`
    
The position is relative to the content box.
`padding-box`
    
The position is relative to the padding box.
`border-box`
    
The position is relative to the border box.
`fill-box`
    
The position is relative to the object bounding box.
`stroke-box`
    
The position is relative to the stroke bounding box.
`view-box`
    
Uses the nearest SVG viewport as reference box. If a `viewBox` attribute is specified for the element creating the SVG viewport, the reference box is positioned at the origin of the coordinate system established by the `viewBox` attribute and the dimension of the reference box is set to the width and height values of the `viewBox` attribute.
There are three non-standard values that are shortcuts for standard `<coord-box>` values: `content` is an alias for `content-box`, `padding` is an alias for `padding-box`, and `border` is an alias for `border-box`.
## Description
The `mask-origin` property is very similar to the `background-origin` property, but it has a different set of values and a different initial value. The initial value depends on the if there is an associated CSS layout box; if yes, the default value is `border-box`. In comparison, the default for `background-origin` is `padding-box`.
For SVG elements without an associated CSS layout box, the values `content-box`, `padding-box`, and `border-box` (the default value) compute to `fill-box`, meaning the position is relative to the object bounding box. For HTML elements, if a SVG-related value of `fill-box`, `stroke-box`, or `view-box` is set, the value is computed to `border-box`.
An element can have multiple mask layers applied. The number of layers is determined by the number of comma-separated values in the `mask-image` property value (even if one or more of those values is `none`). Each `mask-origin` value in the comma-separated list of values is matched with a comma-separated `mask-image` value, in the same order.
If the number of values in the two properties differs, any excess values of `mask-origin` are not used in cases where `mask-origin` has more values than `mask-image`. If `mask-origin` has fewer values than `mask-image`, the `mask-origin` values are repeated.
For elements rendered as a single box, this property specifies the mask positioning area — or the origin position — of the image referenced by the `mask-image` property.
For elements rendered as multiple boxes, such as inline boxes that span more than one line, the `mask-origin` property specifies which boxes the `box-decoration-break` property operates upon to determine the mask positioning area.
The `mask-origin` can cause the mask layer image to be clipped. For example, if the `mask-clip` property is set to `padding-box`, the `mask-origin` is set to `border-box`, the `mask-position` is set to the `top left` edge, and the element has a border, then the mask layer image will be clipped at the top-left edge.
## Examples
>
### Comparing content, padding, and border
This example demonstrates basic usage while comparing three values of the `mask-origin` property.
#### HTML
We include four `<section>` elements, each containing one `<div>` element.
    
    <section class="content">
      <div></div>
    </section>
    <section class="padding">
      <div></div>
    </section>
    <section class="border">
      <div></div>
    </section>
    <section class="comparison">
      <div></div>
    </section>
    
#### CSS
We apply `border`, `padding`, and `margin` to every `<div>`. These create the reference points for the mask image origin. The `border` shorthand includes a `border-color`. We also include a `background-color`. These provide a green background and a blue border to mask. Finally, all our `<div>` elements are provided with a `mask-image`.
    
    div {
      width: 100px;
      height: 100px;
      margin: 10px;
      border: 10px solid blue;
      background-color: #8cffa0;
      padding: 10px;
      mask-image: url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg");
    }
    section {
      border: 1px solid black;
    }
    
We give each `<div>` a different `mask-origin` value.
    
    .content div {
      mask-origin: content-box;
    }
    
    .padding div {
      mask-origin: padding-box;
    }
    
    .border div {
      mask-origin: border-box;
    }
    
    .comparison div {
      mask-image: none;
    }
    
We also generate some text inside each `<section>` to indicate the mask origin for each `<div>` container.
    
    section::before {
      content: attr(class);
      display: block;
      text-align: center;
    }
    
#### Result
Notice the difference between the three values. In the first three boxes, respectively, the mask originates from:
  * The outside edge of the border.
  * The inside border edge, which is the outer edge of the padding box.
  * The inside padding edge, which is the outer edge of the content box.


The fourth box has no `mask-image` specified: it is a reference image, included to allow you to easily visualize the extent of the content and padding areas.
### Multiple values
This example demonstrates using different `mask-origin` values for different `mask-image`s applied to a single element.
#### HTML
We include a single `<div>`.
    
    <div></div>
    
#### CSS
We apply three mask images instead of one, each with a different `mask-position`. We also set the mask images not to repeat.
    
    div {
      width: 120px;
      height: 120px;
      margin: 10px;
      border: 10px solid blue;
      background-color: #8cffa0;
      padding: 10px;
      mask-image:
        url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg"),
        url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg"),
        url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg");
      mask-position:
        top left,
        top right,
        bottom center;
      mask-repeat: no-repeat;
      mask-origin: content-box, border-box;
    }
    
#### Results
We have three `mask-image` values, but only two `mask-origin` values. This means the `mask-origin` values are repeated, as if we had set `mask-origin: content-box, padding-box, content-box;`. The `border-box` star, the only mask overlapping the border, is the top-right star.
# view-transition-name
The `view-transition-name` CSS property specifies the view transition snapshot that selected elements will participate in. This enables you to animate those elements separately from the rest of the page, which uses the default cross-fade animation during a view transition. You can then define custom animation styles for these elements.
## Syntax
    
    /* <custom-ident> value examples */
    view-transition-name: header;
    view-transition-name: figure-caption;
    
    /* Keyword value */
    view-transition-name: none;
    view-transition-name: match-element;
    
    /* Global values */
    view-transition-name: inherit;
    view-transition-name: initial;
    view-transition-name: revert;
    view-transition-name: revert-layer;
    view-transition-name: unset;
    
### Values
`<custom-ident>`
    
An identifying name that causes the selected element to participate in a separate snapshot from the root snapshot. The `<custom-ident>` cannot be `auto`, `match-element`, `none`, or a CSS-wide keyword value.
`match-element`
    
The browser automatically assigns a unique name to the selected element. This name is used to snapshot the element separately from all other elements on the page. (This name is internal and cannot be read from the DOM.)
`none`
    
The selected element will not participate in a separate snapshot, unless it has a parent element with a `view-transition-name` set, in which case it will be snapshotted as part of that element.
## Description
By default, when a view transition is applied to a web app, all changes to the UI that occur during that transition are snapshotted and animated together. This is the default — or `root` — snapshot (see The view transition pseudo-element tree). By default, this animation is a smooth cross-fade, which can be seen in action in the View Transitions SPA demo.
If you want certain elements to be animated differently from the `root` snapshot during the view transition, you can do so by giving them a different `view-transition-name`, for example:
    
    figcaption {
      view-transition-name: figure-caption;
    }
    
You can then specify which animations you want for the before and after snapshots using the relevant view transition pseudo-elements — `::view-transition-old()` and `::view-transition-new()`. For example:
    
    ::view-transition-old(figure-caption) {
      animation: 0.25s linear both shrink-x;
    }
    
    ::view-transition-new(figure-caption) {
      animation: 0.25s 0.25s linear both grow-x;
    }
    
If you don't want an element to be snapshotted separately, you can specify a `view-transition-name` value of `none`:
    
    .dont-animate-me {
      view-transition-name: none;
    }
    
The `view-transition-name` `<custom-ident>` must be unique for each rendered element taking part in the view transition. If two rendered elements have the same `view-transition-name` at the same time, the `ViewTransition.ready` `Promise` will reject and the transition will be skipped.
### Specifying `view-transition-name` values automatically
Sometimes you will want to animate multiple UI elements separately in a view transition. This is often the case when you have a list of elements on a page and want to rearrange them in some way:
    
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
    
      <!-- ... -->
    
      <li>Item 99</li>
    </ul>
    
Giving each one a unique name can be inconvenient, especially as the number of elements gets larger:
    
    li:nth-child(1) {
      view-transition-name: item1;
    }
    li:nth-child(2) {
      view-transition-name: item2;
    }
    li:nth-child(3) {
      view-transition-name: item3;
    }
    li:nth-child(4) {
      view-transition-name: item4;
    }
    
    /* ... */
    
    li:nth-child(99) {
      view-transition-name: item99;
    }
    
To get around this problem, you can use the `match-element` value, which causes the browser to give each selected element a unique internal `view-transition-name`:
    
    li {
      view-transition-name: match-element;
    }
    
Because `match-element` assigns automatic `view-transition-name` values based on element identity, it can only be used for same-document view transitions. The auto-generated internal identifiers are not transferrable across different elements or documents.
## Examples
>
### Basic `view-transition-name` usage
This example comes from the View Transitions SPA demo, which is a basic image gallery. The Basic SPA view transition provides a more detailed explanation of how this demo works.
Most of the UI changes are animated using the `root` transition snapshot. However, the `<figcaption>` is given a `view-transition-name` of `figure-caption` to allow it to be animated differently from the rest of the page:
    
    figcaption {
      view-transition-name: figure-caption;
    }
    
The following code applies a custom animation just to the `<figcaption>`:
    
    @keyframes grow-x {
      from {
        transform: scaleX(0);
      }
      to {
        transform: scaleX(1);
      }
    }
    
    @keyframes shrink-x {
      from {
        transform: scaleX(1);
      }
      to {
        transform: scaleX(0);
      }
    }
    
    ::view-transition-group(figure-caption) {
      height: auto;
      right: 0;
      left: auto;
      transform-origin: right center;
    }
    
    ::view-transition-old(figure-caption) {
      animation: 0.25s linear both shrink-x;
    }
    
    ::view-transition-new(figure-caption) {
      animation: 0.25s 0.25s linear both grow-x;
    }
    
We create a custom CSS animation and apply it to the `::view-transition-old(figure-caption)` and `::view-transition-new(figure-caption)` pseudo-elements. We also apply other styles to keep them both in the same place and to stop the default styling from interfering with our custom animations.
### Using the `match-element` value
This example contains a list of technologies–HTML, CSS, SVG, and JS–that are displayed in a sidebar next to a main content area, which starts out empty. Clicking a technology's heading animates its content into the adjoining content area that shows more details.
#### HTML
The `<main>` element contains an unordered list and an `<article>` element. The multiple child `<li>` elements inside the list each contain an `<a>` element inside a heading.
    
    <main class="match-element-applied">
      <ul>
        <li>
          <h2><a href="#">HTML</a></h2>
          <h3>HyperText Markup Language</h3>
          <p>
            HyperText Markup Language (HTML) is the most basic building block of the
            web. It defines the meaning and structure of web content. HTML provides
            the fundamental building blocks for structuring web documents and apps.
          </p>
        </li>
        <li>
          <h2><a href="#">CSS</a></h2>
          <h3>Cascading Style Sheets</h3>
          <p>
            Cascading Style Sheets (CSS) is a stylesheet language used to describe
            the presentation of a document written in HTML or XML (including XML
            dialects such as SVG, MathML or XHTML). CSS describes how elements
            should be rendered on screen, on paper, in speech, or on other media.
          </p>
        </li>
        <li>
          <h2><a href="#">SVG</a></h2>
          <h3>Scalable Vector Graphics</h3>
          <p>
            Scalable Vector Graphics (SVG) is an XML-based markup language for
            describing two-dimensional based vector graphics.
          </p>
        </li>
        <li>
          <h2><a href="#">JS</a></h2>
          <h3>JavaScript</h3>
          <p>
            JavaScript (JS) is the web's native programming language. JavaScript is
            a lightweight, interpreted (or just-in-time compiled) programming
            language with first-class functions. While it is most well-known as the
            scripting language for web pages, many non-browser environments, such as
            Node.js, also use it.
          </p>
        </li>
      </ul>
      <article></article>
    </main>
    
#### CSS
We use flexbox to lay out the `<li>` and the `<article>` side by side, and to make the list items share equal amount of space in the first column. The list takes up 35% of the container's width, while the `<article>` fills the remaining available horizontal space.
    
    main {
      container-type: inline-size;
      width: 100%;
      height: 100%;
      display: flex;
      gap: 2cqw;
      position: relative;
    }
    
    ul {
      width: 35cqw;
      display: flex;
      flex-direction: column;
      gap: 1cqw;
    }
    
    article {
      flex: 1;
    }
    
    li {
      flex: 1;
    }
    
We also define a rule that selects elements with the `active-item` class. When this class is applied to an element, the rule causes it to be positioned exactly over the top of the `<article>` element. This class will be applied to the list items via JavaScript when their links are clicked, which will initiate a view transition.
    
    .active-item {
      position: absolute;
      z-index: 1;
      translate: 37cqw;
      width: calc(100% - 37cqw);
      height: 100%;
    }
    
By default, all elements in a view transition are animated together in a single cross-fade. In this example, however, we don't want this — we want each list item to have its own movement animation. We can achieve this by applying `view-transition-name: match-element` to every list item:
    
    .match-element-applied li {
      view-transition-name: match-element;
    }
    
The `match-element-applied` class is applied to the `<main>` element by default, which is why the checkbox in the Result frame is initially selected. If you uncheck it, the class is removed and the default cross-fade animation comes into effect instead. You can toggle the checkbox to compare the default animation with the one applied when `view-transition-name: match-element` is used.
Next, we customize the animation by using the `::view-transition-group()` pseudo-element to apply an `animation-duration` to all the view transition groups (signified by the `*` identifier) and give all the old and new snapshots a `height` of `100%`. This works around differences in the aspect ratios of the old and new snapshots and makes the animations look smoother:
    
    ::view-transition-group(*) {
      animation-duration: 0.5s;
    }
    
    html::view-transition-old(*),
    html::view-transition-new(*) {
      height: 100%;
    }
    
#### JavaScript
In this example, the `active-item` class is applied to the list items when their links are clicked; this is achieved via the `updateActiveItem()` function:
    
    const mainElem = document.querySelector("main");
    let prevElem;
    let checkboxElem = document.querySelector("input");
    
    // View transition code
    function updateActiveItem(event) {
      // Get the list item that contains the clicked link
      const clickedElem = event.target.parentElement.parentElement;
    
      // Set the active-item class on the list item
      clickedElem.className = "active-item";
    
      // Keep track of the previous item that was clicked, if any.
      // Remove the active-item class from the previous item so that only
      // one list item is placed over the <article> at any one time
      if (prevElem === clickedElem) {
        prevElem.className = "";
        prevElem = undefined;
      } else if (prevElem) {
        prevElem.className = "";
        prevElem = clickedElem;
      } else {
        prevElem = clickedElem;
      }
    }
    
    mainElem.addEventListener("click", (event) => {
      event.preventDefault(); // Prevent iframe from scrolling when clicked
      // Do nothing unless a link is clicked inside the <main> element
      if (event.target.tagName !== "A") {
        return;
      }
    
      // Run updateActiveItem() on its own if view transitions are not supported
      if (!document.startViewTransition) {
        updateActiveItem(event);
      } else {
        // Run updateActiveItem() via startViewTransition()
        const transition = document.startViewTransition(() =>
          updateActiveItem(event),
        );
      }
    });
    
    // Toggle the class on <main> to control whether or not match-element is applied
    
    checkboxElem.addEventListener("change", () => {
      mainElem.classList.toggle("match-element-applied");
    });
    
Running the `updateActiveItem()` function via the `startViewTransition()` function animates the display of technology details smoothly.
#### Result
Click a technology heading in the sidebar and notice the animation effect of its content into the main content area.
There is also a checkbox, which is selected by default, so `view-transition-name: match-element` is applied. Uncheck the checkbox and click a heading again to see how the view-transition works without `view-transition-name: match-element`.
# animation-direction
The `animation-direction` CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
## Try it
    
    animation-direction: normal;
    
    
    animation-direction: reverse;
    
    
    animation-direction: alternate;
    
    
    animation-direction: alternate-reverse;
    
    
    <section class="flex-column" id="default-example">
      <div id="example-element"></div>
      <button id="play-pause">Play</button>
    </section>
    
    
    #example-element {
      animation-duration: 3s;
      animation-iteration-count: infinite;
      animation-name: slide;
      animation-play-state: paused;
      animation-timing-function: ease-in;
      background-color: #1766aa;
      border-radius: 50%;
      border: 5px solid #333333;
      color: white;
      height: 150px;
      margin: auto;
      margin-left: 0;
      width: 150px;
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    #play-pause {
      font-size: 2rem;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    
    const el = document.getElementById("example-element");
    const button = document.getElementById("play-pause");
    
    button.addEventListener("click", () => {
      if (el.classList.contains("running")) {
        el.classList.remove("running");
        button.textContent = "Play";
      } else {
        el.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* Single animation */
    animation-direction: normal;
    animation-direction: reverse;
    animation-direction: alternate;
    animation-direction: alternate-reverse;
    
    /* Multiple animations */
    animation-direction: normal, reverse;
    animation-direction: alternate, reverse, normal;
    
    /* Global values */
    animation-direction: inherit;
    animation-direction: initial;
    animation-direction: revert;
    animation-direction: revert-layer;
    animation-direction: unset;
    
### Values
`normal`
    
The animation plays forwards each cycle. In other words, each time the animation cycles, the animation will reset to the beginning state and start over again. This is the default value.
`reverse`
    
The animation plays backwards each cycle. In other words, each time the animation cycles, the animation will reset to the end state and start over again. Animation steps are performed backwards, and easing functions are also reversed. For example, an `ease-in` easing function becomes `ease-out`.
`alternate`
    
The animation reverses direction each cycle, with the first iteration being played forwards. The count to determine if a cycle is even or odd starts at one.
`alternate-reverse`
    
The animation reverses direction each cycle, with the first iteration being played backwards. The count to determine if a cycle is even or odd starts at one.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
Note: When creating CSS scroll-driven animations, specifying an `animation-direction` works as expected, for example `reverse` causes the animation to run in reverse over the course of the timeline's progression. A value of `alternate` (combined with an `animation-iteration-count`) causes the animation to run forwards and backwards as the timeline is progressed.
## Examples
>
### Reversing the animation direction
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
    }
    
    .box:hover {
      animation-name: rotate;
      animation-duration: 0.7s;
      animation-direction: reverse;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
See CSS animations for examples.
# CSS grid layout
The CSS grid layout module excels at dividing a page into major regions or defining the relationship in terms of size, position, and layering between parts of a control built from HTML primitives.
Like tables, grid layout enables an author to align elements into columns and rows. However, many more layouts are either possible or easier with CSS grid than they were with tables. For example, a grid container's child elements could position themselves so they actually overlap and layer, similar to CSS positioned elements.
## Grid layout in action
The example shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. Items have been placed onto the grid using line-based placement.
This sample animation uses `display`, `grid-template-columns`, `grid-template-rows`, and `gap` to create the grid, and `grid-column` and `grid-row` to position items within in the grid. To view and edit the HTML and CSS used, click the 'Play' at the top right of the example.
## Reference
>
### Properties
  * `grid-auto-columns`
  * `grid-auto-flow`
  * `grid-auto-rows`
  * `grid-template-columns`
  * `grid-template-rows`
  * `grid-template-areas`
  * `grid-template` shorthand
  * `grid` shorthand
  * `grid-column-start`
  * `grid-column-end`
  * `grid-column` shorthand
  * `grid-row-start`
  * `grid-row-end`
  * `grid-row` shorthand
  * `grid-area` shorthand


### Functions
  * `repeat()`
  * `minmax()`
  * `fit-content()`


### Data types and values
  * `<flex>` (`fr` unit)


### Terms and glossary definitions
  * Grid
  * Grid areas
  * Grid axis
  * Grid cell
  * Grid column
  * Grid container
  * Grid lines
  * Grid row
  * Grid tracks
  * Gutters


## Guides
Basic concepts of grid layout
    
An overview of the various features provided in the CSS grid layout module.
Relationship of grid layout with other layout methods
    
How grid layout fits together with other CSS features including flexbox, absolutely positioned elements, and `display: contents`.
Grid layout using line-based placement
    
Grid lines and how to position items against those lines, including the `grid-area` properties, negative line numbers, spanning multiple cells, and creating grid gutters.
Grid template areas
    
Placing grid items using named template areas.
Grid layout using named grid lines
    
Combining names and track sizes; placing grid items by defining named grid lined and template areas.
Auto-placement in grid layout
    
How grid positions items that don't have any placement properties declared.
Aligning items in CSS grid layout
    
Aligning, justifying, and centering grid items along the two axes of a grid layout.
Grids, logical values, and writing modes
    
A look at the interaction between CSS grid layout, box alignment and writing modes, along with CSS logical and physical properties and values.
Grid layout and accessibility
    
A look at how CSS grid layout can both help and harm accessibility.
Realizing common layouts using grids
    
A few different layouts demonstrating different techniques you can use when designing with CSS grid layouts, including using `grid-template-areas`, a 12-column flexible grid system, and a product listing using auto-placement.
Subgrid
    
What subgrid does with use cases and design patterns that subgrid solves.
Masonry layout
    
Details what masonry layout is and it is used.
Box alignment in CSS grid layout
    
How box alignment works in the context of grid layout.
## Related features
CSS display module
  * `display`
  * `order`


CSS box alignment module
  * `align-content`
  * `align-items`
  * `align-self`
  * `column-gap`
  * `gap`
  * `justify-content`
  * `justify-items`
  * `justify-self`
  * `place-content`
  * `place-items`
  * `place-self`
  * `row-gap`


CSS box sizing module
  * `aspect-ratio`
  * `box-sizing`
  * `height`
  * `max-height`
  * `max-width`
  * `min-height`
  * `min-width`
  * `width`
  * `<ratio>` data type
  * `min-content` value
  * `max-content` value
  * `fit-content` value
  * `fit-content()` function


# mask-image
The `mask-image` CSS property sets the image that is used as the mask layer for an element, hiding sections of the element on which the masking image is set based on the alpha channel of the mask image and, depending on the `mask-mode` property value, the luminance of the mask image's colors.
## Syntax
    
    /* Keyword value */
    mask-image: none;
    
    /* <mask-source> value */
    mask-image: url("masks.svg#mask1");
    
    /* <image> values */
    mask-image: linear-gradient(black, transparent);
    mask-image: image(url("mask.png"), skyblue);
    
    /* Multiple values */
    mask-image: url("mask.png"), linear-gradient(black 25%, transparent 35%);
    
    /* Global values */
    mask-image: inherit;
    mask-image: initial;
    mask-image: revert;
    mask-image: revert-layer;
    mask-image: unset;
    
### Values
`none`
    
This keyword is interpreted as a transparent black image layer.
`<mask-source>`
    
A `<url>` reference to a `<mask>` or to a CSS image.
`<image>`
    
An image value used as a mask image layer.
## Description
The `mask-image` property provides a mask that hides part of the element to which it is applied. The value is a comma-separated list of mask references. Each mask reference is an `<image>`, a `<mask-source>`, or the keyword `none`.
An `<image>` can be any type of image, including generated images such as CSS gradients.
If only one value is specified in the `mask-image` property value, and that value is `none`, no masking effect will be apparent. If multiple values are specified, a `none` value included in the list may have no direct effect, however, other `mask-*` values in the same list position will apply to a transparent black mask layer and have no visual effect.
Only image sources served over HTTP and HTTPS protocols are accepted as `<image>` values due to the CORS policy. Images served locally, including relative or absolute `file://` protocols, are not accepted, and will render as transparent black. To test URL image sources locally, set up a local server.
A mask will be counted as a transparent black image layer, not revealing anything, in the following cases:
  * The mask image is empty (zero width or zero height).
  * The mask image fails to download.
  * The browser does not support the mask image format.
  * The mask image doesn't exist.
  * The mask value doesn't point to a mask image.


The default value of the `mask-mode` property is `match-source`, which means the mode is defined by the mode of the mask image itself. The mask image's mode is generally `alpha` except when the mask source is an SVG `<mask>` element, in which case the mode is `luminance` unless the mode is changed to `alpha` via the CSS `mask-type` property or SVG `mask-type` attribute.
The `mask-mode` value is significant, because it determines whether the masking effect depends on the image source's alpha channel values alone or a combination of those and the mask's luminance (the lightness/darkness of the colors that make up the `mask-image`):
  * In all cases, the alpha transparency of the mask matters; element areas masked by opaque sections of the `mask-image` will be rendered, while areas masked by transparent image sections are hidden.
  * When the `mask-mode` value is set or resolves to `alpha`, only the alpha-channel of the colors matter; the hue, lightness, etc., don't matter.
  * If the `mask-mode` property is set or defaults to `luminance`, the masking value is the luminance value of each color multiplied by its alpha value. The `mask-mode` will resolve to `luminance` if explicitly set to that value, or if the property is set to `match-source` and the `mask-image` source is an SVG `<mask>` that does not have its `mask-type` property or `mask-type` attribute explicitly set to `alpha`.


## Examples
>
### Gradient as a mask image
In this example, we use an `<image>` value as a mask, defining a CSS radial gradient as our mask image to create a round image with a soft edge.
#### HTML
We include an HTML `<img>` element, which will also be used in all other examples.
    
    <img
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    
#### CSS
We use the CSS `radial-gradient()` function to create a mask that has a black circle with a radius that is half the width of the mask, before transitioning to being transparent over 10%.
    
    img {
      mask-image: radial-gradient(black 50%, transparent 60%);
    }
    
#### Results
The part of the original element that is masked by the black circle is fully opaque, fading to transparent as the mask fades to transparent.
### Image resource as a mask image
In this example, the `<mask-source>` used as our mask image is an external SVG.
#### HTML
We include the same image as the previous example. We've also included the image we will be using as the mask; a star whose `fill-opacity` is `0.5`, or 50% opaque.
    
    <img
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    
    <img
      src="https://mdn.github.io/shared-assets/images/examples/mask-star.svg"
      alt="A star" />
    
#### CSS
We use `mask-star.svg` as a mask image on our first image:
    
    img:first-of-type {
      mask-image: url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg");
    }
    
#### Results
The mask is semi-opaque, which is why the colors are not as vibrant as the previous example. The part of the image that is visible is 50% opaque; the opacity of the mask applied. The mask is smaller than the image, so repeats by default. We could have used `mask-repeat` to control the repeating or `mask-size` to change the size of the mask, which we do in the next example.
### Multiple masks
This example demonstrates applying multiple masks.
#### CSS
We apply two masks — the same semi-transparent SVG as in the previous example, and a `repeating-radial-gradient()`. We control the size of the masks using the `mask-size` property. Because our first mask is not sized at 100%, we make sure our masks are centered and don't repeat with the `mask-position` and `mask-repeat` properties, respectively.
    
    img {
      mask-size: 95%, 100%;
      mask-position: center;
      mask-repeat: no-repeat;
      mask-image:
        url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg"),
        repeating-radial-gradient(transparent 0 5px, black 5px 10px);
    }
    
#### Results
### Masking with SVG `<mask>`
This example demonstrates using SVG `<mask>` elements as masks. In this case, the color of the mask matters as the `mask-type` value for SVG masks defaults to `luminance`, which means white opaque areas (100% luminance) will be masked and visible, transparent and black areas (0% luminance) will be clipped, and anything in between will be partially masked.
#### HTML
We've included an `id` for each of our four images, and an SVG that contains an equal number of `<mask>` elements.
    
    <img
      id="green"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <img
      id="stroke"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <img
      id="both"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <img
      id="alphaMode"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    
    <svg height="0" width="0">
      <mask id="greenMask">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green" />
      </mask>
      <mask id="strokeMask">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="none"
          stroke="white"
          stroke-width="20" />
      </mask>
      <mask id="bothMask">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="green"
          stroke="white"
          stroke-width="20" />
      </mask>
      <mask id="black">
        <path
          d="M20,70 A40,40,0,0,1,100,70 A40,40,0,0,1,180,70 Q180,130,100,190 Q20,130,20,70 Z"
          fill="black" />
      </mask>
    </svg>
    
#### CSS
We apply a different `<mask>` to each `<img>`. No part of the last image, with the `black` fill, will be visible by default. In this case, while all colors used in this example are fully opaque, the `mask-mode` defaults to `match-type`, which resolves to `luminance` in this case.
    
    #green {
      mask-image: url("#greenMask");
    }
    #stroke {
      mask-image: url("#strokeMask");
    }
    #both {
      mask-image: url("#bothMask");
    }
    #alphaMode {
      mask-image: url("#black");
    }
    
    body:has(:checked) img {
      mask-mode: alpha;
    }
    
The luminance values of `black`, `white`, and `green` are `0`, `100`, and `46.228`, respectively. This means the areas where the mask is white will be visible, whereas areas where the mask is black or fully transparent will be clipped (not visible). Areas where the mask is green will be visible but lighter, equivalent to having a white mask that is 46.228% opaque.
#### Results
Toggle the checkbox to toggle the value of the `mask-mode` between `alpha` (checked) and the initial value, which resolves to `luminance` (unchecked). When `alpha` is used, the color of the mask doesn't matter; all that matters is the alpha-transparency. When the value resolves to `luminance`, `white` areas are visible, `black` areas are not, and `green` areas are visible but at an opacity that matches the luminance of the color `green`. When `mask-mode` is set to `alpha`, the colors are equivalent as they are all fully opaque.
# overflow-block
The `overflow-block` CSS property sets what shows when content overflows the block start and block end edges of a box. This may be nothing, a scroll bar, or the overflow content.
Note: The `overflow-block` property maps to `overflow-y` or `overflow-x` depending on the writing mode of the document.
## Syntax
    
    /* Keyword values */
    overflow-block: visible;
    overflow-block: hidden;
    overflow-block: clip;
    overflow-block: scroll;
    overflow-block: auto;
    
    /* Global values */
    overflow-block: inherit;
    overflow-block: initial;
    overflow-block: revert;
    overflow-block: revert-layer;
    overflow-block: unset;
    
The `overflow-block` property is specified as a single `<overflow>` keyword value:
### Values
`visible`
    
Content is not clipped and may be rendered outside the padding box's block start and block end edges.
`hidden`
    
Content is clipped if necessary to fit the block dimension in the padding box. No scrollbars are provided.
`clip`
    
Overflow content is clipped at the element's overflow clip edge that is defined using the `overflow-clip-margin` property.
`scroll`
    
Content is clipped if necessary to fit in the block dimension in the padding box. Browsers display scrollbars whether or not any content is actually clipped. (This prevents scrollbars from appearing or disappearing when the content changes.) Printers may still print overflowing content.
`auto`
    
Depends on the user agent. If content fits inside the padding box, it looks the same as `visible`, but still establishes a new block-formatting context.
## Examples
>
### HTML
    
    <ul>
      <li>
        <code>overflow-block: hidden</code> (hides the text outside the box)
        <div id="hidden">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-block: scroll</code> (always adds a scrollbar)
        <div id="scroll">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-block: clip</code> (hides the text outside the box beyond the
        overflow clip edge)
        <div id="clip">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-block: visible</code> (displays the text outside the box if
        needed)
        <div id="visible">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    
      <li>
        <code>overflow-block: auto</code> (on most browsers, equivalent to
        <code>scroll</code>)
        <div id="auto">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
          veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
          commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
          velit esse cillum dolore eu fugiat nulla pariatur.
        </div>
      </li>
    </ul>
    
### CSS
    
    div {
      border: 1px solid black;
      width: 250px;
      height: 100px;
      margin-bottom: 120px;
    }
    
    #hidden {
      overflow-block: hidden;
    }
    #scroll {
      overflow-block: scroll;
    }
    #clip {
      overflow-block: clip;
    }
    #visible {
      overflow-block: visible;
    }
    #auto {
      overflow-block: auto;
    }
    
### Result
# backface-visibility
The `backface-visibility` CSS property sets whether the back face of an element is visible when turned towards the user.
## Try it
    
    backface-visibility: visible;
    
    
    backface-visibility: hidden;
    
    
    <section class="default-example" id="default-example">
      <div id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      perspective: 550px;
      perspective-origin: 220% 220%;
      transform-style: preserve-3d;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      background: rgb(0 0 0 / 0.4);
      font-size: 60px;
      color: white;
    }
    
    .front {
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(230 0 0);
      color: white;
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(0 0 0 / 0.6);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(0 0 0 / 0.6);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
An element's back face is a mirror image of its front face. Though invisible in 2D, the back face can become visible when a transformation causes the element to be rotated in 3D space. (This property has no effect on 2D transforms, which have no perspective.)
## Syntax
    
    /* Keyword values */
    backface-visibility: visible;
    backface-visibility: hidden;
    
    /* Global values */
    backface-visibility: inherit;
    backface-visibility: initial;
    backface-visibility: revert;
    backface-visibility: revert-layer;
    backface-visibility: unset;
    
The `backface-visibility` property is specified as one of the keywords listed below.
### Values
`visible`
    
The back face is visible when turned towards the user.
`hidden`
    
The back face is hidden, effectively making the element invisible when turned away from the user.
## Examples
>
### Cube with transparent and opaque faces
This example shows a cube with transparent faces, and one with opaque faces.
#### HTML
    
    <table>
      <tr>
        <th><code>backface-visibility: visible;</code></th>
        <th><code>backface-visibility: hidden;</code></th>
      </tr>
      <tr>
        <td>
          <div class="container">
            <div class="cube show-bf">
              <div class="face front">1</div>
              <div class="face back">2</div>
              <div class="face right">3</div>
              <div class="face left">4</div>
              <div class="face top">5</div>
              <div class="face bottom">6</div>
            </div>
          </div>
          <p>
            Since all faces are partially transparent, the back faces (2, 4, 5) are
            visible through the front faces (1, 3, 6).
          </p>
        </td>
        <td>
          <div class="container">
            <div class="cube hide-bf">
              <div class="face front">1</div>
              <div class="face back">2</div>
              <div class="face right">3</div>
              <div class="face left">4</div>
              <div class="face top">5</div>
              <div class="face bottom">6</div>
            </div>
          </div>
          <p>The three back faces (2, 4, 5) are hidden.</p>
        </td>
      </tr>
    </table>
    
#### CSS
    
    /* Classes that will show or hide the
       three back faces of the "cube" */
    .show-bf div {
      backface-visibility: visible;
    }
    
    .hide-bf div {
      backface-visibility: hidden;
    }
    
    /* Define the container div, the cube div, and a generic face */
    .container {
      width: 150px;
      height: 150px;
      margin: 75px 0 0 75px;
      border: none;
    }
    
    .cube {
      width: 100%;
      height: 100%;
      perspective: 550px;
      perspective-origin: 150% 150%;
      transform-style: preserve-3d;
    }
    
    .face {
      display: block;
      position: absolute;
      width: 100px;
      height: 100px;
      border: none;
      line-height: 100px;
      font-family: sans-serif;
      font-size: 60px;
      color: white;
      text-align: center;
    }
    
    /* Define each face based on direction */
    .front {
      background: rgb(0 0 0 / 30%);
      transform: translateZ(50px);
    }
    
    .back {
      background: lime;
      color: black;
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(196 0 0 / 70%);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 196 / 70%);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(196 196 0 / 70%);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(196 0 196 / 70%);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
    /* Make the table a little nicer */
    th,
    p,
    td {
      background-color: #eeeeee;
      margin: 0px;
      padding: 6px;
      font-family: sans-serif;
      text-align: left;
    }
    
#### Result
# shape-image-threshold
The `shape-image-threshold` CSS property sets the alpha channel threshold used to extract the shape using an image as the value for `shape-outside`.
## Try it
    
    shape-outside: linear-gradient(
      50deg,
      rgb(77 26 103),
      transparent 80%,
      transparent
    );
    shape-image-threshold: 0.2;
    
    
    shape-outside: linear-gradient(
      50deg,
      rgb(77 26 103),
      transparent 80%,
      transparent
    );
    shape-image-threshold: 0.4;
    
    
    shape-outside: linear-gradient(
      50deg,
      rgb(77 26 103),
      transparent 80%,
      transparent
    );
    shape-image-threshold: 0.6;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element"></div>
        We had agreed, my companion and I, that I should call for him at his house,
        after dinner, not later than eleven o’clock. This athletic young Frenchman
        belongs to a small set of Parisian sportsmen, who have taken up “ballooning”
        as a pastime. After having exhausted all the sensations that are to be found
        in ordinary sports, even those of “automobiling” at a breakneck speed, the
        members of the “Aéro Club” now seek in the air, where they indulge in all
        kinds of daring feats, the nerve-racking excitement that they have ceased to
        find on earth.
      </div>
    </section>
    
    
    .example-container {
      text-align: left;
      padding: 20px;
    }
    
    #example-element {
      float: left;
      width: 150px;
      height: 150px;
      margin: 20px;
      background-image: linear-gradient(
        50deg,
        rgb(77 26 103),
        transparent 80%,
        transparent
      );
    }
    
Any pixels whose alpha component's value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. For example, a value of `0.5` means that the shape will enclose all the pixels that are more than 50% opaque.
## Syntax
    
    /* <number> value */
    shape-image-threshold: 0.7;
    
    /* Global values */
    shape-image-threshold: inherit;
    shape-image-threshold: initial;
    shape-image-threshold: revert;
    shape-image-threshold: revert-layer;
    shape-image-threshold: unset;
    
### Values
`<alpha-value>`
    
Sets the threshold used for extracting a shape from an image. The shape is defined by the pixels whose alpha value is greater than the threshold. Values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) are clamped to this range.
## Examples
>
### Aligning text to a gradient
This example creates a `<div>` block with a gradient background image. The gradient is established as a CSS shape using `shape-outside`, so that pixels within the gradient which are at least 20% opaque (that is, those pixels with an alpha component greater than 0.2) are considered part of the shape.
#### HTML
    
    <div id="gradient-shape"></div>
    
    <p>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel at commodi
      voluptates enim, distinctio officia. Saepe optio accusamus doloribus sint
      facilis itaque ab nulla, dolor molestiae assumenda cum sit placeat adipisci,
      libero quae nihil porro debitis laboriosam inventore animi impedit nostrum
      nesciunt quisquam expedita! Dolores consectetur iure atque a mollitia dicta
      repudiandae illum exercitationem aliquam repellendus ipsum porro modi, id nemo
      eligendi, architecto ratione quibusdam iusto nisi soluta? Totam inventore ea
      eum sed velit et eligendi suscipit accusamus iusto dolore, at provident eius
      alias maxime pariatur non deleniti ipsum sequi rem eveniet laboriosam magni
      expedita?
    </p>
    
#### CSS
    
    #gradient-shape {
      width: 150px;
      height: 150px;
      float: left;
      background-image: linear-gradient(30deg, black, transparent 80%, transparent);
      shape-outside: linear-gradient(30deg, black, transparent 80%, transparent);
      shape-image-threshold: 0.2;
    }
    
The shape is established here using `background-image` with a linear gradient rather than an image file. The same gradient is also used as the image from which the shape is derived for establishing the float area, using the `shape-outside` property.
The 20% opacity threshold for treating gradient pixels as part of the shape is then established using `shape-image-threshold` with a value of `0.2`.
#### Result
# clamp()
The `clamp()` CSS function clamps a value within a range of values between a defined minimum bound and a maximum bound. The function takes three parameters: a minimum value, a preferred value, and a maximum allowed value.
## Try it
    
    font-size: clamp(1rem, 2.5vw, 2rem);
    
    
    font-size: clamp(1.5rem, 2.5vw, 4rem);
    
    
    font-size: clamp(1rem, 10vw, 2rem);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        The font-size of this text varies depending on the base font of the page,
        and the size of the viewport.
      </div>
    </section>
    
Note that using `clamp()` for font sizes, as in these examples, allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size. It has the same effect as the code in Fluid Typography but in one line, and without the use of media queries.
## Syntax
    
    /* Static values */
    width: clamp(200px, 40%, 400px);
    width: clamp(20rem, 30vw, 70rem);
    width: clamp(10vw, 20em, 100vw);
    
    /* Calculated values */
    width: clamp(min(10vw, 20rem), 300px, max(90vw, 55rem));
    width: clamp(100px, calc(30% / 2rem + 10px), 900px);
    
### Parameters
The `clamp(min, val, max)` function accepts three comma-separated expressions as its parameters.
`min`
    
The minimum value is the smallest (most negative) value. This is the lower bound in the range of allowed values. If the preferred value is less than this value, the minimum value will be used.
`val`
    
The preferred value is the expression whose value will be used as long as the result is between the minimum and maximum values.
`max`
    
The maximum value is the largest (most positive) expression value to which the value of the property will be assigned if the preferred value is greater than this upper bound.
The expressions can be math functions (see `calc()` for more information), literal values, other expressions that evaluate to a valid argument type (like `<length>`), or nested `min()` and `max()` functions. For math expressions, you can use addition, subtraction, multiplication, and division without using the `calc()` function itself. You may also use parentheses to establish computation order when needed.
You can use different units for each value in your expressions and different units in any math function making up any of the arguments.
Keep the following aspects in mind while working with the function:
  * Math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if `auto` had been specified.
  * It is permitted to nest `max()` and `min()` functions as expression values, in which case the inner ones are treated as basic parentheses. The expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself.
  * The expression can be values combining the addition ( `+` ), subtraction ( `-` ), multiplication ( `*` ) and division ( `/` ) operators, using standard operator precedence rules. Make sure to put a space on each side of the `+` and `-` operands. The operands in the expression may be any `<length>` syntax value. You can use different units for each value in your expression. You may also use parentheses to establish computation order when needed.
  * Oftentimes you will want to use `min()` and `max()` within a `clamp()` function.


### Return value
`clamp(MIN, VAL, MAX)` is resolved as `max(MIN, min(VAL, MAX))`.
Based on the provided parameters, the function returns `<length>`, `<frequency>`, `<angle>`, `<time>`, `<percentage>`, `<number>`, or `<integer>`.
## Examples
>
### min(), max(), and clamp() comparison
In this example we have a web page that uses `min()`, `max()`, and `clamp()` to set sizes responsively.
The example adjusts the sizes of page elements in three ways:
  * the lengths of the lines of text
  * the font size of paragraph text
  * the font size of heading text


In all three cases, the page uses a combination of a viewport-relative units (`vw` and `<percentage>`), to set a size that varies with the viewport width, and a value that is not viewport relative (`rem` and `px`) to implement minimum and/or maximum sizes.
The example is at https://mdn.github.io/css-examples/min-max-clamp/. Open it in a new window and try adjusting the window width.
The line length (controlled by the `width` of the `<body>` element) will increase as the window width increases, but only up to a certain point (`1000px`), and beyond that point, it won't increase anymore. We're using `min()` to set a maximum line length: it can go under `1000px`, but won't go over. This is helpful because long lines are harder to read, so we often want to limit how long a line can be. To achieve this we use `min(1000px, calc(70% + 100px))`: when the result of the percentage-based calculation goes above `1000px`, we switch to the fixed `1000px` value.
The size of the paragraph text, controlled by the `font-size` of the `<p>` element, decreases as the window gets narrower, but only up to a certain point, and beyond that point (the point where `1.2vw` is less than `1.2rem`) it doesn't get any smaller: it stays at `1.2rem`. We're using `max()` to set a minimum font size: the font can grow above `1.2rem` but will never go below it. This is helpful because really small text is hard to read. To achieve this we use `max(1.2rem, 1.2vw)`. This means that the `font-size` will be set at `1.2rem`, unless the computed value of `1.2vw` is greater than that of `1.2rem`, in which case it will be set to `1.2vw` instead.
The size of the heading text, controlled by the `font-size` of the `<h1>` element, has a viewport-relative value with both a maximum and a minimum threshold. To achieve this we use `clamp(1.8rem, 2.5vw, 2.8rem)`. The viewport-relative value is `2.5vw` but it is clamped between `1.8rem` and `2.8rem`, so:
  * if the calculated value of `2.5vw` is less than `1.8rem`, then `1.8rem` will be used
  * if the calculated value of `2.5vw` is greater than `2.8rem`, then `2.8rem` will be used.


This prevents the heading text from getting too small in a very narrow window, or too big in a very wide window.
#### HTML
    
    <h1>Basic responsive test</h1>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. In orci orci,
      eleifend id risus nec, mattis rutrum velit. Suspendisse fringilla egestas erat
      eu convallis. Phasellus eu velit ut magna dapibus elementum cursus at ligula.
      Ut tempus varius nibh, nec auctor sapien iaculis sit amet. Fusce iaculis,
      libero quis elementum viverra, nulla ante accumsan lectus, sit amet convallis
      lacus ipsum vel est. Curabitur et urna non est consectetur pulvinar vel id
      risus. Ut vestibulum, sem in semper aliquet, felis arcu euismod sapien, ac
      imperdiet massa nisl quis sem. Vestibulum ac elementum felis, in tempor velit.
      Pellentesque purus ex, mattis at ornare quis, porta condimentum mi. Donec
      vestibulum ligula vel nulla blandit, quis euismod nulla vestibulum.
      Suspendisse potenti. Nunc neque mauris, tempor sed facilisis at, ultrices eget
      nulla. Pellentesque convallis ante nec augue porttitor, id tempus ante luctus.
    </p>
    
    <p>
      Integer rutrum sollicitudin tellus, quis cursus nulla scelerisque nec. Nunc eu
      facilisis lorem. Maecenas faucibus sapien eleifend, semper tellus at, pharetra
      quam. Cras feugiat vulputate tortor at rhoncus. Class aptent taciti sociosqu
      ad litora torquent per conubia nostra, per inceptos himenaeos. Nam non felis
      quis sem lobortis sodales vel id libero. Phasellus sit amet placerat lorem.
    </p>
    
#### CSS
    
    html {
      font-family: sans-serif;
    }
    
    body {
      margin: 0 auto;
      width: min(1000px, calc(70% + 100px));
    }
    
    h1 {
      letter-spacing: 2px;
      font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    }
    
    p {
      line-height: 1.5;
      font-size: max(1.2rem, 1.2vw);
    }
    
# font-language-override
The `font-language-override` CSS property controls the use of language-specific glyphs in a typeface.
By default, HTML's `lang` attribute tells browsers to display glyphs designed specifically for that language. For example, a lot of fonts have a special character for the digraph `fi` that merge the dot on the "i" with the "f." However, if the language is set to Turkish the typeface will likely know not to use the merged glyph; Turkish has two versions of the "i," one with a dot (`i`) and one without (`ı`), and using the ligature would incorrectly transform a dotted "i" into a dotless "i."
The `font-language-override` property lets you override the typeface behavior for a specific language. This is useful, for example, when the typeface you're using lacks proper support for the language. For instance, if a typeface doesn't have proper rules for the Azeri language, you can force the font to use Turkish glyphs, which follow similar rules.
## Syntax
    
    /* Keyword value */
    font-language-override: normal;
    
    /* <string> values */
    font-language-override: "ENG"; /* Use English glyphs */
    font-language-override: "TRK"; /* Use Turkish glyphs */
    
    /* Global values */
    font-language-override: inherit;
    font-language-override: initial;
    font-language-override: revert;
    font-language-override: revert-layer;
    font-language-override: unset;
    
The `font-language-override` property is specified as the keyword `normal` or a `<string>`.
### Values
`normal`
    
Tells the browser to use font glyphs that are appropriate for the language specified by the `lang` attribute. This is the default value.
`<string>`
    
Tells the browser to use font glyphs that are appropriate for the language specified by the string. The string must match a language tag found in the OpenType language system. For example, "ENG" is English, and "KOR" is Korean.
## Examples
>
### Using Danish glyphs
#### HTML
    
    <p class="para1">Default language setting.</p>
    <p class="para2">
      This is a string with the <code>font-language-override</code> set to Danish.
    </p>
    
#### CSS
    
    p.para1 {
      font-language-override: normal;
    }
    
    p.para2 {
      font-language-override: "DAN";
    }
    
#### Result
# direction
Warning: Where possible, authors are encouraged to avoid using the `direction` CSS property and use the HTML `dir` global attribute instead.
The `direction` CSS property sets the direction of text, table and grid columns, and horizontal overflow. Use `rtl` for languages written from right to left (like Hebrew or Arabic), and `ltr` for those written from left to right (like English and most other languages).
## Try it
    
    direction: ltr;
    
    
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      padding: 0.75em;
      width: 80%;
      max-height: 300px;
      display: flex;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex: 1;
    }
    
Note that text direction is usually defined within a document (e.g., with HTML's `dir` attribute) rather than through direct use of the `direction` property.
The property sets the base text direction of block-level elements and the direction of embeddings created by the `unicode-bidi` property. It also sets the default alignment of text, block-level elements, and the direction that cells flow within a table or grid row.
Unlike the `dir` attribute in HTML, the `direction` property is not inherited from table columns into table cells, since CSS inheritance follows the document tree, and table cells are inside of rows but not inside of columns.
The `direction` and `unicode-bidi` properties are the only two properties which are not affected by the `all` shorthand property.
## Syntax
    
    /* Keyword values */
    direction: ltr;
    direction: rtl;
    
    /* Global values */
    direction: inherit;
    direction: initial;
    direction: revert;
    direction: revert-layer;
    direction: unset;
    
### Values
`ltr`
    
Text and other elements go from left to right. This is the default value.
`rtl`
    
Text and other elements go from right to left.
For the `direction` property to have any effect on inline-level elements, the `unicode-bidi` property's value must be `embed` or `override`.
## Examples
>
### Setting right-to-left direction
In the example below are two strings of text, both which are displaying using `direction: rtl`. While the Arabic text is displayed correctly with this setting, the English text now has a full stop in an unusual location.
    
    blockquote {
      direction: rtl;
      width: 300px;
    }
    
    
    <blockquote>
      <p>This paragraph is in English but incorrectly goes right to left.</p>
      <p></p>
    </blockquote>
    
    <blockquote>
      <p>هذه الفقرة باللغة العربية ، لذا يجب الانتقال من اليمين إلى اليسار.</p>
      <p></p>
    </blockquote>
    
# caption-side
The `caption-side` CSS property puts the content of a table's `<caption>` on the specified side. The values are relative to the `writing-mode` of the table.
## Try it
    
    caption-side: top;
    
    
    caption-side: bottom;
    
    
    <section class="default-example" id="default-example">
      <table class="transition-all" id="example-element">
        <caption>
          Famous animals
        </caption>
        <tr>
          <th>Name</th>
          <th>Location</th>
        </tr>
        <tr>
          <td>Giraffe</td>
          <td>Africa</td>
        </tr>
        <tr>
          <td>Penguin</td>
          <td>Antarctica</td>
        </tr>
        <tr>
          <td>Sloth</td>
          <td>South America</td>
        </tr>
        <tr>
          <td>Tiger</td>
          <td>Asia</td>
        </tr>
      </table>
    </section>
    
    
    table {
      font-size: 1.2rem;
      text-align: left;
      color: black;
    }
    
    th,
    td {
      padding: 0.2rem 1rem;
    }
    
    caption {
      background: #ffcc33;
      padding: 0.5rem 1rem;
    }
    
    tr {
      background: #eeeeee;
    }
    
    tr:nth-child(even) {
      background: #cccccc;
    }
    
## Syntax
    
    /* Directional values */
    caption-side: top;
    caption-side: bottom;
    
    /* Global values */
    caption-side: inherit;
    caption-side: initial;
    caption-side: revert;
    caption-side: revert-layer;
    caption-side: unset;
    
The `caption-side` property is specified as one of the keyword values listed below.
### Values
`top`
    
The caption box should be positioned at the block start side of the table.
`bottom`
    
The caption box should be positioned at the block end side of the table.
Note: The CSS logical properties and values module defines two logical values, `inline-start` and `inline-end`, to position the caption box at the inline start edge and inline end edge of the table, respectively. These values are not supported in any browsers.
## Examples
>
### Setting captions above and below
#### HTML
    
    <table class="top">
      <caption>
        Caption ABOVE the table
      </caption>
      <tr>
        <td>Some data</td>
        <td>Some more data</td>
      </tr>
    </table>
    
    <br />
    
    <table class="bottom">
      <caption>
        Caption BELOW the table
      </caption>
      <tr>
        <td>Some data</td>
        <td>Some more data</td>
      </tr>
    </table>
    
#### CSS
    
    .top caption {
      caption-side: top;
    }
    
    .bottom caption {
      caption-side: bottom;
    }
    
    table {
      border: 1px solid red;
    }
    
    td {
      border: 1px solid blue;
    }
    
#### Result
# empty-cells
The `empty-cells` CSS property sets whether borders and backgrounds appear around `<table>` cells that have no visible content.
## Try it
    
    empty-cells: show;
    
    
    empty-cells: hide;
    
    
    <section class="default-example" id="default-example">
      <table class="transition-all" id="example-element">
        <tr>
          <th>Client Name</th>
          <th>Age</th>
        </tr>
        <tr>
          <td></td>
          <td>25</td>
        </tr>
        <tr>
          <td>Louise Q.</td>
          <td></td>
        </tr>
        <tr>
          <td>Owen B.</td>
          <td></td>
        </tr>
        <tr>
          <td>Stan L.</td>
          <td>71</td>
        </tr>
      </table>
    </section>
    
    
    th,
    td {
      border: 2px solid #aa1199;
      padding: 0.25rem 0.5rem;
    }
    
This property has an effect only when the `border-collapse` property is `separate`.
## Syntax
    
    /* Keyword values */
    empty-cells: show;
    empty-cells: hide;
    
    /* Global values */
    empty-cells: inherit;
    empty-cells: initial;
    empty-cells: revert;
    empty-cells: revert-layer;
    empty-cells: unset;
    
The `empty-cells` property is specified as one of the keyword values listed below.
### Values
`show`
    
Borders and backgrounds are drawn like in normal cells.
`hide`
    
No borders or backgrounds are drawn.
## Examples
>
### Showing and hiding empty table cells
#### HTML
    
    <table class="table_1">
      <tr>
        <td>Moe</td>
        <td>Larry</td>
      </tr>
      <tr>
        <td>Curly</td>
        <td></td>
      </tr>
    </table>
    <br />
    <table class="table_2">
      <tr>
        <td>Moe</td>
        <td>Larry</td>
      </tr>
      <tr>
        <td>Curly</td>
        <td></td>
      </tr>
    </table>
    
#### CSS
    
    .table_1 {
      empty-cells: show;
    }
    
    .table_2 {
      empty-cells: hide;
    }
    
    td,
    th {
      border: 1px solid gray;
      padding: 0.5rem;
    }
    
#### Result
# <calc-keyword>
The `<calc-keyword>` CSS data type represents well-defined constants such as `e` and `pi`. Rather than require authors to manually type out several digits of these mathematical constants or calculate them, a few of them are provided directly by CSS for convenience.
## Syntax
The `<calc-keyword>` type defines numeric constants that can be used in CSS math functions.
### Values
`e`
    
The base of the natural logarithm, approximately equal to `2.7182818284590452354`.
`pi`
    
The ratio of a circle's circumference to its diameter, approximately equal to `3.1415926535897932`.
`infinity` & `-infinity`
    
An infinite value, used to indicate the largest/smallest possible value.
`NaN`
    
A value representing "Not a Number" canonical casing.
### Notes
Serializing the arguments inside `calc()` follows the IEEE-754 standard for floating point math which means there's a few cases to be aware of regarding constants like `infinity` and `NaN`:
  * Dividing by zero will return positive or negative `infinity` depending on the sign of the numerator.
  * Adding, subtracting or multiplying `infinity` to anything will return `infinity` unless it produces `NaN` (see below).
  * Any operation with at least one `NaN` argument will return `NaN`. This means `0 / 0`, `infinity / infinity`, `0 * infinity`, `infinity + (-infinity)`, and `infinity - infinity` will all return `NaN`.
  * Positive and negative zero are possible values (`0⁺` and `0⁻`). This has the following effects:
    * Multiplication or division that produces zero with exactly one negative argument (`-5 * 0` or `1 / (-infinity)`) or negative result from combinations in the other math functions will return `0⁻`.
    * `0⁻ + 0⁻` or `0⁻ - 0` will return `0⁻`. All other additions or subtractions that would produce a zero will return `0⁺`.
    * Multiplying or dividing `0⁻` with a positive number (including `0⁺`) will return a negative result (either `0⁻` or `-infinity`), while multiplying or dividing `0⁻` with a negative number will return a positive result.


Examples of how these rules apply are shown in the Infinity, NaN, and division by zero section.
Note: It's rare to need to use `infinity` as an argument in `calc()`, but it can be used to avoid hardcoded "magic numbers" or making sure a certain value is always larger than another value. It may be useful if you need to make it obvious that a property has "the largest possible value" for that data type.
## Description
Mathematical constants can only be used inside CSS math functions for calculations. Math constants are not CSS keywords, but if they are used outside of a calculation, they're treated like any other keyword. For example:
  * `animation-name: pi;` refers to an animation named "pi", not the `pi` numeric constant.
  * `line-height: e;` is invalid, but `line-height: calc(e);` is valid.
  * `rotate(1rad * pi);` won't work because `rotate()` is not a math function. Use `rotate(calc(1rad * pi));`


In math functions, `<calc-keyword>` values are evaluated as `<number>` values, therefore `e` and `pi` act as numeric constants.
Both `infinity` and `NaN` are slightly different, they are considered as degenerate numeric constants. While not technically numbers, they act as `<number>` values, so to get an infinite `<length>`, for example, requires an expression like `calc(infinity * 1px)`.
The `infinity` and `NaN` values are included mostly to make serialization simpler and more obvious, but can be used to indicate a "largest possible value", since an infinite value is clamped to the allowed range. It's rare for this to be reasonable, but when using infinity its much simpler than just putting an enormous number in a stylesheet or hardcoding magic numbers.
All constants are case-insensitive except for `NaN`, which makes `calc(Pi)`, `calc(E)` and `calc(InFiNiTy)` valid:
    
    e
    -e
    E
    pi
    -pi
    Pi
    infinity
    -infinity
    InFiNiTy
    NaN
    
The following are all invalid:
    
    nan
    Nan
    NAN
    
## Examples
>
### Using e and pi in `calc()`
The following example shows how to use `e` inside `calc()` to rotate an element with an exponentially-increasing angle. The second box shows how to use `pi` inside a `sin()` function.
    
    <div id="wrapper">
      <div class="container">
        <div id="e"></div>
        <input type="range" min="0" max="7" step="0.01" value="0" id="e-slider" />
        <label for="e-slider">e:</label>
        <span id="e-value"></span>
      </div>
      <div class="container">
        <div id="pi"></div>
        <input type="range" min="0" max="1" step="0.01" value="0" id="pi-slider" />
        <label for="pi-slider">pi:</label>
        <span id="pi-value"></span>
      </div>
    </div>
    
    
    // sliders
    const eInput = document.querySelector("#e-slider");
    const piInput = document.querySelector("#pi-slider");
    // spans for displaying values
    const eValue = document.querySelector("#e-value");
    const piValue = document.querySelector("#pi-value");
    
    eInput.addEventListener("input", function () {
      e.style.transform = `rotate(calc(1deg * pow(${this.value}, e)))`;
      eValue.textContent = e.style.transform;
    });
    
    piInput.addEventListener("input", function () {
      pi.style.rotate = `calc(sin(${this.value} * pi) * 100deg)`;
      piValue.textContent = pi.style.rotate;
    });
    
### Infinity, NaN, and division by zero
The following example shows the computed value of the `width` property when dividing by zero, followed by how serialization with different `calc()` constants look when viewed in the console:
    
    <div></div>
    
    
    div {
      height: 50px;
      background-color: red;
      width: calc(1px / 0);
    }
    
    
    const div = document.querySelector("div");
    console.log(div.offsetWidth); // 17895698 (infinity clamped to largest value for width)
    
    function logSerializedWidth(value) {
      div.style.width = value;
      console.log(div.style.width);
    }
    
    logSerializedWidth("calc(1px / 0)"); // calc(infinity * 1px)
    logSerializedWidth("calc(1px / -0)"); // calc(-infinity * 1px)
    
    logSerializedWidth("calc(1px * -infinity * -infinity)"); // calc(infinity * 1px)
    logSerializedWidth("calc(1px * -infinity * infinity)"); // calc(-infinity * 1px)
    
    logSerializedWidth("calc(1px * (NaN + 1))"); // calc(NaN * 1px)
    
# :blank
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
Note: The `:blank` selector is considered at risk, as the CSSWG keeps changing it.
See CSSWG issue #1967.
The `:blank` CSS pseudo-class selects empty user input elements (e.g., `<input>` or `<textarea>`).
## Syntax
    
    :blank {
      /* ... */
    }
    
## Examples
>
### Basic :blank example
In eventual supporting browsers, the `:blank` pseudo-class will enable developers to highlight in some way input controls that are not required, but still have no content filled in, perhaps as a reminder to users.
#### HTML
    
    <textarea></textarea>
    
#### CSS
    
    textarea:blank {
      border: 3px solid red;
    }
    
#### Result
Currently, no browsers support this feature.
# x
The `x` CSS property defines the x-axis coordinate of the top left corner of the SVG `<rect>` shape, `<image>` image, `<foreignObject>` viewport or nested `<svg>` viewport relative to the nearest `<svg>` ancestor's user coordinate system. If present, it overrides the element's `x` attribute.
Note: The `x` property only applies to `<rect>`, `<image>`, `<foreignObject>`, and `<svg>` elements nested in an `<svg>`. It has no effect on the outermost `<svg>` elements itself, and does not apply to other SVG elements nor to HTML elements or pseudo-elements.
## Syntax
    
    /* length and percentage values */
    x: 40px;
    x: 40%;
    
    /* Global values */
    x: inherit;
    x: initial;
    x: revert;
    x: revert-layer;
    x: unset;
    
### Values
The `<length>` and `<percentage>` values denote the x-axis coordinate position of the top left corner of the SVG element container.
`<length>`
    
As an absolute or relative length, it can be expressed in any unit allowed by the CSS `<length>` data type.
`<percentage>`
    
Percentages refer to the width of the SVG `viewBox`, if declared, otherwise, the percentage refers to the width of the current SVG viewport.
## Examples
>
### Defining the x-axis coordinates of SVG shapes
This example demonstrates the basic use case of `x`, and how the CSS `x` property takes precedence over the `x` attribute.
#### HTML
We include four identical SVG `<rect>` elements; their `x` and `y` attributes values are all `10`, meaning the four rectangles are all in the same location, `10px` from the top and left corner of the SVG viewport.
    
    <svg xmlns="http://www.w3.org/2000/svg">
      <rect width="100" height="100" x="10" y="10" />
      <rect width="100" height="100" x="10" y="10" />
      <rect width="100" height="100" x="10" y="10" />
      <rect width="100" height="100" x="10" y="10" />
    </svg>
    
#### CSS
We style all the rectangles to have a black border and be slightly transparent, so overlapping rectangles are visible. We provide each rectangle with different fill and `x` values.
    
    svg {
      border: 1px solid;
      width: 300px;
    }
    
    rect {
      fill: none;
      stroke: black;
      opacity: 0.8;
    }
    
    rect:nth-of-type(2) {
      x: 3em;
      fill: red;
    }
    
    rect:nth-of-type(3) {
      x: 180px;
      fill: yellow;
    }
    
    rect:nth-of-type(4) {
      x: 50%;
      fill: orange;
    }
    
#### Results
The left edges of the rectangles are at `10` (from the attribute), `3em`, `180px`, and `50%`, respectively. The SVG is `300px` wide, so the last rectangle's left side is at the `150px` mark.
# :left
The `:left` CSS pseudo-class, used with the `@page` at-rule, represents all left-hand pages of a printed document.
    
    /* Selects any left-hand pages when printing */
    @page :left {
      margin: 2in 3in;
    }
    
Whether a given page is "left" or "right" is determined by the major writing direction of the document. For example, if the first page has a major writing direction of left-to-right then it will be a `:right` page; if it has a major writing direction of right-to-left then it will be a `:left` page.
Note: This pseudo-class can be used to change only the `margin`, `padding`, `border`, and `background` properties of the page box. All other properties will be ignored, and only the page box, not the document content on the page, will be affected.
## Syntax
    
    :left {
      /* ... */
    }
    
## Examples
>
### Setting a margin for left-hand pages
    
    @page :left {
      margin: 2in 3in;
    }
    
# ::highlight()
The `::highlight()` CSS pseudo-element applies styles to a custom highlight.
A custom highlight is a collection of `Range` objects and is registered on a webpage using the `HighlightRegistry`.
The `::highlight()` pseudo-element follows a special inheritance model common to all highlight pseudo-elements. For more details on how this inheritance works, see the Highlight pseudo-elements inheritance section.
## Allowable properties
Only certain CSS properties can be used with `::highlight()`:
  * `color`
  * `background-color`
  * `text-decoration` and its associated properties
  * `text-shadow`
  * `-webkit-text-stroke-color`, `-webkit-text-fill-color` and `-webkit-text-stroke-width`


In particular, `background-image` is ignored.
## Syntax
    
    ::highlight(custom-highlight-name)
    
## Examples
>
### Highlighting characters
#### HTML
    
    <p id="rainbow-text">CSS Custom Highlight API rainbow</p>
    
#### CSS
    
    #rainbow-text {
      font-family: monospace;
      font-size: 1.5rem;
    }
    
    ::highlight(rainbow-color-1) {
      color: violet;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-2) {
      color: purple;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-3) {
      color: blue;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-4) {
      color: green;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-5) {
      color: yellow;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-6) {
      color: orange;
      text-decoration: underline;
    }
    ::highlight(rainbow-color-7) {
      color: red;
      text-decoration: underline;
    }
    
#### JavaScript
    
    const textNode = document.getElementById("rainbow-text").firstChild;
    
    if (!CSS.highlights) {
      textNode.textContent =
        "The CSS Custom Highlight API is not supported in this browser!";
    }
    
    // Create and register highlights for each color in the rainbow.
    const highlights = [];
    for (let i = 0; i < 7; i++) {
      // Create a new highlight for this color.
      const colorHighlight = new Highlight();
      highlights.push(colorHighlight);
    
      // Register this highlight under a custom name.
      CSS.highlights.set(`rainbow-color-${i + 1}`, colorHighlight);
    }
    
    // Iterate over the text, character by character.
    for (let i = 0; i < textNode.textContent.length; i++) {
      // Create a new range just for this character.
      const range = new Range();
      range.setStart(textNode, i);
      range.setEnd(textNode, i + 1);
    
      // Add the range to the next available highlight,
      // looping back to the first one once we've reached the 7th.
      highlights[i % 7].add(range);
    }
    
#### Result
# writing-mode
The `writing-mode` CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents).
## Try it
    
    writing-mode: horizontal-tb;
    
    
    writing-mode: vertical-lr;
    
    
    writing-mode: vertical-rl;
    
    
    writing-mode: sideways-rl;
    
    
    writing-mode: sideways-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      padding: 0.75em;
      width: 80%;
      max-height: 300px;
      display: flex;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
      margin: 10px;
      flex: 1;
    }
    
This property specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. Thus, it also determines the ordering of block-level content.
## Syntax
    
    /* Keyword values */
    writing-mode: horizontal-tb;
    writing-mode: vertical-rl;
    writing-mode: vertical-lr;
    writing-mode: sideways-rl;
    writing-mode: sideways-lr;
    
    /* Global values */
    writing-mode: inherit;
    writing-mode: initial;
    writing-mode: revert;
    writing-mode: revert-layer;
    writing-mode: unset;
    
The `writing-mode` property is specified as one of the values listed below. The flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (`ltr`, like English and most other languages) or right-to-left (`rtl`, like Hebrew or Arabic).
### Values
`horizontal-tb`
    
For `ltr` scripts, content flows horizontally from left to right. For `rtl` scripts, content flows horizontally from right to left. The next horizontal line is positioned below the previous line.
`vertical-rl`
    
For `ltr` scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the left of the previous line. For `rtl` scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the right of the previous line.
`vertical-lr`
    
For `ltr` scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the right of the previous line. For `rtl` scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the left of the previous line.
`sideways-rl`
    
For `ltr` scripts, content flows vertically from top to bottom. For `rtl` scripts, content flows vertically from bottom to top. All the glyphs, even those in vertical scripts, are set sideways toward the right.
`sideways-lr`
    
For `ltr` scripts, content flows vertically from bottom to top. For `rtl` scripts, content flows vertically from top to bottom. All the glyphs, even those in vertical scripts, are set sideways toward the left.
`lr`
    
Deprecated except for SVG1 documents. For CSS, use `horizontal-tb` instead.
`lr-tb`
    
Deprecated except for SVG1 documents. For CSS, use `horizontal-tb` instead.
`rl`
    
Deprecated except for SVG1 documents. For CSS, use `horizontal-tb` instead.
`tb`
    
Deprecated except for SVG1 documents. For CSS, use `vertical-lr` instead.
`tb-lr` Deprecated
    
Deprecated except for SVG1 documents. For CSS, use `vertical-lr` instead.
`tb-rl`
    
Deprecated except for SVG1 documents. For CSS, use `vertical-rl` instead.
## Examples
>
### Using multiple writing modes
This example demonstrates all of the writing modes, showing each with text in various languages.
#### HTML
The HTML is a `<table>` with each writing mode in a row with a column showing text in various scripts using that writing mode.
    
    <table>
      <caption>
        Using multiple writing modes
      </caption>
      <tr>
        <th>Value</th>
        <th>Vertical script</th>
        <th>Horizontal (LTR) script</th>
        <th>Horizontal (RTL) script</th>
        <th>Mixed script</th>
      </tr>
      <tr class="text1">
        <th>horizontal-tb</th>
        <td>我家没有电脑。</td>
        <td>Example text</td>
        <td>מלל ארוך לדוגמא</td>
        <td>1994年に至っては</td>
      </tr>
      <tr class="text2">
        <th>vertical-lr</th>
        <td>我家没有电脑。</td>
        <td>Example text</td>
        <td>מלל ארוך לדוגמא</td>
        <td>1994年に至っては</td>
      </tr>
      <tr class="text3">
        <th>vertical-rl</th>
        <td>我家没有电脑。</td>
        <td>Example text</td>
        <td>מלל ארוך לדוגמא</td>
        <td>1994年に至っては</td>
      </tr>
      <tr class="experimental text4">
        <th>sideways-lr</th>
        <td>我家没有电脑。</td>
        <td>Example text</td>
        <td>מלל ארוך לדוגמא</td>
        <td>1994年に至っては</td>
      </tr>
      <tr class="experimental text5">
        <th>sideways-rl</th>
        <td>我家没有电脑。</td>
        <td>Example text</td>
        <td>מלל ארוך לדוגמא</td>
        <td>1994年に至っては</td>
      </tr>
    </table>
    <p class="notice">
      Your browser does not support the <code>sideways-lr</code> or
      <code>sideways-rl</code> values.
    </p>
    
#### CSS
The CSS that adjusts the directionality of the content looks like this:
    
    .text1 td {
      writing-mode: horizontal-tb;
    }
    
    .text2 td {
      writing-mode: vertical-lr;
    }
    
    .text3 td {
      writing-mode: vertical-rl;
    }
    
    .text4 td {
      writing-mode: sideways-lr;
    }
    
    .text5 td {
      writing-mode: sideways-rl;
    }
    
#### Result
### Using writing-mode with transforms
If your browser doesn't support `sideways-lr`, a workaround is to use `transform` to achieve a similar effect depending on the script direction. The effect of `vertical-rl` is the same as with `sideways-lr`, so no transformation is required for left-to-right scripts. In some cases, rotating the text 180 degrees is sufficient to achieve the effect of `sideways-lr`, but font glyphs may not be designed to be rotated, so this may produce unexpected positioning or rendering.
#### HTML
    
    <table>
      <caption>
        Using writing-mode with transforms
      </caption>
      <thead>
        <tr>
          <th>Vertical LR</th>
          <th>Vertical LR with transform</th>
          <th>Sideways LR</th>
          <th>Only rotate</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>
            <span class="vertical-lr">我家没有电脑。</span>
            <span class="vertical-lr">Example text</span>
          </td>
          <td>
            <span class="vertical-lr rotated">我家没有电脑。</span>
            <span class="vertical-lr rotated">Example text</span>
          </td>
          <td>
            <span class="sideways-lr">我家没有电脑。</span>
            <span class="sideways-lr">Example text</span>
          </td>
          <td>
            <span class="only-rotate">我家没有电脑。</span>
            <span class="only-rotate">Example text</span>
          </td>
        </tr>
      </tbody>
    </table>
    
#### CSS
    
    .vertical-lr {
      writing-mode: vertical-lr;
    }
    
    .rotated {
      transform: rotate(180deg);
    }
    
    .sideways-lr {
      writing-mode: sideways-lr;
    }
    
    .only-rotate {
      inline-size: fit-content;
      transform: rotate(-90deg);
    }
    
#### Result
# object-fit
The `object-fit` CSS property sets how the content of a replaced element, such as an `<img>` or `<video>`, should be resized to fit its container.
Note: The `object-fit` property has no effect on `<iframe>`, `<embed>`, and `<fencedframe>` elements.
You can alter the alignment of the replaced element's content object within the element's box using the `object-position` property.
## Try it
    
    object-fit: fill;
    
    
    object-fit: contain;
    
    
    object-fit: cover;
    
    
    object-fit: none;
    
    
    object-fit: scale-down;
    
    
    <section id="default-example">
      <img
        class="transition-all"
        id="example-element"
        src="/shared-assets/images/examples/plumeria-146x200.jpg" />
    </section>
    
    
    #example-element {
      height: 100%;
      width: 100%;
      border: 2px dotted #888888;
    }
    
## Syntax
    
    object-fit: contain;
    object-fit: cover;
    object-fit: fill;
    object-fit: none;
    object-fit: scale-down;
    
    /* Global values */
    object-fit: inherit;
    object-fit: initial;
    object-fit: revert;
    object-fit: revert-layer;
    object-fit: unset;
    
The `object-fit` property is specified as a single keyword chosen from the list of values below.
### Values
`contain`
    
The replaced content is scaled to maintain its aspect ratio while fitting within the element's content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" or "pillarboxed" if its aspect ratio does not match the aspect ratio of the box.
`cover`
    
The replaced content is sized to maintain its aspect ratio while filling the element's entire content box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
`fill`
    
The replaced content is sized to fill the element's content box. The entire object will completely fill the box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit.
`none`
    
The replaced content is not resized.
`scale-down`
    
The content is sized as if `none` or `contain` were specified, whichever would result in a smaller concrete object size.
## Examples
>
### Setting object-fit for an image
#### HTML
    
    <section>
      <h2>object-fit: fill</h2>
      <img class="fill" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <img class="fill narrow" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <h2>object-fit: contain</h2>
      <img class="contain" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <img class="contain narrow" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <h2>object-fit: cover</h2>
      <img class="cover" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <img class="cover narrow" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <h2>object-fit: none</h2>
      <img class="none" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <img class="none narrow" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <h2>object-fit: scale-down</h2>
      <img class="scale-down" src="mdn_logo_only_color.png" alt="MDN Logo" />
    
      <img class="scale-down narrow" src="mdn_logo_only_color.png" alt="MDN Logo" />
    </section>
    
#### CSS
    
    h2 {
      font-family:
        Courier New,
        monospace;
      font-size: 1em;
      margin: 1em 0 0.3em;
    }
    
    img {
      width: 150px;
      height: 100px;
      border: 1px solid black;
      margin: 10px 0;
    }
    
    .narrow {
      width: 100px;
      height: 150px;
    }
    
    .fill {
      object-fit: fill;
    }
    
    .contain {
      object-fit: contain;
    }
    
    .cover {
      object-fit: cover;
    }
    
    .none {
      object-fit: none;
    }
    
    .scale-down {
      object-fit: scale-down;
    }
    
#### Result
# ruby-position
The `ruby-position` CSS property defines the position of a ruby element relative to its base element. It can be positioned over the element (`over`), under it (`under`), or between the characters on their right side (`inter-character`).
## Try it
    
    ruby-position: over;
    
    
    ruby-position: under;
    
    
    <section id="default-example">
      <ruby id="example-element"> 明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp> </ruby>
    </section>
    
    
    #example-element {
      font-size: 2em;
    }
    
## Syntax
    
    /* Keyword values */
    ruby-position: over;
    ruby-position: under;
    ruby-position: alternate;
    ruby-position: alternate over;
    ruby-position: alternate under;
    ruby-position: inter-character;
    
    /* Global values */
    ruby-position: inherit;
    ruby-position: initial;
    ruby-position: revert;
    ruby-position: revert-layer;
    ruby-position: unset;
    
### Values
`over`
    
Is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts.
`under`
    
Is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts.
`alternate`
    
Is a keyword indicating that the ruby alternates between over and under, when there are multiple levels of annotation.
`inter-character`
    
When specified, it behaves as `over` in vertical writing modes. Otherwise, it indicates that the ruby has to be placed between the different characters, appearing on the right of the base in horizontal text and forcing the children of the ruby annotation container to have a `vertical-rl` writing mode.
## Examples
>
### Ruby positioned over the text
#### HTML
    
    <ruby>
      <rb>超電磁砲</rb>
      <rp>（</rp><rt>レールガン</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-position: over;
    }
    
#### Result
### Ruby positioned under the text
#### HTML
    
    <ruby>
      <rb>超電磁砲</rb>
      <rp>（</rp><rt>レールガン</rt><rp>）</rp>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-position: under;
    }
    
#### Result
### Ruby alternate
#### HTML
    
    <ruby>
      <rb>A</rb><rb>B</rb><rb>C</rb>
      <rtc>Above</rtc>
      <rtc>Below</rtc>
    </ruby>
    
#### CSS
    
    ruby {
      ruby-position: alternate; /* this is also the initial value */
    }
    
#### Result
# -webkit-tap-highlight-color
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
`-webkit-tap-highlight-color` is a non-standard CSS property that sets the color of the highlight that appears over a link while it's being tapped. The highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on.
## Syntax
    
    -webkit-tap-highlight-color: red;
    -webkit-tap-highlight-color: transparent; /* for removing the highlight */
    
    /* Global values */
    -webkit-tap-highlight-color: inherit;
    -webkit-tap-highlight-color: initial;
    -webkit-tap-highlight-color: revert;
    -webkit-tap-highlight-color: revert-layer;
    -webkit-tap-highlight-color: unset;
    
### Values
A `<color>`.
Not part of any standard. Apple has a description in the Safari Web Content Guide.
# @keyframes
The `@keyframes` CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. This gives more control over the intermediate steps of the animation sequence than transitions.
## Syntax
    
    @keyframes slide-in {
      from {
        transform: translateX(0%);
      }
    
      to {
        transform: translateX(100%);
      }
    }
    
### Values
`<custom-ident>`
    
A name identifying the keyframe list. This must match the identifier production in CSS syntax.
`from`
    
A starting offset of `0%`.
`to`
    
An ending offset of `100%`.
`<percentage>`
    
A percentage of the time through the animation sequence at which the specified keyframe should occur.
`<timeline-range-name>` `<percentage>`
    
A percentage of the time through the specified `animation-range` at which the specified keyframe should occur. See CSS scroll-driven animations for more information on the kinds of animations that use named timeline ranges.
## Description
To use keyframes, create a `@keyframes` rule with a name that is then used by the `animation-name` property to match an animation to its keyframe declaration. Each `@keyframes` rule contains a style list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a block containing the styles for that keyframe.
You can list the keyframe percentages in any order; they will be handled in the order they should occur.
JavaScript can access the `@keyframes` at-rule with the CSS object model interface `CSSKeyframesRule`.
### Valid keyframe lists
If a keyframe rule doesn't specify the start or end states of the animation (that is, `0%`/`from` and `100%`/`to`), browsers will use the element's existing styles for the start/end states. This can be used to animate an element from its initial state and back.
Properties that can't be animated in keyframe rules are ignored, but supported properties will still be animated.
### Resolving duplicates
If multiple keyframe sets exist for a given name, the last one encountered by the parser is used. `@keyframes` rules don't cascade, so animations never derive keyframes from more than one rule set.
If a given animation time offset is duplicated, all keyframes in the `@keyframes` rule for that percentage are used for that frame. There is cascading within a `@keyframes` rule if multiple keyframes specify the same percentage values.
### When properties are left out of some keyframes
Properties that aren't specified in every keyframe are interpolated if possible — properties that can't be interpolated are dropped from the animation. For example:
    
    @keyframes identifier {
      0% {
        top: 0;
        left: 0;
      }
      30% {
        top: 50px;
      }
      68%,
      72% {
        left: 50px;
      }
      100% {
        top: 100px;
        left: 100%;
      }
    }
    
Here, the `top` property animates using the `0%`, `30%`, and `100%` keyframes, and `left` animates using the `0%`, `68%`, `72%` and `100%` keyframes.
### When a keyframe is defined multiple times
If a keyframe is defined multiple times but not all affected properties are in each keyframe, all values specified in these keyframes are considered. For example:
    
    @keyframes identifier {
      0% {
        top: 0;
      }
      50% {
        top: 30px;
        left: 20px;
      }
      50% {
        top: 10px;
      }
      100% {
        top: 0;
      }
    }
    
In this example, at the `50%` keyframe, the values used are `top: 10px` and `left: 20px`.
Cascading keyframes are supported starting in Firefox 14.
###  `!important` in a keyframe
Declarations in a keyframe qualified with `!important` are ignored.
    
    @keyframes important1 {
      0% {
        margin-top: 50px;
      }
      50% {
        margin-top: 150px !important; /* ignored */
      }
      100% {
        margin-top: 100px;
      }
    }
    
    @keyframes important2 {
      from {
        margin-top: 50px;
        margin-bottom: 100px;
      }
      to {
        margin-top: 150px !important; /* ignored */
        margin-bottom: 50px;
      }
    }
    
## Examples
>
### CSS animation examples
See Using CSS animations and Animate elements on scroll with Scroll-driven animations for examples.
# view-timeline-name
The `view-timeline-name` CSS property is used to define the name of a named view progress timeline, which is progressed through based on the change in visibility of an element (known as the subject) inside a scrollable element (scroller). `view-timeline` is set on the subject.
The visibility of the subject inside the scroller is tracked — by default, the timeline is at 0% when the subject is first visible at one edge of the scroller and 100% when it reaches the opposite edge. The name is then referenced in an `animation-timeline` declaration to indicate the element that will be animated as the timeline progresses. This can be the subject element, but it doesn't have to be — you can animate a different element as the subject moves through the scrolling area.
Note: If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.
The `view-timeline-name`, `view-timeline-axis` and `view-timeline-inset` properties can also be set using the `view-timeline` shorthand property.
## Syntax
    
    view-timeline-name: none;
    view-timeline-name: --custom_name_for_timeline;
    
### Values
Allowed values for `view-timeline-name` are:
`none`
    
The timeline has no name.
`<dashed-ident>`
    
An arbitrary custom identifier defining a name for a view progress timeline, which can then be referenced in an `animation-timeline` property.
Note: `<dashed-ident>` values must start with `--`, which helps avoid name clashes with standard CSS keywords.
## Examples
>
### Creating a named view progress timeline
A view progress timeline named `--subject-reveal` is defined using the `view-timeline-name` property on a subject element with a `class` of `animation`. This is then set as the timeline for the same element using `animation-timeline: --subject-reveal;`. The result is that the subject element animates as it moves upwards through the document as it is scrolled.
#### HTML
The HTML for the example is shown below.
    
    <div class="content">
      <h1>Content</h1>
    
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Risus quis varius quam
        quisque id. Et ligula ullamcorper malesuada proin libero nunc consequat
        interdum varius. Elit ullamcorper dignissim cras tincidunt lobortis feugiat
        vivamus at augue.
      </p>
    
      <p>
        Dolor sed viverra ipsum nunc aliquet. Sed sed risus pretium quam vulputate
        dignissim. Tortor aliquam nulla facilisi cras. A erat nam at lectus urna
        duis convallis convallis. Nibh ipsum consequat nisl vel pretium lectus.
        Sagittis aliquam malesuada bibendum arcu vitae elementum. Malesuada bibendum
        arcu vitae elementum curabitur vitae nunc sed velit.
      </p>
    
      <div class="subject animation"></div>
    
      <p>
        Adipiscing enim eu turpis egestas pretium aenean pharetra magna ac. Arcu
        cursus vitae congue mauris rhoncus aenean vel. Sit amet cursus sit amet
        dictum. Augue neque gravida in fermentum et. Gravida rutrum quisque non
        tellus orci ac auctor augue mauris. Risus quis varius quam quisque id diam
        vel quam elementum. Nibh praesent tristique magna sit amet purus gravida
        quis. Duis ultricies lacus sed turpis tincidunt id aliquet. In egestas erat
        imperdiet sed euismod nisi. Eget egestas purus viverra accumsan in nisl nisi
        scelerisque. Netus et malesuada fames ac.
      </p>
    </div>
    
#### CSS
The `subject` element and its containing `content` element are styled minimally, and the text content is given some basic font settings:
    
    .subject {
      width: 300px;
      height: 200px;
      margin: 0 auto;
      background-color: deeppink;
    }
    
    .content {
      width: 75%;
      max-width: 800px;
      margin: 0 auto;
    }
    
    p,
    h1 {
      font-family: Arial, Helvetica, sans-serif;
    }
    
    h1 {
      font-size: 3rem;
    }
    
    p {
      font-size: 1.5rem;
      line-height: 1.5;
    }
    
The `<div>` with the class of `subject` is also given a class of `animation` — this is where `view-timeline-name` is set to define a named view progress timeline. It is also given an `animation-timeline` name with the same value to declare that this will be the element animated as the view progress timeline is progressed.
Last, an animation is specified on the element that animates its opacity and scale, causing it to fade in and size up as it moves up the scroller.
    
    .animation {
      view-timeline-name: --subject-reveal;
      animation-timeline: --subject-reveal;
    
      animation-name: appear;
      animation-fill-mode: both;
      animation-duration: 1ms; /* Firefox requires this to apply the animation */
    }
    
    @keyframes appear {
      from {
        opacity: 0;
        transform: scaleX(0);
      }
    
      to {
        opacity: 1;
        transform: scaleX(1);
      }
    }
    
#### Result
Scroll to see the subject element being animated.
# CSS custom highlight API
The CSS custom highlight API module provides a programmatic way to target specific ranges of text defined by range objects, without affecting the underlying DOM structure. The range objects can then be selected via `::highlight()` pseudo-elements, and have highlight styles added and removed. The features of this module can create highlight effects similar to how text editors highlight spelling or grammar errors, and code editors highlight syntax errors.
The CSS Custom Highlight API extends the concept of other highlight pseudo-elements such as `::selection`, `::spelling-error`, `::grammar-error`, and `::target-text` by providing a way to create arbitrary text ranges (defined as `Range` objects in JavaScript) and style them via CSS, rather than being limited to browser-defined ranges.
## Custom highlight API in action
To enable styling text ranges on a webpage using the CSS Custom Highlight API, you create a `Range` object, then a `Highlight` object for the range. After registering the highlight using the `HighlightRegistry.set()` method, you can then select the range using the `::highlight()` pseudo-element. The name defined in the `set()` method is used as the parameter of the `::highlight()` pseudo-element selector to select that range.The range selected by the `::highlight()` pseudo-element can be styled using a limited number of properties.
This example uses the `text-decoration` property to strike through the `steps` highlight range defined by our JavaScript:
    
    ::highlight(steps) {
      text-decoration: line-through;
      color: blue;
    }
    
We create a `Range` with a start and end node (which is the same node in this case). We then set this range as the `Highlight` using the `set()` method of the CSS `HighlightRegistry` interface.
    
    const rangeToHighlight = new Range();
    const list = document.querySelector("ol");
    rangeToHighlight.setStart(list, 0);
    rangeToHighlight.setEnd(list, 0);
    
    CSS.highlights.set("steps", new Highlight(rangeToHighlight));
    
An event listener updates the end of the highlighted range when the number of completed steps changes:
    
    const currentPositionSlider = document.querySelector("input");
    currentPositionSlider.addEventListener("change", (e) => {
      rangeToHighlight.setEnd(list, e.target.value);
    });
    
## Reference
>
### Pseudo-elements
  * `::highlight()`


### Interfaces
  * `Highlight`
  * `HighlightRegistry`


### Interface extensions
This module adds properties and methods to interfaces defined in other specifications.
  * `CSS`
    * `CSS.highlights`


## Guides
CSS custom highlight API
    
The concepts and usage of the CSS custom highlight API, including creating `Range` and `Highlight` objects, registering the highlights using the `HighlightRegistry`, and styling the highlights using the `::highlight()` pseudo-element.
## Related concepts
  * `::grammar-error`
  * `::selection`
  * `::spelling-error`
  * `::target-text`
  * `Range` Interface and `Range()` constructor
  * Text fragments
  * `FragmentDirective` Interface


# color
The `color` CSS property sets the foreground color value of an element's text and text decorations, and sets the `currentColor` value. `currentColor` may be used as an indirect value on other properties and is the default for other color properties, such as `border-color`.
## Try it
    
    color: rebeccapurple;
    
    
    color: #00a400;
    
    
    color: rgb(214 122 127);
    
    
    color: hsl(30deg 82% 43%);
    
    
    color: hsl(237deg 74% 33% / 61%);
    
    
    color: hwb(152deg 0% 58% / 70%);
    
    
    <section id="default-example">
      <div class="example-container">
        <p id="example-element">
          London. Michaelmas term lately over, and the Lord Chancellor sitting in
          Lincoln's Inn Hall. Implacable November weather.
        </p>
      </div>
    </section>
    
    
    #example-element {
      font-size: 1.5em;
    }
    
    .example-container {
      background-color: white;
      padding: 10px;
    }
    
For an overview of using color in HTML, see Applying color to HTML elements using CSS.
## Syntax
    
    /* Keyword values */
    color: currentColor;
    
    /* <named-color> values */
    color: red;
    color: orange;
    color: tan;
    color: rebeccapurple;
    
    /* <hex-color> values */
    color: #090;
    color: #009900;
    color: #090a;
    color: #009900aa;
    
    /* <rgb()> values and legacy <rgba()> values*/
    color: rgb(34, 12, 64);
    color: rgb(34, 12, 64, 0.6);
    color: rgba(34, 12, 64, 0.6);
    color: rgb(34 12 64 / 0.6);
    color: rgba(34 12 64 / 0.6);
    color: rgb(34.6 12 64 / 60%);
    color: rgba(34.6 12 64 / 60%);
    
    /* <hsl()> values and legacy <hsla()> values */
    color: hsl(30, 100%, 50%);
    color: hsl(30, 100%, 50%, 0.6);
    color: hsla(30, 100%, 50%, 0.6);
    color: hsl(30 100% 50% / 0.6);
    color: hsla(30 100% 50% / 0.6);
    color: hsl(30.2 100% 50% / 60%);
    color: hsla(30.2 100% 50% / 60%);
    
    /* <hwb()> values */
    color: hwb(90 10% 10%);
    color: hwb(90 10% 10% / 0.5);
    color: hwb(90deg 10% 10%);
    color: hwb(1.5708rad 60% 0%);
    color: hwb(0.25turn 0% 40% / 50%);
    
    /* Global values */
    color: inherit;
    color: initial;
    color: revert;
    color: revert-layer;
    color: unset;
    
The `color` property is specified as a single `<color>` value.
Note that the value must be a uniform color. It can't be a `<gradient>`, which is actually a type of `<image>`.
### Values
`<color>`
    
Sets the color of the textual and decorative parts of the element.
`currentColor`
    
Sets the color to the element's `color` property value. However, if set as the value of `color`, `currentColor` is treated as `inherit`.
## Accessibility
It is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page.
Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.
  * WebAIM: Color Contrast Checker
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0


## Examples
>
### Making text red
The following are all ways to make a paragraph's text red:
    
    p {
      color: red;
    }
    p {
      color: #f00;
    }
    p {
      color: #ff0000;
    }
    p {
      color: rgb(255 0 0);
    }
    p {
      color: rgb(100% 0% 0%);
    }
    p {
      color: hsl(0 100% 50%);
    }
    
    /* 50% translucent */
    p {
      color: #ff000080;
    }
    p {
      color: rgb(255 0 0 / 50%);
    }
    p {
      color: hsl(0 100% 50% / 50%);
    }
    
# box-shadow
The `box-shadow` CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.
## Try it
    
    box-shadow: 10px 5px 5px red;
    
    
    box-shadow: 60px -16px teal;
    
    
    box-shadow: 12px 12px 2px 1px rgb(0 0 255 / 0.2);
    
    
    box-shadow: inset 5em 1em gold;
    
    
    box-shadow:
      3px 3px red,
      -1em 0 0.4em olive;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <p>This is a box with a box-shadow around it.</p>
      </div>
    </section>
    
    
    #example-element {
      margin: 20px auto;
      padding: 0;
      border: 2px solid #333333;
      width: 80%;
      text-align: center;
    }
    
The `box-shadow` property enables you to cast a drop shadow from the frame of almost any element. If a `border-radius` is specified on the element with a box shadow, the box shadow takes on the same rounded corners. The z-ordering of multiple box shadows is the same as multiple text shadows (the first specified shadow is on top).
Box-shadow generator is an interactive tool allowing you to generate a `box-shadow`.
## Syntax
    
    /* Keyword values */
    box-shadow: none;
    
    /* A color and two length values */
    /* <color> | <length> | <length> */
    box-shadow: red 60px -16px;
    
    /* Three length values and a color */
    /* <length> | <length> | <length> | <color> */
    box-shadow: 10px 5px 5px black;
    
    /* Four length values and a color */
    /* <length> | <length> | <length> | <length> | <color> */
    box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
    
    /* inset, length values, and a color */
    /* <inset> | <length> | <length> | <color> */
    box-shadow: inset 5em 1em gold;
    
    /* Any number of shadows, separated by commas */
    box-shadow:
      3px 3px red inset,
      -1em 0 0.4em olive;
    
    /* Global values */
    box-shadow: inherit;
    box-shadow: initial;
    box-shadow: revert;
    box-shadow: revert-layer;
    box-shadow: unset;
    
Specify a single box-shadow using:
  * Two, three, or four `<length>` values.
    * If only two values are given, they are interpreted as `<offset-x>` and `<offset-y>` values.
    * If a third value is given, it is interpreted as a `<blur-radius>`.
    * If a fourth value is given, it is interpreted as a `<spread-radius>`.
  * Optionally, the `inset` keyword.
  * Optionally, a `<color>` value.


To specify multiple shadows, provide a comma-separated list of shadows.
### Values
`<color>` Optional
    
Specifies color for the shadow. See `<color>` values for possible keywords and notations. If not specified, the value of the `color` property defined in the parent element is used.
`<length>`
    
Specifies the offset length of the shadow. This parameter accepts two, three, or four values. Third and fourth values are optional. They are interpreted as follows:
  * If two values are specified, they are interpreted as `<offset-x>` (horizontal offset) and `<offset-y>` (vertical offset) values. Negative `<offset-x>` value places the shadow to the left of the element. Negative `<offset-y>` value places the shadow above the element.  
If not specified, the value of `0` is used for the missing length. If both `<offset-x>` and `<offset-y>` are set to `0`, the shadow is placed behind the element (and may generate a blur effect if `<blur-radius>` and/or `<spread-radius>` is set).
  * If three values are specified, the third value is interpreted as `<blur-radius>`. The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not allowed. If not specified, it will be set to `0` (meaning that the shadow's edge will be sharp). The specification does not include an exact algorithm for how the blur radius should be calculated; however, it does elaborate as follows:
> …for a long, straight shadow edge, this should create a color transition the length of the blur distance that is perpendicular to and centered on the shadow's edge, and that ranges from the full shadow color at the radius endpoint inside the shadow to fully transparent at the endpoint outside it.
  * If four values are specified, the fourth value is interpreted as `<spread-radius>`. Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. If not specified, it will be set to `0` (that is, the shadow will be the same size as the element).


`inset` Optional
    
Changes the shadow from an outer box-shadow to an inner box-shadow (as if the content is pressed into the box). Inset shadows are drawn inside the box's border (even if the border is transparent), and they appear above the background but below the content. By default, the shadow behaves like a drop shadow, giving the appearance that the box is elevated above its content. This is the default behavior when `inset` is not specified.
### Interpolation
When animating shadows, such as when multiple shadow values on a box transition to new values on hover, the values are interpolated. Interpolation determines intermediate values of properties, such as the blur radius, spread radius, and color, as shadows transition. For each shadow in a list of shadows, the color, x, y, blur, and spread transition; the color as `<color>`, and the other values as `<length>`s.
In interpolating multiple shadows between two comma-separated lists of multiple box shadows, the shadows are paired, in order, with interpolation occurring between paired shadows. If the lists of shadows have different lengths, then the shorter list is padded at the end with shadows whose color is `transparent`, and X, Y, and blur are `0`, with the inset, or lack of inset, being set to match. If in any pair of shadows, one has `inset` set and the other does not, the entire shadow list is uninterpolated; the shadows will change to the new values without an animating effect.
## Examples
>
### Setting three shadows
In this example, we include three shadows: an inset shadow, a regular drop shadow, and a 2px shadow that creates a border effect (we could have used an `outline` instead for that third shadow).
#### HTML
    
    <blockquote>
      <q>
        You may shoot me with your words,<br />
        You may cut me with your eyes,<br />
        You may kill me with your hatefulness,<br />
        But still, like air, I'll rise.
      </q>
      <p>&mdash; Maya Angelou</p>
    </blockquote>
    
#### CSS
    
    blockquote {
      padding: 20px;
      box-shadow:
        inset 0 -3em 3em rgb(0 200 0 / 30%),
        0 0 0 2px white,
        0.3em 0.3em 1em rgb(200 0 0 / 60%);
    }
    
#### Result
### Setting zero for offset and blur
When the `x-offset`, `y-offset`, and `blur` are all zero, the box shadow will be a solid-colored outline of equal-size on all sides. The shadows are drawn back to front, so the first shadow sits on top of subsequent shadows. When the `border-radius` is set to 0, as is the default, the corners of the shadow will be, well, corners. Had we put in a `border-radius` of any other value, the corners would have been rounded.
We added a margin the size of the widest box-shadow to ensure the shadow doesn't overlap adjacent elements or go beyond the border of the containing box. A box-shadow does not impact box model dimensions.
#### HTML
    
    <div><p>Hello World</p></div>
    
#### CSS
    
    p {
      box-shadow:
        0 0 0 2em #f4aab9,
        0 0 0 4em #66ccff;
      margin: 4em;
      padding: 1em;
    }
    
#### Result
# CSS overflow
The CSS overflow module properties enable you to handle scrollable overflow in visual media.
Overflow happens when the content in an element box extends past one or more of the box's edges. Scrollable overflow is the content that appears outside the element box for which you might want to add a scrolling mechanism. CSS overflow properties let you control what happens when content overflows an element box, including creating carousels without JavaScript.
Painting effects that overflow the content but do not participate in the CSS box model do not affect layout. This type of overflow is also known as ink overflow. Examples of ink overflows include box shadows, border images, text decoration, overhanging glyphs, and outlines. Ink overflows do not extend the scrollable overflow region.
## Overflow in action
Try the following example to see the effects of various `overflow` property values on the content overflow and scrollbars in the adjacent fixed-size box.
The example includes options to change the values for the `overflow-clip-margin` and `width` properties, as well as to programmatically scroll the content if the overflow property creates a scroll container. Select `overflow: clip` and see the effect of different `overflow-clip-margin` values. Select `overflow: hidden` or `overflow: scroll` to check out the various `ScrollLeft` and `ScrollTop` slider settings.
A link is included in the content box above to demonstrate the effects of keyboard focus on overflow and scroll behaviors. Try tabbing to the link or programmatically scrolling the content: the content will scroll only if the enumerated `<overflow>` value creates a scroll container.
## Reference
>
### Properties
  * `line-clamp`
  * `overflow` shorthand
  * `overflow-block`
  * `overflow-clip-margin`
  * `overflow-inline`
  * `overflow-x`
  * `overflow-y`
  * `scroll-behavior`
  * `scroll-marker-group`
  * `scrollbar-gutter`
  * `text-overflow`


The CSS overflow level 4 module also introduces the `block-ellipsis`, `continue`, `max-lines`, `overflow-clip-margin-block`, `overflow-clip-margin-block-end`, `overflow-clip-margin-block-start`, `overflow-clip-margin-bottom`, `overflow-clip-margin-inline`, `overflow-clip-margin-inline-end`, `overflow-clip-margin-inline-start`, `overflow-clip-margin-left`, `overflow-clip-margin-right`, and `overflow-clip-margin-top` properties. Currently, no browsers support these features.
### Selectors and pseudo-elements
  * `::scroll-button()`
  * `::scroll-marker`
  * `::scroll-marker-group`
  * `:target-current`


### Data types
  * `<overflow>` enumerated values


## Guides
Learn: Overflowing content
    
Learn what overflow is and how to manage it.
Creating CSS carousels
    
Create pure-CSS carousel UI features using scroll buttons, scroll markers, and generated columns.
Creating a named scroll progress timeline animation
    
The CSS scroll timeline `scroll-timeline-name` and `scroll-timeline-axis` properties, along with the `scroll-timeline` shorthand, create animations tied to the scroll offset of a scroll container.
## Related concepts
  * `::column`
  * `scrollbar-width` CSS property
  * `scrollbar-color` CSS property
  * `scrollbar-gutter` CSS property
  * `scroll-behavior` CSS property
  * `scroll-margin` CSS shorthand property
  * `scroll-padding` CSS shorthand property
  * `scroll-snap-align` CSS property
  * `scroll-snap-stop` CSS property
  * `scroll-snap-type` CSS property
  * `text-overflow` CSS property
  * `::-webkit-scrollbar` pseudo-element
  * `scrollbar` ARIA role
  * Element `scroll()` method
  * Element `scrollBy()` method
  * Element `scrollIntoView()` method
  * Element `scrollTo()` method
  * Element `scrollTop` property
  * Element `scrollLeft` property
  * Element `scrollWidth` property
  * Element `scrollHeight` property
  * Document `scroll` event
  * Scroll container glossary term
  * Ink overflow glossary term


# :active
The `:active` CSS pseudo-class represents an element (such as a button) that is being activated by the user. When using a mouse, "activation" typically starts when the user presses down the primary mouse button.
## Try it
    
    .joinBtn {
      width: 10em;
      height: 5ex;
      background-image: linear-gradient(135deg, #f34079 40%, #fc894d);
      border: none;
      border-radius: 5px;
      font-weight: bold;
      color: white;
      cursor: pointer;
    }
    
    .joinBtn:active {
      box-shadow: 2px 2px 5px #fc894d;
    }
    
    
    <p>Would you like to subscribe to our channel?</p>
    <button class="joinBtn">Subscribe</button>
    
The `:active` pseudo-class is commonly used on `<a>` and `<button>` elements. Other common targets of this pseudo-class include elements that are contained in an activated element, and form elements that are being activated through their associated `<label>`.
Styles defined by the `:active` pseudo-class will be overridden by any subsequent link-related pseudo-class (`:link`, `:hover`, or `:visited`) that has at least equal specificity. To style links appropriately, put the `:active` rule after all other link-related rules, as defined by the LVHA-order: `:link` — `:visited` — `:hover` — `:active`.
Note: On systems with multi-button mice, CSS specifies that the `:active` pseudo-class must only apply to the primary button; on right-handed mice, this is typically the leftmost button.
## Syntax
    
    :active {
      /* ... */
    }
    
## Examples
>
### Active links
#### HTML
    
    <p>
      This paragraph contains a link:
      <a href="#">This link will turn red while you click on it.</a>
      The paragraph will get a gray background while you click on it or the link.
    </p>
    
#### CSS
    
    /* Unvisited links */
    a:link {
      color: blue;
    }
    /* Visited links */
    a:visited {
      color: purple;
    }
    /* Hovered links */
    a:hover {
      background: yellow;
    }
    /* Active links */
    a:active {
      color: red;
    }
    
    /* Active paragraphs */
    p:active {
      background: #eeeeee;
    }
    
#### Result
### Active form elements
#### HTML
    
    <form>
      <label for="my-button">My button: </label>
      <button id="my-button" type="button">Try Clicking Me or My Label!</button>
    </form>
    
#### CSS
    
    form :active {
      color: red;
    }
    
    form button {
      background: white;
    }
    
#### Result
# row-gap
The `row-gap` CSS property sets the size of the gap (gutter) between an element's rows.
Early versions of the specification called this property `grid-row-gap`, and to maintain compatibility with legacy websites, browsers will still accept `grid-row-gap` as an alias for `row-gap`.
## Try it
    
    row-gap: 0;
    
    
    row-gap: 1ch;
    
    
    row-gap: 1em;
    
    
    row-gap: 20px;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
          <div>Four</div>
          <div>Five</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      width: 200px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Syntax
    
    /* <length> values */
    row-gap: 20px;
    row-gap: 1em;
    row-gap: 3vmin;
    row-gap: 0.5cm;
    
    /* <percentage> value */
    row-gap: 10%;
    
    /* Global values */
    row-gap: inherit;
    row-gap: initial;
    row-gap: revert;
    row-gap: revert-layer;
    row-gap: unset;
    
### Values
`<length-percentage>`
    
Is the width of the gutter separating the rows. `<percentage>` values are relative to the dimension of the element.
## Examples
>
### Flex layout
#### HTML
    
    <div id="flexbox">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #flexbox {
      display: flex;
      flex-wrap: wrap;
      width: 300px;
      row-gap: 20px;
    }
    
    #flexbox > div {
      border: 1px solid green;
      background-color: lime;
      flex: 1 1 auto;
      width: 100px;
      height: 50px;
    }
    
#### Result
### Grid layout
#### HTML
    
    <div id="grid">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    
#### CSS
    
    #grid {
      display: grid;
      height: 200px;
      grid-template-columns: 150px 1fr;
      grid-template-rows: repeat(3, 1fr);
      row-gap: 20px;
    }
    
    #grid > div {
      border: 1px solid green;
      background-color: lime;
    }
    
#### Result
# sin()
The `sin()` CSS function is a trigonometric function that returns the sine of a number, which is a value between `-1` and `1`. The function contains a single calculation that must resolve to either a `<number>` or an `<angle>` by interpreting the result of the argument as radians. That is, `sin(45deg)`, `sin(0.125turn)`, and `sin(3.14159 / 4)` all represent the same value, approximately `0.707`.
## Try it
    
    transform: translateX(calc(cos(0deg) * 140px))
      translateY(calc(sin(0deg) * -140px));
    
    
    transform: translateX(calc(cos(90deg) * 140px))
      translateY(calc(sin(90deg) * -140px));
    
    
    transform: translateX(calc(cos(135deg) * 140px))
      translateY(calc(sin(135deg) * -140px));
    
    
    transform: translateX(calc(cos(180deg) * 140px))
      translateY(calc(sin(180deg) * -140px));
    
    
    transform: translateX(calc(cos(-45deg) * 140px))
      translateY(calc(sin(-45deg) * -140px));
    
    
    <div class="circle">
      <span class="dot" id="example-element"></span>
    </div>
    
    
    :root {
      --radius: 140px;
      --dot-size: 10px;
    }
    .circle {
      display: grid;
      place-content: center;
      margin: 0 auto;
      width: calc(var(--radius) * 2);
      aspect-ratio: 1;
      border-radius: 50%;
      border: 2px solid #666666;
      background-image:
        radial-gradient(black var(--dot-size), transparent var(--dot-size)),
        linear-gradient(135deg, blue, deepskyblue, lightgreen, lavender, honeydew);
    }
    .dot {
      display: block;
      width: var(--dot-size);
      aspect-ratio: 1;
      border-radius: 50%;
      border: 2px solid #666666;
      background-color: #ff6666;
      transform: translateX(calc(cos(0deg) * var(--radius)))
        translateY(calc(sin(0deg) * var(--radius) * -1));
    }
    
## Syntax
    
    /* Single <angle> values */
    width: calc(100px * sin(45deg));
    width: calc(100px * sin(0.25turn));
    width: calc(100px * sin(1.0471967rad));
    
    /* Single <number> values */
    width: calc(100px * sin(63.673));
    width: calc(100px * sin(2 * 0.125));
    
    /* Other values */
    width: calc(100px * sin(pi / 2));
    width: calc(100px * sin(e / 4));
    
### Parameters
The `sin(angle)` function accepts only one value as its parameter.
`angle`
    
A calculation which resolves to a `<number>` or an `<angle>`. When specifying unitless numbers they are interpreted as a number of radians, representing an `<angle>`
### Return value
The sine of an `angle` will always return a number between `−1` and `1`.
  * If `angle` is `infinity`, `-infinity`, or `NaN`, the result is `NaN`.
  * If `angle` is `0⁻`, the result is `0⁻`.


## Examples
>
### Changing box sizes
In this example, `sin(30deg)` will return `0.5`, making the box have a `50px` width and a `50px` height.
    
    div {
      background-color: red;
      width: calc(sin(30deg) * 100px);
      height: calc(sin(30deg) * 100px);
    }
    
### Controlling animation duration
Another use case is to control the `animation-duration`, reducing the duration based on the sine value. In this case, the animation duration will be `1s`.
    
    div {
      animation-name: myAnimation;
      animation-duration: calc(sin(0.25turn) * 1s);
    }
    
# corner-bottom-left-shape
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `corner-bottom-left-shape` CSS property specifies the shape of a box's bottom-left corner, within its `border-radius` area.
For a full description of corner shape behavior and multiple examples, see the `corner-shape` shorthand property page.
## Syntax
    
    /* Keyword values */
    corner-bottom-left-shape: bevel;
    corner-bottom-left-shape: round;
    
    /* superellipse() function values */
    corner-bottom-left-shape: superellipse(0.7);
    corner-bottom-left-shape: superellipse(-1.9);
    
    /* Global values */
    corner-bottom-left-shape: inherit;
    corner-bottom-left-shape: initial;
    corner-bottom-left-shape: revert;
    corner-bottom-left-shape: revert-layer;
    corner-bottom-left-shape: unset;
    
### Values
The `corner-bottom-left-shape` property is specified using a `<corner-shape-value>` value.
## Examples
You can find other related examples on the `corner-shape` reference page.
### Basic `corner-bottom-left-shape` usage
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `80px 40% 60px 20%`, and a `corner-bottom-left-shape` of `squircle`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 80px 40% 60px 20%;
      corner-bottom-left-shape: squircle;
    }
    
#### Result
The rendered result looks like this:
# <filter-function>
The `<filter-function>` CSS data type represents a graphical effect that can change the appearance of an input image. It is used in the `filter` and `backdrop-filter` properties.
## Syntax
The `<filter-function>` data type is specified using one of the filter functions listed below. Each function requires an argument which, if invalid, results in no filter being applied.
`blur()`
    
Blurs the image.
`brightness()`
    
Makes the image brighter or darker.
`contrast()`
    
Increases or decreases the image's contrast.
`drop-shadow()`
    
Applies a drop shadow behind the image.
`grayscale()`
    
Converts the image to grayscale.
`hue-rotate()`
    
Changes the overall hue of the image.
`invert()`
    
Inverts the colors of the image.
`opacity()`
    
Makes the image transparent.
`saturate()`
    
Super-saturates or desaturates the input image.
`sepia()`
    
Converts the image to sepia.
## Examples
>
### Filter function comparison
This example provides a graphic, a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function. Updating the controls updates the filter effect in real time, allowing you to investigate the effects of different filters.
The dropdown selects the function name, and the slider sets the parameter value for that function. For `drop-shadow`, the value is used for both the horizontal and vertical offsets, and the radius is set to half the value.
# background-repeat
The `background-repeat` CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.
## Try it
    
    background-repeat: repeat-x;
    
    
    background-repeat: repeat;
    
    
    background-repeat: space;
    
    
    background-repeat: round;
    
    
    background-repeat: no-repeat;
    
    
    background-repeat: space repeat;
    
    
    <section id="default-example">
      <div id="example-element"></div>
    </section>
    
    
    #example-element {
      background: #cccccc url("/shared-assets/images/examples/moon.jpg") center /
        120px;
      min-width: 100%;
      min-height: 100%;
    }
    
## Syntax
    
    /* Keyword values */
    background-repeat: repeat;
    background-repeat: repeat-x;
    background-repeat: repeat-y;
    background-repeat: space;
    background-repeat: round;
    background-repeat: no-repeat;
    
    /* Two-value syntax: horizontal | vertical */
    background-repeat: repeat space;
    background-repeat: repeat repeat;
    background-repeat: round space;
    background-repeat: no-repeat round;
    
    /* Global values */
    background-repeat: inherit;
    background-repeat: initial;
    background-repeat: revert;
    background-repeat: revert-layer;
    background-repeat: unset;
    
## Description
The property accepts a comma-separated list of two `<repeat-style>` keyterms, or one keyterm as a shorthand for the two values. When two values are provided, the first value defines the horizontal repetition behavior and the second value defines the vertical behavior. Property values can be used to repeat only horizontally, vertically, or not at all.
The default value is `repeat repeat`. With this value, the background image maintains its intrinsic aspect ratio, repeating both horizontally and vertically to cover the entire background paint area, with edge images being clipped to the size of the element. Which edges clipped depends on the value of the corresponding `background-position` value. How many times they are repeated and how much the images on the edges are clipped depends on the size of the background painting area and the corresponding `background-size` value.
The repeating images can be evenly spaced apart, ensuring the repeated image maintains its aspect ratio without being clipped. With the `space` value, if the background paint area has a different aspect ratio than the image or does not otherwise have a size that is a multiple of the background size in either direction, there will be areas not covered by the background image.
Alternatively, the repeated background image can be stretched to cover the entire area without clipping. With `round`, the repeated image is stretched to fill all the available space until there is room to add an additional repeated image if the aspect ratio of the background image is not the same as the paint area's aspect ratio. For example, given a background image that is 100px x 100px and a background paint area of 1099px x 750px, the image will be repeated 10 times in the horizontal direction and 7 times vertically, for a total of 70 repetitions, with each image stretched in both directions to be 109.9px x 105px, altering the image's aspect ratio and potentially distorting it. If the width of the paint area increases by 1px, becoming 1100px wide, an 11th image will fit horizontally for a total of 77 image repetitions, with each image being painted at 100px wide and 105px tall, stretched only in the vertical direction.
## Values
The property accepts a comma-separated list of two `<repeat-style>` keyterms or one keyterm as a shorthand for the two values. The first value is the horizontal repetition. The second value is the vertical behavior. If only a single value is set to a value other than `repeat-x` or `repeat-y`, that value is applied the both vertices. The values include:
`repeat`
    
The default value. The image is repeated as many times as needed to cover the entire background image painting area, with the edge image being clipped if the dimension of the painting area is not a multiple of the dimension of your background image.
`no-repeat`
    
The image is not repeated (and hence the background image painting area will not necessarily be entirely covered). The position of the non-repeated background image is defined by the `background-position` CSS property.
`space`
    
The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. The `background-position` property is ignored unless only one image can be displayed without clipping. The only case where clipping happens using `space` is when there isn't enough room to display one image.
`round`
    
As the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. This is the only `<repeat-style>` value that can lead to the distortion of the background image's aspect ratio, which will occur if the aspect ratio of the background image differs from the aspect ratio of the background paint area.
`repeat-x`
    
Shorthand for `repeat no-repeat`, the background image repeats horizontally only, with the edge image being clipped if the width of the paint area is not a multiple of the background image's width.
`repeat-y`
    
Shorthand for `no-repeat repeat`, the background image repeats vertically only, with the edge image being clipped if the height of the paint area is not a multiple of the background image's height.
When one `<repeat-style>` keyterm is provided, the value is shorthand for the following two-value syntax:
Single value Two-value equivalent  
`repeat-x` `repeat no-repeat`  
`repeat-y` `no-repeat repeat`  
`repeat` `repeat repeat`  
`space` `space space`  
`round` `round round`  
`no-repeat` `no-repeat no-repeat`  
## Examples
>
### Setting background-repeat
#### HTML
    
    <ol>
      <li>
        no-repeat
        <div class="one"></div>
      </li>
      <li>
        repeat
        <div class="two"></div>
      </li>
      <li>
        repeat-x
        <div class="three"></div>
      </li>
      <li>
        repeat-y
        <div class="four"></div>
      </li>
      <li>
        space
        <div class="five"></div>
      </li>
      <li>
        round
        <div class="six"></div>
      </li>
      <li>
        repeat-x, repeat-y (multiple images)
        <div class="seven"></div>
      </li>
    </ol>
    
#### CSS
    
    /* Shared for all DIVS in example */
    ol,
    li {
      margin: 0;
      padding: 0;
    }
    li {
      margin-bottom: 12px;
    }
    div {
      background-image: url("star-solid.gif");
      width: 160px;
      height: 70px;
    }
    
    /* Background repeats */
    .one {
      background-repeat: no-repeat;
    }
    .two {
      background-repeat: repeat;
    }
    .three {
      background-repeat: repeat-x;
    }
    .four {
      background-repeat: repeat-y;
    }
    .five {
      background-repeat: space;
    }
    .six {
      background-repeat: round;
    }
    
    /* Multiple images */
    .seven {
      background-image:
        url("star-solid.gif"), url("/shared-assets/images/examples/favicon32.png");
      background-repeat: repeat-x, repeat-y;
      height: 144px;
    }
    
#### Result
In this example, each list item is matched with a different value of `background-repeat`.
# cursor
The `cursor` CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.
The cursor setting should inform users of the mouse operations that can be performed at the current location, including: text selection, activating help or context menus, copying content, resizing tables, and so on. You can specify either the type of cursor using a keyword, or load a specific icon to use (with optional fallback images and mandatory keyword as a final fallback).
## Try it
    
    cursor: help;
    
    
    cursor: wait;
    
    
    cursor: crosshair;
    
    
    cursor: not-allowed;
    
    
    cursor: zoom-in;
    
    
    cursor: grab;
    
    
    <section class="default-example container" id="default-example">
      <div id="example-element">
        Move over this element to see the cursor style.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      background-color: #1766aa;
      color: white;
      height: 180px;
      width: 360px;
      justify-content: center;
      align-items: center;
      font-size: 14pt;
      padding: 5px;
    }
    
## Syntax
    
    /* Keyword value */
    cursor: auto;
    cursor: pointer;
    /* … */
    cursor: zoom-out;
    
    /* URL with mandatory keyword fallback */
    cursor: url("hand.cur"), pointer;
    
    /* URL and coordinates, with mandatory keyword fallback */
    cursor:
      url("cursor_1.png") 4 12,
      auto;
    cursor:
      url("cursor_2.png") 2 2,
      pointer;
    
    /* URLs and fallback URLs (some with coordinates), with mandatory keyword fallback */
    cursor:
      url("cursor_1.svg") 4 5,
      url("cursor_2.svg"),
      /* …, */ url("cursor_n.cur") 5 5,
      progress;
    
    /* Global values */
    cursor: inherit;
    cursor: initial;
    cursor: revert;
    cursor: revert-layer;
    cursor: unset;
    
The `cursor` property is specified as zero or more `<url>` values, separated by commas, followed by a single mandatory keyword value. Each `<url>` should point to an image file. The browser will try to load the first image specified, falling back to the next if it can't, and falling back to the keyword value if no images could be loaded (or if none were specified).
Each `<url>` may be optionally followed by a pair of space-separated numbers, which set the `<x>` and `<y>` coordinates of the cursor's hotspot relative to the top-left corner of the image.
### Values
`<url>` Optional
    
A `url()` or a comma separated list `url(), url(), …`, pointing to an image file. More than one `<url>` may be provided as fallbacks, in case some cursor image types are not supported. A non-URL fallback (one or more of the keyword values) must be at the end of the fallback list.
`<x>`, `<y>` Optional
    
Optional x- and y-coordinates indicating the cursor hotspot; the precise position within the cursor that is being pointed to.
The numbers are in units of image pixels. They are relative to the top left corner of the image, which corresponds to `0 0`, and are clamped within the boundaries of the cursor image. If these values are not specified, they may be read from the file itself, and will otherwise default to the top-left corner of the image.
`keyword`
    
A keyword value must be specified, indicating either the type of cursor to use, or the fallback cursor to use if all specified icons fail to load.
The available keywords are listed in the table below. Other than `none`, which means no cursor, there is an image showing how the cursors used to be rendered. You can hover your mouse over the table rows to see the effect of the different cursor keyword values on your browser today.
Category Keyword Example Description  
General `auto` The UA will determine the cursor to display based on the current context. E.g., equivalent to `text` when hovering text.   
`default` The platform-dependent default cursor. Typically an arrow.  
`none` No cursor is rendered.  
Links & status `context-menu` A context menu is available.  
`help` Help information is available.  
`pointer` The cursor is a pointer that indicates a link. Typically an image of a pointing hand.   
`progress` The program is busy in the background, but the user can still interact with the interface (in contrast to `wait`).   
`wait` The program is busy, and the user can't interact with the interface (in contrast to `progress`). Sometimes an image of an hourglass or a watch.   
Selection `cell` The table cell or set of cells can be selected.  
`crosshair` Cross cursor, often used to indicate selection in a bitmap.  
`text` The text can be selected. Typically the shape of an I-beam.  
`vertical-text` The vertical text can be selected. Typically the shape of a sideways I-beam.   
Drag & drop `alias` An alias or shortcut is to be created.  
`copy` Something is to be copied.  
`move` Something is to be moved.  
`no-drop` An item may not be dropped at the current location.  
Firefox bug 275173: On Windows and macOS, `no-drop` is the same as `not-allowed`.   
`not-allowed` The requested action will not be carried out.  
`grab` Something can be grabbed (dragged to be moved).  
`grabbing` Something is being grabbed (dragged to be moved).  
Resizing & scrolling  `all-scroll` Something can be scrolled in any direction (panned).  
Firefox bug 275174: On Windows, `all-scroll` is the same as `move`.   
`col-resize` The item/column can be resized horizontally. Often rendered as arrows pointing left and right with a vertical bar separating them.   
`row-resize` The item/row can be resized vertically. Often rendered as arrows pointing up and down with a horizontal bar separating them.   
`n-resize` Some edge is to be moved. For example, the `se-resize` cursor is used when the movement starts from the south-east corner of the box.  
In some environments, an equivalent bidirectional resize cursor is shown. For example, `n-resize` and `s-resize` are the same as `ns-resize`.   
`e-resize`  
`s-resize`  
`w-resize`  
`ne-resize`  
`nw-resize`  
`se-resize`  
`sw-resize`  
`ew-resize` Bidirectional resize cursor.  
`ns-resize`  
`nesw-resize`  
`nwse-resize`  
Zooming `zoom-in`
Something can be zoomed (magnified) in or out.  
`zoom-out`  
## Usage notes
>
### Icon size limits
While the specification does not limit the `cursor` image size, user agents commonly restrict them to avoid potential misuse. For example, on Firefox and Chromium cursor images are restricted to 128x128 pixels by default, but it is recommended to limit the cursor image size to 32x32 pixels. Cursor changes using images that are larger than the user-agent maximum supported size will generally just be ignored.
### Supported image file formats
User agents are required by the specification to support PNG files, SVG v1.1 files in secure static mode that contain a natural size, and any other non-animated image file formats that they support for images in other properties. Desktop browsers also broadly support the `.cur` file format.
The specification further indicates that user agents should also support SVG v1.1 files in secure animated mode that contain a natural size, along with any other animated images file formats they support for images in other properties. User agents may support both static and animated SVG images that do not contain a natural size.
### iPadOS
iPadOS supports pointer devices like trackpads and mouses. By default, the iPad cursor is displayed as a circle, and the only supported value that will change an appearance of the pointer is `text`.
### Other notes
Cursor changes that intersect toolbar areas are commonly blocked to avoid spoofing.
## Examples
>
### Setting cursor types
    
    .foo {
      cursor: crosshair;
    }
    
    .bar {
      cursor: zoom-in;
    }
    
    /* A fallback keyword value is required when using a URL */
    .baz {
      cursor: url("hyper.cur"), auto;
    }
    
# font-size-adjust
The `font-size-adjust` CSS property provides a way to modify the size of lowercase letters relative to the size of uppercase letters, which defines the overall `font-size`. This property is useful for situations where font fallback can occur.
Legibility can become an issue when the first-choice `font-family` is unavailable and its replacement fallback font has a significantly different aspect value (height of lowercase letters divided by font size). Legibility of fonts, especially at small font sizes, is determined more by the size of lowercase letters than by the size of uppercase letters. The `font-size-adjust` property is useful for adjusting the font size of fallback fonts to keep the aspect value across fonts consistent, ensuring that the text appears similar regardless of the font used.
## Syntax
    
    /* Keyword */
    font-size-adjust: none;
    
    /* One value: <number> or from-font */
    font-size-adjust: 0.5;
    font-size-adjust: from-font;
    
    /* Two values */
    font-size-adjust: ex-height 0.5;
    font-size-adjust: ch-width from-font;
    
    /* Global values */
    font-size-adjust: inherit;
    font-size-adjust: initial;
    font-size-adjust: revert;
    font-size-adjust: revert-layer;
    font-size-adjust: unset;
    
### Values
The `font-size-adjust` property takes as its value the keyword `none`, one (`<number>` or `from-font`), or two (`<font-metric>` and either `<number>` or `from-font`) values.
`none`
    
No adjustment is applied to the `font-size` value for the fallback font.
`<font-metric>` Optional
    
Specifies the first-choice font metric to use for adjusting the font size of the fallback font. This parameter accepts one of the keywords listed below. It is an optional parameter, and `ex-height` is used if no `<font-metric>` is specified.
`ex-height`
    
Uses the ratio of x-height (height of lowercase "x" in a font) to font size (aspect value) to adjust the fallback font size. This keyword value is used to normalize lowercase letters across fonts.
`cap-height`
    
Uses the ratio of cap-height (height of uppercase letters) to font size to adjust fallback font size. This keyword value is used to normalize uppercase letters across fonts.
`ch-width`
    
Uses the ratio of the advance width (horizontal space taken up by a character in a font) of the character "0" (ZERO, U+0030) to font size. This keyword value is used to normalize horizontal narrow pitch of fonts.
`ic-width`
    
Uses the ratio of the advance width of the character "水" (CJK water ideograph, U+6C34) to font size. This keyword value is used to normalize horizontal wide pitch of fonts, particularly those that include CJK (Chinese, Japanese, Korean) characters.
`ic-height`
    
Uses the ratio of the advance height (vertical space taken up by a character in a font) of the character "水" (CJK water ideograph, U+6C34) to font size. This keyword value is used to normalize vertical wide pitch of fonts, particularly those that include CJK characters.
`<number>`
    
Adjusts the font size used depending on the specified `<font-metric>`. When no `<font-metric>` is specified (in which case the default value `ex-height` is used), the `<number>` value adjusts the font size of the fallback font so that its x-height is the specified multiple of the font size. This value should generally match the aspect value (ratio of x-height to font size) of the first-choice font. This means that the first-choice font, when available, will display consistently across browsers, regardless of their support for `font-size-adjust`.
When a `<font-metric>` value is specified, the `<number>` value adjusts the font size as per the chosen `<font-metric>` to maintain a consistent appearance for the specified font metric across different fonts.
The `<number>` value accepts any number from `0` to infinity. `0` yields text of zero height (that is, the text is hidden). Negative values are invalid.
`from-font`
    
Uses the `<number>` value for the specified `<font-metric>` from the first available font.
## Description
To ensure compatibility with browsers that don't support `font-size-adjust`, this property is specified as a numeric multiplier of the `font-size` property. This number should generally match the aspect value of the first-choice font.
Note: If the specified `<font-metric>` has been overridden in `@font-face`, e.g., by using the `size-adjust` descriptor, then the overridden metric will be used in the `font-size-adjust` calculation. This means that when `font-size-adjust` and `size-adjust` are applied together, `size-adjust` does not have any effect.
The adjusted font size is calculated using the formula `u = ( m / m′ ) s`, where:
  * `m` is the ratio of the specified `<font-metric>` to the first-choice font size.
  * `m′` is the ratio of the corresponding `<font-metric>` to the fallback font size.
  * `s` is the value of the `font-size` property.
  * `u` is the new, adjusted font size for the fallback font.


Consider this example to see how the adjusted font size is calculated. A first-choice font has a `font-size` of `12px` (`s`), and the ratio of `cap-height` to font size is `0.20` (`m`). The `cap-height` to font size ratio in the fallback font is `0.15` (`m′`). The `font-size-adjust` value has been specified as `cap-height 0.20`. If the primary font is unavailable, the adjusted font size of the fallback font will be calculated to be `16px` (`(0.20 / 0.15) * 12`). This will ensure that the `cap-height` of the fallback font is similar to that of the first-choice font when displayed.
## Examples
>
### Normalizing font size by lowercase and uppercase letters
This example demonstrates how the `font-size-adjust` property can be used to retain the same aspect value across fonts. The Verdana font has a relatively high aspect value of `0.545`, which means that the lowercase letters are relatively tall compared to uppercase letters. This makes the text in small font sizes appear legible. However, the Times font has a lower aspect value of `0.447`, so the text is less legible at small sizes. If Verdana is the first-choice font and Times is the fallback font, specifying the `font-size-adjust` property can help to retain the same aspect value in Times. So if the font falls back to Times, the text will maintain a similar level of legibility as it would have with Verdana.
Similarly, the cap-height to font size ratio in Verdana is `0.73` and that in Times is `0.66`. When `font-size-adjust` property is applied to Times to adjust its uppercase letters to match the ratio in Verdana, the Times font displays in adjusted font size ((0.73 / 0.66) * 14) `15.48px`.
    
    <p class="verdana">
      A: This text uses the Verdana font (14px), which has relatively large
      lowercase letters.
    </p>
    <p class="times">
      B: This text uses the Times font (14px), which is hard to read in small sizes.
    </p>
    <p class="times adj-times-ex-height">
      C: This text in 14px Times font is adjusted to the same aspect value as the
      Verdana font, so lowercase letters are normalized across the two fonts.
    </p>
    <p class="times adj-times-cap-height">
      D: This text in 14px Times font is adjusted to the same cap-height to font
      size ratio as the Verdana font, so uppercase letters are normalized across the
      two fonts.
    </p>
    
    
    .times {
      font-family: Times, serif;
      font-size: 14px;
    }
    
    .verdana {
      font-family: Verdana, sans-serif;
      font-size: 14px;
    }
    
    .adj-times-ex-height {
      font-size-adjust: 0.545;
    }
    
    .adj-times-cap-height {
      font-size-adjust: cap-height 0.73;
    }
    
Without `font-size-adjust` in `B`, the switch from Verdana font to Times font could result in a noticeable decrease in legibility due to its lower aspect value. In `C`, notice that only one value is specified for the `font-size-adjust` property, so the default `<font-metric>` value `ex-height` is used. `D` shows how the font would look compared to `A` if its uppercase letter height is adjusted.
### Determining the aspect value of a font
For a given font, the same content in two side-by-side `<span>` elements can be used to determine the font's aspect value. If the same font size is used for content in both spans, the spans will match when the `font-size-adjust` value in one span is accurate for the given font.
In the example below, there are three pairs of side-by-side `<span>` elements, each containing the letter "b". The goal is to adjust the `font-size-adjust` property for the right `<span>` in each pair until the borders around the two letters align. The resulting `font-size-adjust` value can be considered the aspect value for the font.
Starting at `0.6` in the first pair and adjusting to `0.5` in the second, we continue adjusting the `font-size-adjust` property value until the borders around the "b" letters align perfectly in the third pair. In this example, the aspect value is determined to be `0.482`.
    
    <div>
      <p><span>b</span><span class="adjust1">b</span></p>
      0.6
    </div>
    
    <div>
      <p><span>b</span><span class="adjust2">b</span></p>
      0.5
    </div>
    
    <div>
      <p><span>b</span><span class="adjust3">b</span></p>
      0.482
    </div>
    
    
    body {
      display: flex;
    }
    
    div {
      text-align: center;
    }
    
    p {
      font-family: Futura, sans-serif;
      font-size: 50px;
    }
    
    span {
      border: solid 1px red;
    }
    
    .adjust1 {
      font-size-adjust: 0.6;
    }
    
    .adjust2 {
      font-size-adjust: 0.5;
    }
    
    .adjust3 {
      font-size-adjust: 0.482;
    }
    
# CSS scroll anchoring
The CSS scroll anchoring module defines a mechanism to prevent page movement due to DOM changes above the visible region of a scrolling box while the user is consuming the visible content.
Scroll anchoring attempts to keep the user's view of the document stable across layout changes. It works by selecting a DOM node (the anchor node) whose movement is used to determine adjustments to the scroll position. The anchor node is always a descendant of the scrolling box.
For scroll containers that are snapped to an element, scroll anchoring is limited to adjustments that would be allowed by re-snapping.
## Reference
>
### Properties
  * `overflow-anchor`


## Glossary and definitions
  * Scroll container
  * Scroll snap


## Guides
Overview of scroll anchoring
    
What is scroll anchoring, suppression triggers, and when and how to enable and disable this browser feature.
## Related concepts
  * `overscroll-behavior`


# min-inline-size
The `min-inline-size` CSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`.
## Try it
    
    min-inline-size: 200px;
    writing-mode: horizontal-tb;
    
    
    min-inline-size: 200px;
    writing-mode: vertical-rl;
    
    
    min-inline-size: 20px;
    writing-mode: horizontal-tb;
    
    
    min-inline-size: 75%;
    writing-mode: vertical-lr;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">Change min-inline-size</div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
## Syntax
    
    /* <length> values */
    min-inline-size: 100px;
    min-inline-size: 5em;
    min-inline-size: anchor-size(width);
    
    /* <percentage> values */
    min-inline-size: 10%;
    
    /* Keyword values */
    min-inline-size: max-content;
    min-inline-size: min-content;
    min-inline-size: fit-content;
    min-inline-size: fit-content(20em);
    
    /* Global values */
    min-inline-size: inherit;
    min-inline-size: initial;
    min-inline-size: revert;
    min-inline-size: revert-layer;
    min-inline-size: unset;
    
If the writing mode is vertically oriented, the value of `min-inline-size` relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. A related property is `min-block-size`, which defines the other dimension of the element.
### Values
The `min-inline-size` property takes the same values as the `min-width` and `min-height` properties.
## Examples
>
### Setting minimum inline size for vertical text
#### HTML
    
    <p class="exampleText">Example text</p>
    
#### CSS
    
    .exampleText {
      writing-mode: vertical-rl;
      background-color: yellow;
      block-size: 5%;
      min-inline-size: 200px;
    }
    
#### Result
# color-interpolation
The `color-interpolation` CSS property is used in SVG to specify which color space to use for `<linearGradient>` and `<radialGradient>` SVG elements.
## Syntax
    
    /* Keyword values */
    color-interpolation: auto;
    color-interpolation: sRGB;
    color-interpolation: linearRGB;
    
### Values
`auto`
    
Indicates that the user agent can choose either the `sRGB` or `linearRGB` spaces for color interpolation. This option indicates that the author doesn't require that color interpolation occur in a particular color space.
`sRGB`
    
Indicates that color interpolation should occur in the sRGB color space. Defaults to this initial value if no `color-interpolation` property is set.
`linearRGB`
    
Indicates that color interpolation should occur in the linearized RGB color space as described in the sRGB specification.
## Example
In the first SVG, the `color-interpolation` property is not included on the `<linearGradient>` element and color interpolation defaults to `sRGB`. The second example shows color interpolation using the `linearRGB` value.
    
    <svg width="450" height="70">
      <title>Example of using the color-interpolation CSS Property</title>
      <defs>
        <linearGradient id="sRGB">
          <stop offset="0%" stop-color="white" />
          <stop offset="25%" stop-color="blue" />
          <stop offset="50%" stop-color="white" />
          <stop offset="75%" stop-color="red" />
          <stop offset="100%" stop-color="white" />
        </linearGradient>
      </defs>
      <rect x="0" y="0" width="400" height="40" fill="url(#sRGB)" stroke="black" />
      <text x="0" y="60" font-family="courier" font-size="16">
        no color-interpolation (CSS property)
      </text>
    </svg>
    
    
    <svg width="450" height="70">
      <title>Example of using the color-interpolation CSS Property</title>
      <defs>
        <linearGradient id="linearRGB">
          <stop offset="0%" stop-color="white" />
          <stop offset="25%" stop-color="blue" />
          <stop offset="50%" stop-color="white" />
          <stop offset="75%" stop-color="red" />
          <stop offset="100%" stop-color="white" />
        </linearGradient>
      </defs>
      <rect
        x="0"
        y="0"
        width="400"
        height="40"
        fill="url(#linearRGB)"
        stroke="black" />
      <text x="0" y="60" font-family="courier" font-size="16">
        color-interpolation: linearRGB; (CSS property)
      </text>
    </svg>
    
    
    svg {
      display: block;
    }
    
    #linearRGB {
      color-interpolation: linearRGB;
    }
    
# offset-anchor
The `offset-anchor` CSS property specifies the point inside the box of an element traveling along an `offset-path` that is actually moving along the path.
## Try it
    
    offset-anchor: auto;
    
    
    offset-anchor: right top;
    
    
    offset-anchor: left bottom;
    
    
    offset-anchor: 20% 80%;
    
    
    <section class="default-example" id="default-example">
      <div class="wrapper">
        <div id="example-element"></div>
      </div>
      <button id="playback" type="button">Play</button>
    </section>
    
    
    #example-element {
      offset-path: path("M 0,20 L 200,20");
      animation: distance 3000ms infinite alternate ease-in-out;
      width: 40px;
      height: 40px;
      background: cyan;
      animation-play-state: paused;
    }
    
    #example-element.running {
      animation-play-state: running;
    }
    
    .wrapper {
      background-image: linear-gradient(
        to bottom,
        transparent,
        transparent 49%,
        black 50%,
        black 51%,
        transparent 52%
      );
      border: 1px solid #cccccc;
      width: 90%;
    }
    
    @keyframes distance {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
    #playback {
      position: absolute;
      top: 0;
      left: 0;
      font-size: 1em;
    }
    
    
    const example = document.getElementById("example-element");
    const button = document.getElementById("playback");
    
    button.addEventListener("click", () => {
      if (example.classList.contains("running")) {
        example.classList.remove("running");
        button.textContent = "Play";
      } else {
        example.classList.add("running");
        button.textContent = "Pause";
      }
    });
    
## Syntax
    
    /* Keyword values */
    offset-anchor: top;
    offset-anchor: bottom;
    offset-anchor: left;
    offset-anchor: right;
    offset-anchor: center;
    offset-anchor: auto;
    
    /* <percentage> values */
    offset-anchor: 25% 75%;
    
    /* <length> values */
    offset-anchor: 0 0;
    offset-anchor: 1cm 2cm;
    offset-anchor: 10ch 8em;
    
    /* Edge offsets values */
    offset-anchor: bottom 10px right 20px;
    offset-anchor: right 3em bottom 10px;
    
    /* Global values */
    offset-anchor: inherit;
    offset-anchor: initial;
    offset-anchor: revert;
    offset-anchor: revert-layer;
    offset-anchor: unset;
    
### Values
`auto`
    
`offset-anchor` is given the same value as the element's `transform-origin`, unless `offset-path` is `none`, in which case it takes its value from `offset-position`.
`<position>`
    
A `<position>` defines an x/y coordinate, to place an item relative to the edges of an element's box. It can be defined using one to four values. For more specifics, see the `<position>` and `background-position` reference pages. Note that the 3-value position syntax does not work for any usage of `<position>`, except for in `background(-position)`.
## Examples
>
### Setting various offset-anchor values
In the following example, we have three `<div>` elements nested in `<section>` elements. Each `<div>` is given the same `offset-path` (a horizontal line 200 pixels long) and animated to move along it. The three are then given different `background-color` and `offset-anchor` values.
Each `<section>` has been styled with a linear gradient to give it a horizontal line running through its center, to give you a visual display of where the `<div>`'s offset paths are running.
This allows you to see what effect the different `offset-anchor` values have — the first one, `auto`, causes the `<div>`'s center point to move along the path. The other two cause the `<div>`'s top-right and bottom-left points to move along the path, respectively.
#### HTML
    
    <section>
      <div class="offset-anchor1"></div>
    </section>
    <section>
      <div class="offset-anchor2"></div>
    </section>
    <section>
      <div class="offset-anchor3"></div>
    </section>
    
#### CSS
    
    div {
      offset-path: path("M 0,20 L 200,20");
      animation: move 3000ms infinite alternate ease-in-out;
      width: 40px;
      height: 40px;
    }
    
    section {
      background-image: linear-gradient(
        to bottom,
        transparent,
        transparent 49%,
        black 50%,
        black 51%,
        transparent 52%
      );
      border: 1px solid #cccccc;
      margin-bottom: 10px;
    }
    
    .offset-anchor1 {
      offset-anchor: auto;
      background: cyan;
    }
    
    .offset-anchor2 {
      offset-anchor: right top;
      background: purple;
    }
    
    .offset-anchor3 {
      offset-anchor: left bottom;
      background: magenta;
    }
    
    @keyframes move {
      0% {
        offset-distance: 0%;
      }
      100% {
        offset-distance: 100%;
      }
    }
    
#### Result
# shape-rendering
The `shape-rendering` CSS property provides hints to the renderer about what tradeoffs to make when rendering shapes like paths, circles, or rectangles. It only has an effect on the `<circle>`, `<ellipse>`, `<line>`, `<path>`, `<polygon>`, `<polyline>`, and `<rect>` elements. If explicitly declared, the value of the CSS property overrides the any values of the element's `shape-rendering` attribute.
## Syntax
    
    shape-rendering: auto;
    shape-rendering: crispEdges;
    shape-rendering: geometricPrecision;
    shape-rendering: optimizeSpeed;
    
    /* Global values */
    shape-rendering: inherit;
    shape-rendering: initial;
    shape-rendering: revert;
    shape-rendering: revert-layer;
    shape-rendering: unset;
    
### Values
The `<length>` and `<percentage>` values denote the horizontal center of the circle or ellipse.
`auto`
    
This value directs the user agents to make tradeoffs in order to balance speed, edge crispness, and geometric precision, with geometric precision given more importance than speed and edge crispness.
`crispEdges`
    
This value directs the user agent to emphasize edge contrast over geometric precision or rendering speed. The final rendering is likely to skip techniques such as anti-aliasing. It may also adjust line positions and line widths in order to align edges with device pixels.
`geometricPrecision`
    
This value directs the user agent to emphasize geometric precision over speed or crisp edges. The final rendering may involve techniques such as anti-aliasing.
`optimizeSpeed`
    
This value directs the user agent to emphasize rendering speed over geometric precision or edge crispness. The final rendering is likely to skip techniques such as anti-aliasing.
## Example
To show the different renderings, we create a set of four ellipses of equal size and shape.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 120">
      <ellipse cx="50" cy="60" rx="40" ry="60" />
      <ellipse cx="150" cy="60" rx="40" ry="60" />
      <ellipse cx="250" cy="60" rx="40" ry="60" />
      <ellipse cx="350" cy="60" rx="40" ry="60" />
    </svg>
    
We then apply the four values of `shape-rendering`, one per ellipse.
    
    ellipse:nth-of-type(1) {
      shape-rendering: crispEdges;
    }
    ellipse:nth-of-type(2) {
      shape-rendering: geometricPrecision;
    }
    ellipse:nth-of-type(3) {
      shape-rendering: optimizeSpeed;
    }
    ellipse:nth-of-type(4) {
      shape-rendering: auto;
    }
    
The resulting SVG is shown here. The first and third ellipses (counting from left to right) are more likely to show jagged edges, whereas the second should have a smoother appearance. The fourth and last ellipse's appearance will be dictated by the specific tradeoffs made by the user agent you use to view the example.
# filter
The `filter` CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders.
Several functions, such as `blur()` and `contrast()`, are available to help you achieve predefined effects.
## Try it
    
    filter: url("/shared-assets/images/examples/shadow.svg#element-id");
    
    
    filter: blur(5px);
    
    
    filter: contrast(200%);
    
    
    filter: grayscale(80%);
    
    
    filter: hue-rotate(90deg);
    
    
    filter: drop-shadow(16px 16px 20px red) invert(75%);
    
    
    <section id="default-example">
      <div class="example-container">
        <img
          id="example-element"
          src="/shared-assets/images/examples/firefox-logo.svg"
          width="200" />
      </div>
    </section>
    
    
    .example-container {
      background-color: white;
      width: 260px;
      height: 260px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    #example-element {
      flex: 1;
      padding: 30px;
    }
    
## Syntax
    
    /* <filter-function> values */
    filter: blur(5px);
    filter: brightness(0.4);
    filter: contrast(200%);
    filter: drop-shadow(16px 16px 20px blue);
    filter: grayscale(50%);
    filter: hue-rotate(90deg);
    filter: invert(75%);
    filter: opacity(25%);
    filter: saturate(30%);
    filter: sepia(60%);
    
    /* URL */
    filter: url("filters.svg#filter-id");
    
    /* Multiple filters */
    filter: contrast(175%) brightness(3%);
    filter: drop-shadow(3px 3px red) sepia(100%) drop-shadow(-3px -3px blue);
    
    /* Use no filter */
    filter: none;
    
    /* Global values */
    filter: inherit;
    filter: initial;
    filter: revert;
    filter: revert-layer;
    filter: unset;
    
### Referencing an SVG filter
You can use `url()` to reference an SVG filter element. For a reference to an SVG `<filter>` element, use the following syntax:
    
    filter: url("file.svg#filter-element-id");
    
### Functions
The `filter` property is specified as `none` or one or more of the functions listed below. If the parameter for any function is invalid, the function returns `none`. Except where noted, the functions that take a value expressed with a percent sign (as in `34%`) also accept the value expressed as decimal (as in `0.34`).
When the `filter` property values contains multiple functions, the filters are applied in order.
`blur()`
    
Applies a Gaussian blur to the input image.
    
    filter: blur(5px);
    
`brightness()`
    
Applies a linear multiplier to the input image, making it appear more or less bright. Values are linear multipliers on the effect, with `0%` creating a completely black image, `100%` having no effect, and values over `100%` brightening the image.
    
    filter: brightness(2);
    
`contrast()`
    
Adjusts the contrast of the input image. A value of `0%` makes the image grey, `100%` has no effect, and values over `100%` create a contrast.
    
    filter: contrast(200%);
    
`drop-shadow()`
    
Applies the parameter `<shadow>` as a drop shadow, following the contours of the image. The shadow syntax is similar to `<box-shadow>` (defined in the CSS backgrounds and borders module), with the exception that the `inset` keyword and `spread` parameter are not allowed. As with all `filter` property values, any filters after the `drop-shadow()` are applied to the shadow.
    
    filter: drop-shadow(16px 16px 10px black);
    
`grayscale()`
    
Converts the image to grayscale. A value of `100%` is completely grayscale. The initial value of `0%` leaves the input unchanged. Values between `0%` and `100%` produce linear multipliers on the effect.
    
    filter: grayscale(100%);
    
`hue-rotate()`
    
Applies a hue rotation. The `<angle>` value defines the number of degrees around the hue color circle at which the input samples will be adjusted. A value of `0deg` leaves the input unchanged.
    
    filter: hue-rotate(90deg);
    
`invert()`
    
Inverts the samples in the input image. A value of `100%` completely inverts the image. A value of `0%` leaves the input unchanged. Values between `0%` and `100%` have linear multipliers on the effect.
    
    filter: invert(100%);
    
`opacity()`
    
Applies transparency. `0%` makes the image completely transparent and `100%` leaves the image unchanged.
    
    filter: opacity(50%);
    
`saturate()`
    
Saturates the image, with `0%` being completely unsaturated, `100%` leaving the image unchanged, and values of over `100%` increasing saturation.
    
    filter: saturate(200%);
    
`sepia()`
    
Converts the image to sepia, with a value of `100%` making the image completely sepia and `0%` making no change.
    
    filter: sepia(100%);
    
### Combining functions
You may combine any number of functions to manipulate the rendering. The filters are applied in the order declared. The following example enhances the contrast and brightness of the image:
    
    filter: contrast(175%) brightness(103%);
    
### Interpolation
When animated, if both the beginning and end filters have a function list of the same length without `<url>` in the same order, each of their filter functions is interpolated according to the filter function's specific rules.
If the filter lists are of different lengths, the missing equivalent filter functions from the longer list are added to the end of the shorter list. The added functions use their initial, no filter modification values. All the filters listed are then interpolated according to the filter function's specific rules. Otherwise, discrete interpolation is used.
## Examples
>
### Applying filter functions
The `filter` property is applied to the second image, greying and blurring both the image and its border.
    
    img {
      border: 5px solid yellow;
    }
    /* Gray the second image by 40% and blur by 5px */
    img:nth-of-type(2) {
      filter: grayscale(0.4) blur(5px);
    }
    
    
    <img src="pencil.jpg" alt="Original image is sharp" />
    <img src="pencil.jpg" alt="The image and border are blurred and muted" />
    
### Repeating filter functions
Filter functions are applied in order of appearance. The same filter function can be repeated.
    
    #MDN-logo {
      border: 1px solid blue;
      filter: drop-shadow(5px 5px 0 red) hue-rotate(180deg)
        drop-shadow(5px 5px 0 red);
    }
    
The filters are applied in order. This is why the drop shadows are not the same color: the first drop shadow's hue is altered by the `hue-rotate()` function but the second one is not.
# translate
The `translate` CSS property allows you to specify translation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value.
## Try it
    
    translate: none;
    
    
    translate: 40px;
    
    
    translate: 50% -40%;
    
    
    translate: 20px 4rem;
    
    
    translate: 20px 4rem 150px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
      perspective: 800px;
      perspective-origin: 150% 150%;
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      perspective: 550px;
      transform-style: preserve-3d;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 0.7);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 0.7);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 0.7);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 0.7);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 0.7);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 0.7);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
## Syntax
    
    /* Keyword values */
    translate: none;
    
    /* Single values */
    translate: 100px;
    translate: 50%;
    
    /* Two values */
    translate: 100px 200px;
    translate: 50% 105px;
    
    /* Three values */
    translate: 50% 105px 5rem;
    
    /* Global values */
    translate: inherit;
    translate: initial;
    translate: revert;
    translate: revert-layer;
    translate: unset;
    
### Values
Single `<length-percentage>` value
    
A `<length>` or `<percentage>` that specifies a translation along the X-axis. Equivalent to a `translate()` (2D translation) function with a single value specified.
Two `<length-percentage>` values
    
Two `<length>` or `<percentage>` that specify the X and Y axis translation values (respectively) of a 2D translation. Equivalent to a `translate()` (2D translation) function with two values specified.
Three values
    
Two `<length-percentage>` and single `<length>` values that specify the X, Y, and Z axis translation values (respectively) of a 3D translation. Equivalent to a `translate3d()` (3D translation) function.
`none`
    
Specifies that no translation should be applied.
## Examples
>
### Translating an element on hover
This example shows how to use the `translate` property to move an element in three axes. The first box is moved along the X axis and the second box is moved along the X and Y axes. The third box is moved along the X, Y and Z axes and has the appearance of moving toward the viewer because of the addition of `perspective` to the parent element.
#### HTML
    
    <div class="wrapper">
      <div id="box1">translate X</div>
      <div id="box2">translate X,Y</div>
      <div id="box3">translate X,Y,Z</div>
    </div>
    
#### CSS
    
    .wrapper {
      perspective: 100px;
      display: inline-flex;
      gap: 1em;
    }
    .wrapper > div {
      width: 7em;
      line-height: 7em;
      text-align: center;
      transition: 0.5s ease-in-out;
      border: 3px dotted;
    }
    #box1:hover {
      translate: 20px;
    }
    
    #box2:hover {
      translate: 20px 20px;
    }
    
    #box3:hover {
      translate: 5px 5px 30px;
    }
    
#### Result
# border-start-start-radius
The `border-start-start-radius` CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode.
## Try it
    
    border-start-start-radius: 80px 80px;
    
    
    border-start-start-radius: 250px 100px;
    direction: rtl;
    
    
    border-start-start-radius: 50%;
    writing-mode: vertical-lr;
    
    
    border-start-start-radius: 50%;
    writing-mode: vertical-rl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a top left rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
This property affects the corner between the block-start and the inline-start sides of the element. For instance, in a `horizontal-tb` writing mode with `ltr` direction, it corresponds to the `border-top-left-radius` property.
## Syntax
    
    /* <length> values */
    /* With one value the corner will be a circle */
    border-start-start-radius: 10px;
    border-start-start-radius: 1em;
    
    /* With two values the corner will be an ellipse */
    border-start-start-radius: 1em 2em;
    
    /* Global values */
    border-start-start-radius: inherit;
    border-start-start-radius: initial;
    border-start-start-radius: revert;
    border-start-start-radius: revert-layer;
    border-start-start-radius: unset;
    
### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Border radius with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example</p>
    </div>
    
#### CSS
    
    div {
      background-color: rebeccapurple;
      width: 120px;
      height: 120px;
      border-start-start-radius: 10px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding: 10px;
      background-color: white;
      border-start-start-radius: 10px;
    }
    
#### Results
# padding-inline
The `padding-inline` CSS shorthand property defines the logical inline start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation.
## Try it
    
    padding-inline: 5% 10%;
    writing-mode: horizontal-tb;
    
    
    padding-inline: 15px 40px;
    writing-mode: vertical-rl;
    
    
    padding-inline: 5% 20%;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section id="default-example">
      <div class="transition-all" id="example-element">
        <div class="box">
          Far out in the uncharted backwaters of the unfashionable end of the
          western spiral arm of the Galaxy lies a small unregarded yellow sun.
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 10px solid #ffc129;
      overflow: hidden;
      text-align: left;
    }
    
    .box {
      border: dashed 1px;
      unicode-bidi: bidi-override;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `padding-inline-end`
  * `padding-inline-start`


## Syntax
    
    /* <length> values */
    padding-inline: 10px 20px; /* An absolute length */
    padding-inline: 1em 2em; /* relative to the text size */
    padding-inline: 10px; /* sets both start and end values */
    
    /* <percentage> values */
    padding-inline: 5% 2%; /* relative to the nearest block container's width */
    
    /* Global values */
    padding-inline: inherit;
    padding-inline: initial;
    padding-inline: revert;
    padding-inline: revert-layer;
    padding-inline: unset;
    
The `padding-inline` property may be specified with one or two values. If one value is given, it is used as the value for both `padding-inline-start` and `padding-inline-end`. If two values are given, the first is used for `padding-inline-start` and the second for `padding-inline-end`.
### Values
`<length>`
    
The size of the padding as a fixed value. Must be nonnegative.
`<percentage>`
    
The size of the padding as a percentage, relative to the inline size (width in a horizontal language, defined by `writing-mode`) of the containing block. Must be nonnegative.
## Description
The padding values specified by `padding-inline` can be equivalent to the `padding-top` and `padding-bottom` properties or the `padding-right` and `padding-left` properties, depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Examples
>
### Setting inline padding for vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding-inline: 20px 40px;
      background-color: #c8c800;
    }
    
#### Result
# image-resolution
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `image-resolution` CSS property specifies the intrinsic resolution of all raster images used in or on the element. It affects content images such as replaced elements and generated content, and decorative images such as `background-image` images.
The image resolution is defined as the number of image pixels per unit length, e.g., pixels per inch. By default, CSS assumes a resolution of one image pixel per CSS px unit; however, the `image-resolution` property allows a different resolution to be specified.
## Syntax
    
    image-resolution: from-image;
    image-resolution: 300dpi;
    image-resolution: from-image 300dpi;
    image-resolution: 300dpi snap;
    
    /* Global values */
    image-resolution: inherit;
    image-resolution: initial;
    image-resolution: revert;
    image-resolution: revert-layer;
    image-resolution: unset;
    
### Values
`<resolution>`
    
Specifies the intrinsic resolution explicitly.
`from-image`
    
Uses the intrinsic resolution as specified by the image format. If the image does not specify its own resolution, the explicitly specified resolution is used (if given), else it defaults to `1dppx` (1 image pixel per CSS px unit).
`snap`
    
If the `snap` keyword is provided, the computed resolution is the specified resolution rounded to the nearest value that would map one image pixel to an integer number of device pixels. If the resolution is taken from the image, then the used intrinsic resolution is the image's native resolution similarly adjusted.
Note: As vector formats such as SVG do not have an intrinsic resolution, this property has no effect on vector images.
## Examples
>
### Setting a high dpi for print
When printing the document, use a higher resolution.
    
    @media print {
      .my-image {
        image-resolution: 300dpi;
      }
    }
    
### Use image resolution with fallback
Uses the resolution from the image. If the image does not have a resolution, use 300dpi rather than the default 1dppx.
    
    .my-image {
      image-resolution: from-image 300dpi;
    }
    
Currently, no browsers support this feature.
# border-image-slice
The `border-image-slice` CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image.
## Try it
    
    border-image-slice: 30;
    
    
    border-image-slice: 30 fill;
    
    
    border-image-slice: 44;
    
    
    border-image: url("/shared-assets/images/examples/border-florid.svg") round;
    border-image-slice: calc(50 / 184 * 100%) calc(80 / 284 * 100%) fill;
    border-image-width: 30px 48px;
    
    
    <section id="default-example">
      <div id="example-element">This is a box with a border around it.</div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 50px;
      background: #fff3d4;
      color: black;
      border: 30px solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png") 30
        round;
      font-size: 1.2em;
    }
    
The slicing process creates nine regions in total: four corners, four edges, and a middle region. Four slice lines, set a given distance from their respective sides, control the size of the regions.
The above diagram illustrates the location of each region.
  * Zones 1-4 are corner regions. Each one is used a single time to form the corners of the final border image.
  * Zones 5-8 are edge regions. These are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element.
  * Zone 9 is the middle region. It is discarded by default, but is used like a background image if the keyword `fill` is set.


The `border-image-repeat`, `border-image-width`, and `border-image-outset` properties determine how these regions are used to form the final border image.
## Syntax
    
    /* All sides */
    border-image-slice: 30%;
    
    /* top and bottom | left and right */
    border-image-slice: 10% 30%;
    
    /* top | left and right | bottom */
    border-image-slice: 30 30% 45;
    
    /* top | right | bottom | left */
    border-image-slice: 7 12 14 5;
    
    /* Using the `fill` keyword */
    border-image-slice: 10% fill;
    border-image-slice: fill 10%;
    
    /* Global values */
    border-image-slice: inherit;
    border-image-slice: initial;
    border-image-slice: revert;
    border-image-slice: revert-layer;
    border-image-slice: unset;
    
The `border-image-slice` property may be specified using one to four `<number-percentage>` values to represent the position of each image slice. Negative values are invalid; values greater than their corresponding dimension are clamped to `100%`.
  * When one position is specified, it creates all four slices at the same distance from their respective sides.
  * When two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right.
  * When three positions are specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom.
  * When four positions are specified, they create slices measured from the top, right, bottom, and left in that order (clockwise).


The optional `fill` value, if used, can be placed anywhere in the declaration.
### Values
`<number>`
    
Represents an edge offset in pixels for raster images and coordinates for vector images. For vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.
`<percentage>`
    
Represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets.
`fill`
    
Preserves the middle image region and displays it like a background image, but stacked above the actual `background`. Its width and height are sized to match the top and left image regions, respectively.
## Examples
>
### Adjustable border width and slice
The following example shows a `<div>` with a border image set on it. The source image for the borders is as follows:
The diamonds are 30px across, so setting 30 pixels as the value for both `border-width` and `border-image-slice` will get you complete and fairly crisp diamonds in your border:
    
    border-width: 30px;
    border-image-slice: 30;
    
These are the default values we have used in this example. However, we have also provided two sliders to allow you to dynamically change the values of the above two properties, allowing you to appreciate the effect they have:
`border-image-slice` Changes the size of the image slice sampled for use in each border and border corner (and the content area, if the `fill` keyword is used) — varying this away from 30 causes the border to look somewhat irregular, but can have some interesting effects.
`border-width`: Changes the width of the border. The sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixelated (unless of course you use an SVG image).
#### HTML
    
    <div class="wrapper">
      <div></div>
    </div>
    
    <ul>
      <li>
        <label for="width">slide to adjust <code>border-width</code></label>
        <input type="range" min="10" max="45" id="width" />
        <output id="width-output">30px</output>
      </li>
      <li>
        <label for="slice">slide to adjust <code>border-image-slice</code></label>
        <input type="range" min="10" max="45" id="slice" />
        <output id="slice-output">30</output>
      </li>
    </ul>
    
#### CSS
    
    .wrapper {
      width: 400px;
      height: 300px;
    }
    
    div > div {
      width: 300px;
      height: 200px;
      border-width: 30px;
      border-style: solid;
      border-image: url("/shared-assets/images/examples/border-diamonds.png");
      border-image-slice: 30;
      border-image-repeat: round;
    }
    
    li {
      display: flex;
      place-content: center;
    }
    
#### JavaScript
    
    const widthSlider = document.getElementById("width");
    const sliceSlider = document.getElementById("slice");
    const widthOutput = document.getElementById("width-output");
    const sliceOutput = document.getElementById("slice-output");
    const divElem = document.querySelector("div > div");
    
    widthSlider.addEventListener("input", () => {
      const newValue = `${widthSlider.value}px`;
      divElem.style.borderWidth = newValue;
      widthOutput.textContent = newValue;
    });
    
    sliceSlider.addEventListener("input", () => {
      const newValue = sliceSlider.value;
      divElem.style.borderImageSlice = newValue;
      sliceOutput.textContent = newValue;
    });
    
#### Result
# width
The `width` CSS property sets an element's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box`, it sets the width of the border area.
## Try it
    
    width: 150px;
    
    
    width: 20em;
    
    
    width: 75%;
    
    
    width: auto;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the width.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      height: 80%;
      justify-content: center;
      color: white;
    }
    
The specified value of `width` applies to the content area so long as its value remains within the values defined by `min-width` and `max-width`.
  * If the value for `width` is less than the value for `min-width`, then `min-width` overrides `width`.
  * If the value for `width` is greater than the value for `max-width`, then `max-width` overrides `width`.


Note: As a geometric property, `width` also applies to the `<svg>`, `<rect>`, `<image>`, and `<foreignObject>` SVG elements, with `auto` resolving to `100%` for `<svg>` and `0` for other elements, and percent values being relative to the SVG viewport width for `<rect>`. The CSS `width` property value overrides any SVG `width` attribute value set on the SVG element.
## Syntax
    
    /* <length> values */
    width: 300px;
    width: 25em;
    width: anchor-size(width);
    width: anchor-size(--my-anchor inline, 120%);
    
    /* <percentage> value */
    width: 75%;
    
    /* Keyword values */
    width: max-content;
    width: min-content;
    width: fit-content;
    width: fit-content(20em);
    width: auto;
    width: stretch;
    
    /* Global values */
    width: inherit;
    width: initial;
    width: revert;
    width: revert-layer;
    width: unset;
    
### Values
`<length>`
    
Defines the width as a distance value.
`<percentage>`
    
Defines the width as a percentage of the containing block's width.
`auto`
    
The browser will calculate and select a width for the specified element.
`max-content`
    
The intrinsic preferred width.
`min-content`
    
The intrinsic minimum width.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the fit-content formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, <length-percentage>))`.
`stretch`
    
Sets the width of the element's margin box to the width of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
## Accessibility
Ensure that elements set with a `width` aren't truncated and/or don't obscure other content when the page is zoomed to increase text size.
  * MDN Understanding WCAG, Guideline 1.4 explanations
  * Understanding Success Criterion 1.4.4 | W3C Understanding WCAG 2.0


## Examples
>
### Default width
    
    p.gold {
      background: gold;
    }
    
    
    <p class="gold">The MDN community writes really great documentation.</p>
    
### Example using pixels and ems
    
    .px_length {
      width: 200px;
      background-color: red;
      color: white;
      border: 1px solid black;
    }
    
    .em_length {
      width: 20em;
      background-color: white;
      color: red;
      border: 1px solid black;
    }
    
    
    <div class="px_length">Width measured in px</div>
    <div class="em_length">Width measured in em</div>
    
### Example with percentage
    
    .percent {
      width: 20%;
      background-color: silver;
      border: 1px solid red;
    }
    
    
    <div class="percent">Width in percentage</div>
    
### Example using "max-content"
    
    p.max-green {
      background: lightgreen;
      width: max-content;
    }
    
    
    <p class="max-green">The MDN community writes really great documentation.</p>
    
### Example using "min-content"
    
    p.min-blue {
      background: lightblue;
      width: min-content;
    }
    
    
    <p class="min-blue">The MDN community writes really great documentation.</p>
    
### Stretch width to fill the containing block
#### HTML
    
    <div class="parent">
      <div class="child">text</div>
    </div>
    
    <div class="parent">
      <div class="child stretch">stretch</div>
    </div>
    
#### CSS
    
    .parent {
      border: solid;
      margin: 1rem;
      display: flex;
    }
    
    .child {
      background: #00999999;
      margin: 1rem;
    }
    
    .stretch {
      width: stretch;
    }
    
#### Result
# min-height
The `min-height` CSS property sets the minimum height of an element. It prevents the used value of the `height` property from becoming smaller than the value specified for `min-height`.
## Try it
    
    min-height: 150px;
    
    
    min-height: 7em;
    
    
    min-height: 75%;
    
    
    min-height: 10px;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box where you can change the minimum height. <br />If there is
        more content than the minimum the box will grow to the height needed by the
        content.
      </div>
    </section>
    
    
    #example-element {
      display: flex;
      flex-direction: column;
      background-color: #5b6dcd;
      justify-content: center;
      color: white;
    }
    
The element's height is set to the value of `min-height` whenever `min-height` is larger than `max-height` or `height`.
## Syntax
    
    /* <length> value */
    min-height: 3.5em;
    min-height: anchor-size(height);
    min-height: anchor-size(--my-anchor block, 200px);
    
    /* <percentage> value */
    min-height: 10%;
    
    /* Keyword values */
    min-height: max-content;
    min-height: min-content;
    min-height: fit-content;
    min-height: fit-content(20em);
    min-height: stretch;
    
    /* Global values */
    min-height: inherit;
    min-height: initial;
    min-height: revert;
    min-height: revert-layer;
    min-height: unset;
    
### Values
`<length>`
    
Defines the `min-height` as an absolute value.
`<percentage>`
    
Defines the `min-height` as a percentage of the containing block's height.
`auto`
    
The browser will calculate and select a `min-height` for the specified element.
`max-content`
    
The intrinsic preferred `min-height`.
`min-content`
    
The intrinsic minimum `min-height`.
`fit-content`
    
Use the available space, but not more than max-content, i.e., `min(max-content, max(min-content, stretch))`.
`fit-content(<length-percentage>)`
    
Uses the `fit-content` formula with the available space replaced by the specified argument, i.e., `min(max-content, max(min-content, argument))`.
`stretch`
    
Limits the minimum height of the element's margin box to the height of its containing block. It attempts to make the margin box fill the available space in the containing block, so in a way behaving similar to `100%` but applying the resulting size to the margin box rather than the box determined by box-sizing.
Note: To check aliases used by browsers for the `stretch` value and its implementation status, see the Browser compatibility section.
## Examples
>
### Setting min-height
    
    table {
      min-height: 75%;
    }
    
    form {
      min-height: 0;
    }
    
# scale
The `scale` CSS property allows you to specify scale transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value.
## Try it
    
    scale: none;
    
    
    scale: 1.5;
    
    
    scale: 1.7 50%;
    
    
    scale: 1 -1;
    
    
    scale: 1.2 1.2 2;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        <div class="face front">1</div>
        <div class="face back">2</div>
        <div class="face right">3</div>
        <div class="face left">4</div>
        <div class="face top">5</div>
        <div class="face bottom">6</div>
      </div>
    </section>
    
    
    #default-example {
      background: linear-gradient(skyblue, khaki);
      perspective: 800px;
      perspective-origin: 150% 150%;
    }
    
    #example-element {
      width: 100px;
      height: 100px;
      perspective: 550px;
      transform-style: preserve-3d;
    }
    
    .face {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      position: absolute;
      backface-visibility: inherit;
      font-size: 60px;
      color: white;
    }
    
    .front {
      background: rgb(90 90 90 / 0.7);
      transform: translateZ(50px);
    }
    
    .back {
      background: rgb(0 210 0 / 0.7);
      transform: rotateY(180deg) translateZ(50px);
    }
    
    .right {
      background: rgb(210 0 0 / 0.7);
      transform: rotateY(90deg) translateZ(50px);
    }
    
    .left {
      background: rgb(0 0 210 / 0.7);
      transform: rotateY(-90deg) translateZ(50px);
    }
    
    .top {
      background: rgb(210 210 0 / 0.7);
      transform: rotateX(90deg) translateZ(50px);
    }
    
    .bottom {
      background: rgb(210 0 210 / 0.7);
      transform: rotateX(-90deg) translateZ(50px);
    }
    
## Syntax
    
    /* Keyword values */
    scale: none;
    
    /* Single values */
    /* values of more than 1 or 100% make the element grow */
    scale: 2;
    /* values of less than 1 or 100% make the element shrink */
    scale: 50%;
    
    /* Two values */
    scale: 2 0.5;
    
    /* Three values */
    scale: 200% 50% 200%;
    
    /* Global values */
    scale: inherit;
    scale: initial;
    scale: revert;
    scale: revert-layer;
    scale: unset;
    
### Values
Single value
    
A `<number>` or `<percentage>` specifying a scale factor to make the affected element scale by the same factor along both the X and Y axes. Equivalent to a `scale()` (2D scaling) function with a single value specified.
Two values
    
Two `<number>` or `<percentage>` values that specify the X and Y axis scaling values (respectively) of a 2D scale. Equivalent to a `scale()` (2D scaling) function with two values specified.
Three values
    
Three `<number>` or `<percentage>` values that specify the X, Y, and Z axis scaling values (respectively) of a 3D scale. Equivalent to a `scale3d()` (3D scaling) function.
`none`
    
Specifies that no scaling should be applied.
## Examples
>
### Scaling an element on hover
The following example shows how to scale an element on hover. Two boxes are shown, one with a single `scale` value which scales the element along both axes. The second box has two `scale` values which scales the element along the X and Y axes independently.
#### HTML
    
    <div class="box" id="box1">single value</div>
    <div class="box" id="box2">two values</div>
    
#### CSS
    
    .box {
      float: left;
      margin: 1em;
      width: 7em;
      line-height: 7em;
      text-align: center;
      transition: 0.5s ease-in-out;
      border: 3px dotted;
    }
    
    #box1:hover {
      scale: 1.25;
    }
    
    #box2:hover {
      scale: 1.25 0.75;
    }
    
#### Result
# word-break
The `word-break` CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box.
## Try it
    
    word-break: normal;
    
    
    word-break: break-all;
    
    
    word-break: keep-all;
    
    
    word-break: break-word;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        Honorificabilitudinitatibus califragilisticexpialidocious
        Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
        グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      padding: 20px;
      text-align: start;
      border: solid 1px darkgray;
    }
    
## Syntax
    
    /* Keyword values */
    word-break: normal;
    word-break: break-all;
    word-break: keep-all;
    word-break: auto-phrase; /* experimental */
    word-break: break-word; /* deprecated */
    
    /* Global values */
    word-break: inherit;
    word-break: initial;
    word-break: revert;
    word-break: revert-layer;
    word-break: unset;
    
The `word-break` property is specified as a single keyword chosen from the list of values below.
### Values
`normal`
    
Use the default line break rule.
`break-all`
    
To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).
`keep-all`
    
Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for `normal`.
`auto-phrase`
    
Has the same effect as `word-break: normal` except that language-specific analysis is performed to improve word breaks by not placing them in the middle of natural phrases.
`break-word`
    
Has the same effect as `overflow-wrap: anywhere` combined with `word-break: normal`, regardless of the actual value of the `overflow-wrap` property.
Note: In contrast to `word-break: break-word` and `overflow-wrap: break-word` (see `overflow-wrap`), `word-break: break-all` will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break).
The specification also lists an additional value, `manual`, which is not currently supported in any browsers. When implemented, `manual` will have the same effect as `word-break: normal` except that breaks won't be automatically inserted in Southeast Asian languages. This is needed because, in such languages, user agents frequently place breaks in suboptimal positions. `manual` will allow you to insert line breaks in optimal positions manually.
## Examples
>
### HTML
    
    <p>1. <code>word-break: normal</code></p>
    <p class="normal narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
    <p>2. <code>word-break: break-all</code></p>
    <p class="breakAll narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
    <p>3. <code>word-break: keep-all</code></p>
    <p class="keepAll narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
    <p>4. <code>word-break: manual</code></p>
    <p class="manual narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
    <p>5. <code>word-break: auto-phrase</code></p>
    <p class="autoPhrase narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
    <p>6. <code>word-break: break-word</code></p>
    <p class="breakWord narrow">
      This is a long and Honorificabilitudinitatibus califragilisticexpialidocious
      Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu
      グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉
    </p>
    
### CSS
    
    .narrow {
      padding: 10px;
      border: 1px solid;
      width: 500px;
      margin: 0 auto;
      font-size: 20px;
      line-height: 1.5;
      letter-spacing: 1px;
    }
    
    .normal {
      word-break: normal;
    }
    
    .breakAll {
      word-break: break-all;
    }
    
    .keepAll {
      word-break: keep-all;
    }
    
    .manual {
      word-break: manual;
    }
    
    .autoPhrase {
      word-break: auto-phrase;
    }
    
    .breakWord {
      word-break: break-word;
    }
    
# position-try
The `position-try` CSS property is a shorthand that corresponds to the `position-try-order` and `position-try-fallbacks` properties.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `position-try-order`
  * `position-try-fallbacks`


## Syntax
    
    /* position-try-fallbacks only */
    position-try: normal flip-block;
    position-try: top;
    position-try: --custom-try-option;
    position-try: flip-block flip-inline;
    position-try: top, right, bottom;
    position-try: --custom-try-option1, --custom-try-option2;
    position-try:
      normal flip-block,
      right,
      --custom-try-option;
    
    /* position-try-order and position-try-fallbacks */
    position-try: normal none;
    position-try:
      most-width --custom-try-option1,
      --custom-try-option2;
    position-try:
      most-height flip-block,
      right,
      --custom-try-option;
    
    /* Global values */
    position-try: inherit;
    position-try: initial;
    position-try: revert;
    position-try: revert-layer;
    position-try: unset;
    
### Values
See `position-try-order` and `position-try-fallbacks` for value descriptions.
The `position-try` shorthand can specify values for `position-try-fallbacks`, or `position-try-order` and `position-try-fallbacks`, in that order. If `position-try-order` is omitted, it is set to the property's initial value, which is `normal`, meaning the position-try fallback options are tried in the order they appear in the property.
## Examples
>
### Basic `position-try` usage
This demo shows the effect of `position-try`.
#### HTML
The HTML includes two `<div>` elements that will become an anchor and an anchor-positioned element.
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
#### CSS
In the CSS, the anchor is given an `anchor-name` and has a `position` value of `absolute` set on it. We position it in the top-half of the viewport using `top` and `left` values:
    
    .anchor {
      anchor-name: --my-anchor;
      position: absolute;
      top: 100px;
      left: 45%;
    }
    
We then include a custom position option — `--custom-bottom` — which positions the element below the anchor and gives it an appropriate margin:
    
    @position-try --custom-bottom {
      top: anchor(bottom);
      bottom: unset;
      margin-top: 10px;
    }
    
We initially position the element above its anchor, and then set a `position-try` value on it that gives it a `position-try-order` of `most-height`, and a `position-try-fallbacks` list that just includes our custom fallback option:
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
    
      bottom: anchor(top);
      margin-bottom: 10px;
      justify-self: anchor-center;
    
      position-try: most-height --custom-bottom;
    }
    
#### Result
The element appears below its anchor, even though it is initially positioned above it. This occurs because there is more vertical space below the anchor than there is above it. The `most-height` try order causes the `--custom-bottom` try fallback option to be applied, placing the positioned element in the position that gives its containing block the most height.
# clip-rule
The `clip-rule` CSS property determines, when parts of the path overlap other parts, which pixels in a mask's box are inside the clipping shape defined by a clip path and which are outside.
The `clip-rule` property only applies to SVG elements that are contained within a `<clipPath>` element, overriding the element's `clip-rule` attribute value if present. The `clip-rule` property basically works as the `fill-rule` property, except that it applies to `<clipPath>` definitions. It does not have any effect on CSS `<basic-shape>`s.
## Syntax
    
    /* Keywords */
    clip-rule: nonzero;
    clip-rule: evenodd;
    
    /* Global values */
    clip-rule: inherit;
    clip-rule: initial;
    clip-rule: revert;
    clip-rule: revert-layer;
    clip-rule: unset;
    
### Values
`nonzero`
    
For every point in the clipping mask's box, a ray is drawn in a random direction. Every time the ray intersects with any part of the clipping path, a tally is increased by one if the clipping path's part is moving from left to right across the ray, whereas it is decreased by one if the path part is moving right to left across the ray. If the final total of the tally is zero, the point is outside the path's shape. Otherwise, it's inside the path's shape.
`even-odd`
    
For every point in the clipping mask's box, a ray is drawn in a random direction. Every time the ray intersects with any part of the clipping path, a tally is increased by one. If the final total of the tally is even, the point is outside the path's shape; otherwise, it's inside the path's shape. Zero is taken to be even.
## Examples
>
### Value comparison
In this example, we will apply different CSS `clip-rule` values to similar SVG `<path>` elements to demonstrate the difference between `evenodd` and `non-zero`.
#### HTML
The markup has multiple `<svg>` containers, each containing a `<clipPath>` element that defines a star shape, and a `<rect>` element to draw the star inside. The stars are created with overlapping lines. Other than the `id`, the markup of the first two SVG elements is identical. The third SVG includes just the `<path>` element, showing how the lines of the path that created the star overlap.
    
    <svg>
      <clipPath id="star1">
        <path d="M50,0 21,90 98,35 2,35 79,90z" />
      </clipPath>
      <rect clip-path="url(#star1)" width="95" height="95" />
    </svg>
    
    <svg>
      <clipPath id="star2">
        <path d="M50,0 21,90 98,35 2,35 79,90z" />
      </clipPath>
      <rect clip-path="url(#star2)" width="95" height="95" />
    </svg>
    
    <svg id="star3">
      <path d="M50,0 21,90 98,35 2,35 79,90z" />
    </svg>
    
#### CSS
The `clip-rule` for the `<path>` in the first SVG is set to `evenodd`; `nonzero` in the second SVG. For the path-only SVG, we removed the default `fill` and defined both a `stroke` color and `stroke-width` to make the overlapping path lines visible:
    
    #star1 path {
      clip-rule: evenodd;
    }
    
    #star2 path {
      clip-rule: nonzero;
    }
    
    #star3 path {
      fill: none;
      stroke: black;
      stroke-width: 1;
    }
    
#### Results
### Within basic shape definitions
This example demonstrates that, while the `clip-rule` does not have any effect on CSS `<basic-shape>`s, it can affect a `<clipPath>` used as the source of a shape.
#### HTML
We include an SVG with two `<clipPath>` elements that define star shapes, which are identical except for their `id` attribute values. We also include two `<div>` elements that will contain our star shapes.
    
    <svg height="0" width="0">
      <defs>
        <clipPath id="star1">
          <path d="M100,0 42,180 196,70 4,70 158,180z" />
        </clipPath>
        <clipPath id="star2">
          <path d="M100,0 42,180 196,70 4,70 158,180z" />
        </clipPath>
      </defs>
    </svg>
    
    <div></div>
    <div></div>
    
#### CSS
We provide the `<div>` elements with a set `width` and `height`, adding a `conic-gradient()` for their `background-image` value:
    
    div {
      height: 200px;
      width: 200px;
      background-image: conic-gradient(
        at center,
        rebeccapurple,
        green,
        lightblue,
        rebeccapurple
      );
    }
    
We use the `clip-path` property to set the different `<clipPath>` elements as the clipping path for each `<div>`:
    
    div:first-of-type {
      clip-path: url("#star1");
    }
    div:last-of-type {
      clip-path: url("#star2");
    }
    
Finally, we set the different `clip-rule` values for each of the `<clipPath>` element's `<path>`s:
    
    #star1 path {
      clip-rule: evenodd;
    }
    #star2 path {
      clip-rule: nonzero;
    }
    
#### Results
### Choosing between rules for a path with all clockwise paths
In this SVG image, we have two rectangles that are clipped, once with each clipping rule. There are two `<clipPath>` elements, so that one can be set to use the non-zero clipping rule and the other uses the even-odd rule. Both paths are drawn in a clockwise direction for both its inner and outer parts.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 50">
      <g stroke="#112233" fill="#bbccdd">
        <!-- basic rectangle and clipping path visualization follow -->
        <rect x="10" y="10" width="30" height="30" />
        <path
          d="M 65,5 l 20,20 -20,20 -20,-20 20,-20 m 0,10 l 10,10 -10,10 -10,-10 10,-10 z"
          fill="none"
          stroke-width="0.5" />
        <!-- rectangles to be clipped follow -->
        <rect x="110" y="10" width="30" height="30" clip-path="url(#clipper1)" />
        <rect x="160" y="10" width="30" height="30" clip-path="url(#clipper2)" />
      </g>
      <!-- clipping paths follow -->
      <clipPath id="clipper1" clipPathUnits="objectBoundingBox">
        <path
          d="M 0.5 -0.15 l 0.65 0.65 -0.65,0.65 -0.65,-0.65 0.65,-0.65 m 0,0.33 l 0.33,0.33 -0.33,0.33 -0.33,-0.33 0.33,-0.33 z"
          clip-rule="evenodd" />
      </clipPath>
      <clipPath id="clipper2" clipPathUnits="objectBoundingBox">
        <path
          d="M 0.5 -0.15 l 0.65 0.65 -0.65,0.65 -0.65,-0.65 0.65,-0.65 m 0,0.33 l 0.33,0.33 -0.33,0.33 -0.33,-0.33 0.33,-0.33 z"
          clip-rule="nonzero" />
      </clipPath>
    </svg>
    
To the clipping paths that are applied to the clipped rectangles, the CSS `clip-rule` property is used to set one path to use the `nonzero` rules, and the other to use the `evenodd` rule. These override the values of the `clip-path` attributes in the SVG, which have been intentionally set to the opposite values as the CSS imposes.
    
    #clipper1 {
      clip-rule: nonzero;
    }
    #clipper2 {
      clip-rule: evenodd;
    }
    
Because both the inner and outer parts of the path move in a clockwise (left-to-right) direction, the resulting clip shape will be different between the two clipping rules. For `nonzero`, any ray inside the outer part of the shape will tally to a value above zero, because it will encounter one or more left-to-right path fragments. For `even-odd`, points between the two parts of the path will have an odd-numbered tally, whereas any point either inside the inner path or outside the outer part will have an even-numbered tally.
### Choosing between rules for a path with different winding paths
This example uses the same SVG as the previous example, with the change that the interior part of the clipping path winds in a counterclockwise direction.
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 50">
      <g stroke="#112233" fill="#bbccdd">
        <!-- basic rectangle and clipping path visualization follow -->
        <rect x="10" y="10" width="30" height="30" />
        <path
          d="M 65,5 l 20,20 -20,20 -20,-20 20,-20 m 0,10 l 10,10 -10,10 -10,-10 10,-10 z"
          fill="none"
          stroke-width="0.5" />
        <!-- rectangles to be clipped follow -->
        <rect x="110" y="10" width="30" height="30" clip-path="url(#clipper1)" />
        <rect x="160" y="10" width="30" height="30" clip-path="url(#clipper2)" />
      </g>
      <!-- clipping paths follow -->
      <clipPath id="clipper1" clipPathUnits="objectBoundingBox">
        <path
          d="M 0.5 -0.15 l 0.65 0.65 -0.65,0.65 -0.65,-0.65 0.65,-0.65 m 0,0.33 l -0.33,0.33 0.33,0.33 0.33,-0.33 -0.33,-0.33 z" />
      </clipPath>
      <clipPath id="clipper2" clipPathUnits="objectBoundingBox">
        <path
          d="M 0.5 -0.15 l 0.65 0.65 -0.65,0.65 -0.65,-0.65 0.65,-0.65 m 0,0.33 l 0.33,0.33 -0.33,0.33 -0.33,-0.33 0.33,-0.33 z" />
      </clipPath>
    </svg>
    
We apply the same CSS as before.
    
    #clipper1 {
      clip-rule: nonzero;
    }
    #clipper2 {
      clip-rule: evenodd;
    }
    
In this case, because the outer part of the path moves in a clockwise (left-to-right) direction and the interior part of the path moves in a counterclockwise (right-to-left) direction, the resulting clip shape will be the same regardless of which clipping rule is used.
# font-stretch
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Note: The `font-stretch` property has now been renamed to `font-width` in the specifications. The name `font-stretch` has been kept as an alias for the `font-width` property. The new name `font-width` is not yet supported by any browsers.
The `font-stretch` CSS property selects a normal, condensed, or expanded face from a font.
## Try it
    
    font-stretch: condensed;
    
    
    font-stretch: expanded;
    
    
    font-stretch: ultra-expanded;
    
    
    font-stretch: 50%;
    
    
    font-stretch: 100%;
    
    
    font-stretch: 150%;
    
    
    <section class="default-example" id="default-example">
      <p class="transition-all" id="example-element">
        London. Michaelmas term lately over, and the Lord Chancellor sitting in
        Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
        as if the waters had but newly retired from the face of the earth, and it
        would not be wonderful to meet a Megalosaurus, forty feet long or so,
        waddling like an elephantine lizard up Holborn Hill.
      </p>
    </section>
    
    
    @font-face {
      src: url("/shared-assets/fonts/LeagueMono-VF.ttf") format("truetype");
      font-family: League;
      font-style: normal;
      font-weight: 400;
      font-stretch: 50% 200%; /* Required by Chrome - allow 50% to 200% */
    }
    
    section {
      font-size: 1.2em;
      font-family: League, sans-serif;
    }
    
## Syntax
    
    /* <font-stretch-css3> keyword values */
    font-stretch: normal;
    font-stretch: ultra-condensed;
    font-stretch: extra-condensed;
    font-stretch: condensed;
    font-stretch: semi-condensed;
    font-stretch: semi-expanded;
    font-stretch: expanded;
    font-stretch: extra-expanded;
    font-stretch: ultra-expanded;
    
    /* Percentage values */
    font-stretch: 50%;
    font-stretch: 100%;
    font-stretch: 200%;
    
    /* Global values */
    font-stretch: inherit;
    font-stretch: initial;
    font-stretch: revert;
    font-stretch: revert-layer;
    font-stretch: unset;
    
This property may be specified as a single `<font-stretch-css3>` keyword value or a single `<percentage>` value.
### Values
`normal`
    
Specifies a normal font face.
`semi-condensed`, `condensed`, `extra-condensed`, `ultra-condensed`
    
Specifies a more condensed font face than normal, with `ultra-condensed` as the most condensed.
`semi-expanded`, `expanded`, `extra-expanded`, `ultra-expanded`
    
Specifies a more expanded font face than normal, with `ultra-expanded` as the most expanded.
`<percentage>`
    
A `<percentage>` value between 50% and 200% (inclusive). Negative values are not allowed for this property.
### Keyword to numeric mapping
The table below shows the mapping between the `<font-stretch-css3>` keyword values and numeric percentages:
Keyword Percentage  
`ultra-condensed` 50%  
`extra-condensed` 62.5%  
`condensed` 75%  
`semi-condensed` 87.5%  
`normal` 100%  
`semi-expanded` 112.5%  
`expanded` 125%  
`extra-expanded` 150%  
`ultra-expanded` 200%  
## Description
Some font families offer additional faces in which the characters are narrower than the normal face (condensed faces) or wider than the normal face (expanded faces).
You can use `font-stretch` to select a condensed or expanded face from such fonts. If the font you are using does not offer condensed or expanded faces, this property has no effect.
### Font face selection
The face selected for a given value of `font-stretch` depends on the faces supported by the font in question. If the font does not provide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face.
The table below demonstrates the effect of supplying various different percentage values of `font-stretch` on two different fonts:
  * Anek Malayalam is a variable google font that supports widths from 75% to 125%. Values below and above this range select the closest matching font.
  * Inconsolata is a variable font that offers a continuous range of widths from 50% to 200%. 


## Examples
>
### Setting font stretch percentages
    
    <p class="condensed">an elephantine lizard</p>
    <p class="normal">an elephantine lizard</p>
    <p class="expanded">an elephantine lizard</p>
    
    
    @font-face {
      src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf");
      font-family: "LeagueMonoVariable";
      font-style: normal;
      font-stretch: 1% 500%; /* Required by Chrome */
    }
    
    p {
      font:
        1.5rem "LeagueMonoVariable",
        sans-serif;
    }
    
    .condensed {
      font-stretch: 50%;
    }
    
    .normal {
      font-stretch: 100%;
    }
    
    .expanded {
      font-stretch: 200%;
    }
    
# tan()
The `tan()` CSS function is a trigonometric function that returns the tangent of a number, which is a value between `−infinity` and `infinity`. The function contains a single calculation that must resolve to either a `<number>` or an `<angle>` by interpreting the result of the argument as radians.
## Syntax
    
    /* Single <angle> values */
    width: calc(100px * tan(45deg));
    width: calc(100px * tan(0.125turn));
    width: calc(100px * tan(0.785398163rad));
    
    /* Single <number> values */
    width: calc(100px * tan(0.5773502));
    width: calc(100px * tan(1.732 - 1));
    
    /* Other values */
    width: calc(100px * tan(pi / 3));
    width: calc(100px * tan(e));
    
### Parameters
The `tan(angle)` function accepts only one value as its parameter.
`angle`
    
A calculation which resolves to a `<number>` or an `<angle>`. When specifying unitless numbers they are interpreted as a number of radians, representing an `<angle>`.
### Return value
The tangent of an `angle` will always return a number between `−∞` and `+∞`.
  * If `angle` is `infinity`, `-infinity`, or `NaN`, the result is `NaN`.
  * If `angle` is `0⁻`, the result is `0⁻`.
  * If `angle` is one of the asymptote values (such as `90deg`, `270deg`, etc.), the result is explicitly undefined. Authors must not rely on `tan()` returning any particular value for these inputs.


## Examples
>
### Drawing parallelograms
The `tan()` function can be used to draw a parallelogram with a given bounding box.
#### HTML
    
    <div class="parallelogram"></div>
    
#### CSS
    
    .parallelogram {
      --w: 400;
      --h: 200;
      --angle: 30deg;
      position: relative;
      width: calc(1px * var(--w));
      height: calc(1px * var(--h));
    }
    .parallelogram::before {
      content: "";
      position: absolute;
      width: calc(100% - 100% * var(--h) / var(--w) * tan(var(--angle)));
      height: 100%;
      transform-origin: 0 100%;
      transform: skewX(calc(0deg - var(--angle)));
      background-color: red;
    }
    
#### Result
# border-radius
The `border-radius` CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.
## Try it
    
    border-radius: 30px;
    
    
    border-radius: 25% 10%;
    
    
    border-radius: 10% 30% 50% 70%;
    
    
    border-radius: 10% / 50%;
    
    
    border-radius: 10px 100px / 120px;
    
    
    border-radius: 50% 20% / 10% 40%;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with rounded corners.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
The radius applies to the whole `background`, even if the element has no border; the exact position of the clipping is defined by the `background-clip` property.
The `border-radius` property does not apply to table elements when `border-collapse` is `collapse`.
Note: As with any shorthand property, individual sub-properties cannot inherit, such as in `border-radius:0 0 inherit inherit`, which would partially override existing definitions. Instead, the individual longhand properties have to be used.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-top-left-radius`
  * `border-top-right-radius`
  * `border-bottom-right-radius`
  * `border-bottom-left-radius`


## Syntax
    
    /* The syntax of the first radius allows one to four values */
    /* Radius is set for all 4 sides */
    border-radius: 10px;
    
    /* top-left-and-bottom-right | top-right-and-bottom-left */
    border-radius: 10px 5%;
    
    /* top-left | top-right-and-bottom-left | bottom-right */
    border-radius: 2px 4px 2px;
    
    /* top-left | top-right | bottom-right | bottom-left */
    border-radius: 1px 0 3px 4px;
    
    /* The syntax of the second radius allows one to four values */
    /* (first radius values) / radius */
    border-radius: 10px / 20px;
    
    /* (first radius values) / top-left-and-bottom-right | top-right-and-bottom-left */
    border-radius: 10px 5% / 20px 30px;
    
    /* (first radius values) / top-left | top-right-and-bottom-left | bottom-right */
    border-radius: 10px 5px 2em / 20px 25px 30%;
    
    /* (first radius values) / top-left | top-right | bottom-right | bottom-left */
    border-radius: 10px 5% / 20px 25em 30px 35em;
    
    /* Global values */
    border-radius: inherit;
    border-radius: initial;
    border-radius: revert;
    border-radius: revert-layer;
    border-radius: unset;
    
The `border-radius` property is specified as:
  * one, two, three, or four `<length>` or `<percentage>` values. This is used to set a single radius for the corners.
  * followed optionally by "/" and one, two, three, or four `<length>` or `<percentage>` values. This is used to set an additional radius, so you can have elliptical corners.


### Values
radius Is a `<length>` or a `<percentage>` denoting a radius to use for the border in each corner of the border. It is used only in the one-value syntax.   
top-left-and-bottom-right Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the top-left and bottom-right corners of the element's box. It is used only in the two-value syntax.   
top-right-and-bottom-left Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the top-right and bottom-left corners of the element's box. It is used only in the two- and three-value syntaxes.   
top-left Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the top-left corner of the element's box. It is used only in the three- and four-value syntaxes.   
top-right Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the top-right corner of the element's box. It is used only in the four-value syntax.   
bottom-right Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the bottom-right corner of the element's box. It is used only in the three- and four-value syntaxes.   
bottom-left Is a `<length>` or a `<percentage>` denoting a radius to use for the border in the bottom-left corner of the element's box. It is used only in the four-value syntax.   
`<length>`
    
Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using length values. Negative values are invalid.
`<percentage>`
    
Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using percentage values. Percentages for the horizontal axis refer to the width of the box; percentages for the vertical axis refer to the height of the box. Negative values are invalid.
For example:
    
    border-radius: 1em / 5em;
    
    /* It is equivalent to: */
    border-top-left-radius: 1em 5em;
    border-top-right-radius: 1em 5em;
    border-bottom-right-radius: 1em 5em;
    border-bottom-left-radius: 1em 5em;
    
    
    border-radius: 4px 3px 6px / 2px 4px;
    
    /* It is equivalent to: */
    border-top-left-radius: 4px 2px;
    border-top-right-radius: 3px 4px;
    border-bottom-right-radius: 6px 2px;
    border-bottom-left-radius: 3px 4px;
    
## Examples
>
### Comparing border styles
The following example has seven `<pre>` elements, each of which demonstrates combinations of `border` and `border-radius` styles. The styles applied to each `<pre>` element are included as the element's contents, so you can see the CSS declarations necessary to create the associated border style:
### Using `corner-shape` with `border-radius`
When a non-`0` `border-radius` value is applied to a box corner, you can use the `corner-shape` property (or one of its longhands and shorthands) to apply custom shapes to that corner, such as a bevel, notch, or squircle. This example demonstrates `corner-shape` usage.
#### HTML
The markup for this example contains a single `<div>` element.
    
    <div></div>
    
#### CSS
We give the box some basic styles, which we've hidden for brevity. We also apply a `box-shadow`, a `border-radius` of `0 20% 50px 30%`, and a `corner-shape` of `superellipse(0.5) bevel notch squircle`.
    
    div {
      box-shadow: 1px 1px 3px gray;
      border-radius: 0 20% 50px 30%;
      corner-shape: superellipse(0.5) bevel notch squircle;
    }
    
#### Result
The rendered result looks like this:
Note how no corner shape is applied to the top-left corner, because it has a `border-radius` of `0` set.
# text-box
The `text-box` CSS property is a shorthand that corresponds to the `text-box-trim` and `text-box-edge` properties, which together specify the amount of space to trim from the block-start edge and block-end edge of a text element's block container.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `text-box-trim`
  * `text-box-edge`


## Syntax
    
    /* Single keyword */
    text-box: normal;
    
    /* One text-box-edge keyword */
    text-box: trim-start text;
    text-box: trim-both text;
    
    /* Two text-box-edge keywords */
    text-box: trim-start cap alphabetic;
    text-box: trim-both ex text;
    
    /* Global values */
    text-box: inherit;
    text-box: initial;
    text-box: revert;
    text-box: revert-layer;
    text-box: unset;
    
### Values
The `text-box` value can be composed of a `text-box-trim` value and a `text-box-edge` value separated by a space. See those pages for value descriptions.
The `text-box` property can also take a keyword of `normal`, which is equivalent to `text-box: none auto;`
If `text-box-trim` is omitted, it is set to `trim-both`. If `text-box-edge` is omitted, it is set to `auto`.
## Description
The height of text-only content is relative to the height of the font. In digital font files, the height contains all characters, including capital letters, ascenders, descenders, etc. Different fonts have different base line-heights, meaning that lines of text with the same `font-size` will produce line boxes of differing heights, affecting the appearance of spacing between lines.
The `text-box` properties enable trimming off extra spacing from the block-start edge and block-end edge of a text element's block container, which can include the leading at the text's block-start edge and block-end edges, and the spacing defined inside the font (as described above). This makes it much easier to control text spacing in the block direction.
## Examples
>
### Basic `text-box` usage
In the following example, we have two `<p>` elements with classes of `one` and `two`.
We apply a `text-box` value of `trim-end cap alphabetic` to the first paragraph. The `text-box-edge` value of `cap alphabetic` specifies trimming the over edge to the top of the capital letters and the under edge flush with the text baseline. Because the `text-box-trim` value is set to `trim-end`, only the under edge of the paragraph is trimmed.
We apply a `text-box` value of `trim-both ex alphabetic` to the second paragraph. The `text-box-edge` value of `ex alphabetic` specifies trimming the over edge to the font's x-height (the top edge of the short lower-case letters) and the under edge flush with the text baseline. Because the `text-box-trim` value is set to `trim-both`, both the over and under edge of the paragraph are trimmed.
    
    .one {
      text-box: trim-end cap alphabetic;
    }
    
    .two {
      text-box: trim-both ex alphabetic;
    }
    
    p {
      border-top: 5px solid magenta;
      border-bottom: 5px solid magenta;
    }
    
#### Result
The output is as follows. Note how we've included a top and bottom border on each paragraph, so that you can see how the space has been trimmed in each case.
# place-items
The CSS `place-items` shorthand property aligns items along both the block and inline directions at once. It sets the values of the `align-items` and `justify-items` properties. If the second value is not set, the first value is also used for it.
## Try it
    
    place-items: center stretch;
    
    
    place-items: center start;
    
    
    place-items: start end;
    
    
    place-items: end center;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element">
          <div>One</div>
          <div>Two</div>
          <div>Three</div>
        </div>
      </div>
    </section>
    
    
    #example-element {
      border: 1px solid #c5c5c5;
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-auto-rows: 80px;
      grid-gap: 10px;
      width: 220px;
    }
    
    #example-element > div {
      background-color: rgb(0 0 255 / 0.2);
      border: 3px solid blue;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `align-items`
  * `justify-items`


## Syntax
    
    /* Positional alignment */
    place-items: center;
    place-items: normal start;
    place-items: center normal;
    place-items: start legacy;
    place-items: end normal;
    place-items: self-start legacy;
    place-items: self-end normal;
    place-items: flex-start legacy;
    place-items: flex-end normal;
    place-items: anchor-center;
    
    /* Baseline alignment */
    place-items: baseline normal;
    place-items: first baseline legacy;
    place-items: last baseline normal;
    place-items: stretch legacy;
    
    /* Global values */
    place-items: inherit;
    place-items: initial;
    place-items: revert;
    place-items: revert-layer;
    place-items: unset;
    
### Values
One of the following forms:
  * A single `align-items` value, which is used to set alignment in both block and inline directions.
  * An `align-items` value, which sets alignment in the block direction, followed by a `justify-items` value, which sets alignment in the inline direction.


## Examples
>
### Placing items in a flex container
In flexbox `justify-self` or `justify-items` do not apply, as on the main axis items are treated as a group. Therefore, the second value will be ignored.
#### CSS
    
    #container {
      height: 200px;
      width: 240px;
      place-items: stretch; /* You can change this value by selecting another option in the list */
      background-color: #8c8c8c;
      display: flex;
    }
    
#### Result
### Placing items in a grid container
The following grid container has items which are smaller than the grid areas they are placed in, therefore `place-items` will move them in the block and inline dimensions.
#### CSS
    
    #grid-container {
      height: 200px;
      width: 240px;
      place-items: stretch; /* You can change this value by selecting another option in the list */
      background-color: #8c8c8c;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
    }
    
    #grid-container > div {
      width: 50px;
    }
    
#### Result
# border-end-end-radius
The `border-end-end-radius` CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode.
## Try it
    
    border-end-end-radius: 80px 80px;
    
    
    border-end-end-radius: 250px 100px;
    direction: rtl;
    
    
    border-end-end-radius: 50%;
    writing-mode: vertical-lr;
    
    
    border-end-end-radius: 50%;
    writing-mode: vertical-rl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a bottom right rounded corner.
      </div>
    </section>
    
    
    #example-element {
      width: 80%;
      height: 80%;
      display: flex;
      justify-content: center;
      flex-direction: column;
      background-color: #5b6dcd;
      color: white;
      padding: 10px;
    }
    
This property affects the corner between the block-end and the inline-end sides of the element. For instance, in a `horizontal-tb` writing mode with `ltr` direction, it corresponds to the `border-bottom-right-radius` property.
## Syntax
    
    /* <length> values */
    /* With one value the corner will be a circle */
    border-end-end-radius: 10px;
    border-end-end-radius: 1em;
    
    /* With two values the corner will be an ellipse */
    border-end-end-radius: 1em 2em;
    
    /* Global values */
    border-end-end-radius: inherit;
    border-end-end-radius: initial;
    border-end-end-radius: revert;
    border-end-end-radius: revert-layer;
    border-end-end-radius: unset;
    
### Values
`<length-percentage>`
    
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. As absolute length it can be expressed in any unit allowed by the CSS `<length>` data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
## Examples
>
### Border radius with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example</p>
    </div>
    
#### CSS
    
    div {
      background-color: rebeccapurple;
      width: 120px;
      height: 120px;
      border-end-end-radius: 10px;
    }
    
    .exampleText {
      writing-mode: vertical-rl;
      padding: 10px;
      background-color: white;
      border-end-end-radius: 10px;
    }
    
#### Result
# table-layout
The `table-layout` CSS property sets the algorithm used to lay out `<table>` cells, rows, and columns.
## Try it
    
    table-layout: auto;
    width: 150px;
    
    
    table-layout: fixed;
    width: 150px;
    
    
    table-layout: auto;
    width: 100%;
    
    
    table-layout: fixed;
    width: 100%;
    
    
    <section class="default-example" id="default-example">
      <table class="transition-all" id="example-element">
        <tr>
          <th>Name</th>
          <th>Location</th>
        </tr>
        <tr>
          <td>Lion</td>
          <td>Africa</td>
        </tr>
        <tr>
          <td>Norwegian Lemming</td>
          <td>Europe</td>
        </tr>
        <tr>
          <td>Seal</td>
          <td>Antarctica</td>
        </tr>
        <tr>
          <td>Tiger</td>
          <td>Asia</td>
        </tr>
      </table>
    </section>
    
    
    table {
      border: 1px solid #113399;
    }
    
    th,
    td {
      border: 2px solid #aa1199;
      padding: 0.25rem 0.5rem;
    }
    
## Syntax
    
    /* Keyword values */
    table-layout: auto;
    table-layout: fixed;
    
    /* Global values */
    table-layout: inherit;
    table-layout: initial;
    table-layout: revert;
    table-layout: revert-layer;
    table-layout: unset;
    
### Values
`auto`
    
The automatic table layout algorithm is used. The widths of the table and its cells are adjusted to fit the content. Most browsers use this algorithm by default.
`fixed`
    
The fixed table layout algorithm is used. When using this keyword, the table's width needs to be specified explicitly using the `width` property. If the value of the `width` property is set to `auto` or is not specified, the browser uses the automatic table layout algorithm, in which case the `fixed` value has no effect.  
The fixed table layout algorithm is faster than the automatic layout algorithm because the horizontal layout of the table depends only on the table's width, the width of the columns, and borders or cell spacing. The horizontal layout doesn't depend on the contents of the cells because it depends only on explicitly set widths.
In the fixed table layout algorithm, the width of each column is determined as follows:
  * A column element with explicit width sets the width for that column.
  * Otherwise, a cell in the first row with explicit width determines the width for that column.
  * Otherwise, the column gets the width from the shared remaining horizontal space.


With this algorithm the entire table can be rendered once the first table row has been downloaded and analyzed. This can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided. Cells use the `overflow` property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells.
## Examples
>
### Fixed-width tables with text-overflow
This example uses a fixed table layout, combined with the `width` property, to restrict the table's width. The `text-overflow` property is used to apply an ellipsis to words that are too long to fit. If the table layout were `auto`, the table would grow to accommodate its contents, despite the specified `width`.
#### HTML
    
    <table>
      <tr>
        <td>Ed</td>
        <td>Wood</td>
      </tr>
      <tr>
        <td>Albert</td>
        <td>Schweitzer</td>
      </tr>
      <tr>
        <td>Jane</td>
        <td>Fonda</td>
      </tr>
      <tr>
        <td>William</td>
        <td>Shakespeare</td>
      </tr>
    </table>
    
#### CSS
    
    table {
      table-layout: fixed;
      width: 120px;
      border: 1px solid red;
    }
    
    td {
      border: 1px solid blue;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    
#### Result
# <shape>
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The `<shape>` CSS data type defines the specific form (shape) of a region. The region represents the part of an element to which the `clip` property applies.
Note: `<shape>` and `rect()` work in conjunction with `clip`, which has been deprecated in favor of `clip-path`. When possible, use `clip-path` and the `<basic-shape>` data type instead.
## Syntax
The `<shape>` data type is specified using the `rect()` function, which produces a region in the form of a rectangle.
`rect()`
    
    rect(top, right, bottom, left)
    
### Values
top
    
Is a `<length>` representing the offset for the top of the rectangle relative to the top border of the element's box.
right
    
Is a `<length>` representing the offset for the right of the rectangle relative to the left border of the element's box.
bottom
    
Is a `<length>` representing the offset for the bottom of the rectangle relative to the top border of the element's box.
left
    
Is a `<length>` representing the offset for the left of the rectangle relative to the left border of the element's box.
## Interpolation
When animated, values of the `<shape>` data type are interpolated over their `top`, `right`, `bottom`, and `left` components, each treated as a real, floating-point number. The speed of the interpolation is determined by the easing function associated with the animation.
## Example
>
### Example demonstrating correct use of the rect() function
    
    img.clip04 {
      clip: rect(10px, 20px, 20px, 10px);
    }
    
# font-palette
The `font-palette` CSS property allows specifying one of the many palettes contained in a color font that a user agent may use for the font. Users can also override the values in a palette or create a new palette by using the `@font-palette-values` at-rule.
Note: A `font-palette` palette takes precedence when coloring a font. The `color` property will not override a font palette, even if specified with `!important`.
## Syntax
    
    /* Using a font-defined palette */
    font-palette: normal;
    
    /* Using a user-defined palette */
    font-palette: --one;
    
    /* Creating a new palette by blending two others */
    font-palette: palette-mix(in lch, --blue, --yellow);
    
### Values
`normal`
    
Specifies the default color palette or the default glyph colorization (set by the font maker) to be used for the font. With this setting, the palette in the font at index 0 is rendered.
`light`
    
Specifies the first palette in the font that matches 'light' to be used for the font. Some fonts contain metadata that identify a palette as applicable for a light (close to white) background. If a font does not have this metadata, the `light` value behaves as `normal`.
`dark`
    
Specifies the first palette in the font that matches 'dark' to be used for the font. Some fonts contain metadata that identify a palette as applicable for a dark (close to black) background. If a font does not have this metadata, the value behaves as `normal`.
`<palette-identifier>`
    
Allows you to specify your own values for the font palette by using the @font-palette-values at-rule. This value is specified using the <dashed-ident> format.
`palette-mix()`
    
Creates a new `font-palette` value by blending together two `font-palette` values by specified percentages and color interpolation methods.
## Examples
>
### Specifying a dark palette
This example allows you to use the first palette marked as dark (works best on a near black background) by the font-maker.
    
    @media (prefers-color-scheme: dark) {
      .banner {
        font-palette: dark;
      }
    }
    
### Animating between two palettes
This example illustrates how to animate `font-palette` value changes to create a smooth font animation.
#### HTML
The HTML contains a single paragraph of text to animate:
    
    <p>color-palette<br />animation</p>
    
#### CSS
In the CSS, we import a color font called Nabla from Google Fonts, and define two custom `font-palette` values using the `@font-palette-values` at-rule. We then create `@keyframes` that animate between these two palettes, and apply this animation to our paragraph.
    
    @import "https://fonts.googleapis.com/css2?family=Nabla&display=swap";
    
    @font-palette-values --blue-nabla {
      font-family: Nabla;
      base-palette: 2; /* this is Nabla's blue palette */
    }
    
    @font-palette-values --grey-nabla {
      font-family: Nabla;
      base-palette: 3; /* this is Nabla's grey palette */
    }
    
    @keyframes animate-palette {
      from {
        font-palette: --grey-nabla;
      }
    
      to {
        font-palette: --blue-nabla;
      }
    }
    
    p {
      font-family: "Nabla", fantasy;
      font-size: 5rem;
      margin: 0;
      text-align: center;
      animation: animate-palette 4s infinite alternate linear;
    }
    
#### Result
The output looks like this:
Note: Browsers that still implement `discrete` `font-palette` animation will flip between the two palettes rather than smoothly animating.
# :optional
The `:optional` CSS pseudo-class represents any `<input>`, `<select>`, or `<textarea>` element that does not have the `required` attribute set on it.
## Try it
    
    label {
      display: block;
      margin-top: 1em;
    }
    
    .req {
      color: red;
    }
    
    *:optional {
      background-color: palegreen;
    }
    
    
    <form>
      <label for="name">Name: <span class="req">*</span></label>
      <input id="name" name="name" type="text" required />
    
      <label for="birth">Date of Birth:</label>
      <input id="birth" name="birth" type="date" />
    
      <label for="origin"
        >How did you find out about us? <span class="req">*</span></label
      >
      <select id="origin" name="origin" required>
        <option>Google</option>
        <option>Facebook</option>
        <option>Advertisement</option>
      </select>
      <p><span class="req">*</span> - Required field</p>
    </form>
    
This pseudo-class is useful for styling fields that are not required to submit a form.
Note: The `:required` pseudo-class selects required form fields.
## Syntax
    
    :optional {
      /* ... */
    }
    
## Accessibility
If a form contains optional `<input>`s, required inputs should be indicated using the `required` attribute. This will ensure that people navigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful form submission.
Required inputs should also be indicated visually, using a treatment that does not rely solely on color to convey meaning. Typically, descriptive text and/or an icon are used.
  * MDN Understanding WCAG, Guideline 3.3 explanations
  * Understanding Success Criterion 3.3.2 | W3C Understanding WCAG 2.0


## Examples
>
### The optional field has a purple border
#### HTML
    
    <form>
      <div class="field">
        <label for="url_input">Enter a URL:</label>
        <input type="url" id="url_input" />
      </div>
    
      <div class="field">
        <label for="email_input">Enter an email address:</label>
        <input type="email" id="email_input" required />
      </div>
    </form>
    
#### CSS
    
    label {
      display: block;
      margin: 1px;
      padding: 1px;
    }
    
    .field {
      margin: 1px;
      padding: 1px;
    }
    
    input:optional {
      border-color: rebeccapurple;
      border-width: 3px;
    }
    
#### Result
# border-block-color
The `border-block-color` CSS property defines the color of the logical block borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-color: red;
    writing-mode: horizontal-tb;
    
    
    border-block-color: #32a1ce;
    writing-mode: vertical-rl;
    
    
    border-block-color: rgb(170 50 220 / 0.6);
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border color in the other dimension can be set with `border-inline-color` which sets `border-inline-start-color`, and `border-inline-end-color`.
## Syntax
    
    border-block-color: yellow;
    border-block-color: #f5f6f7;
    
    /* Global values */
    border-block-color: inherit;
    border-block-color: initial;
    border-block-color: revert;
    border-block-color: revert-layer;
    border-block-color: unset;
    
### Values
`<color>`
    
The color of the border.
## Examples
>
### Border with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 10px solid blue;
      border-block-color: red;
    }
    
#### Results
# CSS view transitions
The CSS view transitions module defines the behavior of the View Transition API, which allows developers to create animated transitions between different states within a document and across documents. This module also defines the CSS properties and pseudo-elements for styling these transitions.
## Reference
>
### Properties
  * `view-transition-class`
  * `view-transition-name`


### At-rules and descriptors
  * `@view-transition`
    * `navigation` descriptor


### Selectors and pseudo-elements
  * `:active-view-transition`
  * `:active-view-transition-type()`
  * `::view-transition`
  * `::view-transition-image-pair()`
  * `::view-transition-group()`
  * `::view-transition-new()`
  * `::view-transition-old()`


### Interfaces
  * `CSSViewTransitionRule`
  * `ViewTransition`
    * `ViewTransition.skipTransition()` method
    * `ViewTransition.updateCallbackDone`
    * `ViewTransition.ready`
    * `ViewTransition.finished`
  * `Document.startViewTransition()` method


## Guides
Using the View Transition API
    
Explains how to create view transitions and customize transition animations, including manipulating active view transitions.
## Related concepts
  * `pagereveal` event
  * `pageswap` event
  * `Document.visibilityState`
  * CSS animations module
    * `animation`
    * `@keyframes`
    * `CSSKeyframesRule`
    * `CSSStyleRule`
    * Web animations API
  * CSS transforms module
    * `transform`
    * `<transform-function>`


# ::slotted()
The `::slotted()` CSS pseudo-element represents any element that has been placed into a slot inside an HTML template (see Using templates and slots for more information).
This only works when used inside CSS placed within a shadow DOM. Note that this selector won't select a text node placed into a slot; it only targets actual elements.
## Try it
    
    /* This CSS is being applied inside the shadow DOM. */
    
    ::slotted(.content) {
      background-color: aqua;
    }
    
    h2 ::slotted(span) {
      background: silver;
    }
    
    
    <template id="card-template">
      <div>
        <h2><slot name="caption">title goes here</slot></h2>
        <slot name="content">content goes here</slot>
      </div>
    </template>
    
    <my-card>
      <span slot="caption">Error</span>
      <p class="content" slot="content">Build failed!</p>
    </my-card>
    
    
    customElements.define(
      "my-card",
      class extends HTMLElement {
        constructor() {
          super();
    
          const template = document.getElementById("card-template");
          const shadow = this.attachShadow({ mode: "open" });
          shadow.appendChild(template.content.cloneNode(true));
    
          const elementStyle = document.createElement("style");
          elementStyle.textContent = `
            div {
              width: 200px;
              border: 2px dotted red;
              border-radius: 4px;
            }`;
          shadow.appendChild(elementStyle);
    
          const cssTab = document.querySelector("#css-output");
          const editorStyle = document.createElement("style");
          editorStyle.textContent = cssTab.textContent;
          shadow.appendChild(editorStyle);
          cssTab.addEventListener("change", () => {
            editorStyle.textContent = cssTab.textContent;
          });
        }
      },
    );
    
    
    /* Selects any element placed inside a slot */
    ::slotted(*) {
      font-weight: bold;
    }
    
    /* Selects any <span> placed inside a slot */
    ::slotted(span) {
      font-weight: bold;
    }
    
## Syntax
    
    ::slotted(<compound-selector>) {
      /* ... */
    }
    
## Examples
>
### Highlighting slotted elements
In this example, we use a template with three slots:
    
    <template id="person-template">
      <div>
        <h2>Personal ID Card</h2>
        <slot name="person-name">NAME MISSING</slot>
        <ul>
          <li><slot name="person-age">AGE MISSING</slot></li>
          <li><slot name="person-occupation">OCCUPATION MISSING</slot></li>
        </ul>
      </div>
    </template>
    
We define the `<person-details>` custom element. In this case, we add styles with JavaScript, though we could have added them in a `<style>` block within the `<template>` with the same effect:
    
    customElements.define(
      "person-details",
      class extends HTMLElement {
        constructor() {
          super();
          let template = document.getElementById("person-template");
          let templateContent = template.content;
    
          const shadowRoot = this.attachShadow({ mode: "open" });
    
          let style = document.createElement("style");
          style.textContent =
            "div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }" +
            "h2 { margin: 0 0 10px; }" +
            "ul { margin: 0; }" +
            "p { margin: 10px 0; }" +
            "::slotted(*) { color: gray; font-family: sans-serif; } " +
            "::slotted(span) {text-decoration: underline;} ";
    
          shadowRoot.appendChild(style);
          shadowRoot.appendChild(templateContent.cloneNode(true));
        }
      },
    );
    
When filling the `style` element with content, you'll see that we select all slotted elements (`::slotted(*)`) and give them a different font and color. This differentiates them from the slots that haven't been filled. We styled all the slotted `<span>`s (`::slotted(span)`) to differentiate the `<span>`s from the `<p>`s.
Our markup includes three custom elements, including a custom element with an invalid slot name in a source order that differs from the `<template>`:
    
    <person-details>
      <p slot="person-name">Wonder Woman</p>
      <span slot="person-age">Immortal</span>
      <span slot="person-occupation">Superhero</span>
    </person-details>
    
    <person-details>
      <p slot="person-name">Malala Yousafzai</p>
      <span slot="person-age">17</span>
      <span slot="person-occupation">Activist</span>
    </person-details>
    
    <person-details>
      <span slot="person-age">44</span>
      <span slot="not-a-slot-name">Time traveler</span>
      <p slot="person-name">Dr. Who</p>
    </person-details>
    
#### Result
# :-moz-last-node
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `:-moz-last-node` CSS pseudo-class is a Mozilla extension that represents any element that is the last child node of some other element. It differs from `:last-child` because it does not match a last-child element with (non-whitespace) text after it.
Note: Any whitespace at the end of an element is ignored for the determination of `:-moz-last-node`.
## Syntax
    
    :-moz-last-node {
      /* ... */
    }
    
## Examples
>
### CSS
    
    span:-moz-last-node {
      background-color: lime;
    }
    
### HTML
    
    <p>
      <span>This does not match.</span>
      <span>This matches!</span>
    </p>
    
    <p>
      <span>This doesn't match because it's followed by text.</span>
      Blahblah.
    </p>
    
### Result
Not part of any standard.
# border-collapse
The `border-collapse` CSS property sets whether cells inside a `<table>` have shared or separate borders.
## Try it
    
    border-collapse: collapse;
    
    
    border-collapse: separate;
    
    
    <section class="default-example" id="default-example">
      <table class="transition-all" id="example-element">
        <tr>
          <td>Cell 1.1</td>
          <td>Cell 1.2</td>
        </tr>
        <tr>
          <td>Cell 2.1</td>
          <td>Cell 2.2</td>
        </tr>
        <tr>
          <td>Cell 3.1</td>
          <td>Cell 3.2</td>
        </tr>
      </table>
    </section>
    
    
    table {
      width: 15rem;
      table-layout: fixed;
    }
    
    td {
      border: 5px solid;
      border-color: crimson dodgerblue orange limegreen;
      padding: 0.75rem;
    }
    
When cells are collapsed, the `border-style` value of `inset` behaves like `ridge`, and `outset` behaves like `groove`.
When cells are separated, the distance between cells is defined by the `border-spacing` property.
## Syntax
    
    /* Keyword values */
    border-collapse: collapse;
    border-collapse: separate;
    
    /* Global values */
    border-collapse: inherit;
    border-collapse: initial;
    border-collapse: revert;
    border-collapse: revert-layer;
    border-collapse: unset;
    
The `border-collapse` property is specified as a single keyword, which may be chosen from the list below.
### Values
`collapse`
    
Adjacent cells have shared borders (the collapsed-border table rendering model).
`separate`
    
Adjacent cells have distinct borders (the separated-border table rendering model).
## Examples
>
### A colorful table of browser engines
#### HTML
    
    <table class="separate">
      <caption>
        <code>border-collapse: separate</code>
      </caption>
      <tbody>
        <tr>
          <th>Browser</th>
          <th>Layout Engine</th>
        </tr>
        <tr>
          <td class="fx">Firefox</td>
          <td class="gk">Gecko</td>
        </tr>
        <tr>
          <td class="ed">Edge</td>
          <td class="tr">EdgeHTML</td>
        </tr>
        <tr>
          <td class="sa">Safari</td>
          <td class="wk">WebKit</td>
        </tr>
        <tr>
          <td class="ch">Chrome</td>
          <td class="bk">Blink</td>
        </tr>
        <tr>
          <td class="op">Opera</td>
          <td class="bk">Blink</td>
        </tr>
      </tbody>
    </table>
    <table class="collapse">
      <caption>
        <code>border-collapse: collapse</code>
      </caption>
      <tbody>
        <tr>
          <th>Browser</th>
          <th>Layout Engine</th>
        </tr>
        <tr>
          <td class="fx">Firefox</td>
          <td class="gk">Gecko</td>
        </tr>
        <tr>
          <td class="ed">Edge</td>
          <td class="tr">EdgeHTML</td>
        </tr>
        <tr>
          <td class="sa">Safari</td>
          <td class="wk">WebKit</td>
        </tr>
        <tr>
          <td class="ch">Chrome</td>
          <td class="bk">Blink</td>
        </tr>
        <tr>
          <td class="op">Opera</td>
          <td class="bk">Blink</td>
        </tr>
      </tbody>
    </table>
    
#### CSS
    
    .collapse {
      border-collapse: collapse;
    }
    
    .separate {
      border-collapse: separate;
    }
    
    table {
      display: inline-table;
      margin: 1em;
      border: dashed 5px;
    }
    
    table th,
    table td {
      border: solid 3px;
    }
    
    .fx {
      border-color: orange blue;
    }
    .gk {
      border-color: black red;
    }
    .ed {
      border-color: blue gold;
    }
    .tr {
      border-color: aqua;
    }
    .sa {
      border-color: silver blue;
    }
    .wk {
      border-color: gold blue;
    }
    .ch {
      border-color: red yellow green blue;
    }
    .bk {
      border-color: navy blue teal aqua;
    }
    .op {
      border-color: red;
    }
    
#### Result
# Column combinator
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The column combinator (`||`) is placed between two CSS selectors. It matches only those elements matched by the second selector that belong to the column elements matched by the first.
    
    /* Table cells that belong to the "selected" column */
    col.selected||td {
      background: gray;
    }
    
## Syntax
    
    /* The white space around the || combinator is optional but recommended. */
    column-selector || cell-selector {
      /* style properties */
    }
    
## Examples
>
### HTML
    
    <table border="1">
      <colgroup>
        <col span="2" />
        <col class="selected" />
      </colgroup>
      <tbody>
        <tr>
          <td>A</td>
          <td>B</td>
          <td>C</td>
        </tr>
    
        <tr>
          <td colspan="2">D</td>
          <td>E</td>
        </tr>
        <tr>
          <td>F</td>
          <td colspan="2">G</td>
        </tr>
      </tbody>
    </table>
    
### CSS
    
    col.selected||td {
      background: gray;
      color: white;
      font-weight: bold;
    }
    
### Result
Currently, no browsers support this feature.
# ::view-transition-image-pair()
The `::view-transition-image-pair()` CSS pseudo-element represents a container for a view transition's "old" and "new" view states — before and after the transition.
During a view transition, `::view-transition-image-pair()` is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree. It is only ever a child of a `::view-transition-group()`. In terms of children, it can have a `::view-transition-new()` or a `::view-transition-old()`, or both.
`::view-transition-image-pair()` is given the following default styling in the UA stylesheet:
    
    :root::view-transition-image-pair(*) {
      position: absolute;
      inset: 0;
    
      animation-duration: inherit;
      animation-fill-mode: inherit;
      animation-delay: inherit;
    }
    
During a view transition, `::view-transition-image-pair()` has `isolation: isolate` set on it in the view transition style sheet so that its children can be blended with non-normal blend modes without affecting other visual outputs.
## Syntax
    
    ::view-transition-image-pair([ <pt-name-selector> <pt-class-selector>? ] | <pt-class-selector>) {
      /* ... */
    }
    
### Parameters
`*`
    
The universal selector (`*`); selects all view transition groups on a page.
`root`
    
Causes the pseudo-element to match the default `root` view transition snapshot group created by the user agent to contain the view transition for the overall page. This group includes any element not assigned to its own specific view transition snapshot group via the `view-transition-name` property.
`<pt-name-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-name` property.
`<pt-class-selector>`
    
The `<custom-ident>` set as the value of the `view-transition-class` property preceded by a period (`.`).
## Examples
    
    ::view-transition-image-pair(root) {
      isolation: auto;
    }
    
    ::view-transition-image-pair(.card) {
      isolation: isolate;
    }
    
# reading-order
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `reading-order` CSS property enables changing the order in which a child of a reading flow container is read relative to its element siblings.
## Syntax
    
    /* <integer> values */
    reading-order: 1;
    reading-order: -1;
    
    /* Global values */
    reading-order: inherit;
    reading-order: initial;
    reading-order: revert;
    reading-order: revert-layer;
    reading-order: unset;
    
### Value
`<integer>`
    
Represents the ordinal group the element belongs to.
## Description
When an element's block, flex, or grid parent container has a `reading-flow` property set to a value other than `normal`, the `reading-order` property can be used to set the element's reading flow position relative to that of its siblings.
For reading and navigation, elements inside a block, flex, or grid container are sorted by ascending `reading-order` value. If multiple siblings have the same `reading-order` value, those items are sorted according to the container's `reading-flow`. Siblings not given an explicit `reading-order` value are assigned the default value of `0`, which puts all the children of a reading flow container in the same ordinal group by default.
Sibling elements are ordered starting from the lowest numbered ordinal group to the highest. Therefore, to cause an element to be read out after its siblings, you could set a `reading-order` value or `1` or more on it. To cause an element to be read out before its siblings, you could set a `reading-order` value or `-1` or less on it.
The `reading-order` defines the reading and tabbing order, but has no effect on visual order.
### Interaction with `tabindex`
If a set of reading flow container child elements that are not normally focusable are made focusable with `tabindex="0"` attributes, their reading order will be modified as expected by the `reading-flow` and `reading-order` properties, in just the same way as interactive elements such as `<a>` or `<button>`.
However, any attempt to modify the tabbing order of a reading flow container's content using positive `tabindex` values will be ignored — overridden by the effects of `reading-flow` and `reading-order`. You generally shouldn't be using these anyway; see Don't Use Tabindex Greater than 0. The `reading-flow` and `reading-order` properties provide a much better way to modify tabbing order if required.
## Examples
>
### Grid row order
This example demonstrates using `reading-order` to control the positions of individual grid items within a grid container's reading order. One grid item has a `reading-order` value that is lower than the default `0`, so will be read out before its sibling elements. Another has a higher `reading-order` value set, so will be read out after the others, regardless of source or display order.
#### HTML
In our markup we have six `<a>` elements contained inside a wrapper `<div>`.
    
    <div class="wrapper">
      <a href="#">Item 1</a>
      <a class="bottom" href="#">Item 2</a>
      <a href="#">Item 3</a>
      <a class="top" href="#">Item 4</a>
      <a href="#">Item 5</a>
      <a href="#">Item 6</a>
    </div>
    
#### CSS
On the `<div>`, we set the grid-auto-flow property to `dense`, therefore items may display out of source order. The `reading-order` property on the `<a>` element with a class of `top` is set to `-1`, therefore "Item 4" will be the first item in reading flow. The `reading-order` property on the `<a>` element with a class of `bottom` is set to `21`, therefore "Item 4" will be the last item in the reading order. The remaining items will be visited in between, in grid row order, as the `<div>` element's `reading-flow` property is set to grid-rows.
    
    .wrapper {
      display: grid;
      grid-template-columns: repeat(3, 150px);
      grid-auto-flow: dense;
      reading-flow: grid-rows;
    }
    
    .top {
      reading-order: -1;
    }
    
    .bottom {
      reading-order: 21;
    }
    
#### Result
The above demo renders as follows:
Try tabbing through the links. Note how "Item 4" is tabbed to first and "Item 2" is tabbed to last because of their modified `reading-order` values. In between, the items are tabbed to in grid row order.
### Source order override
In this example, the odd-numbered items have a lower `reading-order` value set, so will be read out before the others in a group, regardless of source or display order.
#### HTML
In our markup, we have five `<a>` elements contained inside a wrapper `<div>`.
    
    <div class="wrapper">
      <a href="#">Item 1</a>
      <a href="#">Item 2</a>
      <a href="#">Item 3</a>
      <a href="#">Item 4</a>
      <a href="#">Item 5</a>
    </div>
    
#### CSS
The `<div>` element's `reading-flow` property is set to `source-order`, which allows `reading-order` to be used to override the default source reading order. The odd-numbered `<a>` elements have a `reading-order` value of `-1`, therefore they are read out before the even-numbered items.
    
    .wrapper {
      reading-flow: source-order;
    }
    
    .wrapper > a {
      display: block;
    }
    
    .wrapper a:nth-child(odd) {
      reading-order: -1;
    }
    
#### Result
The above demo renders as follows:
Try tabbing through the links, and note how "Item 1", "Item 3", and "Item 5" are tabbed to first because of their modified `reading-order`. After that, the items are tabbed to in source order.
# <basic-shape>
The `<basic-shape>` CSS data type represents a shape used in the `clip-path`, `shape-outside`, and `offset-path` properties.
## Try it
    
    clip-path: inset(22% 12% 15px 35px);
    
    
    clip-path: circle(6rem at 12rem 8rem);
    
    
    clip-path: ellipse(115px 55px at 50% 40%);
    
    
    clip-path: polygon(
      50% 2.4%,
      34.5% 33.8%,
      0% 38.8%,
      25% 63.1%,
      19.1% 97.6%,
      50% 81.3%,
      80.9% 97.6%,
      75% 63.1%,
      100% 38.8%,
      65.5% 33.8%
    );
    
    
    clip-path: path("M 50,245 A 160,160 0,0,1 360,120 z");
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element"></div>
    </section>
    
    
    #default-example {
      background: #ffee99;
    }
    
    #example-element {
      background: linear-gradient(to bottom right, #ff5522, #0055ff);
      width: 100%;
      height: 100%;
    }
    
## Syntax
The `<basic-shape>` data type is used to create basic shapes including rectangles by container inset, by coordinate distance, or by set dimensions, circles, ellipses, polygons, paths, and author created shapes. These basic shapes are defined using one `<basic_shape>` CSS functions, with each value requiring a parameter that follows the shape's function-specific syntax.
### Common parameters
The parameters common across the syntax of some basic shape functions include:
`round <'border-radius'>`
    
Defines rounded corners for rectangles by container insets, rectangles by distance, and rectangles with dimensions using the same syntax as the CSS `border-radius` shorthand property.
`<shape-radius>`
    
Defines the radius for a circle or an ellipse. Valid values include `<length>`, `<percentage>`, `closest-side` (the default), and `farthest-side`. Negative values are invalid.
The `closest-side` keyword value uses the length from the center of the shape to the closest side of the reference box to create the radius length. The `farthest-side` keyword value uses the length from the center of the shape to the farthest side of the reference box.
`<position>`
    
Defines the center `<position>` of a circle or an ellipse. It defaults to `center` if omitted.
`<fill-rule>`
    
Sets the `fill-rule` that is used to determine how the interior of the shape defined by the basic shapes polygon, path, and shape is to be filled. Possible values are `nonzero` (the default) and `evenodd`.
Note: `<fill-rule>` is not supported in `offset-path` and using it invalidates the property.
### Syntax for rectangles by container insets
The `inset()` function creates an inset rectangle, with its size defined by the offset distance of each of the four sides of its container and, optionally, rounded corners.
    
    inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )
    
When all of the first four arguments are supplied, they represent the top, right, bottom, and left offsets from the reference box inward that define the position of the edges of the inset rectangle. These arguments follow the syntax of the `margin` shorthand, which lets you set all four insets with one, two, three, or four values.
If a pair of insets for a dimension adds up to more than 100% of that dimension, both values are proportionally reduced so their sum equals 100%. For example, the value `inset(90% 10% 60% 10%)` has a top inset of `90%` and a bottom inset of `60%`. These values are reduced proportionally to `inset(60% 10% 40% 10%)`. Shapes such as this, that enclose no area and have no `shape-margin`, do not affect wrapping.
### Syntax for rectangles by distance
The `rect()` function defines a rectangle using the specified distances from the top and left edges of the reference box, with optional rounded corners.
    
    rect( [ <length-percentage> | auto ]{4} [ round <'border-radius'> ]? )
    
When using the `rect()` function, you do not define the width and height of the rectangle. Instead, you specify four values to create the rectangle, with its dimensions determined by the size of the reference box and the four offset values. Each value can be either a `<length>`, a `<percentage>`, or the keyword `auto`. The `auto` keyword is interpreted as `0%` for the top and left values and as `100%` for the bottom and right values.
### Syntax for rectangles with dimensions
The `xywh()` function defines a rectangle located at the specified distances from the left (`x`) and top (`y`) edges of the reference box and sized by the specified width (`w`) and height (`h`) of the rectangle, in that order, with optional rounded corners.
    
    xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [ round <'border-radius'> ]? )
    
### Syntax for circles
The `circle()` function defines a circle using a radius and a position.
    
    circle( <shape-radius>? [ at <position> ]? )
    
The `<shape-radius>` argument represents the radius of the circle defined as either a `<length>` or a `<percentage>`. A percentage value here is resolved from the used width and height of the reference box as `sqrt(width^2+height^2)/sqrt(2)`. If omitted, the radius is defined by `closest-side`.
### Syntax for ellipses
The `ellipse()` function defines an ellipse using two radii and a position.
    
    ellipse( [ <shape-radius>{2} ]? [ at <position> ]? )
    
The `<shape-radius>` arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order. These values are specified as either a `<length>` or a `<percentage>`. Percentage values here are resolved against the used width (for the rx value) and the used height (for the ry value) of the reference box. If only one radius value is provided, the `ellipse()` shape function is invalid. If no value is provided, `50% 50%` is used.
### Syntax for polygons
The `polygon()` function defines a polygon using an SVG `fill-rule` and a set of coordinates.
    
    polygon( <'fill-rule'>? , [ <length-percentage> <length-percentage> ]# )
    
The function takes a list of comma-separated coordinate pairs, each consisting of two space-separated `<length-percentage>` values as the xi and yi pair. These values represent the x and y axis coordinates of the polygon at position i (the vertex point where two lines meet).
### Syntax for paths
The `path()` function defines a shape using an SVG `fill-rule` and an SVG path definition.
    
    path( <'fill-rule'>? , <string> )
    
The required `<string>` is an SVG path as a quoted string. The `path()` function is not a valid `shape-outside` property value.
### Syntax for shapes
The `shape()` function defines a shape using an initial starting point and a series of shape commands.
    
    shape( <'fill-rule'>? from <coordinate-pair> , <shape-command># )
    
The `from <coordinate-pair>` parameter represents the starting point for the first shape command, and `<shape-command>` defines one or more shape commands, which are similar to the SVG path commands. The `shape()` function is not a valid `shape-outside` property value.
## Description
When creating a shape, the reference box is defined by the property that uses `<basic-shape>` values. The coordinate system for the shape has its origin at the top-left corner of the element's margin box by default, with the x-axis running to the right and the y-axis running downwards. All the lengths expressed in percentages are resolved from the dimensions of the reference box.
The default reference box is the `margin-box`, as demonstrated in the image below. The image shows a circle created using `shape-outside: circle(50%)`, highlighting the different parts of the box model as seen in a browser's Developer Tools. The shape here is defined with reference to the margin-box.
### Computed values of basic shapes
The values in a `<basic-shape>` function are computed as specified, with the following additional considerations:
  * For any omitted values, their defaults are used.
  * A `<position>` value in `circle()` or `ellipse()` is computed as a pair of offsets from the top left corner of the reference box: the first offset is horizontal, and the second is vertical. Each offset is specified as a `<length-percentage>` value.
  * A `<border-radius>` value in `inset()` is expanded into a list of eight values, each either a `<length>` or a `<percentage>`.
  * `inset()`, `rect()`, and `xywh()` functions compute to the equivalent `inset()` function.


### Interpolation of basic shapes
When animating between two `<basic-shape>` functions, the interpolation rules listed below are followed. The parameter values of each `<basic-shape>` function form a list. For interpolation to occur between two shapes, both shapes must use the same reference box and the number and type of values in both `<basic-shape>` lists must match.
Each value in the lists of the two `<basic-shape>` functions is interpolated based on its computed value as a `<number>`, `<length>`, `<percentage>`, `<angle>`, or `calc()` where possible. Interpolation can still occur if the values are not one of those data types but are identical between the two interpolating basic shape functions, such as `nonzero`.
  * Both shapes are of type `ellipse()` or type `circle()`: Interpolation is applied between each corresponding value if their radii are specified as either a `<length>` or a `<percentage>` (rather than keywords such as `closest-side` or `farthest-side`).
  * `inset()`: Interpolation is applied between each corresponding value.
  * `polygon()`: Interpolation is applied between each corresponding value if they use the same `<fill-rule>` and have the same number of comma-separated coordinate pairs.
  * `path()`: Interpolation is applied to each parameter as a `<number>` if the path strings in both the shapes match the number, type, and sequence of path data commands.
  * `shape()`: Interpolation is applied between each corresponding value if they have the identical command keyword and use the same `<by-to>` keyword. If `shape()` is used in the `clip-path` property, the two shapes interpolate if they also have the same `<fill-rule>`.
    * If they use the `<curve-command>` or the `<smooth-command>`, the number of control points must match for interpolation.
    * If they use the `<arc-command>` with different `<arc-sweep>` directions, the interpolated result goes clockwise (`cw`). If they use different `<arc-size>` keywords, the size is interpolated using the `large` value.
  * One shape is of type `path()` and the other is of type `shape()`: Interpolation is applied between each corresponding value if the list of path data commands is identical in number as well as sequence. The interpolated shape is a `shape()` function, maintaining the same list of path data commands.


In all other cases, no interpolation occurs and the animation is discrete.
## Examples
>
### Animated polygon
In this example, we use the @keyframes at-rule to animate a clip path between two polygons. Note that both polygons have the same number of vertices, which is necessary for this type of animation to work.
#### HTML
    
    <div></div>
    
#### CSS
    
    div {
      width: 300px;
      height: 300px;
      background: repeating-linear-gradient(red, orange 50px);
      clip-path: polygon(
        50% 0%,
        60% 40%,
        100% 50%,
        60% 60%,
        50% 100%,
        40% 60%,
        0% 50%,
        40% 40%
      );
      animation: 4s poly infinite alternate ease-in-out;
      margin: 10px auto;
    }
    
    @keyframes poly {
      from {
        clip-path: polygon(
          50% 0%,
          60% 40%,
          100% 50%,
          60% 60%,
          50% 100%,
          40% 60%,
          0% 50%,
          40% 40%
        );
      }
    
      to {
        clip-path: polygon(
          50% 30%,
          100% 0%,
          70% 50%,
          100% 100%,
          50% 70%,
          0% 100%,
          30% 50%,
          0% 0%
        );
      }
    }
    
#### Result
# transform-origin
The `transform-origin` CSS property sets the origin for an element's transformations.
## Try it
    
    transform-origin: center;
    
    
    transform-origin: top left;
    
    
    transform-origin: 50px 50px;
    
    
    /* 3D rotation with z-axis origin */
    transform-origin: bottom right 60px;
    
    
    <section id="default-example">
      <div id="example-container">
        <div id="example-element">Rotate me!</div>
        <img
          alt=""
          id="crosshair"
          src="/shared-assets/images/examples/crosshair.svg"
          width="24px" />
        <div id="static-element"></div>
      </div>
    </section>
    
    
    @keyframes rotate {
      from {
        transform: rotate(0);
      }
    
      to {
        transform: rotate(30deg);
      }
    }
    
    @keyframes rotate3d {
      from {
        transform: rotate3d(0, 0, 0, 0);
      }
    
      to {
        transform: rotate3d(1, 2, 0, 60deg);
      }
    }
    
    #example-container {
      width: 160px;
      height: 160px;
      position: relative;
    }
    
    #example-element {
      width: 100%;
      height: 100%;
      display: flex;
      position: absolute;
      align-items: center;
      justify-content: center;
      background: #f7ebee;
      color: black;
      font-size: 1.2rem;
      text-transform: uppercase;
    }
    
    #example-element.rotate {
      animation: rotate 1s forwards;
    }
    
    #example-element.rotate3d {
      animation: rotate3d 1s forwards;
    }
    
    #crosshair {
      width: 24px;
      height: 24px;
      opacity: 0;
      position: absolute;
    }
    
    #static-element {
      width: 100%;
      height: 100%;
      position: absolute;
      border: dotted 3px #ff1100;
    }
    
    
    function update() {
      const selected = document.querySelector(".selected");
    
      /* Restart the animation
               https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Tips */
      el.className = "";
      window.requestAnimationFrame(() => {
        window.requestAnimationFrame(() => {
          el.className =
            el.style.transformOrigin.split(" ")[2] === "60px"
              ? "rotate3d"
              : "rotate";
        });
      });
    
      const transformOrigin = getComputedStyle(el).transformOrigin;
      const pos = transformOrigin.split(/\s+/);
      crosshair.style.left = `calc(${pos[0]} - 12px)`;
      crosshair.style.top = `calc(${pos[1]} - 12px)`;
    }
    
    const crosshair = document.getElementById("crosshair");
    const el = document.getElementById("example-element");
    
    const observer = new MutationObserver(() => {
      update();
    });
    
    observer.observe(el, {
      attributes: true,
      attributeFilter: ["style"],
    });
    
    update();
    crosshair.style.opacity = "1";
    
The transform origin is the point around which a transformation is applied. For example, the transform origin of the `rotate()` function is the center of rotation.
In effect, this property wraps a pair of translations around the element's other transformations. The first translation moves the transform origin to the true origin at (0,0). Then the other transformations are applied, and because the transform origin is at (0,0), those transformations act about the transform origin. Finally, the opposite translation is applied, moving the transform origin back to its original location. Consequently, this definition
    
    transform-origin: -100% 50%;
    transform: rotate(45deg);
    
results in the same transformation as
    
    transform-origin: 0 0;
    transform: translate(-100%, 50%) rotate(45deg) translate(100%, -50%);
    
Reading from right to left, `translate(100%, -50%)` is the translation to bring the transform origin to the true origin, `rotate(45deg)` is the original transformation, and `translate(-100%, 50%)` is the translation to restore the transform origin to its original location.
By default, the origin of a transform is `center`.
## Syntax
    
    /* One-value syntax */
    transform-origin: 2px;
    transform-origin: bottom;
    
    /* x-offset | y-offset */
    transform-origin: 3cm 2px;
    
    /* x-offset-keyword | y-offset */
    transform-origin: left 2px;
    
    /* x-offset-keyword | y-offset-keyword */
    transform-origin: right top;
    
    /* y-offset-keyword | x-offset-keyword */
    transform-origin: top right;
    
    /* x-offset | y-offset | z-offset */
    transform-origin: 2px 30% 10px;
    
    /* x-offset-keyword | y-offset | z-offset */
    transform-origin: left 5px -3px;
    
    /* x-offset-keyword | y-offset-keyword | z-offset */
    transform-origin: right bottom 2cm;
    
    /* y-offset-keyword | x-offset-keyword | z-offset */
    transform-origin: bottom right 2cm;
    
    /* Global values */
    transform-origin: inherit;
    transform-origin: initial;
    transform-origin: revert;
    transform-origin: revert-layer;
    transform-origin: unset;
    
The `transform-origin` property may be specified using one, two, or three values, where each value represents an offset. Offsets that are not explicitly defined are reset to their corresponding initial values.
If a single `<length>` or `<percentage>` value is defined, it represents the horizontal offset.
If two or more values are defined and either no value is a keyword, or the only used keyword is `center`, then the first value represents the horizontal offset and the second represents the vertical offset.
  * One-value syntax:
    * The value must be a `<length>`, a `<percentage>`, or one of the keywords `left`, `center`, `right`, `top`, and `bottom`.
  * Two-value syntax:
    * One value must be a `<length>`, a `<percentage>`, or one of the keywords `left`, `center`, and `right`.
    * The other value must be a `<length>`, a `<percentage>`, or one of the keywords `top`, `center`, and `bottom`.
  * Three-value syntax:
    * The first two values are the same as for the two-value syntax.
    * The third value must be a `<length>`. It always represents the Z offset.


### Values
x-offset
    
Is a `<length>` or a `<percentage>` describing how far from the left edge of the box the origin of the transform is set.
offset-keyword
    
Is one of the `left`, `right`, `top`, `bottom`, or `center` keyword describing the corresponding offset.
y-offset
    
Is a `<length>` or a `<percentage>` describing how far from the top edge of the box the origin of the transform is set.
x-offset-keyword
    
Is one of the `left`, `right`, or `center` keyword describing how far from the left edge of the box the origin of the transform is set.
y-offset-keyword
    
Is one of the `top`, `bottom`, or `center` keyword describing how far from the top edge of the box the origin of the transform is set.
z-offset
    
Is a `<length>` (and never a `<percentage>` which would make the statement invalid) describing how far from the user eye the z=0 origin is set.
The keywords are convenience shorthands and match the following `<percentage>` values:
Keyword Value  
`left` `0%`  
`center` `50%`  
`right` `100%`  
`top` `0%`  
`bottom` `100%`  
## Examples
>
### A demonstration of various transform values
This example shows the effect of choosing different `transform-origin` values for a variety of transformation functions.
# min-content
The `min-content` sizing keyword represents the minimum intrinsic size of an element. The keyword shrinks the element to the smallest possible size without causing avoidable overflow of its content. For text content, this keyword causes the content to wrap at every opportunity (such as spaces between words), and the element will be only as wide as the longest word.
The `interpolate-size` property and `calc-size()` function can be used to enable animations to and from `min-content`.
## Syntax
    
    /* Used as a length value */
    width: min-content;
    inline-size: min-content;
    height: min-content;
    block-size: min-content;
    
    /* Used in grid tracks */
    grid-template-columns: 200px 1fr min-content;
    
## Examples
>
### Sizing boxes with min-content
#### HTML
    
    <div class="item">Item</div>
    <div class="item">Item with more text in it.</div>
    
#### CSS
    
    .item {
      width: min-content;
      background-color: #8ca0ff;
      padding: 5px;
      margin-bottom: 1em;
    }
    
#### Result
### Sizing grid columns with min-content
#### HTML
    
    <div id="container">
      <div>Item</div>
      <div>Item with more text in it.</div>
      <div>Flexible item</div>
    </div>
    
#### CSS
    
    #container {
      display: grid;
      grid-template-columns: min-content min-content 1fr;
      grid-gap: 5px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background-color: #8cffa0;
      padding: 10px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      padding: 5px;
    }
    
#### Result
# transition-delay
The `transition-delay` CSS property specifies the duration to wait before starting a property's transition effect when its value changes.
## Try it
    
    transition-delay: 250ms;
    transition-property: margin-right;
    
    
    transition-delay: 1s;
    transition-property: background-color;
    
    
    transition-delay: 1s;
    transition-property: margin-right, color;
    
    
    transition-delay: 1s, 250ms;
    transition-property: margin-right, color;
    
    
    <section id="default-example">
      <div id="example-element">Hover to see<br />the transition.</div>
    </section>
    
    
    #example-element {
      background-color: #e4f0f5;
      color: black;
      padding: 1rem;
      border-radius: 0.5rem;
      font: 1em monospace;
      width: 100%;
      transition: margin-right 2s;
    }
    
    #default-example:hover > #example-element {
      background-color: #990099;
      color: white;
      margin-right: 40%;
    }
    
The delay may be zero, positive, or negative:
  * A value of `0s` (or `0ms`) will begin the transition effect immediately.
  * A positive value will delay the start of the transition effect for the given length of time.
  * A negative value will begin the transition effect immediately, and partway through the effect. In other words, the effect will be animated as if it had already been running for the given length of time.


You may specify multiple delays, which is useful when transitioning multiple properties. Each delay will be applied to the corresponding property as specified by the `transition-property` property, which acts as a master list. If there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. If there are more delays, the list of delay values will be truncated to match the number of properties. In both cases, the CSS declaration remains valid.
## Syntax
    
    /* <time> values */
    transition-delay: 3s;
    transition-delay: 2s, 4ms;
    
    /* Global values */
    transition-delay: inherit;
    transition-delay: initial;
    transition-delay: revert;
    transition-delay: revert-layer;
    transition-delay: unset;
    
### Values
`<time>`
    
Denotes the amount of time to wait between a property's value changing and the start of the transition effect.
## Examples
>
### Example showing different delays
#### HTML
    
    <div class="box delay-1">0.5 seconds</div>
    
    <div class="box delay-2">2 seconds</div>
    
    <div class="box delay-3">4 seconds</div>
    
    <button id="change">Change</button>
    
#### CSS
    
    .box {
      margin: 20px;
      padding: 10px;
      display: inline-block;
      width: 100px;
      height: 100px;
      background-color: red;
      font-size: 18px;
      transition-property: background-color, font-size, transform, color;
      transition-timing-function: ease-in-out;
      transition-duration: 3s;
    }
    
    .transformed-state {
      transform: rotate(270deg);
      background-color: blue;
      color: yellow;
      font-size: 12px;
      transition-property: background-color, font-size, transform, color;
      transition-timing-function: ease-in-out;
      transition-duration: 3s;
    }
    
    .delay-1 {
      transition-delay: 0.5s;
    }
    
    .delay-2 {
      transition-delay: 2s;
    }
    
    .delay-3 {
      transition-delay: 4s;
    }
    
#### JavaScript
    
    function change() {
      const elements = document.querySelectorAll("div.box");
      for (const element of elements) {
        element.classList.toggle("transformed-state");
      }
    }
    
    const changeButton = document.querySelector("#change");
    changeButton.addEventListener("click", change);
    
#### Result
# stroke-dashoffset
The `stroke-dashoffset` CSS property defines an offset for the starting point of the rendering of an SVG element's associated dash array. If present, it overrides the element's `stroke-dashoffset` attribute.
This property applies to any SVG shape or text-content element (see `stroke-dashoffset` for a full list), but as an inherited property, it may be applied to elements such as `<g>` and still have the intended effect on descendant elements' strokes.
## Syntax
    
    /* Keyword */
    stroke-dashoffset: none;
    
    /* Length and percentage values */
    stroke-dashoffset: 2;
    stroke-dashoffset: 2px;
    stroke-dashoffset: 2%;
    
    /* Global values */
    stroke-dashoffset: inherit;
    stroke-dashoffset: initial;
    stroke-dashoffset: revert;
    stroke-dashoffset: revert-layer;
    stroke-dashoffset: unset;
    
### Values
`<number>` Non-standard
    
A number of SVG units, the size of which defined by the current unit space. The value given, if other than `0`, moves the starting point from the start of the dash array to another point within it. Thus, positive values will appear to shift the dash-gap pattern backwards, and negative values will appear to shift the pattern forwards.
`<length>`
    
Pixel units are handled the same as SVG units (see `<number>`, above) and font-based lengths such as `em` are calculated with respect to the element's SVG value for the text size; the effects of other length units may depend on the browser. The shifting effect for any value is the same as for `<number>` values (see above).
`<percentage>`
    
Percentages refer to the normalized diagonal of the current SVG viewport, which is calculated as <width>2+<height>22, not to the overall length of the stroke path. Negative values are invalid.
## Examples
>
### Dash offsetting
To show how dashes can be offset, we first set up five identical paths, all of which are given a dash array of a 20-unit dash followed by a 3-unit gap via the SVG attribute `stroke-dasharray`. (This could also have been done with the CSS property `stroke-dasharray`.) The paths are then given individual dash offsets via CSS.
    
    <svg viewBox="0 0 100 50" width="500" height="250">
      <rect x="10" y="5" width="80" height="30" fill="#eeeeee" />
      <g stroke="dodgerblue" stroke-width="2" stroke-dasharray="20,3">
        <path d="M 10,10 h 80" />
        <path d="M 10,15 h 80" />
        <path d="M 10,20 h 80" />
        <path d="M 10,25 h 80" />
        <path d="M 10,30 h 80" />
      </g>
    </svg>
    
    
    path:nth-of-type(1) {
      stroke-dashoffset: 0;
    }
    path:nth-of-type(2) {
      stroke-dashoffset: -5;
    }
    path:nth-of-type(3) {
      stroke-dashoffset: 5;
    }
    path:nth-of-type(4) {
      stroke-dashoffset: 5px;
    }
    path:nth-of-type(5) {
      stroke-dashoffset: 5%;
    }
    
In order:
  1. The first of the five paths is given a zero offset, which is the default behavior.
  2. The second path is given an offset of `-5`, which shifts the start point of the array to five units before the zero-point. The visual effect is that the dash pattern is pushed forward five units; thus, we see, at the start of the path, the last two units of a dash and then a three-unit gap.
  3. The third path has an offset of `5`, which means the starting point of the dashes is five units into the dash pattern. The visual effect is to push the dash pattern backward by five units; thus, we see, at the start of the path, the last fifteen units of a dash followed by a three-unit gap.
  4. The fourth path has an offset of `5px`, which has the same effect as a value of `5` (see previous).
  5. The fifth and last path has an offset of `5%`, which is very similar to the previous two examples, but is not quite the same. Percentages are calculated against the diagonal measure of the SVG viewport, and so can very depending on that viewport's size and aspect ratio.


# contain-intrinsic-inline-size
The `contain-intrinsic-inline-size` CSS logical property defines the inline-size of an element that a browser can use for layout when the element is subject to size containment.
Inline-size is the size of the element in the dimension parallel to the flow of text within a line. In a horizontal writing mode like standard English, inline size is the horizontal dimension (width); for a vertical writing mode, inline size is the vertical dimension.
## Syntax
    
    /* Keyword values */
    contain-intrinsic-inline-size: none;
    
    /* <length> values */
    contain-intrinsic-inline-size: 1000px;
    contain-intrinsic-inline-size: 10rem;
    
    /* auto <length> */
    contain-intrinsic-inline-size: auto 300px;
    
    /* Global values */
    contain-intrinsic-inline-size: inherit;
    contain-intrinsic-inline-size: initial;
    contain-intrinsic-inline-size: revert;
    contain-intrinsic-inline-size: revert-layer;
    contain-intrinsic-inline-size: unset;
    
### Values
The following values can be specified for the intrinsic inline size of an element:
`none`
    
The element has no intrinsic inline-size.
`<length>`
    
The element has the specified inline-size (`<length>`).
`auto <length>`
    
When the element is in size containment and skipping its contents (for example, when it is offscreen and `content-visibility: auto` is set) the inline size is remembered from the actual size of the element when it was last able to render its child elements. If the element has never rendered its child elements and hence has no remembered value for the normally rendered element size, or if it is not skipping its contents, the inline size is the specified `<length>`.
## Description
The property is commonly applied alongside elements that can trigger size containment, such as `contain: size` and `content-visibility`.
Size containment allows a user agent to lay out an element as though it had a fixed size, preventing unnecessary reflows by avoiding the re-rendering of child elements to determine the actual size (thereby improving user experience). By default, size containment treats elements as though they had no contents, and may collapse the layout in the same way as if the contents had no width or height. The `contain-intrinsic-inline-size` property allows authors to specify an appropriate value to be used as the inline-size for layout.
The `auto <length>` value allows the inline-size of the element to be stored if the element is ever "normally rendered" (with its child elements), and then used instead of the specified value when the element is skipping its contents. This allows offscreen elements with `content-visibility: auto` to benefit from size containment without developers having to be as precise in their estimates of element size. The remembered value is not used if the child elements are being rendered (if size containment is enabled, the `<length>` will be used).
## Examples
>
### Setting the intrinsic inline size
The HTML below defines an element "contained_element" that will be subject to size constraint, and which contains a child element.
    
    <div id="contained_element">
      <div class="child_element"></div>
    </div>
    
The CSS below sets the `content-visibility` of `contained_element` to `auto`, so if the element is hidden it will be size constrained. The intrinsic block size and inline size that are used when it is size constrained are set at the same time using `contain-intrinsic-block-size` and `contain-intrinsic-inline-size`, respectively.
    
    #contained_element {
      border: 2px solid green;
      inline-size: 151px;
      content-visibility: auto;
      contain-intrinsic-inline-size: 152px;
      contain-intrinsic-block-size: 52px;
    }
    .child_element {
      border: 1px solid red;
      background: blue;
      block-size: 50px;
      inline-size: 150px;
    }
    
# text-indent
The `text-indent` CSS property sets the length of empty space (indentation) that is put before lines of text in a block.
## Try it
    
    text-indent: 0;
    
    
    text-indent: 30%;
    
    
    text-indent: -3em;
    
    
    text-indent: 3em each-line;
    
    
    text-indent: 3em hanging;
    
    
    text-indent: 3em hanging each-line;
    
    
    <section id="default-example">
      <div id="example-element">
        <p>
          This text is contained within a single paragraph. This paragraph is two
          sentences long.
        </p>
        <p>
          This is a new paragraph. There is a line break element
          <code>&lt;br&gt;</code> after this sentence.<br />There it is! Notice how
          it affects the indentation.
        </p>
      </div>
    </section>
    
    
    section {
      font-size: 1.25em;
      background-color: darkslateblue;
      align-items: start;
    }
    
    #example-element {
      text-align: left;
      margin-left: 3em;
      background-color: slateblue;
      color: white;
    }
    
Horizontal spacing is with respect to the left (or right, for right-to-left layout) edge of the containing block-level element's content box.
## Syntax
    
    /* <length> values */
    text-indent: 3mm;
    text-indent: 40px;
    
    /* <percentage> value
       relative to the containing block width */
    text-indent: 15%;
    
    /* Keyword values */
    text-indent: 5em each-line;
    text-indent: 5em hanging;
    text-indent: 5em hanging each-line;
    
    /* Global values */
    text-indent: inherit;
    text-indent: initial;
    text-indent: revert;
    text-indent: revert-layer;
    text-indent: unset;
    
### Values
`<length>`
    
Indentation is specified as an absolute `<length>`. Negative values are allowed. See `<length>` values for possible units.
`<percentage>`
    
Indentation is a `<percentage>` of the containing block's width.
`each-line`
    
Indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break.
`hanging`
    
Inverts which lines are indented. All lines except the first line will be indented.
## Examples
>
### Basic indent
#### HTML
    
    <p>
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
      nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </p>
    <p>
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
      nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </p>
    
#### CSS
    
    p {
      text-indent: 5em;
      background: powderblue;
    }
    
#### Result
### Skipping indentation on the first paragraph
A common typographic practice when paragraph indentation is present is to skip the indentation for the first paragraph. As The Chicago Manual of Style puts it, "the first line of text following a subhead may begin flush left or be indented by the usual paragraph indention."
Treating first paragraphs differently from subsequent paragraphs can be done using the next-sibling combinator, as in the following example:
#### HTML
    
    <h2>Lorem ipsum</h2>
    
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eu
      venenatis quam. Vivamus euismod eleifend metus vitae pharetra. In vel tempor
      metus. Donec dapibus feugiat euismod. Vivamus interdum tellus dolor. Vivamus
      blandit eros et imperdiet auctor. Mauris sapien nunc, condimentum a efficitur
      non, elementum ac sapien. Cras consequat turpis non augue ullamcorper, sit
      amet porttitor dui interdum.
    </p>
    
    <p>
      Sed laoreet luctus erat at rutrum. Proin velit metus, luctus in sapien in,
      tincidunt mattis ex. Praesent venenatis orci at sagittis eleifend. Nulla
      facilisi. In feugiat vehicula magna iaculis vehicula. Nulla suscipit tempor
      odio a semper. Donec vitae dapibus ipsum. Donec libero purus, convallis eu
      efficitur id, pulvinar elementum diam. Maecenas mollis blandit placerat. Ut
      gravida pellentesque nunc, in eleifend ante convallis sit amet.
    </p>
    
    <h2>Donec ullamcorper elit nisl</h2>
    
    <p>
      Donec ullamcorper elit nisl, sagittis bibendum massa gravida in. Fusce tempor
      in ante gravida iaculis. Integer posuere tempor metus. Vestibulum lacinia,
      nunc et dictum viverra, urna massa aliquam tellus, id mollis sem velit
      vestibulum nulla. Pellentesque habitant morbi tristique senectus et netus et
      malesuada fames ac turpis egestas. Donec vulputate leo ut iaculis ultrices.
      Cras egestas rhoncus lorem. Nunc blandit tempus lectus, rutrum hendrerit orci
      eleifend id. Ut at quam velit.
    </p>
    
    <p>
      Aenean rutrum tempor ligula, at luctus ligula auctor vestibulum. Sed
      sollicitudin velit in leo fringilla sollicitudin. Proin eu gravida arcu. Nam
      iaculis malesuada massa, eget aliquet turpis sagittis sed. Sed mollis tellus
      ac dui ullamcorper, nec lobortis diam pellentesque. Quisque dapibus accumsan
      libero, sed euismod ipsum ullamcorper sed.
    </p>
    
#### CSS
    
    p {
      text-align: justify;
      margin: 1em 0 0 0;
    }
    p + p {
      text-indent: 2em;
      margin: 0;
    }
    
#### Result
### Percentage indent
#### HTML
    
    <p>
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
      nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </p>
    <p>
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
      nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </p>
    
#### CSS
    
    p {
      text-indent: 30%;
      background: plum;
    }
    
#### Result
# border-block-width
The `border-block-width` CSS property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-block-width: thick;
    writing-mode: horizontal-tb;
    
    
    border-block-width: thick;
    writing-mode: vertical-rl;
    
    
    border-block-width: 4px;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: palegreen;
      color: black;
      border: 0 solid crimson;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
The border width in the other dimension can be set with `border-inline-width`, which sets `border-inline-start-width`, and `border-inline-end-width`.
## Syntax
    
    /* <'border-width'> values */
    border-block-width: 5px;
    border-block-width: thick;
    
    /* Global values */
    border-block-width: inherit;
    border-block-width: initial;
    border-block-width: revert;
    border-block-width: revert-layer;
    border-block-width: unset;
    
### Values
`<'border-width'>`
    
The width of the border. See `border-width`.
## Examples
>
### Border width with vertical text
#### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
#### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 1px solid blue;
      border-block-width: 5px;
    }
    
#### Results
# scroll-margin-block
The `scroll-margin-block` shorthand property sets the scroll margins of an element in the block dimension.
## Try it
    
    scroll-margin-block: 0;
    
    
    scroll-margin-block: 20px;
    
    
    scroll-margin-block: 2em;
    
    
    <section class="default-example" id="default-example">
      <div class="scroller">
        <div>1</div>
        <div id="example-element">2</div>
        <div>3</div>
      </div>
      <div class="info">Scroll »</div>
    </section>
    
    
    .default-example .info {
      inline-size: 100%;
      padding: 0.5em 0;
      font-size: 90%;
      writing-mode: vertical-rl;
    }
    
    .scroller {
      text-align: left;
      height: 250px;
      width: 270px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      border: 1px solid black;
      scroll-snap-type: y mandatory;
    }
    
    .scroller > div {
      flex: 0 0 250px;
      background-color: rebeccapurple;
      color: white;
      font-size: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: start;
    }
    
    .scroller > div:nth-child(even) {
      background-color: white;
      color: rebeccapurple;
    }
    
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `scroll-margin-block-end`
  * `scroll-margin-block-start`


## Syntax
    
    /* <length> values */
    scroll-margin-block: 10px;
    scroll-margin-block: 1em 0.5em;
    
    /* Global values */
    scroll-margin-block: inherit;
    scroll-margin-block: initial;
    scroll-margin-block: revert;
    scroll-margin-block: revert-layer;
    scroll-margin-block: unset;
    
### Values
`<length>`
    
An outset from the corresponding edge of the scroll container.
## Description
The scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
# :-moz-submit-invalid
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
The `:-moz-submit-invalid` CSS pseudo-class is a Mozilla extension that represents any submit `<button>` on forms whose contents aren't valid based on their validation constraints.
By default, no style is applied. You can use this pseudo-class to customize the appearance of the submit button when there are invalid form fields.
## Syntax
    
    :-moz-submit-invalid {
      /* ... */
    }
    
Not part of any standard.
# content
The `content` CSS property replaces content with a generated value. It can be used to define what is rendered inside an element or pseudo-element. For elements, the `content` property specifies whether the element renders normally (`normal` or `none`) or is replaced with an image (and associated "alt" text). For pseudo-elements and margin boxes, `content` defines the content as images, text, both, or none, which determines whether the element renders at all.
Objects inserted using the `content` property are anonymous replaced elements.
## Try it
    
    .topic-games::before {
      content: "🎮 " / "games";
    }
    
    .topic-weather::before {
      content: "⛅ " / "cloudy";
    }
    
    .topic-hot::before {
      content: url("/shared-assets/images/examples/fire.png") / "On fire";
      margin-right: 6px;
    }
    
    
    <p class="topic-games">Game News: A new inFamous is not planned</p>
    
    <p class="topic-weather">
      Weather for Today: Heat, violent storms and twisters
    </p>
    
    <p class="topic-hot">Trending Article: Must-watch videos of the week</p>
    
## Syntax
    
    /* Keywords that cannot be combined with other values */
    content: normal;
    content: none;
    
    /* <content-replacement>: <image> values */
    content: url("http://www.example.com/test.png");
    content: linear-gradient(#e66465, #9198e5);
    content: image-set("image1x.png" 1x, "image2x.png" 2x);
    
    /* speech output: alternative text after a "/"  */
    content: url("../img/test.png") / "This is the alt text";
    
    /* <string> value */
    content: "unparsed text";
    
    /* <counter> values, optionally with <list-style-type> */
    content: counter(chapter_counter);
    content: counter(chapter_counter, upper-roman);
    content: counters(section_counter, ".");
    content: counters(section_counter, ".", decimal-leading-zero);
    
    /* attr() value linked to the HTML attribute value */
    content: attr(href);
    
    /* <quote> values */
    content: open-quote;
    content: close-quote;
    content: no-open-quote;
    content: no-close-quote;
    
    /* <content-list>: a list of content values. 
    Several values can be used simultaneously */
    content: "prefix" url("http://www.example.com/test.png");
    content: "prefix" url("/img/test.png") "suffix" / "Alt text";
    content: open-quote counter(chapter_counter);
    
    /* Global values */
    content: inherit;
    content: initial;
    content: revert;
    content: revert-layer;
    content: unset;
    
### Values
The value can be:
  * One of two keywords: `none` or `normal`. `normal` is the default property value.
  * `<content-replacement>` when replacing a DOM node. `<content-replacement>` is always an `<image>`.
  * A `<content-list>` when replacing pseudo-elements and margin boxes. A `<content-list>` is a list of one or more anonymous inline boxes appearing in the order specified. Each `<content-list>` item is of type `<string>`, `<image>`, `<counter>`, `<quote>`, `<target>`, or `<leader()>`.
  * An optional alternative text value of a `<string>` or `<counter>`, preceded by a slash (`/`).


The keywords and data types mentioned above are described in more detail below:
`none`
    
When applied to a pseudo-element, the pseudo-element is not generated. When applied to an element, the value has no effect.
`normal`
    
For the `::before` and `::after` pseudo-elements, this value computes to `none` . For other pseudo-elements such as `::marker`, `::placeholder`, or `::file-selector-button`, it produces the element's initial (or normal) content. For regular elements or page margin boxes, it computes to the element's descendants. This is the default value.
`<string>`
    
A sequence of characters enclosed in matching single or double quotes. Multiple string values will be concatenated (there is no concatenation operator in CSS).
`<image>`
    
An `<image>`, representing an image to display. This can be equal to a `<url>`, `image-set()`, or `<gradient>` data type, or a part of the webpage itself, defined by the `element()` function.
`<counter>`
    
The `<counter>` value is a CSS counter, generally a number produced by computations defined by `<counter-reset>` and `<counter-increment>` properties. It can be displayed using either the `counter()` or `counters()` function.
`counter()`
    
The `counter()` function has two forms: 'counter(name)' or 'counter(name, style)'. The generated text is the value of the innermost counter of the given name in scope at the given pseudo-element. It is formatted in the specified `<list-style-type>` (`decimal` by default).
`counters()`
    
The `counters()` function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'. The generated text is the value of all counters with the given name in scope at the given pseudo-element, from outermost to innermost, separated by the specified string. The counters are rendered in the indicated `<list-style-type>` (`decimal` by default).
`<quote>`
    
The `<quote>` data type includes language- and position-dependent keywords:
`open-quote` and `close-quote`
    
These values are replaced by the appropriate string from the `quotes` property.
`no-open-quote` and `no-close-quote`
    
Introduces no content, but increments (decrements) the level of nesting for quotes.
`<target>`
    
The `<target>` data type includes three target functions, `<target-counter()>`, `<target-counters()>`, and `<target-text()>` that create cross-references obtained from the target end of a link. See Formal syntax.
`<leader()>`
    
The `<leader()>` data type includes a leader function: `leader( <leader-type> )`. This function accepts the keyword values `dotted`, `solid`, or `space` (equal to `leader(".")`, `leader("_")`, and `leader(" ")`, respectively), or a `<string>` as a parameter. When supported and used as a value for `content`, the leader-type provided will be inserted as a repeating pattern, visually connecting content across a horizontal line.
`attr(x)`
    
The `attr(x)` CSS function retrieves the value of an attribute of the selected element, or the pseudo-element's originating element. The value of the element's attribute `x` is an unparsed string representing the attribute name. If there is no attribute `x`, an empty string is returned. The case sensitivity of the attribute name parameter depends on the document language.
alternative text: `/ <string> | <counter>`
    
Alternative text may be specified for an image or any `<content-list>` items, by appending a forward slash and then a string of text or a counter. The alternative text is intended for speech output by screen-readers, but may also be displayed in some browsers. The `/ <string>` or `/ <counter>` data types specify the "alt text" for the element.
## Accessibility
CSS-generated content is not included in the DOM. Because of this, it will not be represented in the accessibility tree and certain assistive technology/browser combinations will not announce it. If the content conveys information that is critical to understanding the page's purpose, it is better to include it in the main document.
If inserted content is not decorative, check that the information is provided to assistive technologies and is also available when CSS is turned off.
  * Accessibility support for CSS generated content – Tink (2015)
  * WCAG, Guideline 1.3: Create content that can be presented in different ways
  * Understanding Success Criterion 1.3.1 | W3C Understanding WCAG 2.0
  * Failure of Success Criterion 1.3.1: inserting non-decorative generated content Techniques for WCAG 2.0


## Examples
The first five examples create generated content on pseudo-elements. The last three are examples of element replacement.
### Appending strings based on an element's class
This example inserts generated text after the text of elements that have a particular class name. The text is colored red.
#### HTML
    
    <h2>Paperback Best Sellers</h2>
    <ol>
      <li>Political Thriller</li>
      <li class="new-entry">Halloween Stories</li>
      <li>My Biography</li>
      <li class="new-entry">Vampire Romance</li>
    </ol>
    
#### CSS
    
    .new-entry::after {
      content: " New!"; /* The leading space creates separation
                           between the DOM node's content and the generated content
                           being added. */
      color: red;
    }
    
#### Result
### Quotes
This example inserts differently colored quotation marks around quotes.
#### HTML
    
    <p>
      According to Sir Tim Berners-Lee,
      <q cite="http://www.w3.org/People/Berners-Lee/FAQ.html#Internet">
        I was lucky enough to invent the Web at the time when the Internet already
        existed - and had for a decade and a half.
      </q>
      We must understand that there is nothing fundamentally wrong with building on
      the contributions of others.
    </p>
    <p lang="fr-fr">
      Mais c'est Magritte qui a dit,
      <q lang="fr-fr"> Ceci n'est pas une pipe. </q>.
    </p>
    
#### CSS
    
    q {
      color: blue;
    }
    
    q::before,
    q::after {
      font-size: larger;
      color: red;
      background: #cccccc;
    }
    
    q::before {
      content: open-quote;
    }
    
    q::after {
      content: close-quote;
    }
    
#### Result
Note the type of quotes generated is based on the language. Browsers add open- and close-quotes before and after `<q>` elements by default, so the quotes in this example would appear without them being explicitly set. They could have been turned off by setting the respective `content` property values to `no-open-quote` and `no-close-quote`, or by setting them both to `none`. They can also be turned off by setting the `quotes` property to `none` instead.
### Adding text to list item counters
This example combines a counter sandwiched between two `<string>`s prepended to all list items, creating a more detailed marker for list items (`<li>`) within unordered lists (`<ol>`).
#### HTML
    
    <ol>
      <li>Dogs</li>
      <li>Cats</li>
      <li>
        Birds
        <ol>
          <li>Owls</li>
          <li>Ducks</li>
          <li>Flightless</li>
        </ol>
      </li>
      <li>Marsupials</li>
    </ol>
    
#### CSS
    
    ol {
      counter-reset: items;
      margin-left: 2em;
    }
    li {
      counter-increment: items;
    }
    li::marker {
      content: "item " counters(items, ".", numeric) ": ";
    }
    
#### Result
The generated content on each list item's marker adds the text "item " as a prefix, including a space to separate the prefix from the counter, which is followed by ": ", a colon and an additional space. The `counters()` function defines a numeric `items` counter, in which the numbers of nested ordered lists have their numbers separated with a period (`.`) in most browsers.
### Strings with attribute values
This example is useful for print stylesheets. It uses an attribute selector to select every fully qualified secure link, adding the value of the `href` attribute after the link text as the content of the `::after` pseudo-element.
#### HTML
    
    <ul>
      <li><a href="https://mozilla.com">Mozilla</a></li>
      <li><a href="/">MDN</a></li>
      <li><a href="https://openwebdocs.org">OpenWebDocs</a></li>
    </ul>
    
#### CSS
    
    a[href^="https://"]::after
    {
      content: " (URL: " attr(href) ")";
      color: darkgreen;
    }
    
#### Result
The generated content is the value of the `href` attribute, prepended by "URL: ", with a space, all in parentheses.
### Adding an image with alternative text
This example inserts an image before all links. Two `content` values are provided. The later `content` value includes an image with alternative text that a screen reader can output as speech.
#### HTML
    
    <a href="https://www.mozilla.org/en-US/">Mozilla Home Page</a>
    
#### CSS
The CSS to show the image and set the alternative text is shown below. This also sets the font and color for the content.
    
    a::before {
      content: url("https://mozorg.cdn.mozilla.net/media/img/favicon.ico") /
        " MOZILLA: ";
    }
    
#### Result
Note: The alternative text value is exposed in the browser's accessibility tree. Refer to the See also section for browser-specific accessibility panels.
If using a screen reader, it should speak the word "MOZILLA" when it reaches the image. You can select the `::before` pseudo-element with your developer tools selection tool, and view the accessible name in the accessibility panel.
### Element replacement with URL
This example replaces a regular element! The element's contents are replaced with an SVG using the `<url>` type.
Pseudo-elements aren't rendered on replaced elements. As this element is replaced, any matching `::after` or `::before` are not generated or applied. To demonstrate this, we include an `::after` declaration block, attempting to add the `id` as generated content. This pseudo-element will not be generated as the element is replaced.
#### HTML
    
    <div id="replaced">This content is replaced!</div>
    
#### CSS
    
    #replaced {
      content: url("mdn.svg");
    }
    
    /* will not show if element replacement is supported */
    div::after {
      content: " (" attr(id) ")";
    }
    
#### Result
When generating content on regular elements (rather than just on pseudo-elements), the entire element is replaced. This means that `::before` and `::after` pseudo-elements are not generated.
### Element replacement with `<gradient>`
This example demonstrates how an element's contents can be replaced by any type of `<image>`, in this case, a CSS gradient. The element's contents are replaced with a `linear-gradient()`. We provide alt text because all images should be described for accessibility.
#### HTML
    
    <div id="replaced">I disappear</div>
    
#### CSS
    
    div {
      border: 1px solid;
      background-color: #cccccc;
      min-height: 100px;
      min-width: 100px;
    }
    
    #replaced {
      content: repeating-linear-gradient(blue 0, orange 10%) /
        "Gradients and alt text are supported";
    }
    
#### Result
Check the browser compatibility chart. All browsers support gradients and all browsers support replacing elements with images, but not all browsers support gradients as a `content` value.
### Element replacement with `image-set()`
This example replaces an element's content with a `image-set()`. If the users display has normal resolution the `1x.png` will be displayed. Screens with a higher resolution will display the `2x.png` image.
#### HTML
    
    <div id="replaced">I disappear!</div>
    
#### CSS
    
    #replaced {
      content: image-set(
        "1x.png" 1x,
        "2x.png" 2x
      ) / "DPI";
    }
    
#### Result
# border-inline-start-style
The `border-inline-start-style` CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
## Try it
    
    border-inline-start-style: dotted;
    writing-mode: horizontal-tb;
    
    
    border-inline-start-style: dotted;
    writing-mode: vertical-rl;
    
    
    border-inline-start-style: groove;
    writing-mode: horizontal-tb;
    direction: rtl;
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: black;
      border: 0.75em solid;
      padding: 0.75em;
      width: 80%;
      height: 100px;
      unicode-bidi: bidi-override;
    }
    
## Syntax
    
    /* <'border-style'> values */
    border-inline-start-style: dashed;
    border-inline-start-style: dotted;
    border-inline-start-style: groove;
    
    /* Global values */
    border-inline-start-style: inherit;
    border-inline-start-style: initial;
    border-inline-start-style: revert;
    border-inline-start-style: revert-layer;
    border-inline-start-style: unset;
    
Related properties are `border-block-start-style`, `border-block-end-style`, and `border-inline-end-style`, which define the other border styles of the element.
### Values
`<'border-style'>`
    
The line style of the border. See `border-style`.
## Examples
>
### HTML
    
    <div>
      <p class="exampleText">Example text</p>
    </div>
    
### CSS
    
    div {
      background-color: yellow;
      width: 120px;
      height: 120px;
    }
    
    .exampleText {
      writing-mode: vertical-lr;
      border: 5px solid blue;
      border-inline-start-style: dashed;
    }
    
# animation-name
The `animation-name` CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframes` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframes` at-rule, no properties are animated.
## Try it
    
    animation-name: none;
    
    
    animation-name: slide;
    
    
    animation-name: bounce;
    
    
    <section class="flex-column" id="default-example">
      <div class="animating" id="example-element"></div>
    </section>
    
    
    #example-element {
      animation-direction: alternate;
      animation-duration: 1s;
      animation-iteration-count: infinite;
      animation-timing-function: ease-in;
      background-color: #1766aa;
      border-radius: 50%;
      border: 5px solid #333333;
      color: white;
      height: 150px;
      margin: auto;
      margin-left: 0;
      width: 150px;
    }
    
    @keyframes slide {
      from {
        background-color: orange;
        color: black;
        margin-left: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-left: 80%;
      }
    }
    
    @keyframes bounce {
      from {
        background-color: orange;
        color: black;
        margin-top: 0;
      }
      to {
        background-color: orange;
        color: black;
        margin-top: 40%;
      }
    }
    
It is often convenient to use the shorthand property `animation` to set all animation properties at once.
## Syntax
    
    /* No animation */
    animation-name: none;
    
    /* Single animation */
    animation-name: test_05;
    animation-name: -specific;
    animation-name: "sliding-vertically";
    
    /* Multiple animations */
    animation-name: test1, animation4;
    animation-name:
      none,
      -moz-specific,
      sliding;
    
    /* Global values */
    animation-name: inherit;
    animation-name: initial;
    animation-name: revert;
    animation-name: revert-layer;
    animation-name: unset;
    
### Values
`none`
    
A special keyword denoting no keyframes. It can be used to deactivate an animation without changing the ordering of the other identifiers, or to deactivate animations coming from the cascade.
`<custom-ident>`
    
An unquoted name identifying the animation. This identifier is composed of a combination of case-sensitive letters `a` to `z`, numbers `0` to `9`, underscores (`_`), and/or dashes (`-`). The first non-dash character must be a letter. Also, two dashes are forbidden at the beginning of the identifier. Furthermore, the identifier can't be `none`, `unset`, `initial`, or `inherit`.
`<string>`
    
A series of characters following the same rules as custom identifiers, as described above, except that they are surrounded by either double (") or single (') quotes. If using a quoted string for both the `animation-name` and the corresponding `@keyframes` at-rule name, `none`, global keywords, and names starting with an underscore or double dashes are valid, though not recommended.
Note: When you specify multiple comma-separated values on an `animation-*` property, they are applied to the animations in the order in which the `animation-name`s appear. For situations where the number of animations and `animation-*` property values do not match, see Setting multiple animation property values.
## Examples
>
### Naming an animation
This animation has an `animation-name` of `rotate`.
#### HTML
    
    <div class="box"></div>
    
#### CSS
    
    .box {
      background-color: rebeccapurple;
      border-radius: 10px;
      width: 100px;
      height: 100px;
    }
    
    .box:hover {
      animation-name: rotate;
      animation-duration: 0.7s;
    }
    
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    
#### Result
Hover over the rectangle to start the animation.
See CSS animations for examples.
# <alpha-value>
The `<alpha-value>` CSS data type represents a value that can be either a `<number>` or a `<percentage>`, specifying the alpha channel or transparency of a color.
## Syntax
The value of an `<alpha-value>` is given as either a `<number>` or a `<percentage>`.
If given as a number, the useful range is 0 (fully transparent) to 1.0 (fully opaque), with decimal values in between; that is, 0.5 indicates that half of the foreground color is used and half of the background color is used. Values outside the range of 0 to 1 are permitted, but are clamped to lie within the range 0 to 1.
If the alpha value is given as a percentage, 0% corresponds to fully transparent while 100% indicates fully opaque.
## Interpolation
When animated, values of the `<alpha-value>` CSS data type are interpolated as real, floating-point numbers. The speed of the interpolation is determined by the easing function associated with the animation.
## Examples
>
### Setting text color opacity
The `rgb()` function accepts a fourth optional value to specify an alpha value. The following example shows how to apply a color with 60% opacity using the alpha value:
    
    /* <rgb()> */
    color: rgb(34 12 64 / 60%);
    
### Setting shape image threshold
Here an alpha value is used to determine which parts of an image are considered part of a shape:
    
    /* shape-image-threshold */
    shape-image-threshold: 70%;
    shape-image-threshold: 0.7;
    
# background-blend-mode
The `background-blend-mode` CSS property sets how an element's background images should blend with each other and with the element's background color.
## Try it
    
    background-blend-mode: normal;
    
    
    background-blend-mode: multiply;
    
    
    background-blend-mode: hard-light;
    
    
    background-blend-mode: difference;
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <div class="transition-all" id="example-element"></div>
      </div>
    </section>
    
    
    #example-element {
      background-color: green;
      background-image: url("/shared-assets/images/examples/balloon.jpg");
      width: 250px;
      height: 305px;
    }
    
Blending modes should be defined in the same order as the `background-image` property. If the blending modes' and background images' list lengths are not equal, it will be repeated and/or truncated until lengths match.
## Syntax
    
    /* One value */
    background-blend-mode: normal;
    
    /* Two values, one per background */
    background-blend-mode: darken, luminosity;
    
    /* Global values */
    background-blend-mode: inherit;
    background-blend-mode: initial;
    background-blend-mode: revert;
    background-blend-mode: revert-layer;
    background-blend-mode: unset;
    
### Values
`<blend-mode>`
    
The blending mode to be applied. There can be several values, separated by commas.
## Examples
>
### Basic example
    
    .item {
      width: 300px;
      height: 300px;
      background: url("image1.png"), url("image2.png");
      background-blend-mode: screen;
    }
    
### Try out different blend modes
# max-content
The `max-content` sizing keyword represents the maximum intrinsic size of an element. The keyword expands the element to the largest size needed to display its content without any soft wraps. For text content, this keyword does not wrap the content at all, even if it causes overflow.
The `interpolate-size` property and `calc-size()` function can be used to enable animations to and from `max-content`.
## Syntax
    
    /* Used as a length value */
    width: max-content;
    inline-size: max-content;
    height: max-content;
    block-size: max-content;
    
    /* Used in grid tracks */
    grid-template-columns: 200px 1fr max-content;
    
## Examples
>
### Sizing boxes with max-content
#### HTML
    
    <div id="container">
      <div class="item">Item</div>
      <div class="item">
        Item with more text in it which will overflow the fixed width box.
      </div>
    </div>
    
#### CSS
    
    #container {
      background-color: #8cffa0;
      padding: 10px;
      width: 200px;
    }
    
    .item {
      width: max-content;
      background-color: #8ca0ff;
      padding: 5px;
      margin-bottom: 1em;
    }
    
#### Result
### Sizing grid columns with max-content
#### HTML
    
    <div id="container">
      <div>Item</div>
      <div>Item with more text in it.</div>
      <div>Flexible item</div>
    </div>
    
#### CSS
    
    #container {
      display: grid;
      grid-template-columns: max-content max-content 1fr;
      grid-gap: 5px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background-color: #8cffa0;
      padding: 10px;
    }
    
    #container > div {
      background-color: #8ca0ff;
      padding: 5px;
    }
    
#### Result
# ::column
Experimental: This is an experimental technology  
Check the Browser compatibility table carefully before using this in production.
The `::column` CSS pseudo-element represents the individual columns generated when a container is set to display its content in multiple columns via CSS multi-column layout. The `::column` pseudo-element enables applying styles that do not affect the layout to these generated fragments.
## Syntax
    
    ::column {
      /* ... */
    }
    
## Description
When CSS multi-column layout is used to lay out a container's content in multiple columns (for example, using the `column-count` property), `::column` pseudo-elements are generated to contain each individual column.
The `::column` pseudo-element only accepts scroll snap properties that apply to elements inside a scroll container, including `scroll-margin`, `scroll-snap-align`, and `scroll-snap-stop`.
The `::column` pseudo-element can have a `::scroll-marker` pseudo-element. Other pseudo-elements like `::before` and `::after` are not generated on `::column`. Applying `::column::scroll-marker` creates a marker for every column of the originating scroll container, with the `::scroll-marker` pseudo-elements inheriting from the `::column` pseudo-element's originating element rather than the `::column` itself.
This is useful for CSS carousels — `::column` can be used to generate `::scroll-marker` pseudo-elements for each column, and set them as snap targets using CSS scroll snap.
While the styling that can be applied to `::column` is very limited, it may be expanded in the future. Any properties and values supported in the future will be limited to ones that do not affect layout.
## Examples
>
### Scrolling column layout
This demo creates a responsive container that snaps each "page" of content into place. It uses the `columns` property and the `::column` pseudo-element to create content columns that span the full width of their parent scroll container, which can be scrolled horizontally. Each column contains one or more list items, which vary in number depending on the viewport width.
#### HTML
The HTML consists of an unordered list, with each list item containing some sample content:
    
    <ul>
    ...
      <li>
        <h2>Item 1</h2>
      </li>
    ...
    </ul>
    
#### CSS
The list is given a fixed `height` and a `width` of `100vw` to make it span the full width of the viewport. An `overflow-x` value of `scroll` is then set so that the content will scroll horizontally, and CSS scroll snap is used to snap to each item or "page" — a `scroll-snap-type` value of `x mandatory` is used to make the list into a scroll snap container. Finally, a `columns` value of `1` is set to force the list contents to display as a single column. A `text-align` value of `center` is also applied, to align the content with the center of the list.
    
    ul {
      width: 100vw;
      height: 300px;
      padding: 10px;
    
      overflow-x: scroll;
      scroll-snap-type: x mandatory;
    
      columns: 1;
      text-align: center;
    }
    
The list items are then styled:
  * A `display` value of `inline-block` is set to make the list items sit alongside one another and make the list scroll horizontally.
  * A fixed `width` and `height` has been set on them.
  * A `text-align` value of `left` is set on them to override the `text-align: center` set on the parent container, so the item content will be left-aligned.
  * Every even-numbered list item is given a different background-color via `:nth-child()`, so that it is easier to see the scrolling effect.


    
    li {
      list-style-type: none;
    
      display: inline-block;
      height: 100%;
      width: 200px;
      text-align: left;
    
      background-color: #eeeeee;
      outline: 1px solid #dddddd;
      padding: 0 20px;
      margin: 0 10px;
    }
    
    li:nth-child(even) {
      background-color: cyan;
    }
    
The `scroll-snap-align` property is set on the `::column` pseudo-elements — which represent the content columns generated by the `columns` property — so that when scrolled, a column is snapped to be centered within the scroll container.
    
    ul::column {
      scroll-snap-align: center;
    }
    
#### Result
### Column-based carousel with scroll markers
Expanding on the previous example, we will create scroll markers to enable direct navigation to different columns by applying a `scroll-marker-group` to the container and a `::scroll-marker` to each `::column` pseudo-element. The HTML remains unchanged.
#### CSS
We create a scroll marker group with the `scroll-marker-group` property, placing the group after all the content:
    
    ul {
      scroll-marker-group: after;
    }
    
We then apply styles to the `::scroll-marker-group` pseudo-element to lay out the scroll markers in the center of the row with a `0.4em` gap between each one:
    
    ::scroll-marker-group {
      display: flex;
      gap: 0.4em;
      place-content: center;
    }
    
Finally, we use the `::scroll-marker` pseudo-element to create a round, transparent marker for each list item with a black border, then style the marker of the currently-scrolled element differently from the others, targeting the marker with the `:target-current` pseudo-class:
    
    ul::column::scroll-marker {
      content: "";
      width: 16px;
      height: 16px;
      background-color: transparent;
      border: 2px solid black;
      border-radius: 10px;
    }
    
    ul::column::scroll-marker:target-current {
      background-color: black;
    }
    
#### Result
Try pressing the scroll markers to jump straight to each page. Note how the current marker is highlighted so you can see where you are in the pagination. Also try tabbing to the scroll marker group, then use the cursor keys to cycle through each page.
See Creating CSS carousels for more carousel examples.
# clip-path
The `clip-path` CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden.
## Try it
    
    clip-path: circle(40%);
    
    
    clip-path: ellipse(130px 140px at 10% 20%);
    
    
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    
    
    clip-path: path("M 0 200 L 0,75 A 5,5 0,0,1 150,75 L 200 200 z");
    
    
    clip-path: rect(5px 145px 160px 5px round 20%);
    
    
    clip-path: xywh(0 5px 100% 75% round 15% 0);
    
    
    <section class="default-example" id="default-example">
      <div class="example-container">
        <img
          class="transition-all"
          id="example-element"
          src="/shared-assets/images/examples/balloon-small.jpg"
          width="150" />
        We had agreed, my companion and I, that I should call for him at his house,
        after dinner, not later than eleven o’clock. This athletic young Frenchman
        belongs to a small set of Parisian sportsmen, who have taken up “ballooning”
        as a pastime. After having exhausted all the sensations that are to be found
        in ordinary sports, even those of “automobiling” at a breakneck speed, the
        members of the “Aéro Club” now seek in the air, where they indulge in all
        kinds of daring feats, the nerve-racking excitement that they have ceased to
        find on earth.
      </div>
    </section>
    
    
    section {
      align-items: flex-start;
    }
    
    .example-container {
      text-align: left;
      padding: 20px;
    }
    
    #example-element {
      float: left;
      width: 150px;
      margin: 20px;
    }
    
## Syntax
    
    /* Keyword values */
    clip-path: none;
    
    /* <clip-source> values */
    clip-path: url("resources.svg#c1");
    
    /* <geometry-box> values */
    clip-path: margin-box;
    clip-path: border-box;
    clip-path: padding-box;
    clip-path: content-box;
    clip-path: fill-box;
    clip-path: stroke-box;
    clip-path: view-box;
    
    /* <basic-shape> values */
    clip-path: inset(100px 50px);
    clip-path: circle(50px at 0 100px);
    clip-path: ellipse(50px 60px at 10% 20%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    clip-path: path(
      "M0.5,1 C0.5,1,0,0.7,0,0.3 A0.25,0.25,1,1,1,0.5,0.3 A0.25,0.25,1,1,1,1,0.3 C1,0.7,0.5,1,0.5,1 Z"
    );
    clip-path: rect(5px 5px 160px 145px round 20%);
    clip-path: shape(from 0% 0%, line to 100% 0%, line to 50% 100%, close);
    clip-path: xywh(0 5px 100% 75% round 15% 0);
    
    /* Box and shape values combined */
    clip-path: padding-box circle(50px at 0 100px);
    
    /* Global values */
    clip-path: inherit;
    clip-path: initial;
    clip-path: revert;
    clip-path: revert-layer;
    clip-path: unset;
    
The `clip-path` property is specified as one or a combination of the values listed below.
### Values
`<clip-source>`
    
A `<url>` referencing an SVG `<clipPath>` element.
`<basic-shape>`
    
A shape whose size and position is defined by the `<geometry-box>` value. If no geometry box is specified, the `border-box` will be used as the reference box. One of:
`inset()`
    
Defines an inset rectangle.
`circle()`
    
Defines a circle using a radius and a position.
`ellipse()`
    
Defines an ellipse using two radii and a position.
`polygon()`
    
Defines a polygon using an SVG filling rule and a set of vertices.
`path()`
    
Defines a shape using an optional SVG filling rule and an SVG path definition.
`rect()`
    
Defines a rectangle using the specified distances from the edges of the reference box.
`shape()`
    
Defines a shape using an optional SVG filling rule and shape commands for lines, curves, and arcs.
`xywh()`
    
Defines a rectangle using the specified distances from the top and left edges of the reference box and the specified width and height of the rectangle.
`<geometry-box>`
    
If specified in combination with a `<basic-shape>`, this value defines the reference box for the basic shape. If specified by itself, it causes the edges of the specified box, including any corner shaping (such as a `border-radius`), to be the clipping path. The geometry box can be one of the following values:
`margin-box`
    
Uses the margin box as the reference box.
`border-box`
    
Uses the border box as the reference box.
`padding-box`
    
Uses the padding box as the reference box.
`content-box`
    
Uses the content box as the reference box.
`fill-box`
    
Uses the object bounding box as the reference box.
`stroke-box`
    
Uses the stroke bounding box as the reference box.
`view-box`
    
Uses the nearest SVG viewport as the reference box. If a `viewBox` attribute is specified for the element creating the SVG viewport, the reference box is positioned at the origin of the coordinate system established by the `viewBox` attribute and the dimension of the size of the reference box is set to the width and height values of the `viewBox` attribute.
`none`
    
No clipping path is created.
Note: A computed value other than `none` results in the creation of a new stacking context the same way that CSS `opacity` does for values other than `1`.
## Examples
>
### Shapes and geometry boxes
In this example, two triangles are created by defining a `polygon()` as the clip path on `<div>` elements. Each one has a solid colored background and a thick `border`. The second `<div>` element has its reference box set to `content-box`:
#### HTML
    
    <div></div>
    <div></div>
    
#### CSS
    
    div {
      height: 200px;
      width: 200px;
      box-sizing: border-box;
      background-color: rebeccapurple;
      border: 20px solid magenta;
    
      clip-path: polygon(50% 0, 100% 100%, 0 100%);
    }
    
    div:last-of-type {
      clip-path: content-box polygon(50% 0, 100% 100%, 0 100%);
    }
    
#### Results
For the first triangle, we didn't specify a reference box; it therefore defaults to `border-box`, with the 0% and 100% positions located on the outside edge of the border. In the second example, we set the `<geometry-box>` to `content-box`, meaning the reference box for the basic shape is the outer edge of the content area, which is inside the padding box. Because our example has no `padding`, this is the inner edge of the border.
###  `shape()` versus `path()` functions
Expanding on the previous example, we create the same triangle with different `<basic-shape>` values, demonstrating how the `shape()` and `path()` functions can also be used to create clipping paths, with `shape()` being a more flexible solution.
We use `path()` to define the first element's clipping path, and `shape()` for the second, both using the default `border-box` as their reference box:
    
    div {
      clip-path: path("M100 0 L200 200 L0 200 Z");
    }
    
    div:last-of-type {
      clip-path: shape(from 50% 0, line to 100% 100%, line to 0 100%, close);
    }
    
As a result, the path defined with the shape() function grows with the element, whereas the path() version does not:
Because the `shape()` function allows using `<percentage>` values (and custom properties too), it is more robust.
We'll demonstrate this by increasing the size of the underlying element:
    
    div {
      width: 250px;
      height: 250px;
    }
    
The visibility, or at least partial visibility, of the four border sides in the clip path example defined by the `shape()` function is due to the percentage values allowing the path to grow with the element. In the `path()` version, the element grew, but not the shape. As a result, the top and left borders are partially visible while the right and bottom borders are clipped out.
### SVG as clip source
In this example, we define SVG `<clipPath>` elements to use as a `clip-path` source.
#### HTML
We include two `<div>` elements and an `<svg>` element containing two `<clipPath>` elements. One `<clipPath>` contains four `<rect>` elements that together define window panes, leaving a cross of blank space in the middle, and the other contains two crossing `<rect>` elements.
    
    <svg height="0" width="0">
      <defs>
        <clipPath id="window">
          <rect y="0" x="0" width="80" height="80" />
          <rect y="0" x="120" width="80" height="80" />
          <rect y="120" x="0" width="80" height="80" />
          <rect y="120" x="120" width="80" height="80" />
        </clipPath>
        <clipPath id="cross">
          <rect y="0" x="80" width="40" height="200" />
          <rect y="80" x="0" width="200" height="40" />
        </clipPath>
      </defs>
    </svg>
    
    <div class="window">Window</div>
    <div class="cross">Cross</div>
    
#### CSS
We use flexbox to allow our elements to sit side-by-side with a gap between them, if there is space available. We define a `conic-gradient()` background image on both `<div>` elements, providing an interesting visual to clip, along with a `border`.
    
    body {
      display: flex;
      gap: 20px;
      flex-flow: row wrap;
      font: 2em sans-serif;
    }
    
    div {
      width: 200px;
      height: 200px;
      background-image: conic-gradient(
        at center,
        rebeccapurple,
        green,
        lightblue,
        rebeccapurple
      );
    
      border: 5px solid;
      box-sizing: border-box;
    }
    
We then set the `id` of the `<clipPath>` as the `<clip-source>`. We center the text in the `cross` example vertically using `align-content`, as otherwise the text would be clipped, as is happening in the `window` example.
    
    .window {
      clip-path: url("#window");
    }
    
    .cross {
      clip-path: url("#cross");
      align-content: center;
    }
    
#### Results
The elements, including their border and text, are clipped, with only the parts overlapping the `<clipPath>` elements being drawn to the page.
### The various value types
This example demonstrates the various values of the `clip-path` property clipping an HTML `<img>`.
#### HTML
The HTML includes an `<img>` that will be clipped, a star-shaped `<clipPath>`, and a `<select>` element to choose a `clip-path` property value from.
    
    <img
      id="clipped"
      src="https://mdn.github.io/shared-assets/images/examples/progress-pride-flag.jpg"
      alt="Pride flag" />
    <svg height="0" width="0">
      <defs>
        <clipPath id="star">
          <path d="M100,0 42,180 196,70 4,70 158,180z" />
        </clipPath>
      </defs>
    </svg>
    
    <select id="clipPath">
      <option value="none">none</option>
      <option value="circle(100px at 110px 100px)">circle</option>
      <option value="url(#star)" selected>star</option>
      <option value="inset(20px round 20px)">inset</option>
      <option value="rect(20px 150px 200px 20px round 10%)">rect</option>
      <option value="xywh(0 20% 90% 67% round 0 0 5% 5px)">xywh</option>
      <option value="path('M 0 200 L 0,110 A 110,90 0,0,1 240,100 L 200 340 z')">
        path
      </option>
    </select>
    
#### CSS
The initial rendering includes the star as the `clip-path` source.
    
    #clipped {
      margin-bottom: 20px;
      clip-path: url("#star");
    }
    
#### JavaScript
When you select a new option from the `<select>` menu, an event handler updates the value of the `clip-path` set on the `<img>`.
    
    const clipPathSelect = document.getElementById("clipPath");
    clipPathSelect.addEventListener("change", (evt) => {
      const path = evt.target.value;
      document.getElementById("clipped").style.clipPath = path;
      log(`clip-path: ${path};`);
    });
    
#### Result
Select different options to change the `clip-path` value.
Note: While it is possible to define a path of text, if you want to clip a background image to text rather than a shape, see the `background-clip` property.
# border-bottom
The `border-bottom` shorthand CSS property sets an element's bottom border. It sets the values of `border-bottom-width`, `border-bottom-style` and `border-bottom-color`.
## Try it
    
    border-bottom: solid;
    
    
    border-bottom: dashed red;
    
    
    border-bottom: 1rem solid;
    
    
    border-bottom: thick double #32a1ce;
    
    
    border-bottom: 4mm ridge rgb(211 220 50 / 0.6);
    
    
    <section class="default-example" id="default-example">
      <div class="transition-all" id="example-element">
        This is a box with a border around it.
      </div>
    </section>
    
    
    #example-element {
      background-color: #eeeeee;
      color: darkmagenta;
      padding: 0.75em;
      width: 80%;
      height: 100px;
    }
    
As with all shorthand properties, `border-bottom` always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. Consider the following code:
    
    border-bottom-style: dotted;
    border-bottom: thick green;
    
It is actually the same as this one:
    
    border-bottom-style: dotted;
    border-bottom: none thick green;
    
The value of `border-bottom-style` given before `border-bottom` is ignored. Since the default value of `border-bottom-style` is `none`, not specifying the `border-style` part results in no border.
## Constituent properties
This property is a shorthand for the following CSS properties:
  * `border-bottom-color`
  * `border-bottom-style`
  * `border-bottom-width`


## Syntax
    
    border-bottom: 1px;
    border-bottom: 2px dotted;
    border-bottom: medium dashed blue;
    
    /* Global values */
    border-bottom: inherit;
    border-bottom: initial;
    border-bottom: revert;
    border-bottom: revert-layer;
    border-bottom: unset;
    
The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.
### Values
`<br-width>`
    
See `border-bottom-width`.
`<br-style>`
    
See `border-bottom-style`.
`<color>`
    
See `border-bottom-color`.
## Examples
>
### Applying a bottom border
#### HTML
    
    <div>This box has a border on the bottom side.</div>
    
#### CSS
    
    div {
      border-bottom: 4px dashed blue;
      background-color: gold;
      height: 100px;
      width: 100px;
      font-weight: bold;
      text-align: center;
    }
    
#### Results
# anchor()
The `anchor()` CSS function can be used within an anchor-positioned element's inset property values, returning a length value relative to the position of the edges of its associated anchor element.
## Syntax
    
    /* side or percentage */
    top: anchor(bottom);
    top: anchor(50%);
    top: calc(anchor(bottom) + 10px)
    inset-block-end: anchor(start);
    
    /* side of named anchor */
    top: anchor(--my-anchor bottom);
    inset-block-end: anchor(--my-anchor start);
    
    /* side of named anchor with fallback */
    top: anchor(--my-anchor bottom, 50%);
    inset-block-end: anchor(--my-anchor start, 200px);
    left: calc(anchor(--my-anchor right, 0%) + 10px);
    
### Parameters
The `anchor()` function's syntax is as follows:
    
    anchor(<anchor-name> <anchor-side>, <length-percentage>)
    
The parameters are:
`<anchor-name>` Optional
    
The `anchor-name` property value of an anchor element you want to position the element's side relative to. This is a `<dashed-ident>` value. If omitted, the element's default anchor, referenced in its `position-anchor` property, or associated with the element via the `anchor` HTML attribute, is used.
Note: Specifying an `<anchor-name>` inside an `anchor()` function does not associate an element with an anchor; it only positions the element relative to that anchor. The `position-anchor` CSS property or the `anchor` HTML attribute is still needed to create the association.
`<anchor-side>`
    
Specifies the side of the anchor, or the relative distance from the `start` side, which the element is positioned relative to. If a physical or logical value is used that is not compatible with the inset property on which `anchor()` is set, the fallback value is used. Valid values include:
`top`
    
The top of the anchor element.
`right`
    
The right of the anchor element.
`bottom`
    
The bottom of the anchor element.
`left`
    
The left of the anchor element.
`inside`
    
The same side as the inset property.
`outside`
    
The opposite side of the inset property.
`start`
    
The logical start of the anchor element's containing block along the axis of the inset property on which the `anchor()` function is set.
`end`
    
The logical end of the anchor element's containing block along the axis of the inset property on which the `anchor()` function is set.
`self-start`
    
The logical start of the anchor element's content along the axis of the inset property on which the `anchor()` function is set.
`self-end`
    
The logical end of the anchor element's content along the axis of the inset property on which the `anchor()` function is set.
`center`
    
The center of the axis of the inset property on which the `anchor()` function is set.
`<percentage>`
    
Specifies the distance, as a percentage, from the start of the element's content along the axis of the inset property on which the `anchor()` function is set.
`<length-percentage>` Optional
    
Specifies a fallback value the function should resolve to if the `anchor()` function would otherwise not be valid.
### Return value
Returns a `<length>` value.
## Description
The `anchor()` function enables positioning an element relative to the edges of an anchor element. It is only valid within inset property values set on absolute or fixed position elements.
It returns a `<length>` value specifying the distance between the anchor-positioned element side specified by the inset value, and the side of the anchor element specified by the chosen `<anchor-side>` value. As it returns a `<length>`, it can be used within other CSS functions that accept length values, including `calc()`, `clamp()`, etc.
If no anchor with the name specified by the `<anchor-name>` exists, or if the positioned element does not have an anchor associated with it (i.e., via the `position-anchor` property), the first parameter is considered invalid and the fallback `<length-percentage>` value is used if one is available. For example, if `top: anchor(bottom, 50px)` were specified on the positioned element but no anchor was associated with it, the fallback value would be used, so `top` would get a computed value of `50px`.
For detailed information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
### Properties that accept `anchor()` function values
The CSS inset properties that accept an `anchor()` function as a value component include:
  * `top`
  * `left`
  * `bottom`
  * `right`
  * `inset` shorthand
  * `inset-block-start`
  * `inset-block-end`
  * `inset-block` shorthand
  * `inset-inline-start`
  * `inset-inline-end`
  * `inset-inline` shorthand


### Compatibility of inset properties and `<anchor-side>` values
When using an `anchor()` function inside an inset property value, the `<anchor-side>` parameter specified inside the `anchor()` function has to be compatible with the axis on which the inset property resides.
This means that physical `<anchor-side>` values can be used within the values of physical inset properties if the property has the same axis direction as the `<anchor-side>`. In other words, the `top` and `bottom` sides are not valid within the `left` and `right` property values, and the `left` and `right` sides are not valid within `top` and `bottom` property values. For example, `top: anchor(bottom)` is fine, as they are both vertical values but `top: anchor(left)` is not valid, as `left` is a horizontal value. If `top: anchor(left, 50px)` were specified, the fallback value would be used, so `top` would get a computed value of `50px`. If no fallback is present, the inset property behaves as if it were set to `auto`.
You can use logical `<anchor-side>` values within both logical and physical inset properties as logical `<anchor-side>` values are relative to the inset property's relevant axis, whether the property is logical or relative. For example, `top: anchor(start)`, `top: anchor(self-end)`, `inset-block-start: anchor(end)` and `inset-inline-end: anchor(self-start)` all work fine.
The story gets more complicated when using physical `<anchor-side>` parameters within logical inset property values as the physical side has to match the axis the inset property is relevant to within the current writing mode. For example:
  * In a horizontal writing mode, the block direction is top-to-bottom, therefore `inset-block-end: anchor(bottom)` will work but `inset-block-end: anchor(left)` is incompatible. If `inset-block-end: anchor(left, 50px)` were set, the computed value would be `50px`, and the positioned element would be positioned `50px` from the block end (bottom) of its nearest positioned ancestor or the viewport, depending on the `position` value set.
  * In a vertical writing mode, the block direction is right-to-left or left-to-right, therefore `inset-block-end: anchor(left)` will work, but `inset-block-end: anchor(top)` is incompatible. If `inset-block-end: anchor(top, 50px)` were set, the computed value would be `50px`, and the positioned element would be positioned `50px` from the block end (left or right depending on the writing mode) of its nearest positioned ancestor or the viewport, depending on the `position` value set.


To mitigate the potential for confusion with these values, you are advised to use logical inset properties with logical `<anchor-side>` values, and physical inset properties with physical `<anchor-side>` values. You should favor the use of logical values whenever possible because they are better for internationalization.
The `center` and `<percentage>` values are valid within the `anchor()` function within all logical and physical inset properties.
The below table lists the inset properties, and the `<anchor-side>` parameter values that are compatible with them. We have only listed the longhand inset properties; these comprise the shorthand inset property values.
Inset property Compatible `<anchor-side>` value  
All `center`  
All `<percentage>`  
`top` and `bottom` `top`, `bottom`, `start`, `end`, `self-start`, `self-end`  
`left` and `right` `left`, `right`, `start`, `end`, `self-start`, `self-end`  
`inset-block-start` and `inset-block-end` `start`, `end`, `self-start`, and `self-end`  
`top` and `bottom` in horizontal writing modes  
`left` and `right` in vertical writing modes  
`inset-inline-start` and `inset-inline-end` `start`, `end`, `self-start`, and `self-end`  
`left` and `right` in horizontal writing modes  
`top` and `bottom` in vertical writing modes  
### Using `anchor()` to position popovers
When using `anchor()` to position popovers, be aware that the default styles for popovers may conflict with the position you're trying to achieve. The usual culprits are the default styles for `margin` and `inset`, so it's advisable to reset those:
    
    .positionedPopover {
      margin: 0;
      inset: auto;
    }
    
The CSS working group is looking at ways to avoid requiring this workaround.
### Using `anchor()` inside `calc()`
When the `anchor()` function refers to a side of the default anchor, you can include a `margin` to create spacing between the edges of the anchor and positioned element as needed. Alternatively, you can include the `anchor()` function within a `calc()` function to add spacing.
This example positions the right edge of the positioned element flush to the anchor element's left edge then adds margin to make some space between the edges:
    
    .positionedElement {
      right: anchor(left);
      margin-left: 10px;
    }
    
This example positions the positioned element's logical block end edge `10px` from the anchor element's logical block start edge:
    
    .positionedElement {
      inset-block-end: calc(anchor(start) + 10px);
    }
    
### Positioning an element relative to multiple anchors
You can position an element relative to multiple anchors by specifying different `<anchor-name>` values inside the `anchor()` function of different inset properties on the same element (see Element positioned relative to multiple anchors below). This can be used to create useful functionality such as drag handles at the corners of a positioned element that can be used to resize it.
While a positioned element can be positioned relative to more than one anchor element, it is only ever associated with the single anchor defined via its `position-anchor` property (or the `anchor` HTML attribute). This is the anchor the element will scroll with when the page scrolls; it can also be used to control when the element is conditionally hidden.
## Examples
>
### Common usage
In this example, the `anchor()` function is used to set the height of an anchor-positioned element to the height of its anchor by setting the bottom and top edges to the bottom and top edges of the anchor. The `anchor()` function within a `calc()` function is then used to offset the anchor-positioned element from its anchor.
#### HTML
We include a `<div>` element, which we'll set as our anchor, and a `<p>` element that we will position relative to that anchor:
    
    <div class="anchor">⚓︎</div>
    
    <p class="positionedElement">This is a positioned element.</p>
    
#### CSS
We set the anchor element's `anchor-name` value as the value of the positioned element's `position-anchor` property to associate the elements, then set three inset properties on the anchor-positioned element. The first two position the element's top edge flush with the top edge of the anchor and the bottom edge flush with the bottom edge of the anchor. In the third inset property, the `anchor()` function is used within a `calc()` function to position the element's left edge `10px` to the right edge of the anchor.
    
    .anchor {
      anchor-name: --infobox;
      background: palegoldenrod;
      font-size: 3em;
      width: fit-content;
      border: 1px solid goldenrod;
    }
    
    .positionedElement {
      position: absolute;
      position-anchor: --infobox;
      margin: 0;
      top: anchor(top);
      left: calc(anchor(right) + 10px);
      bottom: anchor(bottom);
      background-color: olive;
      border: 1px solid darkolivegreen;
    }
    
#### Results
### Comparison of different anchor-side values
This example shows an element positioned relative to an anchor via its `top` and `left` properties, which are defined using `anchor()` functions. It also includes two drop-down menus that allow you to vary the `<anchor-side>` values inside those `anchor()` functions, so you can see what effect they have.
#### HTML
We specify two `<div>` elements, one with a class of `anchor` and one with a class of `infobox`. These are intended to be the anchor element and the positioned element we will associate with it, respectively.
We also include some filler text around the two `<div>` elements to make the `<body>` taller so that it will scroll. This example also includes two `<select>` elements to create the drop-down menus enabling the selection of different `<anchor-side>` values to place the positioned element with. We've hidden the filler text and the `<select>` elements for brevity.
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
#### CSS
We declare the `anchor` `<div>` as an anchor element by setting an anchor name on it via the `anchor-name` property. We then associate it with the positioned element by setting the same value for its `position-anchor` property. `top: anchor(--my-anchor bottom)` positions the infobox's top edge flush to the bottom edge of its anchor, while `left: anchor(right)` positions the infobox's left edge flush to the right edge of its anchor. This provides an initial position that will be overwritten when different values are selected from the drop-down menus.
    
    .anchor {
      anchor-name: --my-anchor;
    }
    
    .infobox {
      position: fixed;
      position-anchor: --my-anchor;
      top: anchor(--my-anchor bottom);
      left: anchor(right);
    }
    
#### JavaScript
We listen for the `change` event that occurs when a new `<anchor-side>` value is selected, and set the selected value as the `<anchor-side>` in the `anchor()` function within the infobox's relevant inset property (`top` or `left`) value.
    
    const infobox = document.querySelector(".infobox");
    const topSelect = document.querySelector("#top-anchor-side");
    const leftSelect = document.querySelector("#left-anchor-side");
    
    topSelect.addEventListener("change", (e) => {
      const anchorSide = e.target.value;
      infobox.style.top = `anchor(--my-anchor ${anchorSide})`;
    });
    
    leftSelect.addEventListener("change", (e) => {
      const anchorSide = e.target.value;
      infobox.style.left = `anchor(${anchorSide})`;
    });
    
#### Result
Select different values from the drop-down menus to see how they affect the positioning of the infobox.
### Element positioned relative to multiple anchors
This example positions an element relative to two different anchors, which are used to set the position of the top-left and bottom-right corners of the anchor-positioned element. The anchors can be moved via keyboard controls or dragged, resizing the positioned element.
#### HTML
We specify three `<div>` elements in total. The first two have a class of `anchor` and will be defined as anchors; each one has an individual `id` that will be used to provide them with different positioning information. The last `<div>` has a class of `infobox` and will be defined as the positioned element. We include the `tabindex` attribute to enable them to receive keyboard focus.
    
    <div id="anchor1" class="anchor" tabindex="0">⚓︎1</div>
    
    <div id="anchor2" class="anchor" tabindex="0">⚓︎2</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
#### CSS
The anchors are each given a different `anchor-name` value, a `position` value of `absolute`, and different inset values to position the anchors in a rectangle formation.
    
    .anchor {
      position: absolute;
    }
    
    #anchor1 {
      anchor-name: --my-anchor1;
      top: 50px;
      left: 100px;
    }
    
    #anchor2 {
      anchor-name: --my-anchor2;
      top: 200px;
      left: 350px;
    }
    
The anchor-positioned element, with its `position` set to `fixed`, is associated with one anchor via its `position-anchor` property. It is positioned relative to two anchors by including two different `<anchor-name>` values with the `anchor()` functions set on its inset properties. In this case, we used `<percentage>` values for the `<anchor-side>` parameter, specifying the distance from the start of the axis of the inset property on which the function is set.
    
    .infobox {
      position-anchor: --my-anchor1;
      position: fixed;
      top: anchor(--my-anchor1 100%);
      left: anchor(--my-anchor1 100%);
      bottom: anchor(--my-anchor2 0%);
      right: anchor(--my-anchor2 0%);
    }
    
#### Result
The positioned element is positioned relative to both anchor elements. Drag them with the mouse or tab to them and use the `W`, `A`, `S`, and `D` keys to move them up, down, left, and right. See how this changes their position, and as a consequence, the area of the positioned element. Scroll to see how the positions of all the elements are maintained.
Note: This example is a proof-of-concept and not intended to be used in production code. Among its shortcomings, the example breaks if you try to move the anchors past each other horizontally or vertically.
# anchor-name
The `anchor-name` CSS property enables defining an element as an anchor element by giving it one or more identifying anchor names. Each name can then be set as the value of a positioned element's `position-anchor` property to associate it with the anchor.
## Syntax
    
    /* Single values */
    anchor-name: none;
    anchor-name: --name;
    
    /* Multiple values */
    anchor-name: --name, --another-name;
    
    /* Global values */
    anchor-name: inherit;
    anchor-name: initial;
    anchor-name: revert;
    anchor-name: revert-layer;
    anchor-name: unset;
    
### Values
`none`
    
The default value. Setting `anchor-name: none` on an element means that it is not defined as an anchor element. If the element was previously defined as an anchor and associated with a positioned element, setting `anchor-name: none` disassociates the two.
`<dashed-ident>`
    
One or more comma-separated arbitrary custom identifiers defining the name or names of the anchor, which can then be referenced in a `position-anchor` property.
## Description
To position an element relative to an anchor element, the positioned element requires three features: an association, a position, and a location. The `anchor-name` and `position-anchor` properties provide an explicit association.
The anchor element accepts one or more `<dashed-ident>` anchor names set on it via the `anchor-name` property. When one of those names is then set as the value of the `position-anchor` property of an element that has its `position` set to `absolute` or `fixed`, the two elements are associated. The two elements become tethered by setting a location on the associated element relative to the anchor, making it an "anchor-positioned" element.
If multiple anchor elements have the same anchor name set on them, and that name is referenced by the `position-anchor` property value of a positioned element, that positioned element will be associated with the last anchor element with that anchor name in the source order.
Anchor positioning changes the containing block of anchor-positioned elements, making its `position` relative to its anchor rather than to the nearest positioned ancestor element.
To tether and place a positioned element in a specific location relative to an anchor element, an anchor positioning feature is needed, such as the `anchor()` function (set within an inset property's value) or the `position-area` property.
You cannot associate a positioned element with an anchor element if the anchor is hidden, such as with `display: none` or `visibility: hidden`, or if the anchor is part of the skipped contents of another element due to it having `content-visibility: hidden` set on it.
The `anchor-name` property is supported on all elements that generate a principal box. This means that pseudo-elements, including generated content created using `::before` and `::after`, and UI features like the `range` input thumb (`::-webkit-slider-thumb`) can be anchor elements. Pseudo elements are implicitly anchored to the same element as the pseudo-element's originating element, unless otherwise specified.
For more information on anchor features and usage, see the CSS anchor positioning module landing page and the Using CSS anchor positioning guide.
## Examples
>
### Basic usage
This example tethers a positioned element to an anchor, positioning the element to the right of the anchor.
#### HTML
We specify two `<div>` elements; an anchor element with a class of `anchor` and a positioned element with a class of `infobox`.
We also include some filler text around the two `<div>`s to make the `<body>` taller so that it will scroll.
    
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
      incididunt ut labore et dolore magna aliqua. Dui nunc mattis enim ut tellus
      elementum sagittis vitae et.
    </p>
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox">
      <p>This is an information box.</p>
    </div>
    
    <p>
      Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. In arcu
      cursus euismod quis viverra nibh cras pulvinar. Vulputate ut pharetra sit amet
      aliquam.
    </p>
    
    <p>
      Malesuada nunc vel risus commodo viverra maecenas accumsan lacus. Vel elit
      scelerisque mauris pellentesque pulvinar pellentesque habitant morbi
      tristique. Porta lorem mollis aliquam ut porttitor. Turpis cursus in hac
      habitasse platea dictumst quisque. Dolor sit amet consectetur adipiscing elit.
      Ornare lectus sit amet est placerat. Nulla aliquet porttitor lacus luctus
      accumsan.
    </p>
    
#### CSS
We first declare the `anchor` `<div>` as an anchor element by setting an anchor name on it via the `anchor-name` property:
    
    .anchor {
      anchor-name: --my-anchor;
    }
    
We associate the second `<div>` with the anchor element by setting its anchor name as the value of the positioned element's `position-anchor` property. We then set the positioned element's:
  * `position` property to `fixed`, converting it to an anchor-positioned element so it can be positioned relative to the anchor's position on the page.
  * `left` and `top` properties to `anchor()` functions with values of `right` and `top` respectively. This positions the infobox's left edge flush to the right edge of its anchor, and its top edge relative to the top edge of its anchor.
  * `margin-left` to `10px`, creating space between the anchor positioned element and its anchor.


    
    .infobox {
      position-anchor: --my-anchor;
      position: fixed;
      left: anchor(right);
      top: anchor(top);
      margin-left: 10px;
    }
    
#### Result
Scroll the page to see how the infobox is positioned relative to the anchor. As the anchor scrolls upwards, the positioned element moves along with it.
### Multiple positioned elements
This example demonstrates how you can associate multiple positioned elements with one anchor.
#### HTML
The HTML is the same as for the previous example, except this time we have multiple positioned element `<div>`s with different `id`s to identify them.
    
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
      incididunt ut labore et dolore magna aliqua. Dui nunc mattis enim ut tellus
      elementum sagittis vitae et.
    </p>
    
    <div class="anchor">⚓︎</div>
    
    <div class="infobox" id="infobox1">
      <p>This is an information box.</p>
    </div>
    
    <div class="infobox" id="infobox2">
      <p>This is another information box.</p>
    </div>
    
    <p>
      Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. In arcu
      cursus euismod quis viverra nibh cras pulvinar. Vulputate ut pharetra sit amet
      aliquam.
    </p>
    
    <p>
      Malesuada nunc vel risus commodo viverra maecenas accumsan lacus. Vel elit
      scelerisque mauris pellentesque pulvinar pellentesque habitant morbi
      tristique. Porta lorem mollis aliquam ut porttitor. Turpis cursus in hac
      habitasse platea dictumst quisque. Dolor sit amet consectetur adipiscing elit.
      Ornare lectus sit amet est placerat. Nulla aliquet porttitor lacus luctus
      accumsan.
    </p>
    
#### CSS
We declare the `anchor` `<div>` as an anchor element using the `anchor-name` property, giving it an anchor name as before.
    
    .anchor {
      anchor-name: --my-anchor;
    }
    
Each of the two positioned elements are associated with the anchor element by setting its anchor name as the positioned element's `position-anchor` property value. Both are also given `fixed` positioning, making them anchor positioned elements. The positioned elements are then positioned in different places relative to the anchor using a combination of inset properties as seen above and `align-self` / `justify-self` properties with a value of `anchor-center`, centrally aligning the infobox to the center of the anchor in the inline/block directions respectively.
    
    .infobox {
      position-anchor: --my-anchor;
      position: fixed;
    }
    
    #infobox1 {
      left: anchor(right);
      align-self: anchor-center;
      margin-left: 10px;
    }
    
    #infobox2 {
      bottom: anchor(top);
      justify-self: anchor-center;
      margin-bottom: 15px;
    }
    
#### Result
Scroll the page to see how both of the infoboxes are tethered to the anchor.
### Multiple anchor names
This example demonstrates how an anchor element can have more than one anchor name.
#### HTML
The HTML is the same as for the previous example.
#### CSS
The CSS is the same as the previous example too, except we include two comma-separated names in the target's `anchor-name` property value and each positioned element has a different value for `position-anchor`.
    
    .anchor {
      anchor-name: --anchor1, --anchor2;
    }
    
    .infobox {
      position: fixed;
    }
    
    #infobox1 {
      position-anchor: --anchor1;
      left: anchor(right);
      align-self: anchor-center;
      margin-left: 10px;
    }
    
    #infobox2 {
      position-anchor: --anchor2;
      bottom: anchor(top);
      justify-self: anchor-center;
      margin-bottom: 15px;
    }
    
#### Result
Scroll the page to see how both of the infoboxes are tethered to the anchor.
  *[ Experimental ]: Experimental. Expect behavior to change in the future.
  *[ Non-standard ]: Non-standard. Check cross-browser support before using.
  *[ Deprecated ]: Deprecated. Not for use in new websites.
