小编Pau*_*aul的帖子

CSS制作按钮的背景颜色两种不同的纯色而不是渐变

我怎样才能将按钮的背景设为两种纯色?请参阅下面的示例.

总体目标是按钮在悬停时从两种蓝色阴影过渡到两种灰色阴影.

背景两种纯色 在悬停

颜色:

蓝色:#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;
}
Run Code Online (Sandbox Code Playgroud)

随意使用我为此查询设置的JSFiddle:http://jsfiddle.net/DMc9N/

非常感谢您的帮助

css button css3 background-color

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

background-color ×1

button ×1

css ×1

css3 ×1