This is a pretty difficult reason both for the selector itself and for its location on the sheet. Also, the fact that there is only one true way to write CSS does not help.
I think it would be better if you used the ID and tag selector. Also use the attribute selector:
#contact-form input { ... }
However, you should mention that it is highly recommended to put this sheet on top of others, for example:
<link type="stylesheet" href="/styles/contact-form.css" /> <link type="stylesheet" href="/styles/main.css" />
Why is this approach?
Typically, the developer will want the forms to look the same throughout the site, so he will use the tag name selector:
input { ... } select { ... }
These selectors are weaker than #contact-form input , so they will not override anything. However, sometimes it is necessary to override some rules, so the developer will use the #contact-form input selector, which in this case is quite natural.
If sheets were added as a recommendation, says that the styles of the developers redefine yours, despite the fact that both have a selector with the same strength. That is why the provision of the rules holds.
Crozin
source share