0

なんらかの理由で、クラスのブルーバックを機能させることができません (背景が必死に白いままです)。ありがとう http://jsfiddle.net/wWLz4/

<div class="wrap980px blueback clear">
<div id="block-left">
<h2>dfd</h2>
</div> <!-- End DIV block-left -->

<div id="block-right">
jhjh
</div> <!-- End DIV bloack-right --> 
</div>  <!-- End DIV 980pxWrap -->

CSS

.wrap980px {
    margin: auto;
    width: 980px;
}

.blueback {
    background: #006DB8;
}

#block-left {
    float: left;
    padding: 10px;
    width: 470px;
}
#block-right {
    float: right;
    padding: 10px;
    width: 470px;
}
.clear:after {
    clear: both;
}
4

4 に答える 4

2

Or, alternatively, add:

.wrap980px {
    overflow: hidden;
    ...

There are two floated elements within the container <div>, so it effectively has a height of zero. You can add a fixed height, as has already been suggested, or use the oveflow: hidden; trick.

于 2013-09-14T13:11:09.847 に答える
1

Try This

.wrap980px {
    margin: auto;
    width: 980px;
    overflow:auto;
}

Or

.wrap980px {
        margin: auto;
        width: 980px;
        float:left;
    }
于 2013-09-14T13:12:03.997 に答える
0

使用する:

<div class="wrap980px blueback">
<div id="block-left">
<h2>dfd</h2>
</div> <!-- End DIV block-left -->

<div id="block-right clear">
jhjh
</div> <!-- End DIV bloack-right --> 
</div>

または代わりに使用します:

.wrap980px{ overflow:hidden} 
于 2013-09-14T14:44:07.090 に答える
0

wrap980px の高さを定義します。今のところ 0 です。例:

.wrap980px {
    margin: auto;
    width: 980px;
    height: 150px;

}

http://jsfiddle.net/wWLz4/1/

于 2013-09-14T13:10:07.940 に答える