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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:29:13+00:00 2026-05-27T11:29:13+00:00

I have a content div, that has a header div, which contains two other

  • 0

I have a content div, that has a header div, which contains two other divs, and then a final div that is not in the header, but is in the content. However, it looks like the last child div of content is not actually contained in the content.

Here is the CSS:

div.outline {border: 1px solid red;}
#content{background-color:tan;}
#container{width:680px;overflow:hidden;}
#header{margin-bottom:10px; background-color:yellow;}
#title{float:left;}
#link{float:right;}
.clear_it{clear:both;}
#chooser{float:left; margin-right:20px}
#renamer{padding-left:20px;}
#img{width:170px;height:130px;border:1px solid rgb(192,192,192);float:left;margin-left:20px;margin-top:20px;}

Here is the HTML:

<div id="container">
    <div id="header">
        <div id="title">Header Title</div>
        <div id="link" style="float:right;">
            <a href="http://www.apple.com" target="_blank">Link</a>
        </div>
        <div class="clear_it"></div>
    </div>

    <div id="content">
        <div id="content_header">
            <div id="chooser">
                <select>
                    <option value="1">This is a fairly long option</option>
                    <option value="2">short</option>
                </select>
            </div>
            <div id="renamer">
                <a href="http://apple.com" target="_blank">Link</a>
            </div>
        </div>
        <div class="clear_it"></div>
        <div id="img"></div>
    </div>
</div>

Here is the result:

results

  • 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-27T11:29:14+00:00Added an answer on May 27, 2026 at 11:29 am

    I’d recommend a different method to clear your floats that doesn’t involve any clearing divs (thus removing clear_it altogether). Just add overflow: auto or overflow: hidden to your containers that contain the floated elements:

    #content { overflow: auto; }
    #container { overflow: auto; }
    #content-header { overflow: auto; }

    New HTML:

    <div id="container">
        <div id="header">
            <div id="title">Header Title</div>
            <div id="link" style="float:right;">
                <a href="http://www.apple.com" target="_blank">Link</a>
            </div>
        </div>
    
        <div id="content">
            <div id="content_header">
                <div id="chooser">
                    <select>
                        <option value="1">This is a fairly long option</option>
                        <option value="2">short</option>
                    </select>
                </div>
                <div id="renamer">
                    <a href="http://apple.com" target="_blank">Link</a>
                </div>
            </div>
            <div id="img"></div>
        </div>
    </div>
    

    New CSS:

    div.outline {border: 1px solid red;}
    #content{background-color:tan; overflow: auto;}
    #container{width:680px;overflow:auto;}
    #header{margin-bottom:10px; background-color:yellow; overflow: auto;}
    #title{float:left;}
    #link{float:right;}
    #content_header { overflow: auto; }
    #chooser{float:left; margin-right:20px}
    #renamer{padding-left:20px;}
    #img{width:170px;height:130px;border:1px solid rgb(192,192,192);float:left;margin-left:20px;margin-top:20px;}
    

    See: http://jsfiddle.net/Wexcode/g7MkN/

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

Sidebar

Related Questions

I have a modal popup that initially shows some content but expands a div
I have three DIVs, something like this: <div id=header> ... </div> <div id=content> <div
i have a page that has sections as divs with inner divs and content.
I have a Div that is 400px in height with the ID content, I
The Idea I have a main PHP page that loads content in DIV's from
I want to parse a html content that have something like this: <div id=sometext>Lorem<br>
I have two div elements that are twins (i.e. their dimensions and contents are
I have a page that has a header, a footer middle section that should
I have a page that has three divs one at the top, one at
I have an HTML page layout - something like this: <div id='header'> Header content

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.