Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
5
19k
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
19k
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
無秩序からの脱却 / Emergence from chaos
nrslib
2
12k
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
120
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
150
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
2.9k
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
21k
tparseでgo testの出力を見やすくする
utgwkk
1
150
Microservices rules: What good looks like
cer
PRO
0
710
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
640
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
280
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
KATA
mclloyd
PRO
32
15k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
It's Worth the Effort
3n
187
29k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
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!