<div class="contents">text contents</div>
<ul class="cp_snslink01">
<li class="cp_link facebook"><a href="#"><div class="nav-label"><span>facebook Button</span></div></a></li>
<li class="cp_link twitter"><a href="#"><div class="nav-label"><span>X Button</span></div></a></li>
<li class="cp_link instagram"><a href="#"><div class="nav-label"><span>instagram Button</span></div></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink01 {
position: fixed;
top: 50%;
left: 0;
transform: translateY(-50%);
margin: 0;
padding: 0;
}
/*それぞれのSNS iconの設定*/
.cp_snslink01 .cp_link {
position: relative;
display: block;
width: 40px;
height: 40px;
padding: 10px;
cursor: pointer;
}
.cp_snslink01 .cp_link::before {
position: absolute;
content: '';
background-size: contain;
background-repeat: no-repeat;
width: 40px;
height: 40px;
}
.cp_snslink01 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
.cp_snslink01 .cp_link.twitter::before {
background-image: url(sns/x-logo.svg);
}
.cp_snslink01 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/*hoverで表示されるブロックの設定*/
.cp_snslink01 .cp_link .nav-label {
position: absolute;
top: 0;
left: 60px;/*.cp_linkの幅+padding*/
display: flex;
align-items: center;
width: 150px;
height: 60px;/*.cp_linkの高さ+padding*/
padding: 0 20px;
white-space: nowrap;
}
.cp_snslink01 .cp_link a,
.cp_snslink01 .cp_link:hover {
color: #ffffff;
}
/*facebook*/
.cp_snslink01 .facebook,
.cp_snslink01 .facebook:hover,
.cp_snslink01 .facebook:hover .nav-label {
background: #0866ff;/*iconの背景とhover後の色*/
}
.cp_snslink01 .facebook .nav-label {
background: #5d9afc;/*hover時最初の色*/
}
/*twitter*/
.cp_snslink01 .twitter,
.cp_snslink01 .twitter:hover,
.cp_snslink01 .twitter:hover .nav-label {
background: #000000;/*iconの背景とhover後の色*/
}
.cp_snslink01 .twitter .nav-label {
background: #dddddd;/*hover時最初の色*/
}
/*instagram*/
.cp_snslink01 .instagram,
.cp_snslink01 .instagram:hover,
.cp_snslink01 .instagram:hover .nav-label {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);/*iconの背景とhover後の色*/
}
.cp_snslink01 .instagram .nav-label {
background: #D300C5;/*hover時最初の色*/
}
/* effect */
.cp_snslink01 .cp_link.nav-label,
.cp_snslink01 .cp_link.cp_link:hover .nav-label {
transition: transform 0.4s ease, background 0.4s ease 0.1s;
}
.cp_snslink01 .cp_link.cp_link .nav-label {
transition: transform 0.4s ease;
transform: scaleX(0);
transform-origin: left 50%;/*伸縮の基点*/
}
.cp_snslink01 .cp_link.cp_link:hover .nav-label {
transform: scaleX(1);
}
<div class="contents">text contents</div>
<ul class="cp_snslink02">
<li class="cp_link facebook"><a href="#"><div class="nav-label"><span>facebook Button</span></div></a></li>
<li class="cp_link twitter"><a href="#"><div class="nav-label"><span>X Button</span></div></a></li>
<li class="cp_link instagram"><a href="#"><div class="nav-label"><span>instagram Button</span></div></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink02 {
position: fixed;
top: 50%;
left: -145px;
transform: translateY(-50%);
display: block;
margin: 0;
padding: 0;
}
/*それぞれのSNS iconの設定*/
.cp_snslink02 .cp_link {
position: relative;
left: 0;
padding: 10px 40px 10px 10px;
text-align: right;
transition: left 0.6s ease-in-out;
color: #ffffff;
cursor: pointer;
}
.cp_snslink02 .cp_link a {
color: #ffffff;
}
.cp_snslink02 .cp_link.facebook::after,
.cp_snslink02 .cp_link.twitter::after,
.cp_snslink02 .cp_link.instagram::after {
position: absolute;
content: '';
top: 50%;
right: 10px;
transform: translateY(-50%);
background-size: contain;
background-repeat: no-repeat;
width: 1em;
height: 1em;
}
/*facebook*/
.cp_snslink02 .facebook {
background: #0866ff;
}
.cp_snslink02 .cp_link.facebook::after {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink02 .twitter {
background: #000000;
}
.cp_snslink02 .cp_link.twitter::after {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink02 .instagram {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}
.cp_snslink02 .cp_link.instagram::after {
background-image: url(instagram_glyph_white.svg);
}
.cp_snslink02 .cp_link:hover {
left: 140px;
}
.cp_snslink02 .cp_link .nav-label {
display: inline-block;
}
<div class="contents">text contents</div>
<ul class="cp_snslink03">
<li class="cp_link facebook"><a href="#"><div class="nav-label"><span>facebook Button</span></div></a></li>
<li class="cp_link twitter"><a href="#"><div class="nav-label"><span>X Button</span></div></a></li>
<li class="cp_link instagram"><a href="#"><div class="nav-label"><span>instagram Button</span></div></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink03 {
position: fixed;
top: 50%;
right: 0;
transform: translateY(-50%);
display: block;
overflow: hidden;
margin: 0;
padding: 0 0 0 5px;
}
/*それぞれのSNS iconの設定*/
.cp_snslink03 .cp_link {
position: relative;
right: -148px;
margin: 10px 0;
padding: 5px;
background: #0097A7;
border: 1px dashed #ffffff;
border-right: none;
box-shadow: 0px 0px 0px 3px #0097A7;
cursor: pointer;
transition: right 0.6s ease-in-out;
}
.cp_snslink03 .cp_link .nav-label {
margin-right: 10px;
padding: 0 0 0 25px;
}
.cp_snslink03 .cp_link.facebook::before,
.cp_snslink03 .cp_link.twitter::before,
.cp_snslink03 .cp_link.instagram::before {
position: absolute;
content: '';
top: 50%;
left: 5px;
transform: translateY(-50%);
background-size: contain;
background-repeat: no-repeat;
width: 1em;
height: 1em;
}
/*facebook*/
.cp_snslink03 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink03 .cp_link.twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink03 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
.cp_snslink03 .cp_link:hover {
right: 0;
background: #00bcd4;
box-shadow: 0px 0px 0px 3px #00bcd4;
}
.cp_snslink03 .cp_link a {
text-decoration: none;
color: #ffffff;
}
.cp_snslink03 .cp_link:hover a {
color: #80deea;
}
<div class="contents">text</div>
<ul class="cp_snslink04">
<li class="cp_link facebook"><a href="#"><span>Facebook</span></a></li>
<li class="cp_link twitter"><a href="#"><span>Twitter</span></a></li>
<li class="cp_link instagram"><a href="#"><span>instagram</span></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink04 {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
display: inline-block;
margin: 0;
padding: 0;
list-style-type: none;
}
/*それぞれのSNS iconの設定*/
.cp_snslink04 .cp_link {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 35px;
height: 40px;
color: #ffffff;
background: #fc787f;
border-bottom: 1px solid #ffffff;
cursor: pointer;
}
.cp_snslink04 .cp_link::before {
position: absolute;
content: '';
display: block;
width: 1em;
height: 1em;
background-size: contain;
background-repeat: no-repeat;
color: #ffffff;
}
.cp_snslink04 .cp_link:last-of-type {
border-bottom: none;
}
/*facebook*/
.cp_snslink04 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink04 .cp_link.twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink04 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/*hoverで表示されるブロックの設定*/
.cp_snslink04 .cp_link span {
position: absolute;
display: flex;
align-items: center;
top: 5px;
left: -25px;/*スタート位置*/
display: flex;
align-items: center;
width: fit-content;
height: 30px;
padding: 0 10px;
opacity: 0;
color: #ffffff;
border-radius: 2px;
transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);/*飛び出す動きを設定*/
}
.cp_snslink04 .cp_link span::after{
position: absolute;
content: '';
left: -15px;
width: 15px;
height: 10px;
background: #0866ff;
clip-path: polygon(100% 0, 50% 50%, 100% 100%);
}
/*飛び出した後の位置*/
.cp_snslink04 .cp_link:hover span {
left: 45px;
opacity: 1;
}
/* facebook */
.cp_snslink04 .cp_link.facebook span,
.cp_snslink04 .cp_link.facebook span::after,
.cp_snslink04 .cp_link.facebook:hover,
.cp_snslink04 .cp_link.facebook:hover span {
background: #0866ff;
}
/* twitter */
.cp_snslink04 .cp_link.twitter span,
.cp_snslink04 .cp_link.twitter span::after,
.cp_snslink04 .cp_link.twitter:hover,
.cp_snslink04 .cp_link.twitter:hover span {
background: #000000;
}
/* instagram */
.cp_snslink04 .cp_link.instagram span,
.cp_snslink04 .cp_link.instagram:hover,
.cp_snslink04 .cp_link.instagram:hover span {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}
.cp_snslink04 .cp_link.instagram span::after {
background: #FF7A00;
}
<div class="contents">text</div>
<ul class="cp_snslink05">
<li class="cp_link facebook"><a href="#"><span>Facebook</span></a></li>
<li class="cp_link twitter"><a href="#"><span>Twitter</span></a></li>
<li class="cp_link instagram"><a href="#"><span>instagram</span></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink05 {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
display: inline-block;
margin: 0;
padding: 0;
list-style-type: none;
}
/*それぞれのSNS iconの設定*/
.cp_snslink05 .cp_link {
position: relative;
width: 35px;
height: 40px;
color: #ffffff;
background: #1a405f;
cursor: pointer;
}
.cp_snslink05 .cp_link:first-of-type {
border-radius: 0 5px 0 0;
}
.cp_snslink05 .cp_link:last-of-type {
border-radius: 0 0 5px 0;
}
.cp_snslink05 .cp_link::before {
position: absolute;
content: '';
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: block;
width: 1em;
height: 1em;
background-size: contain;
background-repeat: no-repeat;
color: #ffffff;
}
.cp_snslink05 .cp_link:last-of-type {
border-bottom: none;
}
/*facebook*/
.cp_snslink05 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink05 .cp_link.twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink05 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/*hoverで表示されるブロックの設定*/
.cp_snslink05 .cp_link span {
position: absolute;
top: 5px;
left: 45px;
display: flex;
align-items: center;
width: fit-content;
height: 30px;
padding: 0 10px;
opacity: 0;
color: #ffffff;
background: #1a405f;
border-radius: 2px;
transition: all 0.5s ease 0.3ms;/*hover時の動きを設定*/
}
.cp_snslink05 .cp_link:hover span {
left: 45px;
opacity: 1;
}
.cp_snslink05 .cp_link span::after{/*吹き出しの三角の設定*/
position: absolute;
content: '';
top: 50%;
left: -15px;
transform: translateY(-50%);
width: 15px;
height: 10px;
background: #1a405f;
clip-path: polygon(100% 0, 50% 50%, 100% 100%);
}
/* facebook */
.cp_snslink05 .cp_link.facebook:hover {
background: #0866ff;
}
/* twitter */
.cp_snslink05 .cp_link.twitter:hover {
background: #000000;
}
/* instagram */
.cp_snslink05 .cp_link.instagram:hover {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}
<div class="contents">text</div>
<ul class="cp_snslink06">
<li class="cp_link facebook"><a href="#"><div class="nav-label"><span>facebook Button</span></div></a></li>
<li class="cp_link twitter"><a href="#"><div class="nav-label"><span>X Button</span></div></a></li>
<li class="cp_link instagram"><a href="#"><div class="nav-label"><span>instagram Button</span></div></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink06 {
position: fixed;
top: 50%;
transform: translateY(-50%);
display: block;
margin: 0;
padding: 0;
}
/*それぞれのSNS iconの設定*/
.cp_snslink06 .cp_link {
position: relative;
left: -150px;
display: flex;
align-items: center;
justify-content: flex-end;
margin: 5px;
padding: 0 50px 0 10px;
height: 45px;
border-radius: 0 30px 30px 0;
background: #80cbc4;
transition: all 1s;
}
.cp_snslink06 .cp_link a {
text-decoration: none;
color: #009688;
}
/*SNS各種ロゴ背景*/
.cp_snslink06 .cp_link.facebook::before,
.cp_snslink06 .cp_link.twitter::before,
.cp_snslink06 .cp_link.instagram::before {
position: absolute;
content: '';
right: 8px;
background: #009688;
width: 35px;
height: 35px;
border-radius: 50%;
}
/*SNS各種ロゴ*/
.cp_snslink06 .cp_link.facebook::after,
.cp_snslink06 .cp_link.twitter::after,
.cp_snslink06 .cp_link.instagram::after {
position: absolute;
content: '';
right: 16px;
background-size: contain;
background-repeat: no-repeat;
width: 20px;
height: 20px;
}
/*facebook*/
.cp_snslink06 .cp_link.facebook::after {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink06 .cp_link.twitter::after {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink06 .cp_link.instagram::after {
background-image: url(instagram_glyph_white.svg);
}
/* hover時の動きの設定 */
.cp_snslink06 .cp_link:hover {
left: -5px;
background: #009688;
}
.cp_snslink06 .cp_link:hover a {
color: #ffffff;
}
/*SNS各種ロゴを回転させる*/
.cp_snslink06 .cp_link:hover::before,
.cp_snslink06 .cp_link:hover::after {
transition: all 1s;
transform: rotate(360deg);
}
/*SNS各種ロゴ背景を変える*/
/* facebook */
.cp_snslink06 .cp_link.facebook:hover::before {
background: #0866ff;
}
/* twitter */
.cp_snslink06 .cp_link.twitter:hover::before {
background: #000000;
}
/* instagram */
.cp_snslink06 .cp_link.instagram:hover::before {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}
<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);
}
<div class="contents">text</div>
<div class="cp_snslink08">
<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;
}
.cp_snslink08 {
position: fixed;
bottom: 0px;
display: flex;
justify-content: center;
width: 100%;
border-bottom: 5px solid #f06292;
}
.cp_snslink08 ul.cp_link_list {
position: absolute;
bottom: 0;
display: flex;
gap: 5px;
margin: 0;
list-style: none;
}
.cp_snslink08 .cp_link {
position: relative;
bottom: -40px;
display: flex;
justify-content: center;
width: 40px;
height: 40px;
margin: 0;
padding: 10px;
border-radius: 50%;
background: #f06292;
transition: all 100ms cubic-bezier(0.42, 0, 0.58, 1);
}
/*SNS各種ロゴ*/
.cp_snslink08 .cp_link.facebook::before,
.cp_snslink08 .cp_link.twitter::before,
.cp_snslink08 .cp_link.instagram::before {
position: absolute;
content: '';
background-size: contain;
background-repeat: no-repeat;
width: 25px;
height: 25px;
}
/*facebook*/
.cp_snslink08 .cp_link.facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink08 .cp_link.twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink08 .cp_link.instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/* hover時の動きの設定 */
.cp_snslink08 .cp_link:hover {
bottom: -20px;
}