简体   繁体   English

IE8中的Div高度不变

[英]Div height doesn't change in IE8

I have the following code: 我有以下代码:

<div id="conteudo">
    <img id="logo" height="137" width="327" />
    <div id="data_hora">
    </div>
    <div id="nome_patio">
        <div id="cor_patio"></div> #NOME_PATIO#
    </div>
</div>

css: CSS:

    body
{
    background-color: #000000;
    margin: 0;
    padding: 0;
    font-family:Arial;
}

#conteudo
{
    height: 100%;
    width: 100%;
}

#data_hora
{
    float: right;
    font-size: 50px;
    color: #E0E428;
    margin-top: -90px;
    margin-right: 40px;
}

#nome_patio
{
    text-align: center;
    font-size: 80px;
    color: #E0E428;
    width: 100%;
    font-weight: bold;
}

#cor_patio
{
    border: solid 1px #FFFFFF;
    height: 10px !important;
    width: 80px;
    background-color: #E0E428;
    margin-right: 20px;
}

So, i'm trying to change the div cor_patio height, but nothing happens... why? 因此,我正在尝试更改div cor_patio高度,但是什么也没发生...为什么?

OBS: when i remove font-size from nome_patio , it works fine. OBS:当我从nome_patio删除font-size时,它工作正常。

try to set position:absolute; 尝试设置位置:绝对; to home_patio, if it doesn't work, also set to cor_patio. 到home_patio,如果它不起作用,也将其设置为cor_patio。

Set position:relative; 设定位置:相对; to #nome_patio and position:absolute; 到#nome_patio和position:absolute; to #cor_patio; 到#cor_patio;

Hope it help. 希望对您有所帮助。

You need to set your height on #nome_patio to 100%. 您需要将#nome_patio的高度设置为100%。

Working example: http://jsfiddle.net/aYnyk/ 工作示例: http : //jsfiddle.net/aYnyk/

I solve the solution with this: 我用这个解决方案:

<div id="patio">
    <span id="cor_patio"></span><span id="nome_patio">#NOME_PATIO#</span>
</div>

css: CSS:

#patio
{
    text-align: center;
    width: 100%;
}

#cor_patio
{
    height: 63px;
    width: 63px;
    background-color: #E0E428;
    margin-right: 30px;
}

#nome_patio
{
    font-size: 80px;
    color: #E0E428;
    font-weight: bold;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM