html - CSS 不显示背景(溢出 :auto not helping)

标签 html css background invisible

#navigation_conatiner_7 的背景和边框不可见。我尝试将 overflow:auto 添加到其父级,它只显示滚动条。后来我尝试向其中添加相同的内容,但后来它被完全隐藏了。由于我的想法已经用完了,我想也许这里有人可以找到答案。

这是代码:http://jsfiddle.net/Tamaki/my5GV/

HTML:

<div id="navigation">
    <div id="holder">
        <div id="navigation_category_2">articles</div>
        <div id="navigation_category_3">columns</div>
        <div id="navigation_category_7">submit
            <div id="navigation_container_7">
                <div class="navigation_link"><span style="margin-left: 10px;">submit</span></div>
                <div class="navigation_link"><span style="margin-left: 10px;">applications</span></div>
                <div class="navigation_link"><span style="margin-left: 10px;">points</span></div>
            </div>
        </div>
    </div>
</div>

CSS:

#navigation {
    top: 0px !important;
    width: 100%;
    height: 60px;
    background-color: #eee;
    border-bottom: solid 3px #dd6a0c;
    position: fixed;
}

#holder {
    width: 960px;
    margin: 0 auto;
    height: inherit;
}

/* Navigation
============================*/

#navigation_category_2, #navigation_category_3, #navigation_category_7 {
    height: 60px;
    float: left;
    width: 120px;
    text-align: center;
    margin: 0 7px 0 8px;
    cursor: pointer;
    line-height: 60px;
    font-family: Impact, Arial, sans-serif;
    color: #111;
    font-size: 18px;
}

#navigation_category_2:hover, #navigation_category_3:hover, #navigation_category_7:hover {
    background-color: #dd6a0c;
    color: #eee;
}

#navigation_category_7:hover {
    background-color: #eee;
    color: #111;
}

#navigation_container_7 {
    top: 0;
    position: relative;
    display: none;
    width: 160px;
    left: -24px;
    border: 3px solid #dd6a0c;
    border-top: none;
    height: 0px;
    background-color: #eee;
}

#navigation_category_7:hover #navigation_container_7 {
    display: block;
}

.navigation_link {
    top: 0;
    width: inherit;
    height: 26px;
    text-align: left;
    font-size: 11px;
    font-family: Verdana;
    color: #111;
    line-height: 26px;
    text-transform: capitalize;
    font-weight: bold;
}

.navigation_link:hover {
    background-color: #dd6a0c;
    color: #eee;
}

最佳答案

#navigation_conatiner_7 中删除 height=0px

关于html - CSS 不显示背景(溢出 :auto not helping),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18400988/

相关文章:

php - 从查询字符串中删除值第 2 部分

html - CSS border-right 无法正确渲染

javascript - 每次触发 JavaScript 时,HTML/CSS 结构都会崩溃

html - 如何避免元素的负边距和适合宽度?

javascript - 圆形背景无法放在图标周围

css - 在外部 DIV 中设置两个带有列表的 DIV

c# - 所有 Accordion 行同时打开,如何解决?

iOS:开始在后台处理推送通知?

ios - 无法处理背景音频的远程控制事件

iphone - 如何在iOS中以特定时间间隔在后台执行函数