0
我已經制作了一個滑動文本按鈕,它在向上滑動時向上滑動。這裏是例子:http://jsfiddle.net/kEQq4/滑動文本按鈕:如何使它與CSS3的所有方向滑動
如何使它不僅向上,而且向下,向左或向右滑動?
這裏是我的代碼:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style>
a{
color: white;
font-weight: bold;
text-decoration:none;
text-align: center;
display:block; /* important */
}
.blue-btn, .first-link{
-webkit-transition: 1.8s;
-moz-transition: 1.8s;
-ms-transition: 1.8s;
transition: 1.8s;
}
.blue-btn{
height: 64px;
width: 200px;
line-height: 64px;
overflow: hidden;
background-color: #3b5998;
}
.blue-btn:hover{
background-color: #ff0000;
}
.first-link{
margin-top: 0;
}
.blue-btn:hover .first-link{
margin-top: -64px;
}
</style>
</head>
<body>
<div class="blue-btn">
<a class="first-link" href="#"> First Text </a>
<a href="#"> Second Text </a>
</div>
</body>
</html>
'我已經made' ...嗚嗚嗚嗚......滑稽別人做了同樣的代碼,請參閱[這裏](http://codepen.io/ RichardBray /筆/ julhw)。 – anderstood