2022年12月23日金曜日

Bloggerのブログ上部にアナウンスバーを表示する

Membuat Announcement Bar Dengan Header Sticky
https://www.kompiajaib.com/2019/05/membuat-announcement-bar-dengan-header.html

色とかが良かったので

固定ヘッダーと違ってページの一部となります

関連:

追加CSS

.head-wrap {
    position: -webkit-sticky;
    position: sticky;
    top: -30px;
    margin: 0;
}
.announcement {
    width: 100%;
    font-size: 16px;
    font-weight: 300;
    line-height: 30px;
    background: #ffeb71;
    text-align: center;
    color: #333;
}
.announcement a {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

@media screen and (max-width:425px) {
    .head-wrap {
        top: -60px /* line-height .announcement dikali -2 */
    }
}

<body> タグ のすぐ下に追加

<div class='head-wrap'>
    <div class='announcement'>
        &#10140; <a href='#' title=''>Your Text Here</a>
    </div>
</div>

デモ
https://🍭.blogspot.com/

F(uriouz)

欲しいものリスト / 優先度の高いほしいものリスト / ☕を奢る
Donate 寄付 カンパ サポート Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.
詳細プロフィールを表示

0 comments:

スパム対策の為コメントをオフにしています。
Disqusは利用出来ます。

注: コメントを投稿できるのは、このブログのメンバーだけです。

...

Recent Posts

 
"The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License."