iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 29
0
Modern Web

挑戰 CSS 30 天系列 第 29

day29_hover

按鈕動畫->鼠標移動到按鈕上後添加箭頭標記

範例:

<!DOCTYPE html>
<html>
<head>
  <title>CSS hover</title>
  <meta charset="utf-8">
  <style type="text/css">
	.button {
	  display: inline-block;
	  border-radius: 4px;
	  background-color: skyblue;
	  border: none;
	  color: #FFFFFF;
	  text-align: center;
	  font-size: 28px;
	  padding: 20px;
	  width: 200px;
	  transition: all 0.5s;
	  cursor: pointer;
	  margin: 5px;
	}

	.button span {
	  cursor: pointer;
	  display: inline-block;
	  position: relative;
	  transition: 0.5s;
	}

	.button span:after {
	  content: '»';
	  position: absolute;
	  opacity: 0;
	  top: 0;
	  right: -20px;
	  transition: 0.5s;
	}

	.button:hover span {
	  padding-right: 25px;
	}

	.button:hover span:after {
	  opacity: 1;
	  right: 0;
	}
  </style>
</head>
<body>
	<button class="button" style="vertical-align:middle"><span>Hover </span></button>
</body>
</html>

參考:http://www.runoob.com/css3/css3-buttons.html


上一篇
day28_Happy new year
下一篇
day30_review
系列文
挑戰 CSS 30 天30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言