Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #419937

    Hello!
    I think this must be an easy thing to do but I haven’t figured it out. Can you tell me how to align images horizontally? I have 7 images I want to line up on a desktop. Ideally, I’d like them to stay in one line from desktop to tablet but just have the images reduce in size. Then, when I get to mobile, they would go back to their original size and align vertically.

    I tried a hack with styles that works for all but the mobile part. The images just keep reducing in size and staying on the horizontal which makes them too small for mobile. Is there an easy way to do this?

    If interested, here’s what I did:

    HTML:
    <h2 style=”text-align: center;”>VENUES</h2>
    <div class=”inaline”>
    <div class=”inside”>Dunes Resort Nightclub</div>
    <div class=”inside”>Dunes Resort Main Bar</div>
    </div>

    CSS:
    #top.page-id-241 .inaline {
    white-space: nowrap;
    max-width: 100%;
    }
    #top.page-id-241 .inside {
    width: 14%;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    }
    #top.page-id-241 .inaline img {
    max-width:100%;
    }

    Thanks!

    #420692

    Hi Mike!

    Add this to change their size for mobiles.

    @media (max-width:500px) {
    #top.page-id-241 .inside {
    width: 100% !important;
    }
    }

    Cheers!
    Elliott

    • This reply was modified 9 years, 8 months ago by Elliott.
    #422222

    Thanks so much, Elliot!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Aligning images horizontally’ is closed to new replies.