LoginSignup
0
0

More than 5 years have passed since last update.

CSSだけで、角が丸いグラデーションのGoogle風ボタンを描く

Last updated at Posted at 2019-01-14

画像を使わずにこんなボタンがつくれます。
serch.png

.btn {
  box-shadow:inset 0px 1px 0px 0px #ffffff;
  background:color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9));
  background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%);
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0);
  background-color:#f9f9f9;
  border-radius:6px;
  border:1px solid #dcdcdc;
  display:inline-block;
  cursor:pointer;
  color:#666666;
  font-family:Arial;
  font-size:1em;
  padding:3px 24px; /* ボタンの上下と左右の中の余白 */
  text-decoration:none;
}

.btn:hover {
  background:color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9));
  background:linear-gradient(to bottom, #e9e9e9 5%, #f9f9f9 100%);
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9',GradientType=0);
  background-color:#e9e9e9;
}

.btn:active {
  position:relative;
  top:1px;
}

.btn {
  margin-top: 1em;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0