Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

如何让子div不覆盖父div的border-radius?

<div style="border-radius: 5px;">
    <div>
    </div>
</div>

现在这样父是圆角的,但是子div高度撑满的话会变成方的,有什么方法可以方便的解决呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

两个方案

<div style="border-radius: 5px;overflow: hidden;">
    <div>
    </div>
</div>
<div style="border-radius: 5px;">
    <div style="border-radius: 5px;">
    </div>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...