I understand that the height of a box in CSS is the height of the contents, excluding the margin and padding, but why with this sample, if you uncomment the border: line in the containing div, does the background color of the div extend above the first paragraph while if you have no border it doesn't?
<html>
<head>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
<title></title>
<style type="text/css">
#container {
background-color: green;
/* border: black solid 1px; */
}
p { background-color: red;
margin-top:50px;
margin-bottom: 0px;
border: black dotted 3px;
}
</style>
</head>
<body>
<div id="container">
<p>first paragraph</p>
<p>second paragraph</p>
</div>
</body>
</html>