I am building my first project, I need to make the title <h2>
in the navbar ("la poma") centered in the <div>
instead of the right position.
Using flexbox, or float, is not working; are there any suggestions how I can solve this? Should I use CSS grid, or padding?
Thanks in advance.
* {
margin: 0%;
padding: 0%;
}
body {
background: url(./pexels-huy-phan-1383776.jpg) no-repeat;
background-size: cover;
}
nav {
display: flex;
justify-content: center;
}
.header {
display: flex;
padding: 5px 15px;
}
.menu ul {
display: flex;
float: left;
}
.menu li {
padding: 10px 5px;
list-style: none;
}
.Title {
display: flex;
align-items: center;
}
header {
background-color: orange;
display: flex;
justify-content: space-between;
align-items: center;
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="https://kit.fontawesome.com/3ed3936107.js" crossorigin="anonymous"></script>
<title>Document</title>
<body>
<header>
<nav>
<div class="menu">
<ul class="menu-list">
<li>Home</li>
<li>offer</li>
<li>menu</li>
<li>Branches</li>
</ul>
</div>
</nav>
<h2>La poma</h2>
</header>
</body>
</html>