スマホ追従フッターのデザインをhtml・cssのソースコードのコピペで簡単に実装完了!

はじめに

実務案件でスマホ用の追従フッターを作成して欲しいというご依頼があったため作成しました。

スマホでしか表示されないためPCやタブレットの方は以下でイメージ画像を載せます。

スマホ用追従フッターイメージ画像

スマホ用追従フッターデザインのhtml・cssのソースコード

PR

<div class="contact-footer">
	<a class="contact-footer-tel" href="#"><span>お電話</span></a>
	<a class="contact-footer-mail" href="#"><span>お問い合わせ</span></a>
</div>
@media only screen and (min-width: 481px) {
    .contact-footer {
        display: none;
    }
}
@media only screen and (max-width: 480px) {
    body {
        padding-bottom: 70px;
    }
    .contact-footer {
        position: fixed;
        display: flex;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100000;
    }
    .contact-footer a {
        display: block;
        width: 50%;
        color: #fff;
        font-weight: 700;
        text-align: center;
        line-height: 70px;
        font-size: 16px;
    }
    .contact-footer span {
        position: relative;
        padding-right: 20px;
    }
    .contact-footer span::after{
        content: "";
        position: absolute;
        right: -10px;
        width: 20px;
        height: 20px;
        display: inline-block;
        background-size: contain;
        background-repeat: no-repeat;
    }
    .contact-footer-tel {
        background-color: #094;
    }
    .contact-footer-mail {
        background-color: #007535;
    }
    .contact-footer-tel span::after{
        background-image: url('画像パス');
        top: 1px;
    }
    .contact-footer-mail span::after {
        background-image: url('画像パス');
        top: 3px;
    }
}

色や画像は適宜調整してください。

他のHTMLCSS JavaScriptソースコード紹介記事まとめ

ソースコードまとめ

実務経験で作成したレイアウトのHTML・CSS ・JavaScriptソースコードを紹介した記事まとめています。

>お問い合わせはこちら

お問い合わせはこちら