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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:52:52+00:00 2026-06-15T20:52:52+00:00

On my html page I have this situation: <div1><div2><div3><div4><div5><div6><div7><div8><div9 >… Just left floating divs

  • 0

On my html page I have this situation:

<div1><div2><div3><div4><div5><div6><div7><div8><div9>…

Just left floating divs shown one after another. All of them have CSS style float:left

I would like to achieve this result:

<div1><div2>
<div3><div4><div5><div6><div7>
<div8><div9>...

Basically, I would like to break flow on div3 and div8 (or on any div I wish) by telling it to start in new line. All other elements should follow after div that goes into new line. I tried using clear:left or clear:left on div3 or div8 , but it didn’t work. Div would go to new line, but all others would remain where they were, producing undesired result:

<div1><div2><div4><div5><div6><div7><div9>
<div3>
<div8>...

Is there any nice and simple solution here? Thanks.

  • 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-15T20:52:53+00:00Added an answer on June 15, 2026 at 8:52 pm

    For the love of god… don’t introduce any additional divs into your markup. clear:left works, if your design is correct. (you do know HTML has a whole selection of block-level elements to choose from) Using them might make your targeting a little easier…

    CSS

    div {
        float:left;
        margin-right:2ex;
        width:3em;
    }
    
    #div3, #div8 {
        clear:left;
    }
    

    HTML

    <div>1</div><div>2</div>
    <div id="div3">3</div><div>4</div><div>5</div><div>6</div><div>7</div>
    <div id="div8">8</div><div>9</div>
    

    fiddle: http://jsfiddle.net/d68pr/

    EDIT
    Here’s one that doesn’t require any IDs, classes, OR extra div-itus

    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
    <div>8</div>
    <div>9</div>
    
    div:nth-child(3), div:nth-child(8) {
        clear:left;
    }
    

    http://jsfiddle.net/TMxSE/

    ** warning ** nth-child may not be available in some browsers. Check your traffic statistics to be sure IE8, and below are a very small percentage of your user-base. Or that those users’ experiences are acceptable.

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

Sidebar

Related Questions

All, I have a situation that looks roughly like this: My HTML page a
I have a situation. I read in a html page using php using this
My situation is this: I have an html page which contains a table of
I have this html page which is very simple, it contains a text box
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
I have this HTML in my page <div id='masterDIV'> <div id='divItemNumber'>23</div> <div id='divDesc'>This is
I have a page with another html page in iframe. In this iframe, i
I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is
I have an html page with a link like this: <a href=javascript:window.print()>Print QR code</a>
I have an HTML page that roughly looks like this: <div id=rolesRollerBody style=height: 309px;>

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.