Oma*_*mar 1 html css jquery css3
我试图将按钮的背景颜色从蓝色淡化为白色,并将字体颜色从白色淡化为蓝色.我检查了其他帖子.
这是我的小提琴:http: //jsfiddle.net/t533wbuy/1/
我用这个小提琴作为参考:http: //jsfiddle.net/visualdecree/SvjHx/
我的问题是:
CSS
.menuitem{
width: 200px;
height:30px;
background-color: #005abb;
font-size:16px;font-family: 'gotham_htfbold';-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.menuitem a{
width: 200px;
height: 30px;
height: auto;
display: block;
position: relative;
color: #FFF;
text-align: center;
z-index: 9999;
}
.menu-item-span{
display: none;
width: 200px;
height: 30px;
background-color: #fff;
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
color:#005abb;
z-index: -999;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
jQuery的
$(function() {
$(".menuitem").find("class")
.hide() // Finds span hide.
.end() // After find stop.
.hover(function() { // On hover find and fadein then fadeout
$(this).find("span").stop(true, true).fadeIn();
}, function() {
$(this).find("span").stop(true, true).fadeOut();
});
});
Run Code Online (Sandbox Code Playgroud)
为什么不选择纯CSS呢?
a {
transition: all .4s ease;
padding: 12px 28px;
border-radius: 18px;
}
a {
background-color: blue;
color: #fff;
}
a:hover {
background-color: grey;
color: #000;
}Run Code Online (Sandbox Code Playgroud)
<a href="#">BUTTON</a>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2520 次 |
| 最近记录: |