<div class="contents">text</div>
<div class="cp_snslink07">
<ul class="cp_link_list">
<li class="cp_link facebook"><a href="#"></a></li>
<li class="cp_link twitter"><a href="#"></a></li>
<li class="cp_link instagram"><a href="#"></a></li>
</ul>
</div>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink07 {
position: fixed;
top: 0px;
width: 100%;
border-top: 10px solid #90CAF9;
}
.cp_snslink07 ul.cp_link_list {
position: absolute;
right: 1%;
display: flex;
gap: 5px;
margin: 0;
list-style: none;
}
/*それぞれのSNS iconの設定*/
.cp_snslink07 .cp_link {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
padding: 0;
transition: all 0.3s;
border-radius: 0 0 8px 8px;
background: #90CAF9;
box-shadow: 0 3px 3px 0 rgba(0,0,0,0.2);
transition: all 0.3s;
cursor: pointer;
}
/*SNS各種ロゴ*/
.cp_snslink07 .cp_link.facebook::before,
.cp_snslink07 .cp_link.twitter::before,
.cp_snslink07 .cp_link.instagram::before {
position: absolute;
content: '';
background-size: contain;
background-repeat: no-repeat;
width: 25px;
height: 25px;
}
/*facebook*/
.cp_snslink07 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink07 .cp_link.twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink07 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/* hover時の動きの設定 */
.cp_snslink07 .cp_link:hover {
height: 53px;
box-shadow: 0 0px 0px 0 rgba(0,0,0,0);
}
/*SNS各種ロゴ背景を変える*/
/* facebook */
.cp_snslink07 .cp_link.facebook:hover::before {
background-image: url(facebook_logo_primary.svg);
}
/* twitter */
.cp_snslink07 .cp_link.twitter:hover::before {
background-image: url(x-logo-black.svg);
}
/* instagram */
.cp_snslink07 .cp_link.instagram:hover::before {
background-image: url(Instagram_glyph_gradient.svg);
}