snipt

Ctrl+h for KB shortcuts
Notice: Snipt is moving away from free accounts on May 1st, 2014. Read more about the transition here.
#10098

CSS

clearfix

1
2
3
4
5
6
/*Apply to resolve float clearing issues. Is "new clearfix"*/
.clearfix:after {visibility: hidden;display: block;font-size: 0;content: " ";clear: both;height: 0;}

/*for IE 6/7*/
.clearfix {display: inline-block;}
.clearfix {zoom: 1;}
https://snipt.net/embed/751cbc7771a5a9df8b2cedc9477c59f5/
https://snipt.net/raw/751cbc7771a5a9df8b2cedc9477c59f5/
751cbc7771a5a9df8b2cedc9477c59f5
css
CSS
6
2014-04-23T14:17:17
True
False
/api/public/snipt/10098/
clearfix-9
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">/*Apply to resolve float clearing issues. Is &quot;new clearfix&quot;*/</span> </span><span id="L-2"><a name="L-2"></a><span class="nc">.clearfix</span><span class="nd">:after</span> <span class="p">{</span><span class="k">visibility</span><span class="o">:</span> <span class="k">hidden</span><span class="p">;</span><span class="k">display</span><span class="o">:</span> <span class="k">block</span><span class="p">;</span><span class="k">font-size</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span><span class="k">content</span><span class="o">:</span> <span class="s2">&quot; &quot;</span><span class="p">;</span><span class="k">clear</span><span class="o">:</span> <span class="k">both</span><span class="p">;</span><span class="k">height</span><span class="o">:</span> <span class="m">0</span><span class="p">;}</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c">/*for IE 6/7*/</span> </span><span id="L-5"><a name="L-5"></a><span class="nc">.clearfix</span> <span class="p">{</span><span class="k">display</span><span class="o">:</span> <span class="k">inline</span><span class="o">-</span><span class="k">block</span><span class="p">;}</span> </span><span id="L-6"><a name="L-6"></a><span class="nc">.clearfix</span> <span class="p">{</span><span class="n">zoom</span><span class="o">:</span> <span class="m">1</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
css, layout