做一个代码世界的设计师!🍺|

Jikefan

园龄:4年11个月粉丝:5关注:4

CSS弹性布局

Flexbox of CSS

The First

A webpage where you could study flexbox of css.

FLEXBOX FROGGY

http://flexboxfroggy.com

If you want to use flexbox layout in webpage.You need set value of display property to flex .

  • For example
.box {
display: flex; //using flexbox layout
}

The second

  • introduction of flexbox propertys

    justify-content

    This property could aligns items horizontally and accepts the following values:

    .box {
    justify-content: flex-start; //Items align to the left side of the conthener.
    justify-content: flex-end; //Items align to the end side of the container.
    justify-content: center; //Items align to the center of the container.
    justify-content: space-around; //Items display with equal spacing around them.
    justify-content: space-between;//Items display with equal spacing between them.
    }

    align-items

    This CSS property aligns items vertically and accepts the following values:

    .box {
    align-items: flex-start; //Items align to the top of the container.
    align-items: flex-end; //Items align to the bottom of the container.
    align-items: center; //Items align at the vertical center of the container.
    align-items: baseline; //Items display at the baseline of the container.
    align-items: stretch; //Items are stretched to fit the container.
    }

    flex-direction

    This css property defines direction items are placed in the container.

    .box {
    flex-direction: row; // Items are placed the same as the text direction.
    flex-direction: row-reverse; // Items are placed opposite to the text direction.
    flex-direction: column; // Items are placed top to bottom.
    flex-direction: column-reverse; // Items are placed bottom to top.
    }

The third

Sometimes reversing row or column order of a container is not enough.In these cases, we can apply the order property to individual items.By default,Items have a value of 0, but we can use this property to set it to a positive or negative value(-2, -1, 0, 1, 2).

order

.box {
order: -1;
}

align-self

Another property you can apply to individual items is align-self. This property accepts the same values as align-items and its value for the specific item.

#pond {
display: flex;
align-items: flex-start;
}
.yellow {
order: 1;
align-self: flex-end;
}

image

flex-wrap

Oh no! The frogs are all squeezed onto a single row of lilypads. Spread them out using the flex-wrap property, which accepts the following values:

nowrap: Every item is fit to a single line.
wrap: Items wrap around to additional lines.
wrap-reverse: Items wrap around to additional lines in reverse.

image

#pond {
display: flex;
flex-wrap: wrap;
}

flex-wrap

The two properties flex-direction and flex-wrap are used so often together that the shorthand property flex-flow was created to combine them. This shorthand property accepts the value of the two properties separated by a space.

For example, you can use flex-flow: row wrap to set rows and wrap them.

align-content

The frogs are spread all over the pond, but the lilypads are bunched at the top. You can use align-content to set how multiple lines are spaced apart from each other. This property takes the following values:

flex-start: Lines are packed at the top of the container.
flex-end: Lines are packed at the bottom of the container.
center: Lines are packed at the vertical center of the container.
space-between: Lines display with equal spacing between them.
space-around: Lines display with equal spacing around them.
stretch: Lines are stretched to fit the container.

This can be confusing, but align-content determines the spacing between lines, while align-itemsdetermines how the items as a whole are aligned within the container. When there is only one line, align-contenthas no effect.

The End

Learning requires constant practice.

本文作者:Jikefan

本文链接:https://www.cnblogs.com/jikefan/articles/18325182

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Jikefan  阅读(5)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.

作曲 : Reol

作词 : Reol

fade away...do over again...

fade away...do over again...

歌い始めの一文字目 いつも迷ってる

歌い始めの一文字目 いつも迷ってる

どうせとりとめのないことだけど

伝わらなきゃもっと意味がない

どうしたってこんなに複雑なのに

どうしたってこんなに複雑なのに

噛み砕いてやらなきゃ伝わらない

ほら結局歌詞なんかどうだっていい

僕の音楽なんかこの世になくたっていいんだよ

Everybody don't know why.

Everybody don't know why.

Everybody don't know much.

僕は気にしない 君は気付かない

何処にももういないいない

Everybody don't know why.

Everybody don't know why.

Everybody don't know much.

忘れていく 忘れられていく

We don't know,We don't know.

目の前 広がる現実世界がまた歪んだ

目の前 広がる現実世界がまた歪んだ

何度リセットしても

僕は僕以外の誰かには生まれ変われない

「そんなの知ってるよ」

気になるあの子の噂話も

シニカル標的は次の速報

麻痺しちゃってるこっからエスケープ

麻痺しちゃってるこっからエスケープ

遠く遠くまで行けるよ

安定なんてない 不安定な世界

安定なんてない 不安定な世界

安定なんてない きっと明日には忘れるよ

fade away...do over again...

fade away...do over again...

そうだ世界はどこかがいつも嘘くさい

そうだ世界はどこかがいつも嘘くさい

綺麗事だけじゃ大事な人たちすら守れない

くだらない 僕らみんなどこか狂ってるみたい

本当のことなんか全部神様も知らない

Everybody don't know why.

Everybody don't know why.

Everybody don't know much.

僕は気にしない 君は気付かない

何処にももういないいない

Everybody don't know why.

Everybody don't know why.

Everybody don't know much.

忘れていく 忘れられていく

We don't know,We don't know.