html - Chrome 错误中的边界半径?

标签 html css google-chrome webkit border

我对 chrome 中的 border-radius 有疑问 这是我的代码:

img{
border-radius: 24px;
border: 2px solid #c7c7c7;                 
-moz-border-radius:24px; 
-webkit-border-radius: 24px;
}

在 mozzila 上它工作正常,但在 chrome 上它看起来很有趣...... 在 mozzila 上,我可以看到一个圆圈与我的图像接壤,但在 chrome 上,圆圈裁剪了边界,我只能看到直线

截图:http://postimage.org/image/27turq0mc/

你能帮忙吗?

最佳答案

这可能是一个 chrome 错误。一个解决方案可能是用 div 包装 img 并制作以下​​ css:

img{                
    -moz-border-radius:24px; 
    -webkit-border-radius: 24px;
    border-radius: 24px;
    display:block;
}
div {
    border: 2px solid #c7c7c7; 
    border-radius: 24px;
    -webkit-border-radius: 24px;
    width:40px; /* the width of image */
    height:40px; /* the height of image */
}

演示: http://jsfiddle.net/EnmMp/1/

关于html - Chrome 错误中的边界半径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7739708/

相关文章:

javascript - 当 contenteditable=true 时选择文本将复制样式为 user-select=none 的节点文本;

javascript - 尝试声明接口(interface)时出现 Google Chrome WebUSB API 错误

php - 当用户单击循环内的按钮时创建 session 变量

html - 如何使用 HTML Canvas 绘制圆角矩形?

javascript - textarea.val() 设置和获取

php - "Inactive Wrapper"创建大量空白

html - 如何在表格 html 的 td 内给出边距?

javascript - 溢出-x : hidden breaks smooth scroll

html - Chrome 和 Firefox 上的 CSS3 Transitions 在 Optimus 或 Intel IGP 配置中表现不佳。怎么修?

javascript - 是否有一种方法可以重写 JavaScript 对象来控制 console.log 显示的内容?