Hello I am very new to HTML and CSS and I am trying to do a site for just learning. I just made a header and I put logo in it but I can't set it's vertical-align. Can someone explain it?
Here is HTML file:
<!DOCTYPE html>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Scienitive</title>
</head>
<body>
<div class="header">
<div class="logo-container">
<div class="logo">
<a href ="index.html"><img src ="logo.png"></a>
</div>
<h1>Scienitive</h1>
</div>
</div>
</body>
Here is CSS file:
.header {
width: 100%;
height: 80px;
display: block;
background-color: #FF5733;
}
.logo-container {
height: 100%;
display: table;
float: left;
}
.logo-container h1{
color: white;
height: 100%;
display: table-cell;
vertical-align: middle;
font-family: "Open Sans";
font-size: 48px;
}
.logo {
display: table;
height: 80px;
}
.logo img{
width: 48px;
height: 48px;
vertical-align: middle;
display: table-cell;
}
Here is how site looks like Image