Spec-Zone.ru › CSS

`position-try-fallbacks` CSS property

Baseline Limited availability

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

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.

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

This property is specified as the keyword none or a comma-separated list of the following 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.

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.

The position-try-fallbacks property, along with the position-try-order property, can also be set by using the position-try shorthand.

For detailed information on anchor features and position try fallback usage, see the CSS anchor positioning module 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.

Formal definition

Initial value none
Applies to absolutely positioned elements
Inherited no
Computed value as specified
Animation type discrete

Formal syntax

position-try-fallbacks = 
  none |
  [ [<dashed-ident> || <try-tactic>] | <'position-area'> ]#

<try-tactic> = 
  flip-block ||
  flip-inline ||
  flip-start

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>:

.anchor {
  font-size: 1.8rem;
  color: white;
  text-shadow: 1px 1px 1px black;
  background-color: hsl(240 100% 75%);
  width: fit-content;
  border-radius: 10px;
  border: 1px solid black;
  padding: 3px;
}
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 {
  color: darkblue;
  background-color: azure;
  border: 1px solid #dddddd;
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
}
.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.

Depending on the browser, once the positioned element moves to the fallback position, it may remain in the fallback position even if the fallback positioning is no longer necessary, such as when the space allows it to return to the position defined by the position-area.

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:

<div class="anchor">⚓︎</div>

<div class="infobox">
  <p>This is an information box.</p>
</div>
body {
  width: 1500px;
  height: 500px;
}

.anchor {
  font-size: 1.8rem;
  color: white;
  text-shadow: 1px 1px 1px black;
  background-color: hsl(240 100% 75%);
  width: fit-content;
  border-radius: 10px;
  border: 1px solid black;
  padding: 3px;
}

.anchor {
  anchor-name: --my-anchor;
  margin: 100px 350px;
}

.infobox {
  color: darkblue;
  background-color: azure;
  border: 1px solid #dddddd;
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
}
.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.

<div class="anchor">⚓︎</div>

<div class="infobox">
  <p>This is an information box.</p>
</div>
body {
  width: 1500px;
  height: 500px;
}

.anchor {
  font-size: 1.8rem;
  color: white;
  text-shadow: 1px 1px 1px black;
  background-color: hsl(240 100% 75%);
  width: fit-content;
  border-radius: 10px;
  border: 1px solid black;
  padding: 3px;
}

.anchor {
  anchor-name: --my-anchor;
  margin: 100px 350px;
}

.infobox {
  color: darkblue;
  background-color: azure;
  border: 1px solid #dddddd;
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
}
.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.

Specifications

Specification
CSS Anchor Positioning Module Level 1
# position-try-fallbacks

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS
position-try-fallbacks
128
125–128
128
125–128
147
114
111–114
26
128
125–128
147
85
83–85
26
28.0
27.0–28.0
128
125–128
26
block-end
129
129
147
115
26
129
147
86
26
28.0
129
26
block-start
129
129
147
115
26
129
147
86
26
28.0
129
26
bottom
129
129
147
115
26
129
147
86
26
28.0
129
26
center
129
129
147
115
26
129
147
86
26
28.0
129
26
end
129
129
147
115
26
129
147
86
26
28.0
129
26
flip-block
128
128
147
114
26
128
147
85
26
28.0
128
26
flip-inline
128
128
147
114
26
128
147
85
26
28.0
128
26
flip-start
128
128
147
114
26
128
147
85
26
28.0
128
26
flip-x
144
144
147
128
26.2
144
147
95
26.2
No
144
26.2
flip-y
144
144
147
128
26.2
144
147
95
26.2
No
144
26.2
inline-end
129
129
147
115
26
129
147
86
26
28.0
129
26
inline-start
129
129
147
115
26
129
147
86
26
28.0
129
26
left
129
129
147
115
26
129
147
86
26
28.0
129
26
none
128
128
147
114
26
128
147
85
26
28.0
128
26
position-area
128
125–128inset-area values had to be wrapped inside an inset-area() function.
128
125–128inset-area values had to be wrapped inside an inset-area() function.
147
114
111–114inset-area values had to be wrapped inside an inset-area() function.
26
128
125–128inset-area values had to be wrapped inside an inset-area() function.
147
85
83–85inset-area values had to be wrapped inside an inset-area() function.
26
28.0
27.0–28.0inset-area values had to be wrapped inside an inset-area() function.
128
125–128inset-area values had to be wrapped inside an inset-area() function.
26
right
129
129
147
115
26
129
147
86
26
28.0
129
26
self-block-end
129
129
147
115
26
129
147
86
26
28.0
129
26
self-block-start
129
129
147
115
26
129
147
86
26
28.0
129
26
self-end
129
129
147
115
26
129
147
86
26
28.0
129
26
self-inline-end
129
129
147
115
26
129
147
86
26
28.0
129
26
self-inline-start
129
129
147
115
26
129
147
86
26
28.0
129
26
self-start
129
129
147
115
26
129
147
86
26
28.0
129
26
self-x-end
144
143–144When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
128
127–128When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
115–127When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
144
143–144When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
95
94–95When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
86–94When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
30.0When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
28.0–30.0When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-x-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
self-x-start
144
143–144When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
128
127–128When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
115–127When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
144
143–144When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
95
94–95When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
86–94When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
30.0When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
28.0–30.0When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-x-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When x-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
self-y-end
144
143–144When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
128
127–128When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
115–127When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
144
143–144When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
95
94–95When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
86–94When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
30.0When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
28.0–30.0When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-y-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-end is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
self-y-start
144
143–144When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
128
127–128When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
115–127When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
144
143–144When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
148
147–148When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 2008537.
95
94–95When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
86–94When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
30.0When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
28.0–30.0When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
144
143–144When self-y-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
129–143When y-self-start is used as a single keyword, or alongside span-all, it unexpectedly allows the anchored box to overflow the viewport, obscuring content. Use place-self: anchor-center as a workaround. See bug 438334710.
26.2
26
span-all
129
129
147
115
26
129
147
86
26
28.0
129
26
span-block-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-block-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-bottom
129
129
147
115
26
129
147
86
26
28.0
129
26
span-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-inline-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-inline-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-left
129
129
147
115
26
129
147
86
26
28.0
129
26
span-right
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-block-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-block-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-inline-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-inline-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-self-x-end
143
129–143
143
129–143
147
127
115–127
26.2
26
143
129–143
147
94
86–94
26.2
26
30.0
28.0–30.0
143
129–143
26.2
26
span-self-x-start
143
129–143
143
129–143
147
127
115–127
26.2
26
143
129–143
147
94
86–94
26.2
26
30.0
28.0–30.0
143
129–143
26.2
26
span-self-y-end
143
129–143
143
129–143
147
127
115–127
26.2
26
143
129–143
147
94
86–94
26.2
26
30.0
28.0–30.0
143
129–143
26.2
26
span-self-y-start
143
129–143
143
129–143
147
127
115–127
26.2
26
143
129–143
147
94
86–94
26.2
26
30.0
28.0–30.0
143
129–143
26.2
26
span-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-top
129
129
147
115
26
129
147
86
26
28.0
129
26
span-x-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-x-start
129
129
147
115
26
129
147
86
26
28.0
129
26
span-y-end
129
129
147
115
26
129
147
86
26
28.0
129
26
span-y-start
129
129
147
115
26
129
147
86
26
28.0
129
26
start
129
129
147
115
26
129
147
86
26
28.0
129
26
top
129
129
147
115
26
129
147
86
26
28.0
129
26
x-end
129
129
147
115
26
129
147
86
26
28.0
129
26
x-start
129
129
147
115
26
129
147
86
26
28.0
129
26
y-end
129
129
147
115
26
129
147
86
26
28.0
129
26
y-start
129
129
147
115
26
129
147
86
26
28.0
129
26

See also

  • position-try
  • position-try-order
  • @position-try at-rule
  • position-area
  • <position-area> value
  • Fallback options and conditional hiding for overflow guide
  • Using CSS anchor positioning guide
  • CSS anchor positioning module

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-try-fallbacks

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API