css制作便签
CSS制作便签的方法
使用CSS可以轻松创建具有便签效果的样式,以下是一种常见的实现方式:
HTML结构
<div class="note">
<h3>便签标题</h3>
<p>便签内容文本...</p>
</div>
CSS样式

.note {
position: relative;
width: 200px;
padding: 15px;
margin: 20px;
background: #ffff88;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
transform: rotate(2deg);
font-family: 'Marker Felt', cursive;
}
.note::after {
content: "";
position: absolute;
bottom: 10px;
right: 10px;
width: 30px;
height: 30px;
background: linear-gradient(135deg, transparent 0%, transparent 50%, rgba(0,0,0,0.1) 50%);
}
便签变体设计
彩色便签
.note.yellow { background: #ffff88; }
.note.pink { background: #ffb6c1; }
.note.blue { background: #add8e6; }
卷角效果

.note.curl {
background: linear-gradient(135deg, transparent 25px, #ffff88 25px);
}
.note.curl::before {
content: "";
position: absolute;
top: 0;
right: 0;
width: 25px;
height: 25px;
background: linear-gradient(135deg, #ffff88 40%, #aaa 50%, #ccc 56%, #fff 70%);
}
动画效果
添加悬停动画可以让便签更生动:
.note:hover {
transform: rotate(0deg) scale(1.05);
box-shadow: 0 5px 10px rgba(0,0,0,0.3);
transition: all 0.3s ease;
}
响应式设计
确保便签在不同设备上显示良好:
@media (max-width: 600px) {
.note {
width: 80%;
transform: rotate(1deg);
}
}
这些CSS技术可以组合使用,创建出各种风格的便签效果,根据需求调整颜色、大小和装饰元素即可。






