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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -