0
这里是我的代码标题和图像标头不对齐
header img{
\t width:10%;
\t vertical-align: middle;
}
header h1{ \t
\t text-align: right;
\t display:inline;
\t position: absolute;
}
header {
\t width : 100%;
\t height: 1% ;
\t background: red;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href = "css\main.css" >
<link rel="stylesheet" href="css\responsive.css">
</head>
<body>
<header>
<div class = "container-fluid">
<img src="https://pixabay.com/static/uploads/photo/2015/12/15/09/31/badge-1093966_640.png" alt="">
<h1>KUNAL MEHTA</h1>
</div>
</header>
<section>
</section>
<footer>
</footer>
<script src = "js/main.js"></script>
</body>
</html>
什么,我说的是我想要的H1去正确的,他们都应该在中心对齐父母Element.i使用BOOTSTRAP,因此鼓励使用bootstraps的答案
中心水平,垂直,或两者兼而有之? – j08691
水平和垂直 –