header中有h1,h1中有文字,文字font-size:62px,h1未设置高度,chrome中显示文字和h1的上下边框之间有间距,请问这个间距怎么来的,该怎么处理掉?
尝试了设置line-height:1,间距变小,但未消失
html:
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ife911</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://fonts.font.im/css?family=Montserrat" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="ife911.css">
</head>
<body>
<header>
<h1>Hello World</h1>
</header>
</body>
</html>
CSS:
.html{
font-family: 'Montserrat';
}
*{margin: 0px;padding: 0px;border: 0px}
header{
width: 1600px;
margin: 0 auto;
}
header{
background-image: url(./image/Background1.png);
height:990px;
background-repeat: no-repeat;
overflow: hidden;
}
header h1{
margin-top:207px;
font-size: 62px;
text-align: center;
color: rgb(255, 255, 255);
font-weight: normal;
letter-spacing: 0px;
border: 1px solid;
}
3楼说的是正确的,这个肯定会有默认的间距,这种一行的如果要消除也很简单,一般设计师会给你字体的高度,设置line-height=字体高度,就可以了