如何使按钮的背景为两种纯色?请参阅下面的示例。
总体目标是让按钮在悬停时从两种蓝色阴影过渡到两种灰色阴影。
颜色:
- 蓝色:(
#4098D3
浅),#2B8DCF
(深) - 灰色:(
#515758
浅)、#2B8DCF
(深)
HTML 按钮语法:<button class="submit"></submit>
CSS:
button.submit {
[background CSS from this question] }
button.submit:hover {
[background CSS from this question with alternate colors]
cursor: pointer;
-webkit-transition: background 0.5s linear;
-moz-transition: background 0.5s linear;
-ms-transition: background 0.5s linear;
-o-transition: background 0.5s linear;
transition: background 0.5s linear;
}
随意使用这个JSFiddle我为此查询设置:https ://jsfiddle.net/DMc9N/
非常感谢您的帮助