开发者

How to reffer in CSS to an input which has class attached to?

开发者 https://www.devze.com 2023-01-30 06:20 出处:网络
I have the following problem: I have an form with a few inputs. At the end of the form I have a submit and a reset button, which are inputs. I have a style in my CSS file for inputs (white background)

I have the following problem: I have an form with a few inputs. At the end of the form I have a submit and a reset button, which are inputs. I have a style in my CSS file for inputs (white background), but I want to write another style for inputs which are buttons (type=submit and type=reset).

I have tried to make a style named .button, and adding it to the input ( <input cla开发者_如何学Pythonss=button) but the properties from the input style are used, not the properties from the .button style.

Any help would be appreciated.


Just take a look on attribute selectors from CSS2.1 specification:

[attribute-name=value] - this selector will match every element with attribute-name set on value value. So all you need is input[type=submit], input[type=reset] selector.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号