前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >css里的positioning scheme, 即position property

css里的positioning scheme, 即position property

作者头像
Jerry Wang
发布2021-04-07 16:05:51
3630
发布2021-04-07 16:05:51
举报

在 SAP Spartacus 的scss文件实现里,能观察到很多position property具有不同的值:absolute 或者 relative:

position属性的初始值为static.

首先需要了解css里的三种positioning scheme.

In CSS 2.1, a box may be laid out according to three positioning schemes.

  1. Normal flow : In CSS 2.1, normal flow includes block formatting of block-level boxes, inline formatting of inline-level boxes, and relative positioning of block-level and inline-level boxes.
  2. Floats : In the float model, a box is first laid out according to the normal flow, then taken out of the flow and shifted to the left or right as far as possible. Content may flow along the side of a float.
  3. Absolute positioning : In the absolute positioning model, a box is removed from the normal flow entirely (it has no impact on later siblings) and assigned a position with respect to a containing block.

normal flow

Boxes in the normal flow belong to a formatting context, which may be block or inline, but not both simultaneously. Block-level boxes participate in a block formatting context. Inline-level boxes participate in an inline formatting context.

normal flow里的boxes属于某一种格式化上下文,block或者inline仅居其一,但是不能同时属于二者。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021-03-26 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • normal flow
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档