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

  • Home
  • SEARCH
  • 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 7739137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:26:46+00:00 2026-06-01T08:26:46+00:00

I have some elements I want to display. But sadly it does not work

  • 0

I have some elements I want to display. But sadly it does not work the way I want it.

Here is how it works:
http://jsfiddle.net/lukasoppermann/H3Nmg/7/

I want it so that the red boxes fill the space between the green box and the left side.
It needs to be dynamic though. The width of the container might change and the order of the elements can be different.

I would of course prefer a css-only way, but js is fine too. Does anyone have any tips?

// EDIT
To clarify, the elements cannot be hard-coded or floated to the right, because the number of elements, the width of the wrapper and also the number of green elements can vary. The order of the elements can vary too. I basically need the elements to arrange themselves without any wholes automatically.

Thats what I want.

http://img526.imageshack.us/img526/613/boxsorting.jpg

  • 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-01T08:26:48+00:00Added an answer on June 1, 2026 at 8:26 am

    Hi you can define three div as like this

    css

    .container{
        float:left;
        margin-left:10px;
    }
    .top{
        width:100px;
        height:100px;
        background:red;
    }
    
    
    .middle{
        width:100px;
        height:100px;
        background:darkred;
        margin-top:5px;
    }
    .right{
        width:100px;
        height:200px;
        background:lightgreen;
        float:left;
        margin-left:10px;
    }
    
    .bottom{
        float:left;
        width:100px;
        height:100px;
        background:green;
        margin-left:10px;
    }
    

    HTML

    <div class="container">
        <div class="top"></div>
        <div class="middle"></div>
    </div>
    
    <div class="right"></div>
    
    <div class="bottom"></div>
    ​
    

    Live demo here http://jsfiddle.net/rohitazad/wyvrt/1/
    ​

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

Sidebar

Related Questions

I have some images I want to display on my page but based on
I have some elements and I'm using some jQuery plugins. I want to see
Say we have a standard WPF-application, and I want to show some UI-elements on
I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in
I have 10 UILabels , maybe some UIImageViews . I want to display all
i have some element in my container and want to save all properties of
I have some elements on a page which are draggable. These same elements have
I have some elements with (.) periods in them and I need to select
I have some elements with events bound. Before I remove those elements, do I
On extracting some html from a web page, I have some elements containing text

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.