开发者

CSS border radius - child overlapping parent element

开发者 https://www.devze.com 2022-12-30 08:16 出处:网络
I have the following markup: http://www.webdevout.net/test?01开发者_Python百科1 As you can see, the \"li\" element is overlapping the rounded borders defined for the box.

I have the following markup: http://www.webdevout.net/test?01开发者_Python百科1 As you can see, the "li" element is overlapping the rounded borders defined for the box.

Is there a way to prevent this apart from applying the corner directly to the last "li"?

Thanks


You can move the background colour to .box and remove the border-bottom from last li:

.box {
    background-color: #E6E6E6;
}

#vmenu li:last-child a {
    border-bottom: none;
}

On a side note, you don't need the surrounding div, just add the .box class to the ul.

0

精彩评论

暂无评论...
验证码 换一张
取 消