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
120
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
74
Design a REST API you will love to work with
ujovlado
0
710
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
450
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
340
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
94
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
58
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
130
Don't underestimate CSS (WebElement #30)
ujovlado
0
540
Database Migrations in PHP (Posobota #66)
ujovlado
0
98
Other Decks in Programming
See All in Programming
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
190
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
770
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
110
Package Traits
ikesyo
2
220
Beyond ORM
77web
11
1.6k
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
定理証明プラットフォーム lapisla.net
abap34
1
600
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
270
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
400
ErdMap: Thinking about a map for Rails applications
makicamel
1
840
Linux && Docker 研修/Linux && Docker training
forrep
16
3k
HTML/CSS超絶浅い説明
yuki0329
0
200
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
How to Ace a Technical Interview
jacobian
276
23k
Code Reviewing Like a Champion
maltzj
521
39k
Making Projects Easy
brettharned
116
6k
BBQ
matthewcrist
85
9.4k
What's in a price? How to price your products and services
michaelherold
244
12k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
590
Why Our Code Smells
bkeepers
PRO
335
57k
Producing Creativity
orderedlist
PRO
343
39k
Visualization
eitanlees
146
15k
4 Signs Your Business is Dying
shpigford
182
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
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!