为什么最小高度在我的页面上不起作用? [英] Why doesn't min-height not work on my page?

查看:98
本文介绍了为什么最小高度在我的页面上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在body元素的背景上应用了渐变.然后我有一个容器(紧接在身体之后),上面有一个背景.png图像应用到了它.渐变始终会扩展到至少100%的窗口高度,但容器(#body2)不会.

I have a gradient applied to the background of the body element. Then I have a container (right after body) that has a background .png image applied to it. The gradient always expands to at least 100% window height but the container (#body2) does not.

有什么建议为什么不起作用?您可以在这里检查我网页上的HTML: http://www.savedeth.com/parlours/

Any suggestions to why this doesn't work? You can inspect the HTML on my web page here: http://www.savedeth.com/parlours/

推荐答案

将其拧紧.谁仍然没有JavaScript?尤其是针对这一人群.

Screw it. Who doesn't have javascript anyways? Especially for this demographic.

<script type="text/javascript">
$(document).ready(function(){
if($("body").height() < $(window).height()){
    $("body").height($(window).height());
}
});
</script>

这篇关于为什么最小高度在我的页面上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆