1

我正在尝试设置 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;
}
4

1 回答 1

1

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

因为 id 超过了许多类。

或者只是背景颜色:蓝色!重要;应该管用..

于 2013-07-04T17:57:33.030 回答