Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Media Object clearfix not working
    text
    copied!<p>Using the OOCSS media object from N. Sullivan. I modified the original css to remove overflow hidden and replace it with the micro-clearfix. The problem I'm running into is when I try to nest the media objects, the nested media object doesn't clear its float. I am trying to avoid overflow: hidden;</p> <p>Take a look: <a href="http://codepen.io/anon/pen/kDpLr" rel="nofollow">http://codepen.io/anon/pen/kDpLr</a></p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Media Object&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="media"&gt; &lt;a href="http://twitter.com/stubbornella" class="img"&gt; &lt;img src="http://stubbornella.com/profile_image.jpg" height="200" width="200" alt="me" /&gt; &lt;/a&gt; &lt;div class="bd"&gt; Here is some text inside the media object. Here is some text inside the media object. &lt;/div&gt; &lt;/div&gt; &lt;div class="media"&gt; &lt;a href="http://twitter.com/stubbornella" class="img"&gt; &lt;img src="http://stubbornella.com/profile_image.jpg" alt="me" height="200" width="200" /&gt; &lt;/a&gt; &lt;div class="bd"&gt; &lt;h2&gt;Headline&lt;/h2&gt; &lt;p&gt;Here is some text inside the media object. Here is some text inside the media object. Here is some text inside the media object.&lt;/p&gt; &lt;div class="media"&gt; &lt;a href="http://twitter.com/stubbornella" class="img"&gt; &lt;img src="http://stubbornella.com/profile_image.jpg" alt="me" /&gt; &lt;/a&gt; &lt;div class="bd"&gt; Here is some text inside the media object. &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <pre><code>/* ====== media ====== */ .media { margin:10px; border: 1px solid red; @extend %clearfix; } .bd { @extend %clearfix; } .media .img { float: left; margin-right: 10px; border: 1px solid #ddd; } .media .img img { display:block; } .media .img-right { @extend %clearfix; float:right; margin-left: 10px; } %clearfix { &amp;:before, &amp;:after { content: " "; display: table; } &amp;:after { clear: both; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload