おしゃれなCSSボタンデザイン集!コピペで簡単!実務ですぐ使えるホバーアニメーション付き最新版コード
ホームページ・WEBサイト制作に役立つ、おしゃれで実用的なCSSボタンを多数紹介しています。すべてコピペで簡単に使え、ホバーアニメーション付きのコードも豊富に掲載。ぜひブックマークやお気に入り登録していつでもご活用ください。
※コード画面の右上にあるコピーボタンをクリックするとコピーできます。HTMLとCSSの各数値(ボタンの高さや幅、フォントサイズや色)を任意で調整してみてください。
✅ 線が美しいボタン
HTML
<a href="#" class="btn001">詳細はコチラ</a>CSS
.btn001 {
    position: relative;
    margin: 0 auto; /* 画面の中央寄せ */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 240px; /* ボタンの幅 */
    height: 60px; /* ボタンの高さ */
    color: #776342; /* テキスト色 */
    background-color: #fff; /* ボタン背景色 */
    border: 1px solid #776342; /* 枠線 */
    border-radius: 100px; /* 角の丸み */
    font-size: 14px; /* フォントサイズ */
}
.btn001::before, .btn001::after {
    content: '';
    position: absolute;
    display: block;
    width: 18px; /* 隠す線の長さ */
    height: 3px; /* 隠す線の太さ */
    background-color: #fff; /* ボタン背景色と同色 */
    pointer-events: none;
    transition: all 0.3s ease;
}
.btn001::before {
    top: -1px;
    left: 25px;
}
.btn001::after {
    bottom: -1px;
    right: 25px;
}
/* ホバーアニメーション */
.btn001:hover::before, .btn001:hover::after {
    width: 120px; /* 隠す線の長さ */
}✅ 文字とおしゃれ矢印付きボタン
HTML
<a href="#" class="btn002">
    詳細はコチラ<span class="btn002-arrow"></span>
</a>CSS
.btn002 {
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* 文字と矢印の余白 */
    width: 100%;
    max-width: 240px;
    height: 60px;
    color: #776342;
    background-color: #fff;
    border: 1px solid #776342;
    border-radius: 100px;
    font-size: 14px;
}
.btn002-arrow {
    position: relative;
    top: 3px;
    display: inline-block;
    width: 20px;
    height: 1px;
    background-color: #776342;
    transition: all 0.3s ease;
}
/* 矢印 */
.btn002-arrow::before {
    content: '';
    position: absolute;
    right: 0;
    display: inline-block;
    width: 8px;
    height: 1px;
    background-color: #776342;
    transform-origin: top right;
}
.btn002-arrow::before {
    top: 0;
    transform: rotate(40deg);
}
/* ホバーアニメーション */
.btn002:hover .btn002-arrow {
    width: 34px;
}✅ 背景色が左から伸るボタン
HTML
<a href="#" class="btn003">
  <span class="btn003-text">詳細はコチラ</span>
</a>CSS
.btn003 {
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 240px;
    height: 60px;
    background-color: #776342;
    border: 1px solid #776342;
    border-radius: 100px;
    overflow: hidden;
}
.btn003-text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: #fff;
    transition: all 0.4s ease;
}
/* 伸びてくる背景 */
.btn003::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: right;
    transition: all 0.6s ease;
    transition-property: transform;
}
/* ホバーアニメーション */
.btn003:hover .btn003-text {
    color: #776342;
}
.btn003:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}✅ 文字が上下に切り替わるボタン
HTML
<a href="#" class="btn004">
    <span>詳細はコチラ</span>
    <span>詳細はコチラ</span>
</a>CSS
.btn004 {
    position: relative;
    margin: 0 auto;
    display: block;
    width: 100%;
    max-width: 240px;
    height: 60px;
    background-color: #fff;
    border: 1px solid #776342;
    border-radius: 100px;
    overflow: hidden;
}
.btn004 span {
    position: absolute;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-size: 14px;
    color: #776342;
    text-align: center;
    transition: all 0.6s ease; 
}
.btn004 span:nth-child(1) {
    top: 0;
}
.btn004 span:nth-child(2) {
    top: 100%;
}
/* ホバーアニメーション */
.btn004:hover span:nth-child(1) {
    top: -100%;
}
.btn004:hover span:nth-child(2) {
    top: 0;
}✅ 右端の矢印だけ動くボタン
HTML
<a href="#" class="btn005">
    詳細はコチラ<span class="btn005-arrow"></span>
</a>CSS
.btn005 {
    position: relative;
    margin: 0 auto;
    padding-left: 12px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 240px;
    height: 60px;
    color: #776342;
    background-color: #fff;
    border-bottom: 1px solid #776342;
    font-size: 14px;
    transition: all 0.3s ease;
}
/* 矢印 */
.btn005-arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-block;
    width: 15px;
    height: 1px;
    background-color: #776342;
    pointer-events: none;
    transition: all 0.4s ease;
}
.btn005-arrow::before, .btn005-arrow::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    display: inline-block;
    width: 6px;
    height: 1px;
    background-color: #776342;
    transform-origin: top right;
}
.btn005-arrow::before {
    transform: rotate(40deg);
}
.btn005-arrow::after {
    width: 7px;
    transform: rotate(-40deg);
}
/* ホバーアニメーション */
.btn005:hover {
    opacity: 0.6;
}
.btn005:hover .btn005-arrow {
    right: 5px;
}✅ 下線が伸びるプラス付きボタン
HTML
<a href="#" class="btn006">
    詳細はコチラ<span class="btn006-plus"></span>
</a>CSS
.btn006 {
    position: relative;
    margin: 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 240px;
    height: 60px;
    color: #776342;
    background-color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}
.btn006::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    display: block;
    background-color: #ccc;
}
.btn006::after {
    content: ''; /* 要素に内容を追加 */
    position: absolute; /* 絶対位置指定 */
    bottom: 0; /* 要素の下端からの距離 */
    left: 0; /* 要素の左端からの距離 */
    z-index: 1;
    width: 100%;
    height: 1px; /* 下線の高さ */
    background-color: #776342; /* 下線の色 */
    transform: scale(0, 1); /* 下線を横方向に0倍、縦方向に1倍に変形(非表示) */
    transform-origin: right top; /* 変形の原点を右上に指定 */
    transition: transform 0.6s; 
}
/* プラスマーク */
.btn006-plus {
    position: absolute;
    top: 50%;
    right: 0;
    width: 15px;
    height: 1px;
    display: inline-block;
    background-color: #776342;
}
.btn006-plus::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    width: 15px;
    height: 1px;
    background-color: #776342;
    transform: rotate(-90deg);
    transition: all 0.4s;
}
/* ホバーアニメーション */
.btn006:hover::after {
    transform-origin: left top; /* 変形の原点を左上に指定 */
    transform: scale(1, 1); /* 下線を横方向に1倍、縦方向に1倍に変形(表示) */
}
.btn006:hover .btn006-plus::before {
    transform: rotate(0);
}✅ 可愛い影付きボタン
HTML
<a href="#" class="btn007">詳細はコチラ</a>CSS
.btn007 {
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 280px;
    height: 60px;
    color: #776342;
    background-color: #f4f0e8;
    border-radius: 100px;
    font-size: 14px;
    box-shadow: 5px 5px 0 0 #776342;
    transition: all 0.3s ease;
}
.btn007::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    width: calc(100% - 18px);
    height: calc(100% - 16px);
    border: 2px dotted #776342;
    border-radius: 100px;
}
/* ホバーアニメーション */
.btn007:hover {
    color: #f9ab2d;
    box-shadow: initial;
}✅ テキストと三角矢印ボタン
HTML
<div class="btn008">
    <a href="#" class="btn008-btn">
        <span class="btn008-text">詳細はコチラ</span>
        <span class="btn008-triangle"></span>
    </a>
</div>CSS
.btn008 {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn008-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.btn008-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 180px;
    height: 50px;
    font-size: 14px;
    color: #fff;
    background-color: #776342;
    border: 1px solid #776342;
    border-radius: 6px;
    transition: all 0.3s ease;
}
.btn008-triangle {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-block;
    background-color: #776342;
    border: 1px solid #776342;
    border-radius: 6px;
    transition: all 0.3s ease;
}
/* 三角矢印 */
.btn008-triangle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid #fff;
    border-right: 0;
    transition: all 0.3s ease;
}
/* ホバーアニメーション */
.btn008-btn:hover .btn008-text {
    color: #776342;
    background-color: #fff;
}
.btn008-btn:hover .btn008-triangle {
    color: #776342;
    background-color: #fff;
}
.btn008-btn:hover .btn008-triangle::before {
    border-left: 12px solid #776342;
}✅ テキストと丸い矢印ボタン
HTML
<div class="btn009">
    <a class="btn009-btn" href="#">
        詳細はコチラ
        <span class="btn009-arrow"><span></span></span>
    </a>
</div>CSS
.btn009 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn009-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #776342;
}
/* 丸みのある矢印 */
.btn009-arrow {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #776342;
    border-radius: 50%;
    overflow: hidden;
}
.btn009-arrow span {
    position: absolute;
    top: calc(50% - 1px);
    left: calc(50% - 12px);
    width: 16px;
    height: 2px;
    display: inline-block;
    background-color: #776342;
}
.btn009-arrow span::before {
    content: '';
    position: absolute;
    top: calc(50% - 6px);
    right: -8px;
    width: 10px;
    height: 10px;
    display: inline-block;
    border-top: 2px solid #776342;
    border-right: 2px solid #776342;
    border-radius: 0 5px 0 0;
    transform: rotate(45deg);
}
/* ホバーアニメーション */
.btn009-btn:hover .btn009-arrow span {
    animation: arrow-loop 0.6s ease-in-out forwards;
}
@keyframes arrow-loop {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    40% {
        transform: translateX(110%);
        opacity: 0;
    }
    41% {
        transform: translateX(-110%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}✅ 矢印が一回転するボタン
HTML
<a class="btn010" href="#">
    詳細はコチラ
    <span class="btn010-arrow">
        <span class="arrow arrow01"></span>
        <span class="arrow arrow02"></span>
    </span>
</a>CSS
.btn010 {
    position: relative;
    margin: 0 auto;
    padding-left: 20px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 240px;
    height: 60px;
    color: #776342;
    background-color: #fff;
    border-radius: 100px;
    border: 1px solid #776342;
    font-size: 14px;
    transition: all 0.3s ease;
}
/* 矢印全体を包む枠 */
.btn010-arrow {
    position: absolute;
    top: calc(50% - 10px);
    right: 12px;
    display: inline-block;
    width: 30px;
    height: 20px;
    overflow: hidden;
}
/* 基本の矢印バー */
.btn010-arrow .arrow {
    position: absolute;
    top: 50%;
    left: calc(50% - 11px);
    width: 20px;
    height: 1px;
    background-color: #776342;
    transform: translateY(-50%);
    opacity: 1;
}
/* 矢印先端(→) */
.btn010-arrow .arrow::after {
    content: '';
    position: absolute;
    top: calc(50% - 3px);
    right: 0px;
    width: 6px;
    height: 6px;
    border-top: 1px solid #776342;
    border-right: 1px solid #776342;
    transform: rotate(45deg);
}
/* 初期位置調整 */
.btn010-arrow .arrow01 {
    transform: translateY(-50%) translateX(0); /* 中央に表示 */
    z-index: 2;
}
.btn010-arrow .arrow02 {
    transform: translateY(-50%) translateX(-150%); /* 左外に配置 */
    z-index: 1;
}
/* ホバー時のアニメーション発火 */
.btn010:hover .arrow01 {
    animation: arrow-slide-out 0.5s ease;
}
.btn010:hover .arrow02 {
    animation: arrow-slide-in 0.5s ease;
}
/* アニメーション定義 */
@keyframes arrow-slide-out {
    0% {
        transform: translateY(-50%) translateX(0);
    }
    100% {
        transform: translateY(-50%) translateX(150%);
    }
}
@keyframes arrow-slide-in {
    0% {
        transform: translateY(-50%) translateX(-150%);
    }
    100% {
        transform: translateY(-50%) translateX(0);
    }
}