圆的制作
- border-radius: 50% :百分比以自身宽高为基准
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.box1{
width: 200px;
height: 200px;
background-color: red;
margin: 0 auto;
border-radius: 50%;/*圆角半径*/
text-align: center;/*居中*/
line-height: 200px;
font-size: 48px;/*字体大小*/
}
</style>
</head>
<body>
<div class="box1">
1
</div>
</body>
</html>
单独一角改成圆
.box1{
width: 200px;
height: 200px;
background-color: red;
margin: 0 auto;
border-top-right-radius: 50%;/*右上圆角半径*/
border-bottom-left-radius: 50%; /*左下圆角半径*/
text-align: center;/*字体居中*/
line-height: 200px;
font-size: 48px;/*字体大小*/
}