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
水平和垂直 –