CSS clearfix alternative for children with fixed position
<p>I know that <strong>clearfix</strong> is a way to combat the zero-height container problem for floated elements.</p>

<p>But, I am wondering if there's any clearfix-like way for fixed elements?</p>

<p>I am stuck and getting anywhere from clearfix method.</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.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) */
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="clearfix"&gt;
  &lt;nav class="navbar-float"&gt;
    Float
  &lt;/nav&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;div class="clearfix"&gt;
  &lt;nav class="navbar-fixed"&gt;
    Fixed
  &lt;/nav&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>