父DIV中的圆角不影响子DIV [英] Rounded Corners in Parent DIV not effecting Child DIVs

查看:250
本文介绍了父DIV中的圆角不影响子DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在尝试在CSS3中使用圆角(不是在IE中,不在乎如果它在那里工作),我有DIV,其中所有的内容,看起来很不错。我所遇到的问题是有儿童DIV没有被父母的圆角掩盖。我不是在寻找孩子继承圆角。我只是想让父内的任何内容不可见的地方,它被四舍五入,就好像它被掩盖。我尝试使用overflow:hidden;,但这似乎没有做的伎俩。

So, I'm experimenting with using rounded-corners in CSS3 (not in IE, don't care if it works there), and I have the DIV where all of my content lives looking quite nice. The problem I'm having is that there are child DIVs that are not getting "masked" by the parent's rounded corners. I'm not looking for the child to inherit the rounded-corners. I just want to have any content inside the parent to not be visible where it is rounded, as if it were masked. I tried using "overflow: hidden;", but that doesn't seem to do the trick.

有没有人有任何想法如何孩子的圆角容器DIV可以排序由父DIV掩码?如果它是任何用途,我使用position:absolute;对父DIV。

Does anyone have any ideas how the children of the rounded-cornered container DIV can be sorta masked by the parent DIV? If it's of any use, I'm using "position: absolute;" on the parent DIV. Not sure if that will make any difference.

谢谢!

推荐答案

尝试向父元素添加 overflow:hidden; 。这解决了我的问题。

Try adding overflow: hidden; to the parent element. This fixed the problem for me.

这篇关于父DIV中的圆角不影响子DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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