LukeTerzich LukeTerzich - 3 months ago 7
HTML Question

aligning 3 images in HTML and CSS without table

Im trying to align 2 images and some text.
I do not want to use a table to do this.

Is there a way to do it using inline styling?
I would like them to all be equally spaced as well.

IMG 1 > TEXT > IMG 2

Hope this makes sense

Answer

You can do this with flexbox:

HTML

<div>
    <img />
    <p>text</p>
    <img />
</div>

CSS

div {
    display: flex;
    justify-content: center;
}

More info: https://css-tricks.com/snippets/css/a-guide-to-flexbox/