大网数据广告活动
Web 标准与前端开发

`<overflow-position>` CSS type

· 52CE 我爱测

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

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.

Specifications

See also

  • Properties that use this data type: align-content, align-items, align-self, justify-content justify-items, justify-self, place-content, place-items, and place-self
  • Other box alignment data types: content-distribution, content-position, baseline-position, and self-position
  • CSS box alignment module
  • CSS flexible box layout module
  • CSS grid layout module

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。