如何仅使用CSS设置某个角的边界半径 [英] How to set border radius of some corner only with CSS

查看:16
本文介绍了如何仅使用CSS设置某个角的边界半径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上所示,我可以只给顶部半径而不是底部半径吗?有时不给顶部半径吗?

As shown above, can I give a radius to the top parts only and not to bottom or sometimes to bottom not to top?

有什么想法只将边界半径赋予一个角吗?

And is there any idea to give border radius to one corner only?

推荐答案

border-radius:top-left右上角右下-右下角

div{
    width: 100px;
    height: 30px; 
    background: black;
    border-radius: 8px 8px 0 0
}

演示

DEMO

这篇关于如何仅使用CSS设置某个角的边界半径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆