Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个流畅的布局。我以百分比给出了 div 的宽度值。但以 px 为单位指定高度。因此,当我折叠浏览器时,内容会折叠,但浮动的 div 会溢出容器。所以我试图以 % 更改所有 div 的高度,但它不起作用。请建议我如何做到这一点。谢谢你。
带百分比的高度仅在父级具有固定高度时才有效。看到这个:CSS - 为什么百分比高度不起作用?