【问题标题】:Div positioning problems in IEIE中的div定位问题
【发布时间】:2013-04-30 03:31:00
【问题描述】:

HTML:

<div id="broadcast">
    <div id="broadcast_header">
        Neighbourhood Broadcast
    </div>
</div>

CSS:

#broadcast_header
{
 background-color: #A0522D;
 width: 100%;
 height: 20px;
 position: relative;
 top: -20px;
 font-weight: bold;
}

Firefox:一切正常,标题出现在 div 上方 20px 处,很酷。 IE:拒绝显示 div(broadcast_header)!

溢出:可见 文档类型定义:给定

我的输入:假设将顶部更改为 - 顶部:-5px;它部分显示了 div(header)。谢谢:]。

【问题讨论】:

  • 使用代码标签显示代码!
  • 听起来像是隐藏在另一个div下面。尝试使其位置绝对,并使其父 div 位置相对。
  • 我想实际修复父元素。让它绝对没有帮助,它被隐藏了

标签: html css


【解决方案1】:

试试top:-10px,它会在IE和Firefox中显示

【讨论】:

    【解决方案2】:

    您必须为 #broadcast

    设置 heightwidth css
    #broadcast
    { 
        height:200px;
        width:200px;
        position:relative
    }
    
    #broadcast_header
    {
       background-color: #A0522D;
       width: 100%;
       height: 20px;
       margin-top: -20px;
       font-weight: bold;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多