1.圆角
在css3中 border-radius属性被用于创建圆角(圆角的4个值、3个值、2个值和1个值分别代表什么)
- 1:个值我们都知道就是代表4个角
- 2个值:第一个值代表左上角和右下角第二个值表示右上角和左下角
- 3个值: 第一个值为左上角, 第二个值为右上角和左下角,第三个值为右下角
- 4个值:则依次对应左上角、右上角、右下角、左下角(顺时针方向)
- 如果想要画圆把 border-radius值设置为50%即可
- 画椭圆加宽度就行
代码如下(除了椭圆其他代码都已注释):
<!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>
.div1 {
width: 400px;
height: 200px;
/* border-radius: 30px; */
/*顺序: 左上 右上 右下 左下 */
/* border-radius: 20px 30px 20px 40px; */
/*顺序:左上 右上和左下 右下 */
/* border-radius: 20px 30px 50px; */
border: 5px solid red;
/* 椭圆圆角 水平 、垂直*/
/* border-radius: 40px/80px; */
/* 画圆 */
/* border-radius: 50%; */
/* 画椭圆 加宽度就行*/
border-radius: 50%;
}
</style>
</head>
<body>
<div class="div1"></div>
</body>
</html>
效果:
2.css3盒子阴影
在css3中的 box-shadow属性为添加阴影属性
-
box-shadow(里面的值):水平位置 垂直位置 模糊距离 阴影尺寸(阴影大小 阴影颜色 内/外阴影)
-
说明:前面两个值必须写 模糊值不能为负数
-
内阴影是inset
-
如果想要设置多个值就要用逗号(英文)隔开
代码如下:
<!DOCTYPE html>
<html lang="en">
<