简体   繁体   English

使用边界半径时边界被切断?

[英]Border is cutting off when using border-radius?

I have an image which has a 5px border around it and I wanted to round the corners of both the image and the border, but in webkit the image remained rectangular whereas the corners of the border were rounded.我有一个图像,它周围有一个 5px 的边框,我想把图像和边框的角都修圆,但在 webkit 中,图像保持矩形,而边框的角是圆角。 As a result, the image overlapped the border and created what looks like a gap between the lines of the border at each corner.结果,图像与边界重叠,并在每个角的边界线之间创建了一个看起来像间隙的东西。

I'd like it to look like this http://jsfiddle.net/rmi14/HWDtx/19/ , but on webkit, the white background is rectangular and ends up overlapping some of the light blue border and cutting it off.我希望它看起来像这样http://jsfiddle.net/rmi14/HWDtx/19/ ,但在 webkit 上,白色背景是矩形的,最终与一些浅蓝色边框重叠并将其切断。

You have to use the overflow property for your div as it is showed in this fiddle你必须为你的div使用overflow属性,因为它在这个小提琴中显示

Regards.问候。

because the content angles overflows the rounded borders of the container angles因为内容角度溢出容器角度的圆形边框

you can use:您可以使用:

border-radius: ...
overflow: hidden; /*add this*/

to cut off the angles of the content that overflows切断溢出的内容的角度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM