I am curious about the best practices for creating spacing between two divs that use flexbox. For example:
https://i.sstatic.net/OZ8cp.png
header {
background-image: radial-gradient(circle, #72d6c9, #54d1ed, #7ac5ff, #bcb2fe, #f29cd9);
height: 80px;
}
.menu-section {
display: flex;
}
.nav-logo {
color: #e00986;
font-size: 25px;
margin: 0;
padding-left: 15px;
line-height: 80px;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
text-align: center;
}
nav ul li {
display: inline-block;
width: 150px;
position: relative;
}
nav ul li a {
text-decoration: none;
line-height: 80px;
padding: 0 10px;
display: block;
color: #e00986;
}
nav ul li a:hover {
color: #FFF;
transition-duration: 2s;
}
<header>
<nav class="menu-section">
<h1 class="nav-logo">Love ♡ Cookies</h1>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Cookies</a>
<ul>
<li><a href="#">Cakes</a></li>
<li><a href="#">Cupcakes</a></li>
<li><a href="#">Meringues</a></li>
<li><a href="#">Pastries</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
One option is to add margin-left: 550px to nav ul, but I am not convinced that this is the best approach. What are your thoughts on this matter?