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
140
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
87
Design a REST API you will love to work with
ujovlado
0
730
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
460
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
350
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
110
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
68
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
140
Don't underestimate CSS (WebElement #30)
ujovlado
0
560
Database Migrations in PHP (Posobota #66)
ujovlado
0
110
Other Decks in Programming
See All in Programming
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
840
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
1
180
プログラミング教育のコスパの話
superkinoko
0
130
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.3k
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
1.9k
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
140
Being an ethical software engineer
xgouchet
PRO
0
180
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
13
5.1k
英語 × の私が、生成AIの力を借りて、OSSに初コントリビュートした話
personabb
0
160
Kamal 2 – Get Out of the Cloud
aleksandrov
1
150
Fluent UI Blazor 5 (alpha)の紹介
tomokusaba
0
160
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
410
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
25k
A Tale of Four Properties
chriscoyier
158
23k
Unsuck your backbone
ammeep
670
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Become a Pro
speakerdeck
PRO
27
5.2k
What's in a price? How to price your products and services
michaelherold
245
12k
How to Think Like a Performance Engineer
csswizardry
22
1.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
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!