使元素脱离正常流的 CSS 属性是什么? [英] What are the CSS properties that get elements out of the normal flow?

查看:28
本文介绍了使元素脱离正常流的 CSS 属性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使元素脱离正常流的 CSS 属性是什么?这些属性将是 float、position:absolute 等.

What are the CSS properties that get elements out of the normal flow? Such properties would be float, position:absolute etc.

这个问题涉及正常流程的所有可能的改变.

This question relates to all the possible alterations of the normal flow.

推荐答案

只有以下属性会影响任何给定元素的正常流动:

Only the following properties affects the normal flow of any given element:

  • 浮动:右|左
  • 位置:绝对|固定

只是为了完整性:

  • display: none 从流中移除元素(严格来说元素不会有流序)

  • display: none removes the element from the flow (strictly speaking the element will not have a flow order)

position:relative 不会改变元素的流向,而是改变它相对于正常流向位置的位置.

position: relative does not change the flow order of the element, but changes its position relative to the normal flow position.

visibility: hidden 将保持流上的元素,但不会将其渲染到视口.

visibility: hidden will maintain the element on the flow but will not render it to the viewport.

这篇关于使元素脱离正常流的 CSS 属性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆