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 4337630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:58:14+00:00 2026-05-21T10:58:14+00:00

i was wondering if there is anyway to float many divs with different heights

  • 0

i was wondering if there is anyway to float many divs with different heights next to each others without pushdown effect,

eg:!

|||||||  ||2|||  ||||||||
|||||||  ||||||||  ||||3||
||1||          ||||||||
|||||||        ?||||||||
||||||| ||4||||  
      |||||||||

the problem is the white space under div 2 which is because div3 is taller than div2 so it
pushed down div4 leaving ugly whitespace

code:

<div class=container>

<div class=box>1</div>
<div class=box>2</div>
<div class=box>3</div>
<div class=box>4</div>

</div>

im trying to make div .container float any number of divs inside dynamically and all borders touch each other w/o this pushdown effect,

is there any way to do it ?
i tryed jQuery Masonry plugin but could figure it out also :(..

ty very much for help

  • 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-05-21T10:58:14+00:00Added an answer on May 21, 2026 at 10:58 am

    This is the standard behavior for CSS for floating elements. If you don’t want the space between (2) and (4), then you may need to float (2) and then put a div for content of (2) and another div for (4), so that they are “together” (vertically).

    And I guess it depends what you want to do and achieve. You might also want to make all divs the same height with a background or border, so that they float without the visual empty space. (but there will be space if the content inside doesn’t fill up the divs.

    Also, you might want to float 1 div, and then float (1), (2), and (3) inside of it, and then float (4) separately… but really it depends what you want to do.

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

Sidebar

Related Questions

Just wondering if there is anyway to save data across the line without the
I am using python unit test module. I am wondering is there anyway to
I was wondering if there was anyway to use functions like ReadFileEx that require
I was wondering if there's anyway to filter a set using NSPredicate sorted by
I'm new to WPF and I'm wondering is there anyway to have elements from
i was wondering if there was anyway of combining two characters to form one
I was wondering if there's anyway to get a 'dynamic path' into a .js
I was wondering if there is anyway to lock and unlock the clipboard from
I was just wondering is there anyway to stop application being terminated at all
I have a tkinter script. I was wondering is there anyway to have is

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.