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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:56:42+00:00 2026-05-13T16:56:42+00:00

Very straightforward CSS question that I haven’t been able to find the answer to

  • 0

Very straightforward CSS question that I haven’t been able to find the answer to so far:

I’m trying to lay out a page with two div’s side-by-side in one row (using float:left; and float:right;) and then one div below them. The problem is that if the top row (defined as a div itself) is so wide that the space between the two divs can accomodate the bottom div, the bottom div moves up into the top row creating the appearance of a single row of three divs. I don’t know if that’s clear or not, but here’s the code:

<div id="top div" style="width:400px;">
<div style="float:left;"><img src="images/xlab.jpg" width="100px" height="200px" /></div>
<div style="float:right;"><img src="images/ucbseal.jpg" width="100px" height="250px" /></div>
</div>

<div id="bottom div"><img src="images/xlab.jpg" width="200px" height="200px" /></div>

So, as above, since the top div has a 200px gap in between its left and right child elements, the image in the bottom div slides up between them. If I make the top div’s width 399px that doesn’t happen. I tried using the CSS “clear” property but that didn’t solve the problem. I’ve always just worked my way around this seemingly-odd behavior in a sloppy way but want to find a better practice.

Any help or direction is greatly appreciated!

  • 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-13T16:56:43+00:00Added an answer on May 13, 2026 at 4:56 pm

    Use overflow:auto on the first div

    <div id="top div" style="width:400px;overflow:auto;">
    <div style="float:left;"><img src="images/xlab.jpg" width="100px" height="200px" /></div>
    <div style="float:right;"><img src="images/ucbseal.jpg" width="100px" height="250px" /></div>
    </div>
    
    <div id="bottom div"><img src="images/xlab.jpg" width="200px" height="200px" /></div>
    

    it will cause the container div to expand to the contents of its children and so the following div will maintain its location..

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

Sidebar

Related Questions

I have no idea why this is happening. I have some very straightforward code,
Very simply put: I have a class that consists mostly of static public members,
Very simple question, is there any cloud server enviroments avaliable these days for us
Very basic question: how do I write a short literal in C++? I know
Very direct question, i need to know if its possible and maybe where to
Yeah, I know, this question's been asked/answered 34798796873.5 times. I looked through all 3
I am playing around with Audacity and have been trying to generate tones with
I'm relatively new to the Python world, but this seems very straight forward. Google
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
Very often when working on an ASP.NET web site, the options View Code and

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.