Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML中的Div标记相互重叠_Html_Css_Web - Fatal编程技术网

HTML中的Div标记相互重叠

HTML中的Div标记相互重叠,html,css,web,Html,Css,Web,我正在尝试创建我的个人HTML网站(我是网站开发方面的新手)。但是我遇到了两个最近的div标签相互重叠的问题,我不明白为什么。 以下是代码,您可以自己查看: <!DOCTYPE html> <html> <head> <title>My site</title> <link rel="icon" type="image/png" href="favicon.png" /> <link rel=

我正在尝试创建我的个人HTML网站(我是网站开发方面的新手)。但是我遇到了两个最近的div标签相互重叠的问题,我不明白为什么。 以下是代码,您可以自己查看:

<!DOCTYPE html>
<html>
<head>
    <title>My site</title>
    <link rel="icon" type="image/png" href="favicon.png"  />
    <link rel="stylesheet" type="text/css" href="stylesheet.css" /> 
</head>
<body style="background-color: #759CE0;">
    <div id="wrapper">
        <div id="header">
            <div style="background-color: #708EE0; width: 100%; height: 30px; display: block;" />
            <div>
                <h1 id="segoeuilight">Welcome to my blog</h1>
                <h3 id="smalltip">News and thoughts</h3>
            </div>
        </div>
        <div id="container">
            <div id="left" />
            <div id="right" />
            <div id="center" />     
        </div>
        <div id="footer" /> 
    </div>
</body>
</html>
以下是我得到的结果:

“header”div中的div相互重叠。但我想先创建一个矩形,然后再打印一些文本。我的代码有什么问题? 顺便说一句,我使用Chrome浏览器,但IE9显示了相同的结果


对不起,我的英语不好。

由于某种原因,你不能像
那样写一个空的
标记。改用
。 看这把小提琴:


由于某些原因,您不能像
那样编写空的
标记。改用
。 看这把小提琴:


你能把相关的代码贴出来吗,或者编一把小提琴吗?没有人愿意仔细检查。你能发布相关的代码吗,或者编一把小提琴吗?没人想筛选,谢谢。很有魅力(谢谢你。工作起来像个符咒=)
@font-face
{
    font-family: 'Segoe UI Light';
    src: url('fonts/segoeuil.ttf');
}
@font-face
{
    font-family: 'Segoe UI';
    src: url('fonts/segoeui.ttf');
}
h1#segoeuilight
{
    font-family: 'Segoe UI Light';
    font-weight: normal;
    color: #FFFFFF;
    padding-left: 10px;
    height: 20px;
}
h3#smalltip
{
    font-family: 'Segoe UI';
    font-weight: normal;
    color: #FFFFFF;
    padding-left: 10px;
}
div#header 
{
    height: 20%;
}
div#container 
{
    min-width:800px;
}
div#center 
{
    margin:0px 200px 0px 200px;
}
div#left 
{
    float:left; 
    width:200px;
}
div#right 
{
    float:right; 
    width:200px;
}
div#footer 
{
    height:100px;
}
div#wrapper
{
    width: 800px; /* set to desired width in px or percent */
    text-align: left; /* optionally you could use "justified" */
    border: 0px; /* Changing this value will add lines around the centered area */
    padding: 0;  
    margin: 0 auto;
    background-color: #8D0087;
}