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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:59:34+00:00 2026-05-23T16:59:34+00:00

Three elements are inside a fluid container in the following configuration: +—————–+ | +—–+

  • 0

Three elements are inside a fluid container in the following configuration:

+-----------------+
| +-----+ +-----+ |
| |  A  | |  B  | |
| +-----+ +-----+ |
| +-------------+ |
| |      C      | |
| +-------------+ |
+-----------------+

The width of elements A and B is 50%. The width of element C is 100%. You can see a live example here.

The right edges of the rows do not align when the width of the container is an odd number of pixels, due to rounding when computing the width of elements A and B. You can watch the edges misalign and realign while resizing the frame. The effect is exacerbated when the top row contains many more than two elements, say ten.

Instead, I would like the width of element C to be equal to the combined actual width of elements A and B, rather than the combined percentage width. Is this possible without using JavaScript or resorting to a table?

  • 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-23T16:59:35+00:00Added an answer on May 23, 2026 at 4:59 pm

    One solution would be to make the first element float left, giving it the desired width. The right one would not float, and have a default width, allowing it to stretch, filling the space left by the left. See a modification of your example for how it might work: http://jsfiddle.net/QDVeD/12/. The basics can be summed up with:

    #left {
      float: left;
      width: 50%;
      height: 50px;
    }
    #right {
      height: 50px;
    }
    

    This wouldn’t scale as well as you might like for more items than two, though. The last element will usually be slightly longer than the others: http://jsfiddle.net/QDVeD/18/.

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

Sidebar

Related Questions

Can I add an object of Elements inside another DOM element using grab or
I have problem with XML schema. I need inside one element elements of three
I need to place three elements inside RelativeLayout : scaled image in ImageView on
So I have a large amount of floated elements inside of a container with
How can i make JS select every LI element inside a UL tag and
Is there a way to only print or output 10 elements per row inside
I have got an UITableView. How to simply fill it with three elements, for
my site has three div elements, header, content and footer. i have a picture
I have an xml document with three child elements repeating in any order. I
So I've created a dbml in my project, which has three tables: Elements, ElementImages

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.