我正在尝试为我正在制作的这个模型导航栏上的这个按钮设置一个过渡,当我将鼠标悬停在上面时,我想要一个 0.5 秒的过渡来改变背景,但它不起作用我还没有真正使用过在 css 中转换很多,但这是伟大的谷歌告诉我的:
.btn-primary {
border: 1px solid #e5e5e5;
border-radius: 6px;
padding: 6px;
background: -webkit-linear-gradient(bottom, #0066FF 0, #0088FF 85%, #00AAFF 100% );
font-size: 14px;
color: white;
}
.btn-primary:hover {
background: -webkit-linear-gradient(bottom, #0000CC 0, #0044CC 100%);
cursor: pointer;
-webkit-transition: background 0.3s linear;
}
演示:http ://codepen.io/anon/pen/lApnj
任何信息都会非常感谢!:)