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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:42:12+00:00 2026-05-31T16:42:12+00:00

Dear community members, I am actually a bit new to CSS, however I know

  • 0

Dear community members,

I am actually a bit new to CSS, however I know my way around after a two weeks of studying. However at the moment I have a small problem with layers (div-tags) that I can’t seem to fix. The problem is as follow, I have created the following to demonstrate my problem.

<body style="margin: 0;">
  <div style="margin: 0px auto; width: 960px;" id="main">
    <div style="clear: both; float: left; width: 100%; height: 100px;" id="one">
      Hello World
    </div>
    <div style="clear: both; float: left; width: 100%; height: 200px;" id="two">
      Hello next World!
    </div>
  </div>
</body>

The problem here is, if you “look at the borders” (I have removed; background-color and border property to increase the readability of the code), you will notice that the first main div doesn’t wrap around div one and two. If I want to fix it, I only have to add some contents to the main layer. resulting in the following code:

<body style="margin: 0;">
  <div style="margin: 0px auto; width: 960px;" id="main">
    <div style="clear: both; float: left; width: 100%; height: 100px;" id="one">
      Hello World
    </div>
    <div style="clear: both; float: left; width: 100%; height: 200px;" id="two">
      Hello next World!
    </div>
  LET ME SOLVE IT!
  </div>
</body>

The question now is, how do I get the last result without adding “just contents” to my main layer?

Thank you very much for reading my question and answering it!

For images please see: http://www4.picturepush.com/photo/a/7808622/img/7808622.png and http://www3.picturepush.com/photo/a/7808636/img/7808636.png

(NOTE: all are direct links ;))

  • 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-31T16:42:13+00:00Added an answer on May 31, 2026 at 4:42 pm

    Add overflow:hidden to your container div. This will force the div to ‘wrap’ around your inner divs. Welcome to Stack Overflow!

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

Sidebar

Related Questions

Dear members of the Stackoverflow community, We are developing a web application using the
Dear community members, I would like to position the text inside test in the
Dear community members, I have a small problem, which involves a text input field
Dear experts, I am quite new to javascript and I often see coders use
Dear all devexpress winform gurus:) My way is simple. First, i create a bindinglist:
dear i have a datepicker inside my form. after i click the textfield, datepicker
dear all..i've a textfield, it using barcode scanner for input data..after scan it shows
dear all.. i'm new to ajax timer, since someone tell me to use it
Dear fellow developer, for some reason updates for 1720 records takes around 15 seconds
Dear All, Actually I have done all my Biz(business layer) and DAL CRUD Opprations

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.