4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2016-02-11

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

test.css
.myButton {
  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;
}
.myButton: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;
}
.myButton:active {
  position:relative;
  top:1px;
}
.myButton {
  margin-top: 1em;
}
4
5
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
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?