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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:37:42+00:00 2026-06-06T07:37:42+00:00

I have some auto-generated HTML code. When I add a float:left; on the shared

  • 0

I have some auto-generated HTML code.

When I add a float:left; on the shared class, it looks like this:

+----------------+   +--------------+
|   div 1        |   |   div 2      |
|                |   |              |
|                |   +--------------+
|                |                  
|                |   +--------------+
|                |   |   div 3      |
+----------------+   +--------------+

And what I want is this:

+----------------+   +--------------+
|   div 1        |   |   div 2      |
|                |   |              |
|                |   +--------------+
|                |                  
|                |   
|                |   
+----------------+   

+--------------+
|   div 3      |
+--------------+

How can I get this result?

My CSS code looks like this:

position: relative;
width: 40%;
float: left;
border: 1px solid black;
clear: left;
  • 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-06T07:37:44+00:00Added an answer on June 6, 2026 at 7:37 am

    Assuming your divs have a common class name, such as .boxes, add this CSS:

    .boxes:nth-child(odd) {clear: left;}
    

    This will make it so that every odd-numbered box will clear the float and start a new line.

    Alternatively, set the width of the container such that only two boxes will fit side-by-side, and then use display: inline-block instead of float: left;.

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

Sidebar

Related Questions

I have some ASP.NET (MVC2) auto generated html which is creating forms looking like
I have some auto-instantiation code which I would like to apply to about 15
I have some auto-generated text that includes non-ascii encoded parentheses. For example: <div> Some
I have some XML which contains records and sub records, like this: <data> <record
I'm trying to debug some auto-generated code, but I am a mySQL noob. Everything
I have some classes and I'm trying to fill the objects of this class.
I have this simple html piece of code, whenever I click on any of
We have some auto-generated resource files in our project in Visual Studio 2008, with
I have a C# class that gets generated using the wsdl.exe tool that looks
I have a web page with some auto-generated javascript content which manipulates the DOM

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.