<!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>桃心</title>
</head>
<body>
<!-- 先制作一个盒子作为承载 -->
<div class="all">
<!-- 左边的盒子 -->
<div class="left">
</div>
<!-- 右边的盒子 -->
<div class="right">
</div>
</div>
</body>
</html>
css代码块:
/* 先去除页边距 */
*{
margin: 0px;
padding: 0px;
}
/* 设置总体页面的背景颜色 */
body{
background-color: black;
}
/* 设置承载盒子的大小颜色 */
.all{
width: 500px;
height: 500px;
background-color: white;
margin: 0 auto;
background-image: url(img/1.png);
margin-top: 130px;
}
/* 左边盒子开始 */
.left{
float: left; /*设置盒子向左变流动-便于两个盒子在同一行 */
width: 120px;
height: 200px;
background-color: red;
border-top-left-radius: 100px; /*设置盒子左上角变圆 */
border-top-right-radius: 100px; /*设置盒子右上角变圆*/
border-bottom-left-radius: 25px; /*设置盒子左下角变圆 */
margin-top: 130px;
margin-left: 150px;
transform: rotate(-45deg); /* 盒子旋转 */
}
.right{
float: left; /*设置盒子向左变流动-便于两个盒子在同一行 */
width: 120px;
height: 200px;
background-color:red;
border-top-left-radius: 100px; /*设置盒子左上角变圆 */
border-top-right-radius: 100px; /*设置盒子右上角变圆*/
border-bottom-right-radius: 25px; /*设置盒子左下角变圆 */
margin-top: 130px;
margin-left: -60px;
transform: rotate(45deg); /* 盒子旋转 */
visibility:visible;
}
