效果展示
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/8004878d4b9248470904fe8465b2ec10.png)
代码
<!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>
<style>
.cfx {
width: 200px;
height: 0;
position: relative;
border: 50px solid #f00;
border-right: 50px solid transparent;
}
.text {
position: absolute;
top: -18px;
font-size: 32px;
color: #185dff;
}
</style>
<body>
<div class="cfx">
<div class="text">666666</div>
</div>
</body>
</html>