I want to put the horizontal pictures along line and the names below
<div class="imgages">
<img src="rock.png"/><p>Rock</p>
<img src="paper.png"/><p>Paper</p>
<img src="scissors.png" /><p>Scissors</p>
</div>
I want to put the horizontal pictures along line and the names below
<div class="imgages">
<img src="rock.png"/><p>Rock</p>
<img src="paper.png"/><p>Paper</p>
<img src="scissors.png" /><p>Scissors</p>
</div>
For horizontal align pictures use display: inline-block;
:
TRY
div.images img {
display: inline-block;
}
Use HTML5 <figure>
and <figcaption>
Tags for get the names below:
Example:
<!-- Figure with figcaption -->
<figure>
<img src="https://i.stack.imgur.com/lYeVn.png" alt="An awesome picture">
<figcaption><b>NAME:</b> Caption for the awesome picture</figcaption>
</figure>
Result:
NAME: Caption for the awesome picture
For more info:
Mozilla MDN -
<figure>
FOR BOTH:
HTML:
<div class="images">
<figure>
<img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">
<figcaption><b>NAME:</b> Caption picture</figcaption>
</figure>
<figure>
<img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">
<figcaption><b>NAME:</b> Caption picture</figcaption>
</figure>
<figure>
<img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">
<figcaption><b>NAME:</b> Caption picture</figcaption>
</figure>
</div>
CSS:
.images figure {
display: inline-block;
}