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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:26:40+00:00 2026-06-15T13:26:40+00:00

I need to position two boxes side-by-side within a variable width container. One box

  • 0

I need to position two boxes side-by-side within a variable width container. One box has a width defined, the other needs to fill the rest of the space. Also, the boxes need to be vertically aligned: bottom.

CSS
==============
body { background-color: papayawhip; }
.container {
    background-color: white;
    margin: 10px;
    padding: 10px;
}
.box-fixed {
    background-color: lightgray;
    display: inline-block;
    width: 200px;
}
.box-flexible {
    background-color: lightcoral;
    display: inline-block;
    vertical-align: bottom;
    width: 200px; /* <-- Don't want this! */
}

HTML
==============
<div class="container">
  <div class="box-fixed">Lorem ipsum dolor sit amet</div>
  <div class="box-flexible">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</div>
</div>

I could use floats and overflow:hidden, but then I lose my vertical align bottom. And tables would be bad.

  • 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-15T13:26:41+00:00Added an answer on June 15, 2026 at 1:26 pm

    I managed it using jquery: http://jsfiddle.net/uvvdN/1/

    It’s not perfect, I had to add the + 4 to _fixedWidth purely because of time but I hope this is the sort of thing you are after.

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

Sidebar

Related Questions

I have two divs that I need to position horizontally dependent on the width
Ive got two DIV elements one of which has absolute position (lower left corner
I have two divs. One is position:absolute (.buttonEffectWrapper), over the top of the other
In the code given below, I need to position the userid box in the
I have pickerView with two rows and I need to save position of both
how do I position two programmatically created TextViews in a LinearLayout BESIDE each other?
I've got a custom view in which I need to draw two bitmaps, one
I have a box that contains two boxes floating inside it. If the viewport
I have two DIVs that I need to position exactly on top of each
I have two divs, (100px by 100px) stacked one on-top of the other, where

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.