Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Centering Images help Re: CSS Centering Images help

#103154

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 */
}