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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:03:18+00:00 2026-05-24T08:03:18+00:00

I’m trying out something here with floating the boxes in a container. The problem

  • 0

I’m trying out something here with floating the boxes in a container. The problem I’m having is that if the content gets too big in one of the containers the sub-container below it does not position itself right below it,instead it floats left from the edge of the top container. Hope I’m making some sense. I’m posting the code below, this might give a u better idea. And I’m also attaching the image for what I’m trying to achieve. If the question is not clear please let me know.

Thank You

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>containers</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
#container{width:700px;margin-left:auto;margin-right:auto;overflow:hidden;background:red;}
.subContainer{width:340px;background:blue;float:left;}
.subContainer:nth-child(even){background:green;float:right;}
</style>
</head>

<body>

    <div id="container">
        <div class="subContainer">
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non lorem sem, et scelerisque augue. 
                Integer ut tortor libero, vel aliquam sapien. Pellentesque habitant morbi tristique senectus et netus 
                et malesuada fames ac turpis egestas. Phasellus id aliquet sapien. Cras sit amet diam sed massa bibendum fringilla. 
                Donec aliquet posuere urna. Vestibulum condimentum velit orci, ut iaculis tellus. Fusce sit amet ante felis. Nunc 
                quam felis, venenatis sed tincidunt quis, auctor a orci. Aliquam mauris leo, lacinia eu placerat vitae, placerat 
                sit amet sapien. Etiam eget dolor at neque dapibus pretium auctor non dui. Aliquam erat volutpat. Vestibulum rhoncus 
                urna id enim volutpat vehicula. Proin ut massa diam, quis condimentum sem. Nullam ac scelerisque neque. Donec tristique 
                tristique elit, nec vulputate turpis suscipit quis. Nam nisl purus, blandit non hendrerit eu, vestibulum vel justo. 
                Curabitur et massa sapien.Praesent laoreet, risus eu facilisis sodales, urna lectus condimentum felis, laoreet ullamcorper 
                sapien urna in lorem. Nulla ut sem sapien, ut aliquet augue. Curabitur nec lorem risus, in interdum augue. Sed aliquam sapien
                in sapien viverra iaculis mattis eros pulvinar. In hac habitasse platea dictumst. Suspendisse viverra purus vitae nibh lacinia
                at blandit arcu auctor. Mauris sapien lacus, euismod eget malesuada condimentum, bibendum a quam. Phasellus faucibus, orci in
                ultricies mollis, orci tortor sagittis eros, non iaculis lorem orci nec quam. Donec luctus bibendum risus et gravida. Sed at
                tortor vel metus elementum euismod. 
            </p>
        </div>
        <div class="subContainer">
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non lorem sem, et scelerisque augue. 
                Integer ut tortor libero, vel aliquam sapien. Pellentesque habitant morbi tristique senectus et netus
                et malesuada fames ac turpis egestas. Phasellus id aliquet sapien. Cras sit amet diam sed massa bibendum 
                fringilla. Donec aliquet posuere urna. Vestibulum condimentum velit orci, ut iaculis tellus. Fusce sit amet 
                ante felis. Nunc quam felis, venenatis sed tincidunt quis, auctor a orci. Aliquam mauris leo, lacinia eu 
                placerat vitae, placerat sit amet sapien. Etiam eget dolor at neque dapibus pretium auctor non dui. Aliquam 
                erat volutpat. Vestibulum rhoncus urna id enim volutpat vehicula. Proin ut massa diam, quis condimentum sem. 
                Nullam ac scelerisque neque. Donec tristique tristique elit, nec vulputate turpis suscipit quis. Nam nisl purus, 
                blandit non hendrerit eu, vestibulum vel justo. Curabitur et massa sapien. 
            </p>
        </div>
        <div class="subContainer">
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non lorem sem, et scelerisque augue. 
                Integer ut tortor libero, vel aliquam sapien. Pellentesque habitant morbi tristique senectus et netus 
                et malesuada fames ac turpis egestas. Phasellus id aliquet sapien. Cras sit amet diam sed massa bibendum fringilla. 
                Donec aliquet posuere urna. Vestibulum condimentum velit orci, ut iaculis tellus. Fusce sit amet ante felis. Nunc 
                quam felis, venenatis sed tincidunt quis, auctor a orci. Aliquam mauris leo, lacinia eu placerat vitae, placerat 
                sit amet sapien. Etiam eget dolor at neque dapibus pretium auctor non dui. Aliquam erat volutpat. Vestibulum rhoncus 
                urna id enim volutpat vehicula. Proin ut massa diam, quis condimentum sem. Nullam ac scelerisque neque. Donec tristique 
                tristique elit, nec vulputate turpis suscipit quis. Nam nisl purus, blandit non hendrerit eu, vestibulum vel justo. 
                Curabitur et massa sapien.Praesent laoreet, risus eu facilisis sodales, urna lectus condimentum felis, laoreet ullamcorper 
                sapien urna in lorem. Nulla ut sem sapien, ut aliquet augue. Curabitur nec lorem risus, in interdum augue. Sed aliquam sapien
                in sapien viverra iaculis mattis eros pulvinar. In hac habitasse platea dictumst. Suspendisse viverra purus vitae nibh lacinia
                at blandit arcu auctor. Mauris sapien lacus, euismod eget malesuada condimentum, bibendum a quam. Phasellus faucibus, orci in
                ultricies mollis, orci tortor sagittis eros, non iaculis lorem orci nec quam. Donec luctus bibendum risus et gravida. Sed at
                tortor vel metus elementum euismod. 
            </p>
        </div>
    </div>

</body>
</html>

Now

desiredResult

  • 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-24T08:03:19+00:00Added an answer on May 24, 2026 at 8:03 am

    Something like this?

    http://jsfiddle.net/ZS4RT/7/

    Things may be different if you want to have more floating elements, though.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to loop through a bunch of documents I have to put
We're building an app, our first using Rails 3, and we're having to build
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.