Html 如何消除正文中div上方的空白
我有一个奇怪的空格在正文第一节的上方 在这里: 不明白为什么,我甚至将CSS重置为默认值,即Html 如何消除正文中div上方的空白,html,css,responsive-design,Html,Css,Responsive Design,我有一个奇怪的空格在正文第一节的上方 在这里: 不明白为什么,我甚至将CSS重置为默认值,即*{margin:0;} Html <!DOCTYPE html> <html> <head> <title>Responsive Navigation Demo</title> <meta name="viewport" content="width=device-width, initial-scale=1, maxi
*{margin:0;}
Html
<!DOCTYPE html>
<html>
<head>
<title>Responsive Navigation Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
<script src="js/jquery-3.0.0.min.js"></script>
</head>
<body>
<div id='section-one'>
<div id='headline'>
<h1> This is the headline </h1>
<div class='silver-line-break'>
</div>
<div id='fee-estimate-box'>
<form id='fee-estimate-form' action="#">
<legend>Delivery Fee Calculator</legend>
<span>First name: </span> <input type="text" name="firstname" value="Mickey">
<span>Last name: </span> <input type="text" name="lastname" value="Mouse">
<input type="submit" value="Submit">
</form>
</div>
<div class='silver-break-bar'>
<img id='red-car' src="img/red-car.png" alt="" height="250" width="300">
</div>
</div>
</div>
</body>
</html>
你知道为什么正文
中的第一节
div上方有空格吗
更新:我已经添加了要求的完整代码。不确定是什么问题?这与我的chrome浏览器有关吗 H1有一些像素的边距
h1 {
margin: 0px
}
显示完整的css代码。在我这方面似乎运行良好(供参考)。你有我可以查看的直播版本吗?可能是客户端问题,而不是您的代码不正确。无法复制-您使用的浏览器是什么?请尝试将边距0设置为标题#第一节h1{margin:0;}不,它没有。OP的代码已经将H1的边距设置为0。实际上我没有。我将第一节div设置为边距0。原来是h1tag@Code2016那你为什么说代码中有
*{margin:0}
?我们怎么知道不是这样?
h1 {
margin: 0px
}