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 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

It's very straightforward, but I can't find the answer online. I want to do
It's a pretty straightforward question but I can't find very good documentation on the
My question is very straight-forward but I could not find it on Amazon developer
Apologies or asking what is probably a very straightforward question, but I'm new to
The question is very straightforward: Is it possible to parse PHP using PEG? I
the question is very straightforward: Good DAL library for PHP which has the similar
What I'm trying to do is simple and should be very straightforward in my
this is a very straightforward and easy question. So please give me an easy
Well, the question seems very straightforward, but it isn't. I want to set a
I have a very straightforward HTML page that displays content in two columns. To

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.