如何实现:上面的div根据内容自动高度,下面的div自动铺满剩余高度_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:21:58
Original
1822 people have browsed it

有没有纯粹div+css的方式实现上下两个div满足:上面的div根据内容自动高度,下面的div自动铺满剩余高度


回复讨论(解决方案)

我也想知道,等高手作答!

CSS3中的弹性盒模型可以纯粹使用div+css实现你要的效果。如:

  Temp Web Page  
  
When you come to the end of a perfect day. It can only mean a tired heart, and the dear friends have to part.
Copy after login


目前支持的浏览器有IE10和较新版本的FireFox、Chrome等。



没明白。这个剩余的高度是相对哪个来说的呢?上下的两个div是兄弟元素节点关系吗?

没明白。这个剩余的高度是相对哪个来说的呢?上下的两个div是兄弟元素节点关系吗?

剩余高度是相对父容器而言;
是兄弟节点关系;

直接将width和hight设置成100%,不就可以了吗?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!