我尝试了几乎所有东西来摆脱上边距我使用normalized.css重置,通用选择器重置,HTML和身体重置边距为0.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>index</title>
<link href='https://fonts.googleapis.com/css?family=Orbitron|Lato:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" href="normalize.css">
<!--[if IE]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header>
<div class="content-area">
<div class="text-logo">
<h1>Peacon<span>TT</span></h1>
</div>
</div>
</header>
</body>
</html>
CSS:
html {
margin: 0;
padding: 0;
}
header {
width: 100%;
height: 70px;
background-color: #586f7c;
}
.content-area {
width: 1000px;
margin: 0 auto;
}
.text-logo {
font-family: "orbitron", Arial, Helvetica, sans-serif;
font-weight: 100;
color: #ffffff;
}