I understand that using clearfix can help with the zero-height container issue for floated elements.
However, I am curious if there is a similar technique to clearfix for fixed elements?
I am currently stuck trying to implement the clearfix method.
.navbar-float {
background-color: #adadad;
float: left;
}
.navbar-fixed {
background-color: #dadada;
position: fixed;
}
div.clearfix {
border: 1px solid #adadad;
padding: 4px;
}
.clearfix:before,
.clearfix:after {
content:"";
display:table;
}
.clearfix:after {
clear:both;
}
.clearfix {
zoom:1; /* For IE 6/7 (trigger hasLayout) */
}
<div class="clearfix">
<nav class="navbar-float">
Float
</nav>
</div>
<br/>
<br/>
<br/>
<div class="clearfix">
<nav class="navbar-fixed">
Fixed
</nav>
</div>