height
Last updated
Was this helpful?
Last updated
Was this helpful?
Avoid explicitly setting the height of an element to avoid overflow issues.
Specifying a is problematic.
% refers to the parent's size.
parent's height is typically determined by the height of its children. This produces a circular definition that the browser can’t resolve, so it’ll ignore the declaration.
For percentage-based heights to work, the parent must have an explicitly defined height. 🗣
如果都是用 %,則一路從 html ⟩ body ⟩ .... ⟩ 到自己的直屬母物件都要明確設定 %,否則只要中間有一層斷掉也是沒用。