Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Unidades Mágicas do CSS3
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ricardo Gouveia
February 27, 2016
Programming
64
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Unidades Mágicas do CSS3
Apresentação de algumas unidades que, apesar de muito úteis, são pouco conhecidas.
Ricardo Gouveia
February 27, 2016
More Decks by Ricardo Gouveia
See All by Ricardo Gouveia
Performance Pré JS
ricardogouveia3
2
130
Hexo.js & Github Pages
ricardogouveia3
1
120
Diagrama de Portas (Doors Diagram)
ricardogouveia3
1
56
Other Decks in Programming
See All in Programming
Simple Storage Service(S3) is not simple
iwatsukayura
0
270
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
200
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
150
contenteditable と日本語入力に向き合う
colorful12
0
190
JRuby: Past, Present, and Future
headius
0
230
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
470
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
APNsからLive Activityを開始する話
yumnumm
0
170
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
6k
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.3k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
ラッコキーワード サービス紹介資料
rakko
1
5.3M
Exploring anti-patterns in Rails
aemeredith
4
530
GitHub's CSS Performance
jonrohan
1033
470k
Agile that works and the tools we love
rasmusluckow
331
22k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
My Coaching Mixtape
mlcsv
0
350
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Navigating Weather and Climate Data
rabernat
0
550
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
A designer walks into a library…
pauljervisheath
211
25k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Transcript
Unidades Mágicas do CSS3 rem, vh, vw, vmin, vmax, ex,
ch
Ricardo Gouveia Q @ricardogouveia3 a
rem “root em” Tamanho relativo ao elemento-raiz (em geral <html>)
“em” <html style=“font-size: 10px;”> <body style=“font-size: 15px;”> <h1 style=“font-size: 2em;”>TEXT</h1>
</body> </html> TEXT font-size: 2 * 15px = 30px
“rem” <html style=“font-size: 10px;”> <body style=“font-size: 15px;”> <h1 style=“font-size: 2rem;”>TEXT</h1>
</body> </html> TEXT font-size: 2 * 10px = 20px
vh “viewport height” Tamanho relativo a altura da janela (exceto
quando modificado via meta viewport)
“vh” <div style=“height: 100vh;”></div> 1080px 1920px div
vw “viewport width” Tamanho relativo a largura da janela (exceto
quando modificado via meta viewport)
“vw” <div style=“width: 100vw;”></div> 1080px 1920px div
vmin “viewport min value” Relativo ao menor valor entre altura
e largura
<div style=“height: 100vmin;”></div> 600px 1920px “vmin” div 600px 1300px div
height 600px
se (height < width) { 100vmin = height; } senão
{ 100vmin = width; } “vmin”
vmax “viewport max value” Relativo ao maior valor entre altura
e largura
“vmax” <div style=“height: 100vmax;”></div> 600px 1920px div 600px 1920px div
height 1920px
“vmax” se (height > width) { 100vmax = height; }
senão { 100vmax = width; }
“uso de vmin e vmax” Quando um elemento precisa ser
sempre visível ou cobrir toda a tela 600px 1920px div 600px 1300px div height: 100vmin; width: 100vmin; height: 100vmax; width: 100vmax;
ex “font height-x” para programadores: Altura do caractere “x” ou
1/2em da fonte atual para designers: altura da fonte, excluindo ascendentes e descendentes altura x = distância entre linha de base e linha x
Altura-x “ex” } 1ex
ch “character unit” Tamanho relativo a largura do caractere “0”
na fonte atual (levando em conta font-family + font-size)
“ch” <div style=“width: 10ch; font-family: monospace;”></div> 0123456789 div 10 char
None