特定边框半径CSS [英] Specific Border Radius CSS

查看:44
本文介绍了特定边框半径CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个div,该div的左上角和右上角均具有圆角,但不包括底部两个角. -webkit-border-radius 的值是否可以让您仅在div的某些角上具有弯曲的边缘?

I want to create a div that has rounded corners on the top left and top right, but not not the bottom two corners. Is there a value of -webkit-border-radius that lets you have a curved edge only on certain corners of a div?

推荐答案

语法为:

border-radius: topleft topright bottomright bottomleft;

所以:

div {
  background: red;
  border-radius: 20px 20px 0 0;
  width: 100px;
  height: 100px;
}

<div></div>

这篇关于特定边框半径CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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