Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My final version: Demo <a href="http://dabblet.com/gist/3149345" rel="nofollow">http://dabblet.com/gist/3149345</a> (works in IE9+, Opera 10.5+, Chrome, FF, Safari)</p> <p>HTML structure:</p> <pre><code>&lt;div class="comment b"&gt; &lt;a href="#" class="img-wrapper"&gt;&lt;img src=""&gt;&lt;/a&gt; &lt;div class="comment-content"&gt; &lt;p&gt;&lt;!--a lot of text here--&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>First of all, I float the <code>.img-wrapper</code> to the left, give it a white background plus top right and bottom right border radius of <code>50%</code>. And then the image over it has black background.</p> <p>Then I use two pseudo-elements on the <code>.comment</code>. I give them both widths and heights equal to the <code>border-radius</code> used for <code>.comment</code> (<code>20px</code> in this case). I also give them <code>position: absolute</code> and set their <code>top</code> values to be equal to the height of <code>.img-wrapper</code> (<code>130px</code> in this case).</p> <p>I give the <code>:before</code> element a white background and the <code>:after</code> element a black background. I also give the <code>:after</code> element a 100% top left <code>border-radius</code> in order to achieve the same rounded corner effect under the image wrapper as well.</p> <pre><code>.comment { width: 500px; border-radius: 20px; padding:20px; margin: 5% auto; position: relative; background: #000; color: #fff; } .a { height: 90px; } .b:before, .b:after { top: 130px; left: 0; width: 20px; height: 20px; display: block; position: absolute; content: ''; } .b:before { background: #fff; } .b:after { border-radius: 100% 0 0 0; background: #000; } .img-wrapper { width: 130px; height: 130px; border-radius: 0 50% 50% 0; margin: -20px 20px 20px -20px; float: left; background: #fff; } .img-wrapper img { width: 120px; height: 120px; margin: 5px; border-radius: 50%; background: #000; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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