Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.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 - Fatal编程技术网

Html 整页宽度div

Html 整页宽度div,html,css,Html,Css,我有一个div(作为一个测试站点的“标题”),但我总是左右都有一个小的边距,即使我的宽度设置为100% CSS: html: <html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="main.css"> <title>Test Site</title> </head

我有一个div(作为一个测试站点的“标题”),但我总是左右都有一个小的边距,即使我的宽度设置为100%

CSS:

html:

<html>
   <head>
      <meta charset="utf-8">
      <link rel="stylesheet" type="text/css" href="main.css">
      <title>Test Site</title>
   </head>
   <body>
      <div class="humpty">
            Main Title for this Page entirely
      </div>

试验场地
此页的主标题完全相同
添加


主要是因为正文填充,请尝试将其添加到css
body{padding:0;margin:0}
<html>
   <head>
      <meta charset="utf-8">
      <link rel="stylesheet" type="text/css" href="main.css">
      <title>Test Site</title>
   </head>
   <body>
      <div class="humpty">
            Main Title for this Page entirely
      </div>
body, html {
    margin: 0;
    padding: 0; 
}