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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:10:32+00:00 2026-06-03T03:10:32+00:00

Sample here: http://jsfiddle.net/YUhgb/ HTML <html> <body> <div class=left></div> <div class=right> <div class=container> <div class=item></div>

  • 0

Sample here: http://jsfiddle.net/YUhgb/

HTML

<html>
    <body>
        <div class="left"></div>
        <div class="right">
            <div class="container">
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
            </div>
            <p>
                After Container
            </p>
        </div>
    </body>
</html>

CSS

.left{
    float: left;
    width: 150px;
    height: 700px;
    background-color:red;
}
.right{
    margin-left: 160px;
    background-color:blue;
}
.container:after{
    content: "";
    height: 0;
    clear: both;
    display: block;
}
.item{
    float:left;
    width: 21%;
    margin-right: 1%;
    margin-bottom: 10px;
    height: 200px;
    background-color:green;
}

The problem is, if the left column is too long, the content below the floated content drops down below the left side. In my example, I want the text After Container to be displayed directly below the green boxes.

How can I apply the clear:left so that it only affects the right column?

  • 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-03T03:10:32+00:00Added an answer on June 3, 2026 at 3:10 am

    You can solve this problem by adding display: table and width: 100%; to your block with a class of container. See the working example here: http://jsfiddle.net/skip405/YUhgb/15/

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

Sidebar

Related Questions

here is the sample: http://jsfiddle.net/Zg55k/ How can I change css background image and color
Here is a sample fiddle: http://jsfiddle.net/K2zyU/4/ The problem I am experiencing is that the
I'm using simple jcarousel here is ther code: http://jsfiddle.net/w6fLA/ I'm trying to show div
I have a simple script that closes a DIV. An example is here: http://jsfiddle.net/22fTm/3/
Here is sample code: http://jsfiddle.net/BSjGX/1/ <input id=testing /> $('#testing') .keydown(function(e){ if(e.keyCode==13) {return false;} })
Here's the sample/jsFiddle: http://jsfiddle.net/antonpug/ub7xW/ Basically, you can't see it in the jsFiddle, I don't
Here's the sample: http://jsfiddle.net/HnQWU/ When items are removed from a category, and that category
Here is a sample http://jsfiddle.net/mUpjw/15/ I had JQuery 1.2 in some old code and
Here is my sample http://jsfiddle.net/RaQtg/4/ I want to redirect my page to another URL
I've got two tables Here's a jsfiddle sample http://jsfiddle.net/tiitremmel/zW7bX/ There's two tables and result

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.