Minimal Green

はてなブログテーマ『Minimal Green』のデモブログ。はてなブログカスタマイズや、HTML、CSSなどについて書いています。

ガーリーデザインのボタンのCSSまとめ

f:id:minimalgreen:20180310215428j:plain
saruwakakun.com
サルワカさんのボタンのデザインサンプルが素晴らしいので、今更自分が公開しなくても良いような気がするのですが、今まで自分用のストックで作っていたガーリーデザインのボタンのサンプルCSSをまとめてご紹介します。
はてなブログでもはてなブログ以外でも使えます。

 

1. ステッチ風のボタン

Button
このブログのシェアボタンでも使っているステッチ風のボタンデザインです。縫い目風になるとガーリーデザインっぽくなりますね。ドロップシャドウをかけることでコロンとした立体感を出してみました。
HTML

<a class="girly_btn_1" href="">Button</a>

CSS

.girly_btn_1 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    outline: 0;
    overflow: hidden;
    color: #fff;/* 文字の色 */
    background: #f08080;/* ボタン背景色 */
    border-radius: 8px;/* 角丸サイズ */
    box-shadow: 0 0 0 5px #f08080, 0 2px 3px 5px rgba(0,0,0,0.5);/* 縁取り・影 */
    border: 2px dashed #fff;/* 点線の色・サイズ */
    padding: .5em 1em;/* 余白 */
}
はてなブログで記事内でリンクボタンの色が反映されない場合はcolor:#fff!important;という風に!importantを付けて下さい。もしくはセレクタに.entry-content a.girly_btn_1などclass指定を入れて下さい。

2. 透明感のあるピンクグラデーションボタン

Button
うっすらオレンジがかった透明感のあるピンクグラデーションのボタンデザインです。口紅など化粧品をイメージしました。
HTML

<a class="girly_btn_2" href="">Button</a>

CSS

.girly_btn_2 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    outline: 0;
    overflow: hidden;
    color: #fff;/* 文字の色 */
    background: -moz-linear-gradient(45deg, #ff9a9e 0%, #f0b77f 99%, #fad0c4 100%);
    background: -webkit-linear-gradient(45deg, #ff9a9e 0%, #f0b77f 99%, #fad0c4 100%);
    background: linear-gradient(45deg, #ff9a9e 0%, #f0b77f 99%, #fad0c4 100%);/* 背景グラデーション */
    box-shadow: 0 1px 1px 2px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: .5em 1em;
}

グラデーションのCSSの書き方はこちらの記事をご参照下さい。
saruwakakun.com

3. 吹き出しボタン

バルーン風の吹き出しボタンです。
Button

HTML

<a class="girly_btn_3" href="">Button</a>

CSS

.girly_btn_3 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    padding: .5em .75em;
    background-color: #fff;
    border: 1px solid #77B8DA;
    border-radius: 6px;
}
.girly_btn_3::before,
.girly_btn_3::after {
    position: absolute;
    top: 100%;
    left: 30px;
    content: '';
    height: 0;
    width: 0;
    border: 10px solid transparent;
}
.girly_btn_3::before {
    border-top: 15px solid #77B8DA;
}
.girly_btn_3::after {
    margin-top: -2px;
    border-top: 15px solid #fff;
}

4. ストライプ背景の吹き出しボタン

Button

HTML

<a class="girly_btn_4" href="">Button</a>

CSS

.girly_btn_4 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    padding: .5em .75em;
    color:#f08080;/*ボタン文字色*/
    background: repeating-linear-gradient(-45deg, #ffced0, #ffced0 5px, #ffe6e7 0, #ffe6e7 10px);/* 背景ストライプ */
    border-radius: 6px;
}
.girly_btn_4::before,
.girly_btn_4::after {
    position: absolute;
    top: 100%;
    left: 30px;
    content: '';
    height: 0;
    width: 0;
    border: 10px solid transparent;
}
.girly_btn_4::before {
    border-top: 15px solid fff;
}
.girly_btn_4::after {
    margin-top: -2px;
    border-top: 15px solid #ffced0;
}

5. ステッチ風の丸ボタン

1のステッチ風ボタンを円形にしただけです。ボタンの大きさは70pxのところを変えて下さい。
Button
HTML

<a class="girly_btn_5" href="">Button</a>

CSS

.girly_btn_5 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    outline: 0;
    overflow: hidden;
    color: #fff;/* 文字の色 */
    background: #f08080;/* ボタン背景色 */
    width: 70px;/* 円の大きさ */
    height:70px;/* 円の大きさ */
    line-height:70px;/* 円の大きさ */
    border-radius: 50%;/* 角丸サイズ */
    box-shadow: 0 0 0 5px #f08080, 0 2px 3px 5px rgba(0,0,0,0.5);/* 縁取り・影 */
    border: 2px dashed #fff;/* 点線の色・サイズ */
}

6. ズレた背景の手書き風ボタン

Button
記事内などに置く時、背景に色指定がされているときは背景色が表示されないので背景が透明の場合にお使いいただくか、記事内背景を透明に指定して下さい。
HTML

<a class="girly_btn_6" href="">Button</a>

CSS

/* 背景に色指定がある場合 */
#container #content {
   background: transparent;
}
/* 見出しのデザイン */
.girly_btn_6 {
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin: 10px;
    padding: 8px 25px 8px 25px;
    background: none;
    text-transform: uppercase;
    font-size: 140%;
    font-weight: bold;
    color:#f08080;/*ボタン文字色*/
    border: 2px solid #333;
    border-radius: 3em .5em 2em .5em/.4em 2em .5em 3em;
}
.girly_btn_6:before,
.girly_btn_6::after {
    border-radius: 4px;
    box-shadow: 0 1px 4px #ffced0;
    content: "";
    height: 100%;
    position: absolute;
    width: 100%;
}
.girly_btn_6::before {
    background-color: #ffced0;
    left: 0;
    top: 4px;
    z-index: -1;
}
.girly_btn_6::after {
    background-color: #ffced0;
    top: 5px;
    left: 5px;
    z-index: -2;
}

以上少ないですが、ガーリーデザインのボタンサンプルCSSのまとめでした。

参考:www.nxworld.net
www.nxworld.net
↑では手書き風ボタンや魅力的なホバーエフェクトが紹介されています。是非あわせてご参照下さい。

過去のガーリーデザイン記事:
blog.minimal-green.com
blog.minimal-green.com
blog.minimal-green.com