Home > Web Front-end > HTML Tutorial > Ask a question about css_html/css_WEB-ITnose

Ask a question about css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:10:53
Original
1010 people have browsed it

<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>
Copy after login


The effect I want is that there is a piece of text immediately below the head, and there are also div mains immediately below the text. But the interface that appears in the world is not like this, so frustrating. Doesn't it mean style="margin-top:0px; position:relative" position:relative is relative positioning? , What I mean is that compared to the previous one I was top 0 but the actual effect is very depressing
                                                                                                                                 Solution)

Organize your code. . Or take a screenshot of the desired effect

Have you reset your css? ?

Very true.

Organize your code. . Or take a screenshot of the desired effect

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,,,

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template