🪴qql1's digital garden

Home

❯

笔记

❯

计算机知识

❯

app应用

❯

webAPP

❯

前端

❯

CSS

❯

概念

❯

overflow与height auto

overflow与height auto

2026年1月26日1分钟阅读

要点

  • height:auto 时,容器高度由内容决定,一般不触发滚动;overflow 的滚动前提是“有溢出”。
  • height:100% 若父为 auto → 等价 auto,仍不产生限制,自然也无溢出,不触发滚动。
  • 只有当容器有“可计算的高度上限”(固定 height/max-height/百分比可计算)时,overflow 的滚动/裁剪才会生效。

关联

  • 百分比高度的生效条件、width auto 与 width 100% 的区别、height 100% 与父元素 auto 的效果

关系图谱

反向链接

  • 视差滚动
  • height 100% 与父元素 auto 的效果

Created with Quartz v4.5.2 © 2026

  • GitHub
  • Discord Community