Skip to content

Instantly share code, notes, and snippets.

@shgtkshruch
Last active December 30, 2015 03:28
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 shgtkshruch/7769205 to your computer and use it in GitHub Desktop.
Save shgtkshruch/7769205 to your computer and use it in GitHub Desktop.
押せるボタン
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Btn</title>
<style>
.text {
padding: 10px 0;
margin: 0;
/* marginの相殺が起きないようにする */
}
.btn_blue {
display: block;
width: 200px;
text-align: center;
text-decoration: none;
vertical-align: baseline;
cursor: pointer;
color: white;
background: #1c7dc1;
font-weight: bold;
font-size: 110%;
padding: 6px 0 5px;
margin: 0 0 1px 0;
/* 上下のmarginの値を変えることでボタンの押せる感を出す */
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 3px 0 0 #204873;
-moz-box-shadow: 0 3px 0 0 #204873;
box-shadow: 0 3px 0 0 #204873;
-webkit-transition: background 0.3s ease;
-moz-transition: background 0.3s ease;
-o-transition: background 0.3s ease;
transition: background 0.3s ease;
}
.btn_blue:hover {
background-color: #1890e4;
margin: 1px 0 0 0;
/* 上下のmarginの値を変えることでボタンの押せる感を出す */
-webkit-box-shadow: 0 2px 0 0 #204873;
-moz-box-shadow: 0 2px 0 0 #204873;
box-shadow: 0 2px 0 0 #204873;
}
</style>
</head>
<body>
<p class="text">押せるボタン</p>
<p class="btn_blue">Check!</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment