为什么min-height不工作? [英] Why is min-height not working?

查看:114
本文介绍了为什么min-height不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这里是勺子。

我有一个渐变应用于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>

这篇关于为什么min-height不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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