Html 整页宽度div
我有一个div(作为一个测试站点的“标题”),但我总是左右都有一个小的边距,即使我的宽度设置为100% CSS: html: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
<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;
}