CSS 角落緞帶產生器
設計角落標籤,自訂文字、位置、摺角與陰影。
css-ribbon-generator本機處理
正在啟用本機工具…
工具設定
設定只留在本頁。重新載入後會恢復預設值。
功能參考查閱日期 2026-11-21 · ZeroServer
即時預覽與匯出
CSS
.ribbon-wrap {
position: relative;
overflow: hidden;
min-block-size: 90px;
min-inline-size: 90px;
}
.corner-ribbon {
position: absolute;
top: 0;
right: 0;
width: 90px;
height: 90px;
color: #ffffff;
font-size: 13px;
font-weight: 700;
filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35));
}
.corner-ribbon::before {
content: "";
position: absolute;
inset: 0;
background: #b91c1c;
clip-path: polygon(0 0, 31% 0, 100% 69%, 100% 100%);
transform: scale(1, 1);
z-index: 1;
}
.corner-ribbon::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(rgb(0 0 0 / .35), rgb(0 0 0 / .35)), #b91c1c;
clip-path: polygon(0 0, 14% 0, 8% 12%, 95% 90%, 100% 91%, 100% 100%, 87% 99%, 0 13%);
transform: scale(1, 1);
}
.ribbon-caption {
position: absolute;
top: 42%;
left: 58%;
transform: translate(-50%, -50%) rotate(45deg);
z-index: 2;
max-width: 90%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
}HTML
<div class="ribbon-wrap">
<span class="corner-ribbon"><span class="ribbon-caption">特價</span></span>
<p>卡片內容</p>
</div>如何使用這個工具
選擇預設或修改設定,查看即時預覽,再複製或下載樣式,以及可用的標記。
不適合用在什麼情況
請在實際使用匯出樣式的元件驗證色彩對比、位置及瀏覽器行為。