我是网页设计的新人.我使用CSS和HTML创建了我的网页布局,如下所示.问题是即使我将边距设置为0,上边距也没有设置为0并留下一些空间.我怎样才能清除这个空白区域?
屏幕截图的问题

样式表
<style type="text/css">
body{
margin:0 auto;
background:#F0F0F0;}
#header{
background-color:#009ACD;
height:120px;}
#header_content {
width:70%;
background-color:#00B2EE;
height:120px;
margin:0 auto;
text-align:center;}
#content{
width:68%;
background-color:#EBEBEB;
margin:0 auto;
padding:20px;}
</style>
Run Code Online (Sandbox Code Playgroud)
HTML
<body>
<div id="header">
<div id="header_content">
<p>header_content</p>
</div>
</div>
<div id="content">
Main Content
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
这是整个文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Book Shop</title>
<style type="text/css">
html, body, #header {
margin: 0 !important;
padding: 0 !important;
}
body{
margin:0; padding: 0;
background:#F0F0F0;}
#header{ …Run Code Online (Sandbox Code Playgroud) 哪些浏览器能够正确理解和实现CSS中的星号(*)?(通过'恰当'我的意思 - '因为他们应该'.)
考虑这个CSS代码,例如:
pre .comment * {
color: #800;
}
Run Code Online (Sandbox Code Playgroud)
编辑:我现在看到它被称为'*选择器'或'通用选择器'.非常感谢您的投入.:)
我正在网站上工作,我注意到我的页面顶部和底部有一个无法解释的空白区域.我搜索了一些帖子,他们告诉我确保我使用了没有BOM的UTF-8编码,我尝试了它并没有区别.如果有人愿意看它,网址就是网址