html+css做的丝带标签
先上效果:
HTML:
<div class="tag">
<div class="tag-box">
<div class="tag-content-box">
<div class="tag-content">
<span class="tag-content-line"></span>
<span class="tag-content-text"> 2016.05.24 </span>
</div>
<div class="tag-tail top"></div>
<div class="tag-tail bottom"></div>
<div class="tag-tail below"></div>
</div>
</div>
</div>
CSS:
.tag {
width: 100%;
border-right: 1px solid #DDD;
-moz-border-radius: 4px 0px 0px 4px;
-webkit-border-radius: 4px 0px 0px 4px;
border-radius: 4px 0px 0px 4px;
float: left;
clear: both;
margin: 30px 0;
}
.tag-box {
width: 100%;
height: 50px;
position: relative
}
.tag-content-box {
position: absolute;
color: #792f2f;
top: 16px;
left: 6px;
border-left: solid 6px #f0807b;
}
.tag-content {
font-size: 14px;
line-height: 20px;
height: 20px;
padding: 5px 15px 5px 17px;
color: #ffffff!important;
background: rgba(255, 126, 121, 0.5);
}
.tag-content-line {
border-left: solid 1px #fff;
position: absolute;
padding: 100% 0;
left: 0;
top: 0;
}
.tag-content-text {
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.59);
}
.tag-tail {
width: 0;
height: 0;
border-left: 16px solid rgba(240, 128, 123, 0.74);
border-right: 0 none;
position: absolute;
right: -14px;
border-left-color: rgba(240, 128, 123, 0.74);
}
.tag-tail.top {
border-top: 0 solid transparent;
border-bottom: 16px solid transparent;
top: 0;
}
.tag-tail.bottom {
border-top: 16px solid transparent;
border-bottom: 0 solid transparent;
bottom: 0;
}
.tag-tail.below {
border-top: 0px solid transparent;
border-bottom: 10px solid transparent;
border-left: 0px solid transparent;
border-right: 6px solid #d15952;
top: 100%;
left: -6px;
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义