<!DOCTYPE html>
<html>
<head>
<style>
#one{
background-color: brown;
text-align: center;
margin-top: 0;
}
#two{
background-color: rgb(86, 74, 153);
text-align: center;
margin-top: 0;
}
</style>
</head>
<body>
<div id="one">
<h1>heading</h1>
</div>
<div id="two">
<h2>welcome section</h2>
</div>
</body>
</html>
why do margin-top: 0
and margin-bottom: 0
not working in css here? is there any rule like this in css?if i give border to both, it works. also when i give border of 1px, height of div is increasing automatically and margin goes zero but without border i can not set margin zero. why? please give brief discription of this rule.