Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:41:17+00:00 2026-06-12T18:41:17+00:00

On my site I have multiple images with the same height but with three

  • 0

On my site I have multiple images with the same height but with three different widths. And I want to display these in a nice grid. When an image is uploaded I check if the image should be wide or tall.

I then have three different sizes for images
s, m & l

s for tall images and m & l for wide images.

These images are displayed in a table where a small (s) image takes up 1 spot, medium (m) takes up 2 spots and large (l) takes up 3 spots. And there are 3 spots per row.

If I have maybe 8 images (4 tall and 4 wide) I want it to look like this (w = white-space):

sss
ms
l
l
l

instead of

sss
sww
l
l
l
l

This means that the first 3 images are just small images. And since I need a medium image for the second row then I strech one of the wide images to take up 2 spots. Then there is a tall image beside that one and the last three rows are just three wide images, one on each row.

I hope I explained this well enough.

EDIT:

Or let’s say I’ve got 4 images 2 tall and 2 wide (w = white-space):

Instead of displaying it like this

ssw
l
l

I want it to look like this:

sm (or ms)
sm (or ms)

How do I make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:41:18+00:00Added an answer on June 12, 2026 at 6:41 pm

    There are several libraries for this, the easiest is jQuery Masonry.

    You could achieve what you want with minimal code because it’s only variable widths rather than variable widths and heights, but might as well use a library that already handles this rather than spend the time yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been multiple discussions on this topic in the site but I am
I have a site where I would like to let users select multiple images
Let’s say I have a YouTube-style site, but with images rather than videos. Each
I have to build a site that has multiple color options but it also
I have added multiple image upload to my site using HTML api's. I have
I need to create a WP site which will have multiple subjects. Each subject
I have multiple Projects(site) in my Solution (visual studio 2010). when i run my
I have multiple divs on the site! for example <div id='id_111232'>Some text</div> <div id='id_111233'>Some
I have a site with multiple pages, and each page has a table that
I have a site in multiple languages. I have a method that returns me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.