I am trying to adjust float part of my menu to the left, and the other part to the right. However, I cannot get it to work.
I have been trying to accomplish it using float
s, but I can't quite get it to work.
How can I do this in a proper way?
HTML
<div class="topbar">
<div class="title">Title</div>
<div class="topbar-boxes">
<div class="topbar-boxes-left">
<div class="topbar-box">Box1</div>
<div class="topbar-box">Box2</div>
<div class="topbar-box">Box3</div>
</div>
<div class="topbar-boxes-right">
<div class="topbar-box">Box1</div>
<div class="topbar-box">Box2</div>
<div class="topbar-box">Box3</div>
</div>
</div>
<div style="clear:both"></div>
</div>
CSS
.topbar {
width: 100%;
padding: 14px;
font-size: 18pt;
color: white;
background-color: rgba(42, 42, 42, 0.95);
}
.title {
float: left;
padding-right: 50px;
}
.topbar-boxes {
float: left;
margin: -14px;
}
.topbar-boxes-left {
float: left;
}
.topbar-boxes-right {
float: right;
}
.topbar-box {
float: left;
padding: 20px;
border-left: 1px solid black;
}