Can someone help me align three divs vertically within a container div? The challenge is that all three divs inside the container are floated - one on the right, one in the center, and one on the left to create a navbar.
I've seen the navbars in Bootstrap and I would like to combine three navbar divs into one to create a single navbar.
I'm new to HTML coding, so any assistance would be greatly appreciated.
.container {
width: 100%;
font-size: 11px !important;
}
.sinistra {
float: left;
width: 30%;
height: 7%;
background-color: white !important;
line-height: 10%;
vertical-align: center;
}
.centro {
display: inline-block;
margin: 0 auto;
width: 30%;
height: 7%;
line-height: 10%;
vertical-align: center;
}
.destra {
float: right;
width: 40%;
height: 7%;
line-height: 10%;
vertical-align: center;
}
a {
font-size: 11px !important;
}
<head>
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b5954544f484f495a4b7b0e7">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auAUtT94WrHftjDbrCEXSUBoBoqyl2QvtZ6IW3" crossorigin="anonymous"></link>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e2c21213a3d3a3c2f3e0e707f607d">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7SkGln4gmtz2MlignikTtwXgYsOgedhuPIdRH9ENBO0LRn5qn+8nbTo4+1vp" crossorigin="anonymous"></script>
</head>
<body>
<div id="container">
<div class="sinistra">
<a class="navbar-brand" href="#">
<img src="/docs/5.1/assets/brand/bootstrap-logo.svg" alt="" width="30" height="24" class="d-inline-block align-text-top"> Aaaa
</a>
</div>
<div class="centro"> <a>aaa</a></div>
<div class="destra">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link disabled" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="#">Separated link</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link">Disabled</a>
</li>
</ul>
</div>
</div>
</body>