How to have a different "placeholder style" and at the same time a different "text-input style" in Rails with CSS? -
i have weird selector issue "input[type="text"]" selector overrides "::placeholder" selector. though "::placeholder" selector comes after "input[type="text"]" selector.
questions:
why happening?
and how can achieve different styles input text , placeholder text @ same time?
the priority of css rules not based on order in appear: more specific rules win on less specific. eg, in case
div.bar div.foo { background: blue;} div.foo { background: red;}
the first rule "win" because it's more specific. suspect ::placeholder
winning on input[type="text"]
reason - it's deemed (by browser) more specific.
Comments
Post a Comment