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.

https://developer.mozilla.org/en/docs/web/css/specificity

https://developer.tizen.org/dev-guide/web/2.3.0/org.tizen.mobile.web.appprogramming/html/guide/w3c_guide/dom_guide/html_priorities_css.htm


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -