1

フロートに問題があると思います。フロートが正しく整列しておらず、ボックスのセットアップ方法に関係しているように感じます。margin-left と right で位置合わせを変更しようとしましたが、希望の外観が得られません。すべてをラインナップに入れたいと思います。ここにhtmlとcssがあります。

HTML

<div id="service1">
    <center>
    <h1>Savings <br />Strategies</h1>
    <img src="images/eg1.png" class="alignleft" height="150" width="200" alt="" />
    </center>
</div>

<div id="service2">
    <center>
    <h1>Vendor <br />Management</h1>
    <img src="images/eg2.png" class="alignleft" height="150" width="200" alt="" />
    </center>
</div>

<div id="service3">
    <center>
    <h1>Environmental<br /> Stewardship</h1>
    <img src="images/eg3.png" class="alignleft" height="150" width="200" alt="" />
    </center>
</div>

CSS

#service1 {
float:left;
width:360px;
height:280px;
padding:15px;
}

#service2 {
margin-left:auto;
margin-right:auto;
width:360px;
height:280px;
padding:15px;
}

#service3 {
float:right;
width:360px;
height:280px;
padding 15px; 
}

前もって感謝します!

4

2 に答える 2

5

各 div をインライン ブロックとして表示してみませんか。フロートとマージンもす​​べて削除します。

div { 表示: インラインブロック; }

于 2013-04-19T05:52:24.763 に答える