display标签

.container {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  background-color: #fff;
}

display 标签

display 属性可以设置元素的内部外部显示类型 display types。元素的外部显示类型 outer display types 将决定该元素在流式布局中的表现(块级或内联元素);元素的内部显示类型 inner display types 可以控制其子元素的布局(例如:flow layout,grid 或 flex)。

在 CSS 规范(特指 CSS Level 1/2/3 规范)中查阅 display 属性的所有取值时需要注意:个别取值的详细信息记录在独立的规范中。 例如,display: flex 的详细信息在 CSS Flexible Box Model 规范中记录。可以在本文档末尾的表格中查看所有有关的规范。

类型解释
<display-outside>这些关键字指定了元素的外部显示类型,实际上就是其在流式布局中的角色(即在流式布局中的表现)。
<display-inside>这些关键字指定了元素的内部显示类型,它们定义了该元素内部内容的布局方式(假定该元素为非替换元素 non-replaced element)。
<display-listitem>将这个元素的外部显示类型变为 block 盒,并将内部显示类型变为多个 list-item inline 盒。

flex

The element behaves like a block element and lays out its content according to the flexbox model.
元素的行为如同块模型,它的内容按照flexBox模型排列。

flexBox

The main axis

The main axis is defined by flex-direction, which has four possible values:

  • row
  • row-reverse
  • column
  • column-reverse

Should you choose row or row-reverse, your main axis will run along the row in the inline direction.
在这里插入图片描述

Choose column or column-reverse and your main axis will run from the top of the page to the bottom — in the block direction.
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

t0tott

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值