$30 off During Our Annual Pro Sale. View Details »
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
170
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
140
Design a REST API you will love to work with
ujovlado
0
770
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
500
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
390
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
150
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
110
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
180
Don't underestimate CSS (WebElement #30)
ujovlado
0
600
Database Migrations in PHP (Posobota #66)
ujovlado
0
140
Other Decks in Programming
See All in Programming
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
390
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
140
ゲームの物理 剛体編
fadis
0
350
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
740
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.5k
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
350
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.3k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
270
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
810
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
Designing for humans not robots
tammielis
254
26k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Designing for Performance
lara
610
69k
The Cult of Friendly URLs
andyhume
79
6.7k
Navigating Team Friction
lara
191
16k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Embracing the Ebb and Flow
colly
88
4.9k
Making Projects Easy
brettharned
120
6.5k
Typedesign – Prime Four
hannesfritz
42
2.9k
Done Done
chrislema
186
16k
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!