Skip to content

大小與空白 ​

Sizing ​

高 classcss 效果寬 classcss 效果
h-autoheight: autow-autowidth: auto
h-screenheight: 100dvh--
h-0height: 0w-0width: 0
h-25height: 25%w-25width: 25%
h-50height: 50%w-50width: 50%
h-75height: 75%w-75width: 75%
h-100height: 100%w-100width: 100%

練習

  • 設定長寬是 flex 容器的 50%。 練習

邊距(margin)/填充(padding) ​

方向 ​

code影響方向
ttop上
bbottom下
lleft左
rright右
sstart開始的方向(LTR: 左;RTL: 右)
eend結束的方向(LTR: 右;RTL: 左 )
xxx 軸方向(上下)
yyy 軸方向(左右)
aall所有方向(上下左右)

試試看

練習

  • 加入 breakpoint,使用 {property}{direction}-{breakpoint}-{size}。 練習
  • 對 d-flex 的子元素試試看 my-auto、mx-auto。練習

Reference ​