[CSS]アイデアが面白い!画像無しで、かわいいデザインのラベルをスタイルシートで実装するテクニック

ペロっとかぶさっているようなかわいいデザインのラベルを画像無し、CSSで実装したテクニックを紹介します。

カード状のコンテンツにも画像に使っても面白そうです。

デモのキャプチャ

実際のデモは、下記ページでご覧ください。
テキストを変更したり、スタイルシートでサイズやカラーなどを変更することもできます。

デモのキャプチャ

Label Overlay

実装は、こんな感じ。

HTML

ラベルは画像無し、spanを2つ使用して実装しています。

[html]

ラベル

[/html]

CSS

spanの:before, :afterを使用して、かわいいラベルをスタイルします。

[css]
.product {
width: 300px;
font-family: sans-serif;
margin: 2%;
}

.product-image {
background: #e9e9e9;
margin-bottom: 10px;
position: relative;
min-height: 250px;
}

.onsale-section {
position: absolute;
top: -6px;
right: 15px;
}

.onsale-section:after {
position: absolute;
content: '';
display: block;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 6px solid #6ec5d5;
}

.onsale {
position: relative;
display: inline-block;
text-align: center;
color: #fff;
background: #6ec5d5;
font-size: 14px;
line-height: 1;
padding: 12px 8px 6px;
border-top-right-radius: 8px;
width: 84px;
text-transform: uppercase
}

.onsale:before,
.onsale:after {
position: absolute;
content: '';
display: block;
}

.onsale:before {
background: #6ec5d5;
height: 7px;
width: 6px;
left: -6px;
top: 0;
}

.onsale:after {
background: #96a0a2;
height: 7px;
width: 8px;
border-radius: 8px 8px 0 0;
left: -8px;
top: 0;
}
[/css]

sponsors

top of page

©2026 coliss