Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Unidades Mágicas do CSS3
Search
Ricardo Gouveia
February 27, 2016
Programming
0
54
Unidades Mágicas do CSS3
Apresentação de algumas unidades que, apesar de muito úteis, são pouco conhecidas.
Ricardo Gouveia
February 27, 2016
Tweet
Share
More Decks by Ricardo Gouveia
See All by Ricardo Gouveia
Performance Pré JS
ricardogouveia3
2
110
Hexo.js & Github Pages
ricardogouveia3
1
110
Diagrama de Portas (Doors Diagram)
ricardogouveia3
1
49
Other Decks in Programming
See All in Programming
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
800
エディターってAIで操作できるんだぜ
kis9a
0
740
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
3.2k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
450
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
210
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
150
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
tparseでgo testの出力を見やすくする
utgwkk
2
260
Graviton と Nitro と私
maroon1st
0
120
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
430
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
440
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.5k
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
Six Lessons from altMBA
skipperchong
29
4.1k
Tell your own story through comics
letsgokoyo
0
750
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
The SEO Collaboration Effect
kristinabergwall1
0
300
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
30
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Color Theory Basics | Prateek | Gurzu
gurzu
0
140
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
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