🔸rem
╱🚧 under construction -> :root, <html>, document.documentElement
CSS ⟩ values ⟩ relative ⟩ units ⟩ rem
⭐ rem
是 “root em” 的縮寫,r
指 :root
(<html>
)。
/* :root = html */
:root { font-size: 16px; } /* ⭐️ 定義 rem = 16px */
h1 { font-size: 2rem; } /* 2rem = 32px */
p { font-size: 1rem; } /* 1rem = 16px */
Last updated
Was this helpful?