Css - 我的网页顶部的白边

时间:2017-08-30 10:00:30

标签: html css margin

我已经尝试了所提供解决方案的所有可能组合,以摆脱这种差距,例如:

body {    
    margin: 0 !important;
    padding: 0 !important;
}

* {
   margin: 0px;
   padding: 0px;
}

* {
        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        font-size: 100%;
        vertical-align: baseline;
        background: transparent;
    }

但它没有帮助。事实上,我已经从我的主题的前5个stackoverflow问题尝试了几乎所有合理的解决方案,但仍然没有结果。我的网页是:



body {
  line-height: 1.6;
  color: #3a3a3a;
  font-family: "Arial", sans-serif;
}

a {
  color: #fff;
  text-decoration: none;
}

.main-header {
  background: #3acec2;
}

<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Page Title</title>
  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/style.css">
</head>

<body>


  <header class="main-header">
    <h1 class="name"><a href="#">Header text here</a></h1>
  </header>
&#13;
&#13;
&#13;

我在30.08使用normalize 7.0版。

1 个答案:

答案 0 :(得分:0)

删除h1 <div class="col-md-12 contant-area homeClass"> <div class="col-md-3 col-sm-6"> <div class="homeinfo"> <h2>INNOVATION</h2> <div class="infoIco"> <div class="topCover"></div> <div class="clearfix"></div> <div class="circle circle1"> <i><img src="images/whyinn-icon.png" alt=""></i> </div> <div class="clearfix"></div> <div class="footCover"></div> <div class="fullCircle"></div> </div> <p>We know digital innovation is the key to future growth.</p> </div> margin-top标记的边距。

body
body {
  line-height: 1.6;
  color: #3a3a3a;
  font-family: "Arial", sans-serif;
  margin:0;
}
a { 
  color: #fff;
  text-decoration: none;
}
.main-header {
  background: #3acec2;
}
.main-header h1 {
  margin-top: 0;
}