White corner showing on black box with Border-radius

前端 未结 4 1665
独厮守ぢ
独厮守ぢ 2021-01-04 07:27

I am getting a odd effect (currently in chrome). I have created my own overlay dialog box. which has a semi transparent background sitting on top of my website with a box on

4条回答
  •  心在旅途
    2021-01-04 07:59

    Since overflow: hidden; along with border-radius seems to cause some rendering inconsistencies in some engines (take a look at this), one should use border-radius on both the parent and the child elements to achieve rounded corners.

    As you have noticed, you still get some wierd results with extra pixels "shining" through. Just reduce the border-radius of the child (or the other way round) to compensate this.

    blockUI .overlay h1 {
        border-radius: 2px 2px 0 0;
    }
    

提交回复
热议问题