css two colors on input fields
You probably need to use class. Take a look at this example: https://jsfiddle.net/424cse75/
You can see that border of input that has no class is grey (it is color specified for all inputs), then I added input-red class and input got red color border.
Next input has two classes, input-red and input-green, but border is red because input-red is defined after input-green so it overwrites it.
Then there is a green border input that has only input-green class to show that it works.
And last one has three classes, input-red input-green and input-blue, the border is not red because although input-blue is declared before all other classes, the color attribute has !important keyword, that prevents from being overwritten, but if input-green would have !important keyword after border-color then it would overwrite blue.
Using !important is not advised as it may make you unable to change things easy way.
So the rules order matters, and so does external css impots, so when you use many css files:
<link rel="stylesheet" type="text/css" href="/css/one.css"/> <link rel="stylesheet" type="text/css" href="/css/another.css"/>
all rules from another.css file that match names with one.css file rules will overwrite them.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now