This is CSS1 code.
div.footer{
background:url('http://i.imgur.com/rfC0Ntb.jpg') repeat-x;
height:88px;
margin:0 auto;
width:400px;
border:1px solid red;
}
div.footer p{
margin-top:40px;
text-align:center;
border:1px solid red;
}
<body>
<div class="footer"><p>Copyright© 2013 service center</p></div>
</body>
1. at the top of box
div.footer p
.2.in the box
div.footer
.This is css2 code.
div.footer{
background:url('http://i.imgur.com/rfC0Ntb.jpg') repeat-x;
height:88px;
margin:0 auto;
width:400px;
}
div.footer p{
margin-top:40px;
text-align:center;
}
<body>
<div class="footer"><p>Copyright© 2013 service center</p></div>
</body>
In css2 ,border:1px solid red
was removed from div.footer
and div.footer p
,it result in
1.40px was added at the top of box div.footer
2.out of box div.footer
In my opnion there maybe no different effect between css1 code and css2 code,border:1px solid red
is to draw a region only,why it can result in the differences?
I want to know the reason,why?