高度100%在铬 [英] height 100% in chrome

查看:93
本文介绍了高度100%在铬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题,一个单词,不会得到的高度到100%的铬。它工作正常在FF。
Im使用

  html,body {

padding:0px;
width:100%;
height:100%;

}

#div {

min-height:100%;
}

为什么?

解决方案

这在每个浏览器上都适合我:

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Transitional // EN
http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd>
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< title> min-height test< / title>
< style type =text / css>
html,body {padding:0px; margin:0px; width:100%;高度:100%; }
#div {min-height:100%;背景颜色:灰色}
< / style>
< / head>
< body>
< div id =div> test< / div>
< / body>
< / html>您可以提供更多详情吗?



修改



以下是根据提供的信息更新的版本:

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Transitional // EN
http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd>
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< title> min-height test< / title>
< style type =text / css>
html,body {padding:0px; margin:0px;高度:100%; text-align:center; }
.contents {height:100%; width:780px; margin-left:auto;
margin-right:auto; text-align:left; }
#right {float:left; width:217px; min-height:100%;背景:#4b805b; }
< / style>
< / head>
< body>
< div class =content>
< div id =right> test< / div>
< / div>
< / body>
< / html>

仍然一切看起来都适合Chrome,Firefox和IE8


I'm having problems with a sidediv that wont get the height to 100% in chrome. It works just fine in FF. Im using

html, body {

 padding: 0px;
 width: 100%;
 height: 100%;

}

#div {

    min-height: 100%; 
}

Why is that ?

解决方案

This works perfect for me on every browser :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>min-height test</title>
    <style type="text/css"> 
    html, body { padding: 0px; margin: 0px; width: 100%; height: 100%; }
    #div { min-height: 100%; background-color: gray; }
    </style>
</head>
<body>
    <div id="div">test</div>
</body>
</html>

Can you provide more details?

Edit

Here is the updated version based on the provided information :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>min-height test</title>
    <style type="text/css"> 
    html, body { padding: 0px; margin: 0px; height: 100%; text-align: center; }
    .contents { height: 100%; width: 780px; margin-left: auto;
                 margin-right: auto; text-align: left; }
    #right { float: left; width: 217px; min-height: 100%; background:#4b805b; }
    </style>
</head>
<body>
    <div class="contents">
        <div id="right">test</div>
    </div>
</body>
</html>

Still everything looks fine for Chrome, Firefox and IE8

这篇关于高度100%在铬的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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