Del*_*D0D 4 html css margins padding
我什至不愿意问一个看起来如此愚蠢的东西,但我只是不明白这一点。我要做的就是在窗口顶部有一个蓝色的div,它遍及整个窗口。我以为width:100%;可以做到这一点,但是由于某种原因它在边缘留下了空白。
我的html:
<!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>Untitled Document</title>
<link href="_css/wikiToolBox.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="iWikiTopPanel" class="iWikiTopPanel"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的CSS:
@charset "utf-8";
/* CSS Document */
.iWikiTopPanel{
width:100%;
height:200px;
background-color:#205081;
margin:0px;
border-bottom: 1px solid #2e3d54;
clear: both;
float:left;
}
body{
padding:0px;
/*set This thinking it might fix the issue, it didnt*/
}
Run Code Online (Sandbox Code Playgroud)
这是我最终得到的照片:

这是在Chrome的元素检查器中看到的元素:

我不明白。那么填充/边距从哪里来,我如何摆脱它呢?