Previous Message
Next Message

Easy Clearing and clear:both issue

Sent by jack fredricks on 22 March 2006 01:01

Hi all,

Just wondering if you could please shed some light on this issue for
me. Sorry, I dont have access to an external webserver, so I will
paste the code here;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html lang="en">
    <title>Float Test</title>
    <style type="text/css">

* {margin: 0;padding: 0;}
body {font: 76% verdana, arial, sans-serif;margin: 10px;color: #000;}

    background-color: #edd;
    padding: 2px;

    background-color: #d0b1b4;
    padding: 2px;

    background-color: #d2d6e3;
    padding: 7px;
    width: 150px;
    float: left;

    background-color: #ff0;
    margin-left: 180px;
    padding: 7px;


	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;

    <div id="wrap">
        <div id="header">
        <div id="leftnav">
        <div id="main">
            <div class="z">
                why does my generated content make me as tall as the
floated leftnav to my right?
        <div id="footer">

Basic 2 col layout: leftnav div is floated left, main div has a margin
a bit bigger than the width of the leftnav.

If you run the code you'll see the issue.

I guess the real question is "is clear:both supposed to stop clearing
once it gets to the margin of the containing element, or does it also
clear BEYOND that margin?".


css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: