Skip to content

Instantly share code, notes, and snippets.

@norilog4
Created December 17, 2020 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norilog4/9b377f2d28f0769a519f95aa4e65b69e to your computer and use it in GitHub Desktop.
Save norilog4/9b377f2d28f0769a519f95aa4e65b69e to your computer and use it in GitHub Desktop.
クリックされやすいCSSボタンのデザイン css
/*--------------------------------------
コンバージョンアップボタン 吹き出し赤色(中央寄せ)
--------------------------------------*/
.button2,
a.button2,
button.button2 {
font-size: 1.6rem;
font-weight: 700;
line-height: 1.5;
position: relative;
display: inline-block;
padding: 1rem 4rem;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: all 0.3s;
transition: all 0.3s;
text-align: center;
vertical-align: middle;
text-decoration: none;
letter-spacing: 0.1em;
color: #212529;
border-radius: 0.5rem;
}
.button2-c-wrap {
margin: 30px 0;
text-align: center;
}
a.button2-c {
font-size: 1.15rem;
width: 100%;
position: relative;
padding: 0.25rem 2rem 0.5rem 1.8rem;
color: #fff;
background: #e94919;
-webkit-box-shadow: 0 5px 0 #d44114;
box-shadow: 0 5px 0 #d44114;
}
a.button2-c span {
font-size: 0.8rem;
position: absolute;
top: -0.75rem;
left: calc(50% - 180px);
display: block;
width: 360px;
padding: 0.25rem 0;
color: #d44114;
border: 2px solid #d44114;
border-radius: 100vh;
background: #fff;
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}
a.button2-c span:before,
a.button2-c span:after {
position: absolute;
left: calc(50% - 10px);
content: "";
}
a.button2-c span:before {
bottom: -10px;
border-width: 10px 10px 0 10px;
border-style: solid;
border-color: #d44114 transparent transparent transparent;
}
a.button2-c span:after {
bottom: -7px;
border-width: 10px 10px 0 10px;
border-style: solid;
border-color: #fff transparent transparent transparent;
}
a.button2-c i {
margin-right: 0.75rem;
}
a.button2-c:hover {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
color: #fff;
background: #eb5b30;
-webkit-box-shadow: 0 2px 0 #d44114;
box-shadow: 0 2px 0 #d44114;
}
/*--------------------------------------
コンバージョンアップボタン 緑色(中央寄せ)
--------------------------------------*/
.button1,
a.button1,
button.button1 {
font-size: 1.6rem;
font-weight: 700;
line-height: 1.5;
position: relative;
display: inline-block;
padding: 1rem 4rem;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: all 0.3s;
transition: all 0.3s;
text-align: center;
vertical-align: middle;
text-decoration: none;
letter-spacing: 0.1em;
color: #212529;
border-radius: 0.5rem;
}
.button1-wrap {
margin: 30px 0;
text-align: center;
}
a.button1-c {
font-size: 1.15rem;
width: 100%;
position: relative;
padding: 0.25rem 2rem 0.5rem 3.5rem;
color: #fff;
background: #32b16c;
-webkit-box-shadow: 0 5px 0 #2c9d60;
box-shadow: 0 5px 0 #2c9d60;
}
a.button1-c span {
font-size: 0.8rem;
position: absolute;
top: -10px;
left: calc(50% - 150px);
display: block;
width: 300px;
padding: 0.2rem 0;
color: #32b16c;
border: 2px solid #32b16c;
border-radius: 0.5rem;
background: #fff;
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}
a.button1-c:hover {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
color: #fff;
background: #30a967;
-webkit-box-shadow: 0 2px 0 #2c9d60;
box-shadow: 0 2px 0 #2c9d60;
}
a.button1-c:hover:before {
left: 2rem;
}
/*--------------------------------------
コンバージョンアップボタン 黄色(中央寄せ)
--------------------------------------*/
.button3,
a.button3,
button.button3 {
font-size: 1.6rem;
font-weight: 700;
line-height: 1.5;
position: relative;
display: inline-block;
padding: 1rem 4rem;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: all 0.3s;
transition: all 0.3s;
text-align: center;
vertical-align: middle;
text-decoration: none;
letter-spacing: 0.1em;
color: #212529;
border-radius: 0.5rem;
}
.button3-wrap {
margin: 30px 0;
text-align: center;
}
a.button3-c {
font-size: 1.15rem;
width: 100%;
position: relative;
padding: 0.25rem 2rem 0.5rem 2.1rem;
color: #333;
background: #fff100;
-webkit-box-shadow: 0 5px 0 #2c9d60;
box-shadow: 0 5px 0 #ccc100;
}
a.button3-c span {
font-size: 0.8rem;
position: absolute;
top: -10px;
left: calc(50% - 150px);
display: block;
width: 300px;
padding: 0.2rem 0;
color: #333;
border: 2px solid #333;
border-radius: 0.5rem;
background: #fff;
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}
a.button3-c:hover {
-webkit-transform: translate(0, 3px);
transform: translate(0, 3px);
color: #333;
background: #fff100;
-webkit-box-shadow: 0 2px 0 #ccc100;
box-shadow: 0 2px 0 #ccc100;
}
a.button3-c:hover:before {
left: 2rem;
}
@norilog4
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment