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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Vladimír Kriška
October 08, 2015
Programming
0
180
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
150
Design a REST API you will love to work with
ujovlado
0
780
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
510
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
400
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
160
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
120
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
190
Don't underestimate CSS (WebElement #30)
ujovlado
0
620
Database Migrations in PHP (Posobota #66)
ujovlado
0
150
Other Decks in Programming
See All in Programming
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
ぼくの開発環境2026
yuzneri
0
240
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
CSC307 Lecture 05
javiergs
PRO
0
500
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
Data-Centric Kaggle
isax1015
2
780
Raku Raku Notion 20260128
hareyakayuruyaka
0
310
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
120
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
8k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
Discover your Explorer Soul
emna__ayadi
2
1.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Music & Morning Musume
bryan
47
7.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
The browser strikes back
jonoalderson
0
390
How to train your dragon (web standard)
notwaldorf
97
6.5k
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!