<div class="sliderItem">
<img src="./image/Accessories.png" width="130" height="80" alt="" class="sliderImg">
<span class="caption">Accessories</span>
</div>
I tried in CSS to align them but not getting the expected result.
It is showing images with text below but not on same line.
.sliderItem {
vertical-align: horizontal;
display:inline-block;
text-align: center;
}
.caption{
display: block
}
2
Answers
vertical-align: horizontal
is an invalid property value. I couldn’t get what are you expecting it to result.Anyway consider the following code:
HTML:
CSS:
There are different solutions. This is one: