div要素をどのように配置するのですか?彼らはお互いの隣に浮かぶだけですが、中心にはなりません。浮動小数点divコンテナ中心
div要素にはすべて固定幅の画像が含まれ、画像の下には可変テキストがあります。
<div id="wrapper">
<div style="max-width:900px;margin: 0 auto;">
<div style="width:100%;">
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
</div>
</div>
</div>
#wrapper{
margin: 0 auto;
width: 900px;
max-width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
ありがとうございます。
敬具
も魅力的に機能します、ありがとうございます! –
@MarcoVeLi素晴らしい、問題ありません:) –