How to make CSS3 rounded corners hide overflow in Chrome/Opera

后端 未结 13 1721
无人及你
无人及你 2020-11-22 09:10

I need round corners on a parent div to mask content from its childen. overflow: hidden works in simple situations, but breaks in webkit based browsers and Oper

相关标签:
13条回答
  • 2020-11-22 10:00

    Here look at how I done it; Jsfiddle

    With the Code I put in, I managed to get it working on Webkit (Chrome/Safari) and Firefox. I don't know if it works with the latest version of Opera. Yes it does work under the latest version of Opera.

    #wrapper {
      width: 300px; height: 300px;
      border-radius: 100px;
      overflow: hidden;
      position: absolute; /* this breaks the overflow:hidden in Chrome/Opera */
    }
    
    #box {
      width: 300px; height: 300px;
      background-color: #cde;
      border-radius: 100px;
      -webkit-border-radius: 100px;
      -moz-border-radius: 100px;
      -o-border-radius: 100px;
    }
    
    0 讨论(0)
提交回复
热议问题