Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border-radius bleeding

I want to give border-radius to a <nav> in which all the <a> have an image has background, but the image keeps going outside the border-radius. Why is that?

like image 467
Enrique Moreno Tent Avatar asked Apr 13 '11 16:04

Enrique Moreno Tent


3 Answers

To fix this in all browsers you should use:

-moz-background-clip: padding; 
-webkit-background-clip: padding-box;
background-clip: padding-box;

I found the answer here

like image 126
tgandrews Avatar answered Oct 18 '22 03:10

tgandrews


Add:

-webkit-background-clip: padding-box;

To fix this in Webkit.

like image 4
Rich Bradshaw Avatar answered Oct 18 '22 03:10

Rich Bradshaw


I had a problem with a bootstrap panel border or background bleeding to a HTML header <h> element above the bootstrap panel. The <h> element has class="page-header" and is contained in a div element with class="col-lg-12". The answers here and in other places didn't work for me.

What worked was adding this to the panels CSS class:

overflow:hidden;

I got the direction from here from Carol's answer.

Edit:

This caused another problem for me. I had Dropdown controls in the panel and the overflow:hidden; caused the dropdowns to be cut off and not displayed fully.

The dropdowns are contained in div elements with Bootstrap col-lg classes. I added style="position: inherit" to those div elements containing the dropdowns and that solved the problem.

The solution to that problem I found here.

Additional Option:

I added 3 or 4 <br/> elements before the div tag that was bleeding and that solved the bleeding problem without any bad side effects.

like image 2
Dov Miller Avatar answered Oct 18 '22 03:10

Dov Miller