我在元素中有4个图像,元素中有标题.
每个图像都显示在彼此之下,如:
图片
标题
图片
标题
图片
标题
图片
标题
我希望图像看起来像:
图像图像图像
标题 标题 标题 标题
我的HTML:
<div id="earlylife_images">
<figure>
<img src="images/early/moore01.jpg" alt="Roger Moore Teenage" width="150" height="150">
<figcaption>A young Roger Moore</figcaption>
</figure>
<figure>
<img src="images/early/moore02.jpg" alt="Roger Moore 30's" width="150" height="150">
<figcaption>Roger Moore in his 30's</figcaption>
</figure>
<figure>
<img src="images/early/moore03.jpg" alt="Roger Moore as James Bond" width="150" height="150">
<figcaption>Roger Moore as James Bond</figcaption>
</figure>
<figure>
<img src="images/early/moore04.jpg" alt="Roger Moore Recent" width="150" height="150">
<figcaption>Roger Moore in more recent years</figcaption>
</figure>
</div>
Run Code Online (Sandbox Code Playgroud)
Ale*_*hel 11
制作figure inline-block.
figure {
display: inline-block;
}
Run Code Online (Sandbox Code Playgroud)
我在考虑:
figure {
width: 25%;
float: left;
margin: 0;
text-align: center;
padding: 0;
}
Run Code Online (Sandbox Code Playgroud)
你可以在这里查看:http://jsfiddle.net/cBkTc/3/