我有一个按钮类,我正在使用它覆盖我的默认button
或input type="button"
元素的渐变。这是默认值的代码:
input[type="button"], input[type="submit"], input[type="reset"], button {
background:#05ABE0;
background:linear-gradient(to bottom, #87E0FD 0%, #53CBF1 25%, #05ABE0 50%);
background:-moz-linear-gradient(top, #87E0FD 0%, #53CBF1 25%, #05ABE0 50%);
background:-ms-linear-gradient(top, #87E0FD 0%, #53CBF1 25%, #05ABE0 50%);
background:-o-linear-gradient(top, #87E0FD 0%, #53CBF1 25%, #05ABE0 50%);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #87E0FD), color-stop(25%, #53CBF1), color-stop(50%, #05ABE0));
background:-webkit-linear-gradient(top, #87E0FD 0%, #53CBF1 25%, #05ABE0 50%);
border:solid 2px #0076A3;
border-radius:0.3em;
-moz-border-radius:0.3em;
-o-border-radius:0.3em;
-webkit-border-radius:0.3em;
font-size:1em;
padding:0.4em;
display:inline-block;
margin-right:5px;
margin-left:5px;
font-family:Helvetica Neue, Helvetica, Arial, sans-serif;
color:white;
vertical-align:middle;
text-shadow:rgba(0, 0, 0, 0.7) 0px 2px 2px;
box-shadow:inset 0 1px 1px white;
-moz-box-shadow:inset 0 1px 1px white;
-webkit-box-shadow:inset 0 1px 1px white;
background-size:100% 200%;
-moz-background-size:100% 200%;
-o-background-size:100% 200%;
-webkit-background-size:100% 200%;
-moz-transition:all 0.1s linear;
-o-transition:all 0.1s linear;
-webkit-transition:all 0.1s linear;
}
这是覆盖类:
.orange {
border:2px solid #BF4619;
background: #FF7700;
background:linear-gradient(to bottom, #FFD0A8 0%, #FFAE68 25%, #FF7700 50%);
background:-moz-linear-gradient(top, #FFD0A8 0%, #FFAE68 25%, #FF7700 50%);
background:-ms-linear-gradient(top, #FFD0A8 0%, #FFAE68 25%, #FF7700 50%);
background:-o-linear-gradient(top, #FFD0A8 0%, #FFAE68 25%, #FF7700 50%);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFD0A8), color-stop(25%, #FFAE68), color-stop(50%, #FF7700));
background:-webkit-linear-gradient(top, #FFD0A8 0%, #FFAE68 25%, #FF7700 50%);
background-size:100% 200%;
-moz-background-size:100% 200%;
-o-background-size:100% 200%;
-webkit-background-size:100% 200%;
}
当我使用<button type="button" class="orange">Orange button</button>
它时工作正常,但是当我使用<input type="button" class="orange" value="Orange button" />
它时,它会恢复为不在类中的默认样式orange
。为什么是这样?
PS:如何在 Stackoverflow 上进行多行缩进?这就是为什么我的代码在示例中都在同一个块中。