div背景颜色不影响

时间:2013-07-04 17:30:56

标签: html css

我正在尝试设置div背景颜色(class =“markerDiv”),但我正在努力寻找,我缺少什么。我相信它会是如此之小,但需要帮助。非常感谢提前

HTML

<div id="map_Marker_Check_Block">
    <div class="markerDiv" id="maker_school">
        <label class="marker_label">School</label> <input class=
        "marker_ckeckbox" name="markerType" type="checkbox" value="school">
    </div><br>

    <div class="markerDiv" id="maker_gym">
        <label class="marker_label">Gym</label> <input class="marker_ckeckbox"
        name="markerType" type="checkbox" value="gym">
    </div><br>
</div>

CSS

.markerDiv {
    width: 14em;
    height: 48px;
    margin-left: 5px;
    clear: both;
    background-color: blue;
}

#map_Marker_Check_Block {
    display: block;
    position: absolute;
    width: 15em;
    height: 400px;
    top: 0;
    right: -12em;
    z-index: 10;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #FFF;
}

#maker_school {
    background: url(../Icons/google_marker/Map_school.png) no-repeat;
}

1 个答案:

答案 0 :(得分:1)

你应该尝试使用     #map_Marker_Check_Block .markerDiv {background-color:blue; }

因为id否决了许多类。

或只是背景颜色:蓝色!重要;应该工作..