Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CSS Flexbox (WebElement #35)
Search
Vladimír Kriška
October 08, 2015
Programming
0
100
CSS Flexbox (WebElement #35)
Vladimír Kriška
October 08, 2015
Tweet
Share
More Decks by Vladimír Kriška
See All by Vladimír Kriška
Twelve-Factor app with Docker
ujovlado
0
51
Design a REST API you will love to work with
ujovlado
0
670
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
410
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
300
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
71
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
43
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
110
Don't underestimate CSS (WebElement #30)
ujovlado
0
520
Database Migrations in PHP (Posobota #66)
ujovlado
0
84
Other Decks in Programming
See All in Programming
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
200
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.4k
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
0
200
オートマトン学習しろ / Do automata learning
makenowjust
3
110
ESLint Rule により事業, 技術ドメインに沿った制約と誓約を敷衍させるアプローチのすゝめ
shinyaigeek
1
2.9k
私のEbitengineの第一歩
qt_luigi
0
440
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
570
Swiftコードバトル必勝法
toshi0383
0
150
どうしてこうなった?から理解するActive Recordの関連の裏側
willnet
5
550
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
380
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
940
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
140
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
88
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
123
18k
Visualization
eitanlees
142
15k
Docker and Python
trallard
39
3k
VelocityConf: Rendering Performance Case Studies
addyosmani
322
23k
Designing the Hi-DPI Web
ddemaree
278
34k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
Six Lessons from altMBA
skipperchong
26
3.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
Web development in the modern age
philhawksworth
204
10k
Practical Orchestrator
shlominoach
185
10k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
Transcript
CSS FLEXBOX Vladimír Kriška (@ujovlado) WebElement #35
None
None
Classic “floats”
None
Flexbox applied* *and minor improvements: styled button, changed image position
None
Container, items, … source: http://www.w3.org/TR/css-flexbox-1/
flex-flow (shorthand) flex-direction • row, row-reverse, column, column-reverse • initial
value: row flex-wrap • nowrap, wrap, wrap-reverse • initial value: nowrap • flex-direction || flex-wrap
order • <int> • initial value: 0 • affects only
visual media (not speech) • use it for visual, not logical ordering
Single-line & multi-line Once content is broken into lines, each
line is independent
The “flex” property (shorthand) • none, [flex-grow && flex-shrink ||
flex-basis] • flex: none • 0 0 auto • flex: initial (this is an initial value) • 0 1 auto • flex: auto • 1 1 auto • flex: <int> • <int> 1 0% (e.g. flex: 10 => flex: 10 1 0%)
flex-grow & flex-shrink & flex-basis flex-grow how much the flex
item will grow relative to the rest of the flex items flex-shrink how much the flex item will shrink relative to the rest of the flex items flex-basis initial main size of the flex item, before free space is distributed according to the flex factors
flex: 1 0 20%* *with min-width applied and disabled max-width
min-width: 200px;
Different flex for each box* min-width: 200px; *with min-width applied
and disabled max-width
None
justify-content • flex-start, flex-end, center, space-between, space-around • initial value:
flex-start source: http://www.w3.org/TR/css-flexbox-1/
justify-content: center
None
align-items, align-self align-items • flex-start, flex-end, center, baseline, stretch •
initial value: stretch • applies to: containers align-self • auto, flex-start, flex-end, center, baseline, stretch • initial value: auto • applies to: items
align-items, align-self source: http://www.w3.org/TR/css-flexbox-1/
So, how to center div vertically?
None
Questions? No? Thank you!