I have been trying to move an image (logo.png) and text ("The Crazy Cat Lady") to the center of a page. I have already put the image and text inside a div container and typed text-align="center"; in style.css. Can somone please help me with this issue? My code is below.
HTML:
HTML:
Code:
<!DOCTYPE html>
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link href="https://fonts.googleapis.com/css?family=Poppins:400,500&display=swap" rel="stylesheet"> <link rel="stylesheet" href="/CSS/style.css"/> <title>The Crazy Cat Lady</title> </head> <body> <header> <div class="logo-container"> <img src="img/logo.png" alt="logo"> <h4 class="logo">The Crazy Cat Lady</h4> </div> <nav> <ul class="nav-links"> <li><a class="nav-link" href="#">Pablo Picatso</a></li> <li><a class="nav-link" href="#">Tailay</a></li> <li><a class="nav-link" href="#">Lucky</a></li> </ul> </nav> </header> </body> </html>
CSS:
* {
margin: 5px;
padding: 0px;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
}
header {
display: flex;
width: 90%;
height: 20vh;
margin: 0;
align-items: center;
}
.logo-container,nav-links{
display: flex;
text-align: center;
}
.logo-container {
flex: 1;
text-align: center;
}
.logo{
font-size: 150%;
font-weight: 600;
margin: auto;
}
li{
display: inline;
padding: 0px 30px 0px 30px;
position: relative;
top: 55px;
font-weight: 500;
}
nav {
flex: 2;
}
.nav-links{
justify-content: space-around;
list-style: none;
}
.nav-link{
color: #5f5f79;
font-size: 18px;
text-decoration: none;
}
img {
width: 125px;
height: auto;
align-self: center;
}
Comment