https://jsfiddle.net/2ppdwqu0/
As you can see in this fiddle, the names are aligned to the left. But I want them to be centered horizontally, so there is an image and beautiful text with the center.
HTML:
<div class='designers'>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum consequatur nihil enim dolor voluptatibus nostrum libero, nobis quos animi quidem commodi veniam delectus, accusamus, vitae odit autem suscipit. Pariatur, similique.</p>
<ul>
<li>
<img alt='' src='https://www.zenimax.com/jpn/fallout3/images/avators/100x100falloutav-vb.gif'>
<span>Abdullah Shahbaz</span>
</li>
<li>
<img alt='' src='https://www.zenimax.com/jpn/fallout3/images/avators/100x100falloutav-vb.gif'>
<span>Umer Javed</span>
</li>
<li>
<img alt='' src='https://www.zenimax.com/jpn/fallout3/images/avators/100x100falloutav-vb.gif'>
<span>Ali Qureshi</span>
</li>
</ul>
</div>
CSS:
.designers ul {
overflow: hidden;
list-style: none
}
.designers li {
border: 1px solid grey;
float: left;
margin: 10px;
box-shadow: 0 0 1px black;
width: 250px
}
.designers img {
vertical-align: middle;
width: 70px;
height: 70px;
}
.designers span {
margin: 0 10px;
font-size: 16px;
font-family: Open Sans;
font-weight: bold;
}
My question is different from the fact that I want horizontal alignment vertically.
source
share