Selasa, Mei 14, 2013

Button


HTML
<div class="container">
<a href="index.html" class="button">Start</a><a href="index.html" class="button button-green">Start</a><a href="index.html" class="button button-red">Start</a><br><a href="index.html" class="button hover">Start</a><a href="index.html" class="button button-green hover">Start</a><a href="index.html" class="button button-red hover">Start</a><br><a href="index.html" class="button active">Start</a><a href="index.html" class="button button-green active">Start</a><a href="index.html" class="button button-red active">Start</a>
  </div>

CSS
@import url(http://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css);

.container {
  margin: 50px auto;
  width: 480px;
  text-align: center;
}

.container .button {
  margin: 10px;
}

.button {
  display: inline-block;
  vertical-align: top;
  position: relative;
  padding: 0 15px 0 15px;
  line-height: 35px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
  background: #576dce;
  background-clip: padding-box;
  border: 1px solid;
  border-color: #374fbb #344cb3 #2b3e94;
  border-radius: 2px;
  -webkit-font-smoothing: antialiased;
  background-image: -webkit-linear-gradient(top, #92a0df 0%, #576dce 50%, #3f58c7 80%, #576dce 100%);
  background-image: -moz-linear-gradient(top, #92a0df 0%, #576dce 50%, #3f58c7 80%, #576dce 100%);
  background-image: -o-linear-gradient(top, #92a0df 0%, #576dce 50%, #3f58c7 80%, #576dce 100%);
  background-image: linear-gradient(to bottom, #92a0df 0%, #576dce 50%, #3f58c7 80%, #576dce 100%);
  -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.button:hover, .button.hover {
  background-color: #5f74d0;
  border-color: #2d429c #2d429c #253680;
  -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #576dce;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #576dce;
}

.button:active, .button.active {
  border-color: #253680 #2b3e94 #3147a8;
  background: #475fc9;
  -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
}

.button:before {
  content: '';
  position: absolute;
  top: 9px;
  right: 12px;
  width: 17px;
  height: 17px;
  background: #374fbb;
  border-radius: 9px;
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px rgba(255, 255, 255, 0.2);
}

.button:after {
  content: '>';
  float: right;
  position: relative;
  margin-left: 15px;
  font: bold 18px/33px "Comic Sans MS";
  /* I tried everything but couldn't get the vertical alignment to be
     consistent in IE, so this is a hack targeting IE8-9-10. */
  line-height: 31px\0;
  color: #6377d1;
  text-shadow: 0 -1px #8696dc, 0 1px 1px rgba(0, 0, 0, 0.3);
  -webkit-font-smoothing: subpixel-antialiased;
}

.button-green {
  background: #75a940;
  border-color: #5b8432 #567d2f #425f24;
  background-image: -webkit-linear-gradient(top, #9bc86e 0%, #75a940 50%, #669338 80%, #75a940 100%);
  background-image: -moz-linear-gradient(top, #9bc86e 0%, #75a940 50%, #669338 80%, #75a940 100%);
  background-image: -o-linear-gradient(top, #9bc86e 0%, #75a940 50%, #669338 80%, #75a940 100%);
  background-image: linear-gradient(to bottom, #9bc86e 0%, #75a940 50%, #669338 80%, #75a940 100%);
}

.button-green:hover, .button-green.hover {
  background-color: #7ab043;
  border-color: #476627 #476627 #354d1d;
  -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #75a940;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #75a940;
}

.button-green:active, .button-green.active {
  border-color: #354d1d #425f24 #4f722b;
  background: #6b9a3a;
  -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
}

.button-green:before {
  background: #5b8432;
}

.button-green:after {
  color: #7db444;
  text-shadow: 0 -1px #94c462, 0 1px 1px rgba(0, 0, 0, 0.3);
}

.button-red {
  background: #cf3e38;
  border-color: #ab2e29 #a32c27 #82231f;
  background-image: -webkit-linear-gradient(top, #de7a76 0%, #cf3e38 50%, #bb332d 80%, #cf3e38 100%);
  background-image: -moz-linear-gradient(top, #de7a76 0%, #cf3e38 50%, #bb332d 80%, #cf3e38 100%);
  background-image: -o-linear-gradient(top, #de7a76 0%, #cf3e38 50%, #bb332d 80%, #cf3e38 100%);
  background-image: linear-gradient(to bottom, #de7a76 0%, #cf3e38 50%, #bb332d 80%, #cf3e38 100%);
}

.button-red:hover, .button-red.hover {
  background-color: #d14640;
  border-color: #8a2521 #8a2521 #6d1e1a;
  -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #cf3e38;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 5px #cf3e38;
}

.button-red:active, .button-red.active {
  border-color: #6d1e1a #82231f #962924;
  background: #c3352f;
  -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.8);
}

.button-red:before {
  background: #ab2e29;
}

.button-red:after {
  color: #d24a44;
  text-shadow: 0 -1px #db6e69, 0 1px 1px rgba(0, 0, 0, 0.3);
}

Tidak ada komentar:

Posting Komentar

Catatan:
1. Untuk menyisipkan kode,gunakan tag <i rel="pre">Kode Anda</i>
2. Untuk menyisipkan quote,gunakan tag <b rel="quote">Kata-kata Anda</b>
3. Untuk menyisipkan gambar,gunakan tag [img]URL Gambar[/img]
4. Untuk menyisipkan video,gunakan tag [youtube]URL VIDEO ANDA[/youtube]

NB: Jangan menuliskan link aktif karena akan terhapus secara automatis.
Terimakasih atas kunjungannya ke Blog Kolom Tutorial™, Salam M. Alex Junaedi