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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:26:05+00:00 2026-05-24T05:26:05+00:00

So I am experimenting with pure css layouts, and immediately I have become stuck.

  • 0

So I am experimenting with pure css layouts, and immediately I have become stuck. I have the following html and css:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Layout</title>
        <link type="text/css" href="site.css" rel="stylesheet" >
    </head>
    <body>
        <div id="header">
            <a href="#" id="logo">My Site</a>

            <div id="search-area">
                <form>
                    <input type="text" id="search-box" />
                    <input type="submit" value="Search" />
                </form>
            </div>
        </div>

        <div id="sidebar">
            Account Name <br>
            <a href="#">Edit My Account</a>

        </div>
    </body>
</html>

#header {
    background-color: #151B54;
    height: 30px;
    width: 100%;
}

#logo {
    position: relative;
    left: 10px;
    color: white;
    font-size: x-large;
    font-weight: bold;
    text-decoration: none;
    float: left;
    margin-top: 3px;
}

#search-area {
    position: absolute;
    left: 200px;
    margin-top: 3px;
}

#sidebar {
    float: left;
    width: 100px;
    border-right: double;
}

When I view this in Chrome I get the rendering that I was expecting:

However, in IE I get the following:

Notice how there is a massive blank area to the left of the sidebar. Why is that showing in IE?

  • 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-24T05:26:05+00:00Added an answer on May 24, 2026 at 5:26 am

    I get the same problem in Safari and for the same reason: you’re not clearing your floats in #header and #header isn’t quite tall enough to contain all of its floated children.

    If you increase the height of the header to 31px, you should (but maybe not) get the desired layout. A better approach is you add overflow: hidden as a clear fix, that will make all of the children of #header fully contained with #header and that will stop them from interfering with the layout of the next piece:

    #header {
        background-color: #151B54;
        height: 30px;
        width: 100%;
        overflow: hidden;
    }
    

    Live example: http://jsfiddle.net/ambiguous/EUmyN/

    A rule of thumb with floated elements is to always make sure they’re cleared either with overflow: hidden on their container or, if necessary, with an explicit <div style="clear: both;"></div> at the bottom of the container.

    Also, while we’re here, you rarely need width: 100% on a block element such as a <div>. If you’re positioning it or floating then maybe you’ll need something like that but not for a plain <div>; block elements are full width by default.

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

Sidebar

Related Questions

I have been experimenting with woopra.com A web analytics tool. Which requires a piece
I'm currently experimenting with build script, and since I have an ASP.net Web Part
I am experimenting with embedding my pure offline mobile HTML5 ebook reader (http://www.hyper-books.com/) into
While experimenting with iPhone app development, we have several AppIDs which should be deleted
I am currently experimenting with various input controls and have stumbled upon SneakyInput, which
Experimenting with Cocos2D collection detection and have some questions. First, some background: This is
I experimenting with Flex Styling, and I came across an alignment issue. I have
I've been experimenting with the standard python math module and have come across some
I started experimenting with MVC 3. And I'm stuck with applying the style of
been experimenting with unordered list UL and i have seem varios examples of using

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.