Skip to content

Commit ba4b7cc

Browse files
committed
css实现拐角丝带
1 parent a29320f commit ba4b7cc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>css实现拐角丝带</title>
6+
<style>
7+
.container {
8+
position: relative;
9+
border: 1px solid #ddd;
10+
min-height: 200px;
11+
overflow: hidden;
12+
}
13+
.container-ribbon {
14+
height: 24px;
15+
width: 206px;
16+
position: absolute;
17+
top: 32px;
18+
left: -64px;
19+
transform: rotate(-45deg);
20+
background-color: red;
21+
text-align: center;
22+
color: #fff;
23+
}
24+
</style>
25+
</head>
26+
<body>
27+
<div class="container">
28+
<!-- 丝带 -->
29+
<div class="container-ribbon">hot</div>
30+
<!-- 内容区 -->
31+
<div class="container-content">...</div>
32+
</div>
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)