<body> <div class="pages" style="width:70%; margin-left:auto; margin-right:auto; position:relative"> <div id=head style="margin-top:20px; width:auto; margin-bottom:0px"> <div id=title style="margin-top:0px;width:100%; height:300px; background-color:#399; background-image:url(../../images/20085280814924_3.jpg)"> </div> <div id=menu style=" margin-top:0px; height:2px; background-color:#F00"> <p style="text-align:right">联系电话:0755-xxxxxxxx</p> <p>联系我们</p> </div> </div> <div id="mains" style="margin-top:0px; position:relative"> <div id="footer" style="margin-top:0px; position:relative"> Copyright All Rights Reserved. </div>
Organize your code. . Or take a screenshot of the desired effect
Have you reset your css? ?Before writing css, use DTD. If necessary, reset css
..................... ....
This is the head
........................
This is the middle part
The head and the middle part are close to each other
........................
The middle part and the feet are also close to each other
Here are the feet
........................
The problem now Yes, after putting that piece of css code, there is a part of space between the head and the middle part,
and the feet sometimes run into the middle,,,