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
Ricardo Gouveia
February 27, 2016
Programming
67
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
130
Diagrama de Portas (Doors Diagram)
ricardogouveia3
1
60
Other Decks in Programming
See All in Programming
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
300
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
420
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
410
Getting Started with Vibe Coding
miccheng
0
190
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
190
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
120
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
3.6k
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
540
LLM 101
dalinaum
0
470
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
240
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.6k
Site-Speed That Sticks
csswizardry
13
1.6k
Product Roadmaps are Hard
iamctodd
55
13k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1.1k
Navigating Weather and Climate Data
rabernat
0
590
The untapped power of vector embeddings
frankvandijk
2
2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
480
The agentic SEO stack - context over prompts
schlessera
0
1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Side Projects
sachag
456
43k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
820
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