How to set CSS rules for input, except one type

前端 未结 3 1759
慢半拍i
慢半拍i 2021-01-11 22:05

I have CSS rules for input as

input {
background:#FFFFFF
}
input:hover {
background:#BBBBBB
}

I want to apply this style to al

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-11 22:21

    You can just overwrite the general input field style with a new style for submit input fields. Check it out: http://jsfiddle.net/dpYRX/2/

    input {
    background:#FFFFFF
    }
    input:hover {
    background:#BBBBBB
    }
    
    input[type="submit"] {
        background: #ff0000;
    }
    
    input[type="submit"]:hover {
        background: #cdcdcd;
    }
    

提交回复
热议问题