CSS角半径显示背景颜色?

时间:2012-06-25 18:31:06

标签: css

CSS边框半径工作正常,但它现在显示白色背景。 (我更喜欢透明或灰色,类似于身体背景......)

problematic rounded corners...

CSS:

.window_header{
    width:600px;
    height:42px;
    background: #333 url("../img/bg-2.png") repeat;
    -webkit-border-top-left-radius: 8px;
    -webkit-border-top-right-radius: 8px;
    border-bottom:1px dotted #666;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3),inset 0 -4px 5px rgba(0, 0, 0, 0.2),inset 1px 0px 1px rgba(0, 0, 0, 0.7),inset -1px 0px 1px rgba(0, 0, 0, 0.7),inset 0 -2px 1px rgba(0, 0, 0, 0.5),inset 0 2px 6px rgba(255, 255, 255, 0.15),inset -2px 0 6px rgba(255, 255, 255, 0.15),inset 2px 0 6px rgba(255, 255, 255, 0.15);
}

4 个答案:

答案 0 :(得分:2)

白色应该从容器的背景“后面”应用border-radius到的那个。 也许尝试将border-radius应用于它。

答案 1 :(得分:2)

我建议将Border Radius应用于底层Element,这样该元素就会有圆角,而不是粗糙的白边。所以你不会看到白边。

-OR -

将整个元素编辑放在包含元素之前,使其位于白色背景的顶部并从那里开始。

答案 2 :(得分:0)

也许bg-2文件在该区域不透明?根据您用于创建图像的编辑器,它可能无法使其透明。

Max Gherkins的解释也是一个非常大的可能性。 :)

答案 3 :(得分:0)

背景:#333 url(“../ img / bg-2.png”)重复;

您的背景图片不透明。如果它是“扁平的PNG”,请确保背景是“透明的”而不是“白色”。