Anyone know of a surefire way to force child elements to stay in the border-radius of their parents?
Here is a js fiddle sample I'm working with: http://jsfiddle.net/fuego/qCNRZ/
Markup:
<div id="outer">
<div id="inner">
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
Nah nah nah<br/>
</div>
</div>
CSS:
#outer {
width: 300px;
background: red;
border-radius:20px;
}
#inner {
background:blue;
}
I simply want the container to appear blue now, but with the parents rounded edges. I updated the fiddle to reflect.
CSS Demo: border-radius Note: As with any shorthand property, individual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit , which would partially override existing definitions. Instead, the individual longhand properties have to be used.
If there are contents within the div that has the curved corners, you have to set overflow: hidden because otherwise the child div's overflow can give the impression that the border-radius isn't working.
Use the CSS border-radius property to add rounded corners to the table cells.
Based on your example it would suffice to add overflow:hidden
to your #outer
element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With