1

Is possible to change select box placeholder font-weight via CSS only? I was trying to change it on different browser's with different webkit's prefixes and stil can't find a solution. I have only CSS access.

What i'm trying to achieve (only font-weight)

From:

enter image description here

To:

enter image description here

CSS:

.form > div.Content.ui-widget-content.ui-tabs-panel.PassengerDetailsTableBack > div:nth-child(2) > div > div > div > div.fn_birthdate > div > div.col-xs-3 > select::-webkit-input-placeholder,
.form > div.Content.ui-widget-content.ui-tabs-panel.PassengerDetailsTableBack > div:nth-child(2) > div > div > div > div.fn_birthdate > div > div.col-xs-3 > select::-moz-placeholder,
.form > div.Content.ui-widget-content.ui-tabs-panel.PassengerDetailsTableBack > div:nth-child(2) > div > div > div > div.fn_birthdate > div > div.col-xs-3 > select:-ms-input-placeholder,
.form > div.Content.ui-widget-content.ui-tabs-panel.PassengerDetailsTableBack > div:nth-child(2) > div > div > div > div.fn_birthdate > div > div.col-xs-3 > select:-o-input-placeholder{
    font-weight: 400!important;
}
Slasher
  • 587
  • 4
  • 23
  • 1
    Yes i'm targeting it correctly, and it's not overriden. These prefixed worked for me on normal input fields, but never on select inputs. – Slasher Sep 02 '18 at 19:43
  • You should not combine vendor-specific CSS pseudo-elements. According to CSS documentation. Maybe thats the issue. This post should give you more info -> [Click here to view](https://stackoverflow.com/questions/16982449/why-isnt-it-possible-to-combine-vendor-specific-pseudo-elements-classes-into-on) – thebrownkid Sep 02 '18 at 19:44
  • Can you add your HTML please! – nourza Sep 02 '18 at 19:46
  • @nourza Sorry, can't add HTML because I was targeting this element via DOM. I have only CSS access. – Slasher Sep 02 '18 at 19:54

1 Answers1

0
::-webkit-input-placeholder { font-weight: 400!important; }
::-moz-placeholder { font-weight: 400!important; } /* firefox 19+ */
:-ms-input-placeholder { font-weight: 400!important; } /* ie */
input:-moz-placeholder {font-weight: 400!important; }

Try this and let me know whats the result

nourza
  • 1,705
  • 1
  • 13
  • 26