I think id prefer padding, but borders are just as good.
Here is an example showing you a couple ways of doing same thing.
#example2 uses more emphasis on parent doing all the intial padding,
#example1 on the child (with 1px padding on parent to preven margins from
punching through).
Switch #example1 and #example2 on body tag, should look same.

Arian

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>collapse test</title>

<style type="text/css">

body#example1 { padding:0px; margin:0px; }
#example1 div {
width: 700px;
height: 499px;
margin: 0px auto;
background-color: green;

padding: 1px 0px 0px 0px;
/*
either or:
border-top: 1px solid green;
*/
}
#example1 .first {
background-color: blue;
margin-top: 19px;
}
#example1 p{
background-color: red;
margin: 10px;
}

body#example2  { padding:0px; margin:0px; }
#example2 div {
width: 700px;
height: 480px;
margin: 0px auto;
background-color: green;

padding: 20px 0px 0px 0px;
}
#example2 .first {
background-color: blue;
margin-top: 0px;
}
#example2 p{
background-color: red;
margin: 10px;
}



</style>

</head>




<body id="example1">
    <div>
        <p class="first">this is a paragraph</p>
        <p>this is a paragraph</p>
        <p>this is a paragraph</p>
        <p>this is a paragraph</p>
    </div>
</body>

</html>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to