<!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>
*{
margin:0;
padding:0;
}
.box{
width: 0;
height: 0;
border-top:100px solid transparent;
border-right: 50px solid skyblue;
border-bottom:0px solid blue;
border-left:0px solid green;
text-decoration:none;
}
.price{
width: 160px;
height: 24px;
/* 垂直居中 */
line-height: 24px;
border:1px solid red;
margin:0 auto;
}
.miaosha{
position:relative;
float: left;
width:90px;
height: 100%;
background-color: red;
text-align: center;
font-weight: 700;
color: white;
}
.miaosha i{
position: absolute;
width: 0;
height: 0;
right: 0px;
border-color: transparent #fff transparent transparent;
border-style: solid;
border-width: 24px 10px 0 0;
}
.origin {
font-size: 12px;
color: gray;
text-decoration: line-through;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="price">
<span class="miaosha">¥1650
<i></i>
</span>
<span class="origin">¥5650</span>
</div>
</body>
</html>
CSS三角做价格标签
最新推荐文章于 2022-10-21 11:06:00 发布