Home › Forums › CSS › CSS Centering Images help › Re: CSS Centering Images help
May 20, 2012 at 7:43 pm
#103154
joshuanhibbert
Member
Replace:
.img {
margin-left: auto;
margin-right: auto;
width: 8em;
}
with:
.img {
text-align: center;
}
Then, if you want to adjust their vertical alignment, you can do so with the vertical-align
property:
.img img {
vertical-align: middle; /* bottom, top, or any of the other options */
}