← Hubに戻る
CSSボタン チートシート
シンプルなボタン
.btn {
background: #4f8cff;
color: #fff;
border: none;
border-radius: 6px;
padding: 12px 32px;
font-size: 1.1em;
cursor: pointer;
transition: background 0.2s, transform 0.2s;
}
.btn:hover {
background: #2563eb;
transform: translateY(-2px) scale(1.04);
}
アウトラインボタン
.btn-outline {
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 6px;
padding: 12px 32px;
font-size: 1.1em;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
background: #4f8cff;
color: #fff;
}
シャドウ付きボタン
.btn-shadow {
background: #ff6ec4;
color: #fff;
border: none;
border-radius: 6px;
padding: 12px 32px;
font-size: 1.1em;
box-shadow: 0 4px 16px #ff6ec488;
cursor: pointer;
transition: box-shadow 0.2s, background 0.2s;
}
.btn-shadow:hover {
background: #ff3e9e;
box-shadow: 0 8px 24px #ff6ec4aa;
}
グラデーションボタン
.btn-gradient {
background: linear-gradient(90deg, #4f8cff, #ff6ec4);
color: #fff;
border: none;
border-radius: 6px;
padding: 12px 32px;
font-size: 1.1em;
cursor: pointer;
transition: opacity 0.2s;
}
.btn-gradient:hover {
opacity: 0.8;
}
アイコン付きボタン
.btn-icon {
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 6px;
padding: 12px 32px 12px 24px;
font-size: 1.1em;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: background 0.2s, color 0.2s;
}
.btn-icon:hover {
background: #4f8cff;
color: #fff;
}
丸型ボタン
.btn-round {
background: #4f8cff;
color: #fff;
border: none;
border-radius: 50%;
width: 48px;
height: 48px;
font-size: 1.5em;
cursor: pointer;
transition: background 0.2s;
}
.btn-round:hover {
background: #2563eb;
}
レインボーボタン
.btn-rainbow {
background: linear-gradient(90deg, #ff6ec4, #4f8cff, #6effc4, #ffe66e);
color: #fff;
border: none;
border-radius: 24px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
transition: filter 0.2s;
}
.btn-rainbow:hover {
filter: brightness(1.2) saturate(1.4);
}
ネオンボタン
.btn-neon {
background: #222;
color: #fff;
border: 2px solid #4f8cff;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
box-shadow: 0 0 8px #4f8cff, 0 0 24px #ff6ec4;
text-shadow: 0 0 8px #4f8cff, 0 0 24px #ff6ec4;
cursor: pointer;
transition: box-shadow 0.2s;
}
.btn-neon:hover {
box-shadow: 0 0 32px #ff6ec4, 0 0 64px #4f8cff;
}
グラスボタン
.btn-glass {
background: rgba(255,255,255,0.2);
color: #4f8cff;
border: 1.5px solid #4f8cff88;
border-radius: 12px;
padding: 12px 36px;
font-size: 1.1em;
backdrop-filter: blur(6px);
box-shadow: 0 2px 12px #4f8cff22;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-glass:hover {
background: rgba(79,140,255,0.15);
color: #2563eb;
}
シャドウ浮きボタン
.btn-float {
background: #fff;
color: #4f8cff;
border: none;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
box-shadow: 0 4px 16px #4f8cff33;
cursor: pointer;
transition: box-shadow 0.2s, transform 0.2s;
}
.btn-float:hover {
box-shadow: 0 8px 32px #4f8cff55;
transform: translateY(-4px) scale(1.04);
}
スライドボタン
.btn-slide {
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
position: relative;
overflow: hidden;
cursor: pointer;
transition: color 0.2s;
}
.btn-slide span {
position: relative;
z-index: 2;
}
.btn-slide::before {
content: '';
position: absolute;
left: -100%; top: 0;
width: 100%; height: 100%;
background: #4f8cff;
z-index: 1;
transition: left 0.3s;
}
.btn-slide:hover {
color: #fff;
}
.btn-slide:hover::before {
left: 0;
}
グラデーション枠ボタン
.btn-grad-outline {
background: #fff;
color: #4f8cff;
border: 2px solid transparent;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #4f8cff, #ff6ec4);
background-origin: border-box;
background-clip: padding-box, border-box;
cursor: pointer;
transition: color 0.2s, border-color 0.2s;
}
.btn-grad-outline:hover {
color: #ff6ec4;
border-color: #ff6ec4;
}
ドットボタン
.btn-dot {
background: #fff;
color: #4f8cff;
border: 2px dashed #4f8cff;
border-radius: 50px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-dot:hover {
background: #4f8cff;
color: #fff;
}
パルスボタン
.btn-pulse {
background: #4f8cff;
color: #fff;
border: none;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
box-shadow: 0 0 0 0 #4f8cff88;
animation: pulse 1.2s infinite;
transition: box-shadow 0.2s;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 #4f8cff88; }
70% { box-shadow: 0 0 0 16px #4f8cff00; }
100% { box-shadow: 0 0 0 0 #4f8cff00; }
}
アイコンラウンドボタン
.btn-icon-round {
background: #fff;
color: #ff6ec4;
border: 2px solid #ff6ec4;
border-radius: 50%;
width: 48px;
height: 48px;
font-size: 1.5em;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-icon-round:hover {
background: #ff6ec4;
color: #fff;
}
グローイングボタン
.btn-glow {
background: #4f8cff;
color: #fff;
border: none;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
box-shadow: 0 0 8px #4f8cff, 0 0 24px #ff6ec4;
transition: box-shadow 0.2s;
}
.btn-glow:hover {
box-shadow: 0 0 32px #ff6ec4, 0 0 64px #4f8cff;
}
3D押し込みボタン
.btn-3d {
background: linear-gradient(180deg, #4f8cff 60%, #2563eb 100%);
color: #fff;
border: none;
border-radius: 8px;
padding: 14px 38px;
font-size: 1.1em;
box-shadow: 0 6px 0 #2563eb, 0 8px 24px #4f8cff44;
cursor: pointer;
transition: transform 0.1s, box-shadow 0.1s;
}
.btn-3d:active {
transform: translateY(6px);
box-shadow: 0 0px 0 #2563eb, 0 2px 8px #4f8cff44;
}
波紋エフェクトボタン
.btn-ripple {
position: relative;
overflow: hidden;
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-ripple:hover {
background: #4f8cff;
color: #fff;
}
.btn-ripple .ripple {
position: absolute;
border-radius: 50%;
transform: scale(0);
animation: ripple 0.6s linear;
background: rgba(79,140,255,0.4);
pointer-events: none;
}
@keyframes ripple {
to {
transform: scale(3);
opacity: 0;
}
}
リボンボタン
.btn-ribbon {
position: relative;
background: #ff6ec4;
color: #fff;
border: none;
border-radius: 8px 8px 8px 8px;
padding: 12px 36px 12px 48px;
font-size: 1.1em;
cursor: pointer;
overflow: visible;
}
.btn-ribbon .ribbon {
position: absolute;
left: 0; top: 50%;
transform: translateY(-50%);
width: 28px; height: 28px;
background: #ffe66e;
border-radius: 8px 0 0 8px;
box-shadow: 0 2px 8px #ff6ec422;
}
タグ風ボタン
.btn-tag {
background: #fff;
color: #ff6ec4;
border: 2px solid #ff6ec4;
border-radius: 24px 24px 24px 4px;
padding: 12px 36px 12px 28px;
font-size: 1.1em;
position: relative;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-tag::before {
content: '';
position: absolute;
left: 12px; top: 50%;
transform: translateY(-50%);
width: 8px; height: 8px;
background: #ff6ec4;
border-radius: 50%;
}
.btn-tag:hover {
background: #ff6ec4;
color: #fff;
}
バッジ付きボタン
.btn-badge {
position: relative;
background: #4f8cff;
color: #fff;
border: none;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
}
.btn-badge .badge {
position: absolute;
top: 6px; right: 16px;
background: #ff6ec4;
color: #fff;
border-radius: 50%;
padding: 2px 8px;
font-size: 0.9em;
font-weight: bold;
box-shadow: 0 2px 8px #ff6ec422;
}
トグルボタン
.btn-toggle {
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-toggle.active {
background: #4f8cff;
color: #fff;
}
リフトアップボタン
.btn-lift {
background: #fff;
color: #4f8cff;
border: 2px solid #4f8cff;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
box-shadow: 0 2px 8px #4f8cff22;
cursor: pointer;
transition: box-shadow 0.2s, transform 0.2s;
}
.btn-lift:hover {
box-shadow: 0 12px 32px #4f8cff44;
transform: translateY(-8px) scale(1.06);
}
シャイン(光沢)ボタン
.btn-shine {
position: relative;
background: #4f8cff;
color: #fff;
border: none;
border-radius: 8px;
padding: 12px 36px;
font-size: 1.1em;
overflow: hidden;
cursor: pointer;
}
.btn-shine span {
position: relative;
z-index: 2;
}
.btn-shine::before {
content: '';
position: absolute;
left: -60%;
top: 0;
width: 60%;
height: 100%;
background: linear-gradient(120deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.2) 100%);
transform: skewX(-20deg);
z-index: 1;
transition: left 0.5s;
}
.btn-shine:hover::before {
left: 110%;
}
ステッカーボタン
.btn-sticker {
background: #ffe66e;
color: #ff6ec4;
border: 2px dashed #ff6ec4;
border-radius: 16px 4px 16px 4px;
padding: 12px 36px;
font-size: 1.1em;
box-shadow: 0 2px 8px #ff6ec422;
cursor: pointer;
position: relative;
transition: box-shadow 0.2s, transform 0.2s;
}
.btn-sticker:hover {
box-shadow: 0 8px 24px #ff6ec488;
transform: rotate(-2deg) scale(1.04);
}