一起使用 border-radius 和 box-shadow (CSS) [英] Using border-radius and box-shadow together (CSS)

查看:128
本文介绍了一起使用 border-radius 和 box-shadow (CSS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我知道这些属性都没有被完全支持,但我还是在使用它们:P

Ok, I know neither of these properties are completely supported yet, but I'm using them anyway :P

当我添加border-radius和box-shadow(有和没有vendor前缀)时,border-radius的半径对box-shadow是不透明的.示例:http://cndg.us/3f41a0

When I add a border-radius and box-shadow (with and without vendor prefixes), the radius of the border-radius is not transparent to the box-shadow. Example: http://cndg.us/3f41a0

这可以解决吗?我还注意到 -webkit-box-shadow 在隐藏 div 方面存在一些问题.

Is this possible to fix? I've also noticed that -webkit-box-shadow has some issues with hidden divs.

推荐答案

可以在这里查看:http://jsfiddle.net/Zw4QA/1/

我认为您的 div 中有一个带有圆形编码器的元素.您必须将角应用于此元素.目前,除非您在 CSS 中指定,否则父元素上的圆角不适用于子元素.

i think you have a element inside your div with the rounded corders. You have to apply the corners to this element to. At the moment rounded corners on the parent element will not apply to the children unless you specify it in your CSS.

要了解更多 CSS3 魔法,请查看此链接:http://css3please.com/

for more CSS3 magic check this link: http://css3please.com/

请注意,每个浏览器都有自己处理阴影和边框半径的方式http://thany.nl/apps/boxshadows/

这篇关于一起使用 border-radius 和 box-shadow (CSS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆