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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:13:11+00:00 2026-06-13T19:13:11+00:00

I have four div elements in a container: <div id=container> <div id=top></div> <div id=bottom-left></div>

  • 0

I have four div elements in a container:

<div id="container">
    <div id="top"></div>
    <div id="bottom-left"></div>
    <div id="bottom-center"></div>
    <div id="fill"></div>
</div>

I need to position them as follows:

The top edge of the top element should be at the top edge of the container.
The bottom-left element should be in the bottom-left corner of the container.
The bottom-center element should be centered at the bottom of the container.
The fill element will have a fixed width and should take the remaining space vertically.

The problem is that the fill element will contain arbitrary text and can be of arbitrary height. I need to put it under the top element and place the bottom-center under it. the bottom edge of bottom-left must align with the bottom of bottom-center.

I tried absolute positioning, but it does not work for arbitrary text length.

I would appreciate any help.

EDIT: here is jsfiddle code: http://jsfiddle.net/gCg29/
it creates the layout that I want to achieve but with a table.

how to get rid of the table and have the same functionality? notice that if the width of the browser window is insufficient then the elements do not overlap. also notice that if the text grows in length then the left-bottom and under-text elements stick to the text’s bottom.

                           +-----------------------+
                           |  top (fixed size)     |
                           +-----------------------+
                    +-----------------------------------+
                    |                                   |
                    |                   fill            |
                    |        (arbitrary height,         |
+-----------------+ |         fixed width)              |
|                 | |                                   |
|  bottom-left    | |                                   |
|  (fixed size)   | |                                   |
|                 | |                                   |
|                 | |                                   |
|                 | |                                   |
|                 | |                                   |
|                 | +-----------------------------------+
|                 |      +--------------------------+
|                 |      |bottom-center (fixed size)|
+-----------------+      +--------------------------+
  • 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-13T19:13:12+00:00Added an answer on June 13, 2026 at 7:13 pm

    Here you go:

    #container {
        position: relative;
        overflow: hidden;
    }
    
    #fill {
        margin: 0 auto 50px; /* 50px = height of bottom-center */
        width: 300px;
    }
    
    #top, #bottom-center {
        height: 50px;
        width: 200px;
        margin: 0 auto;
    }
    
    #bottom-center {
        position: absolute;
        bottom: 0;
        left: 50%;
        margin-left: -100px; /* - width / 2 */
    }
    
    #bottom-left {
        position: absolute;
        left: 0;
        bottom: 0;
    }
    

    http://jsfiddle.net/nXqQr/1/

    The important part is overflow: hidden; on the container which will make the margin on #fill extend its size, so that #bottom-center fits in.

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

Sidebar

Related Questions

I have four equally sized div's set up like this: <div id=top-left></div> <div id=top-right></div>
I want to position four div s relative to another. I have a rectangle
If i have the following markup; <div id=container> <div id=box> <div id='sameHeight'>One<br>two<br>three</div> <div id='sameHeight'>four</div>
I have a form with four text input elements. Every time one of them
I have four <select> element. <div id=select-countries-container> <select name=countryId id=select-countries> <option value=>Choose Country &raquo;</option>
I've got four div elements floated to the left. The third div is cleared.
I have four DIV elements on my page. Each has it's own array which
I have four HTML div I want to show and hide them on click
I have replaced a table containing four tables (in a grid) with a div-table
I have four tables. Three of them are tables with one key and they

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.