Note that there are some explanatory texts on larger screens.

plurals
  1. POChild breaking out of parent rounded corners in Safari
    primarykey
    data
    text
    <p>This is my problem: I want to make a parent div round using ronded corners, and I want a child of that element (with a colored background) to remain square, but I don't want the corners of the square to point outside the round parent. This is not that difficult to fix in most browsers, I simply add overflow:hidden to the parent and <em>viola</em>. But, in Safari that fix does not work - the square corners of the child points out of the round parent. So my question is, is there a way to get rounded corners on a parent to affect a child in Safari?</p> <p>There are two obvious workarounds, but none of them applies in this case:</p> <ul> <li>The child must fill up the entire space of the parent, so adding a padding to the parent (as mentioned <a href="https://stackoverflow.com/questions/5277403/rounded-corners-in-parent-div-not-effecting-child-divs">here</a>) is not an option.</li> <li>Neither can I add rounded corners to the child since the child is resized by javascript and used as a status indicator, and therefore needs to be square.</li> </ul> <p>Here is a jsFiddle of my code: <a href="http://jsfiddle.net/henrikandersson/4Lnbt/" rel="nofollow noreferrer">http://jsfiddle.net/henrikandersson/4Lnbt/</a></p> <p>This is the result in Chrome (left) and Safari (right):</p> <p><img src="https://i.stack.imgur.com/qUPAv.png" alt="enter image description here"><img src="https://i.stack.imgur.com/Fi7Bo.png" alt="enter image description here"></p> <p><strong>Update:</strong> I'm running Safari 5.1.7 in both OS X and Windows, same result.</p>
    singulars
    1. This table or related slice is empty.
    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. 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