bloggerでのラベルの装飾

bloggerでラベルの装飾を行う

このブログでは画面の右のウィジェットとして表示される「ラベル」、そして記事ごとの登校日の次に表示される「ラベル」がある。この2種類のラベルを単なる文字列ではなく、もっとラベルっぽく仕上げてみよう。
結局CSSでタグを指定して装飾してあげるだけなんですが。

blogger ガジェット ラベル の装飾

こちら NxWorld 「CSSで実装するタグクラウドのサンプル」の記事を参考にしました。

.Label ul li {
    display: inline-block;
    margin: 0 0 .1em 1em;
}
.Label ul li a {
    position: relative;
    display: inline-block;
    height: 24px;
    line-height: 24px;
    padding: 0 1em;
    background-color: #91a92d;
    border-radius: 0 3px 3px 0;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    -webkit-transition: .2s;
    transition: .2s;
}
.Label ul li a::before {
    position: absolute;
    top: 0;
    left: -24px;
    content: '';
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-right: 12px solid #91a92d;
    -webkit-transition: .2s;
    transition: .2s;
}
.Label ul li a::after {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 2;
    display: block;
    content: '';
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background-color: #555;
    border-radius: 100%;
}
.Label ul li a:hover {
    background-color: #555;
    color: #fff;
}
.Label ul li a:hover::before {
    border-right-color: #555;
}

ラベルら

blogger 記事ごと ラベル の装飾

.post-labels a {
    position: relative;
    display: inline-block;
    height: 20px;
    line-height: 20px;
    margin: 0 0 .1em .8em;
    padding: 0 .8em;
    background-color: #91a92d;
    border-radius: 0 3px 3px 0;
    color: #fff;
    font-size: 11px;
    text-decoration: none;
    -webkit-transition: .2s;
    transition: .2s;
}
.post-labels a::before {
    position: absolute;
    top: 0;
    left: -20px;
    content: '';
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right: 10px solid #91a92d;
    -webkit-transition: .2s;
    transition: .2s;
}
.post-labels a::after {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 2;
    display: block;
    content: '';
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background-color: #555;
    border-radius: 100%;
}
.post-labels a:hover {
    background-color: #555;
    color: #fff;
}
.post-labels a:hover::before {
    border-right-color: #555;
}

ラベルら

なんだか謎の点線が見えるが、まだ原因は特定できていない。

装飾はこのあたりでやめておこう。やりすぎて「え…」ってなったら嫌だし。

0 件のコメント:

コメントを投稿