实现的效果图
实现原理
1.两个三角形来实现右上角的样式
2.已报名文字通过旋转和定位来实现
<html>
<head>
<meta charset="utf-8">
<title>已报名三角形</title>
<link rel="stylesheet" href="./5.css">
</head>
<body>
<div class="big">
<div class="st">
<div class="green">
<span>已报名</span>
<div class="trigger">
</div>
</div>
</div>
</div>
</body>
</html>
body {
background-color: #333333;
}
.big {
position: relative;
width: 400px;
height: 200px;
background-color: #eee;
background-size: 50% 50%;
background-repeat: no-repeat;
margin: 100px auto;
}
.st {
position: absolute;
left: 300px;
}
.green {
position: relative;
color: #eee;
width: 0;
height: 0;
border-top: 100px solid green;
border-left: 100px solid transparent;
}
.green>span {
position: absolute;
top: -75px;
left: -60px;
transform: rotate(45deg);
}
.trigger {
position: absolute;
width: 0;
height: 0;
left: -50px;
top: -100px;
border-top: 50px solid #eee;
border-left: 50px solid transparent;
}