jsfiddle : http://jsfiddle.net/MhcTz/
写真はGoogle画像検索でランダムに選択されたもので、デモ用にサイズの違いがあります)
必要な結果に非常に近いように更新されました。ul全体を中央に配置するだけです。
純粋な CSS ソリューションを探しています。つまり、視覚効果のためだけに div を別の div に埋め込むのではなく、HTML をきれいに保つことができます。
予想される結果:
[img1] [img2] [img3]
--------------------------------
[notes1] [notes2]
私が得た現在:
--------------------------------
[img1] [img2] [img3]
[notes1] [notes2]
HTML:
<ul class="subject-contents">
<li> <img src="images/img1.png"> </li>
<li>
<img src="images/img2.png">
<p>notes...</p>
</li>
<li>
<img src="images/img3.png">
<p>notes...</p>
</li>
</ul>
CSS:
ul.subject-contents {
/* it is horizontal but valign top */
list-style-type: none;
width:75%;
overflow:auto;
margin:0 auto;
padding-bottom: 64pt;
background: url(../images/bottom_boarder.png) center bottom no-repeat;
text-align:center;
}
ul.subject-contents li {
float:left;
}
ul.subject-contents li img+p{
/* ?? */
}
ul.subject-contents li:last-child(){
float:clear;
}