Rendering overlay to div with border radius and overflow: hidden (Chrome only)

Fiddle here: https://jsfiddle.net/mengma/8k5pekrr/1/

This problem is Chrome only - overlay won't cover the whole screen. Removing either the border-radius or overflow css will not have this issue. Any idea to by pass it? Seems to be a bug with latest Chrome (not seeing it before)

 <div class="dialog">
     <div>
       dialog <a href="http://google.com">click</a>
     </div>
     <div class="fadeMe"></div>
  </div>

    div.dialog {
        width: 50px;
        height: 50px;
        position: absolute;
        top: 20px;
        border-radius: 4px;
        border: none;
        left: 20px;
        z-index: 12;
        border: solid 1px #000;
        overflow: hidden;
    }


    div.fadeMe {
        opacity: 0.5;
        background: #ccc;
        width: 100%;
        height: 100%;
        z-index: 10;
        top: 0;
        left: 0;
        position: fixed;
    } 


I was experiencing the same issue. I discovered that adding a transparent border to your dialog that is larger than your border-radius will fix it.

div.dialog { border: solid 5px transparent; }

In your case, it will replace your black 1px border, which also may not be desirable.

链接地址: http://www.djcxy.com/p/75532.html

上一篇: 在换行时,缩进DIV文本的最佳方式是什么?

下一篇: 使用边框半径和溢出渲染叠加到div:隐藏(仅限Chrome)