2

I have a page that has five DIVs stacked up vertically. Would good coding rules dictate that I assign the FLOAT tag to each of these DIVs, or is it really not necessary. I mean, it doesn't SEEM to present a problem (such as re-wraps) in any browser if I don't include a FLOAT, but I don't know what's proper in this instance.

4

1 に答える 1

1

この場合、フロートは必要ありません。ディスプレイをブロックに設定してdivを使用するだけです。

.d
{
    width: 100%;
    display: block;
}

<div class="d">
   ...
</div>
于 2013-11-04T23:55:59.593 に答える