简体   繁体   English

圆角隐藏隐藏溢出+变换(在Firefox和Safari中可以,在Chrome和Opera中不可以)

[英]Rounded corner hide overflow + transform (Ok in Firefox & Safari, not in Chrome nor Opera)

I try to make rounded-corner of a div mask the content of its children. 我尝试使div蒙版的舍入角变为其子元素的内容。 I did it thank to this question , but it doesn't work when the children is transformed. 感谢这个问题 ,我这样做了,但是当孩子们变身时,它不起作用。

So this http://jsfiddle.net/ut2DW/ works well in Firefox and Safari (!), but not in Chrome nor Opera, unless we remove the transforms property (and adjust margins) : 因此,此http://jsfiddle.net/ut2DW/在Firefox和Safari(!)中效果很好,但在Chrome或Opera中却不能,除非我们删除了transforms属性(并调整了边距):

CSS (more in JSFiddle) CSS(更多信息请参见JSFiddle)

div {
    position: absolute;
}

a {
    display: block;
    overflow: hidden;
    -webkit-border-radius: 0 0 20px 0;
            border-radius: 0 0 20px 0;
}

span {
    display: block;
    transform: rotate(45deg);
}

HTML 的HTML

<div>
    <a href="#">
        <span></span>
    </a>
</div>

How can I make it works in (at least) Chrome? 如何使它至少在Chrome中工作? (Oh please, I don't wanna make an image!) (哦,拜托,我不想拍张照片!)

Thanks! 谢谢!

I guess it is due the transform: rotate(45deg); 我猜这是由于transform: rotate(45deg);

I don't know why it doesn't work too.. If you remove it works as you desire.. 我不知道为什么它也不起作用。

I suggest you to add a background image instead of the rotate 我建议您添加背景图片而不是旋转

span {
    display: block;
    margin: 22px 0 0 22px;
    width: 100px;
    height: 100px;
    background: #000 url(../img/black-triangle.png) no-repat;
}​

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

相关问题 如何使CSS3圆角隐藏Chrome / Opera中的溢出 - How to make CSS3 rounded corners hide overflow in Chrome/Opera Chrome,IE,Opera,Safari上的iFrame溢出x错误,但Firefox上没有 - iFrame overflow-x BUG on Chrome, IE, Opera, Safari but not on Firefox 对角溢出滚动不适用于Chrome和Opera - Diagonal overflow scroll not working on chrome nor opera 我的简单Javascript代码可在Safari上运行,但不能在Chrome,Firefox或Opera上运行,这怎么了? - My simple Javascript code is working on Safari, but not Chrome, Firefox nor Opera, Whats wrong? 代码可在Chrome,Firefox和Safari中运行,但不能在IE或Opera中运行 - Code working in Chrome, Firefox and Safari but not in IE or Opera 样式显示在 Firefox、Opera、Safari 中不起作用 -(IE7 正常) - Style display not working in Firefox, Opera, Safari - (IE7 is OK) CSS 在 Chrome 和 Edge 中转换正常,但在 Firefox 中很难看 - CSS transform ok in Chrome and Edge but ugly in Firefox 如何转换CSS代码在Safari,Opera和Chrome中具有支持? - How to transform css code to have support in Safari , Opera and Chrome? Chrome圆角CSS? - Chrome Rounded Corner css? 在chrome和opera上加载网站,但在firefox和safari上部分加载 - Site loading on chrome and opera but partially loading on firefox and safari
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM