当前位置:网站首页>如何设置边框圆角
如何设置边框圆角
2022-08-09 15:04:00 【恁180】
设置圆角我们会用到border-radius属性
例如以下代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
width: 200px;
height: 100px;
background-color: #bfa;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>它的效果图是是一个宽200px 高100px 背景颜色是青色的的一个矩形。
border-radius 用来设置圆角
borde-top-right-radius 设置右上角的弧度
border-top-left-radius 设置左上角的弧度
border-bottom-left-radius 设置左小角的弧度
border-bottom-right-radius 设置右下角的弧度
例如我们设置上面的矩形右上角的弧度
.box {
width: 200px;
height: 100px;
background-color: #bfa;
border-top-right-radius: 20px;
}效果如图:
它的弧度就相当于以20px为半径的1/4圆
设置其它角的弧度也是一样
它的后面也可以跟多个值 例如4个值
.box {
width: 200px;
height: 100px;
background-color: #bfa;
border-radius:10px 20px 30px 40px;
}它的效果:
顺序是 左上 右上 右下 左下
例如3个值
.box {
width: 200px;
height: 100px;
background-color: #bfa;
border-radius:10px 20px 30px ;
}它的效果:
顺序是左上 (右上=左下) 右下
例如跟两个值:
.box {
width: 200px;
height: 100px;
background-color: #bfa;
border-radius: 20px 30px;
}效果如图:
顺序是(左上=右下)(右上=左下 )
一个值的话就是四个角都是这个值
那学了border-radius 我们怎么设置一个圆呢?其实很简单。
我们只需先设置一个正方形 然后将他的圆角都变成50%
.box {
width: 200px;
height: 100px;
background-color: #bfa;
border-radius: 20px 30px;
}效果如图:
那半圆怎么设置呢? 各位想一想。
边栏推荐
- Go语言基础(十二):并发编程
- Heap series_0x06: NT global flags and gflags.exe one page
- properties文件的读取和写入
- yum安装mariadb数据库之后启动时提示 Failed to start mariadb.service: Unit not found
- 7z解压软件(小巧好用)。百度云下载链接
- Win10 安装系统跳过创建用户,直接启用 administrator
- 2022.7.22FPGA学习总结:项目实践——按键消抖模块
- PhotoshopCS6视频教程学习笔记-基础部分之一
- 2022.7.18学习总结(Verilog HDL数字集成电路设计原理与应用)
- The practical skills Vim _5. Move quickly between files and documents
猜你喜欢
随机推荐
文件IO及其函数使用
数组指针的使用方法
2021深圳杯A题思路 火星探测器着陆控制方案
Ntdsutil 清除无效的辅域控制器DC
学编程的第八天
7z解压软件(小巧好用)。百度云下载链接
位运算相关:2的幂、翻转图像、颠倒二进制位、N皇后II、比特位计数 ...
qemu虚拟机模拟固件环境搭建
VRRP详解与配置实例
FFmpeg源码剖析-通用:ffmpeg_parse_options()
Win10 安装系统跳过创建用户,直接启用 administrator
动态规划套题:零钱兑换、完全平方数
聚集索引和非聚集索引
C语言知识细节点(一)
Go语言基础(十二):并发编程
2022年深圳杯建模A题思路: 破除“尖叫效应”与“回声室效应”,走出“信息茧房”
Mysql学习(二)
【QT】QLayout: Attempting to add QLayout “to ***“, which already has a layout的终极解决方法
JS字符串对象基础操作方法
Heap series_0x08: NT heap debug support_Discover now debug support (DPH)









