Change colour of search bar placeholder text

I am trying to change the default colour of the placeholder text in the popup search bar as I have modified the colour and it's lost heaps of contrast. I have used the following CSS but it doesn't seem to work form#searchform input-placeholder { color:white!important; }

Is there something I am missing here?

thanks

Comments

  • Placeholder text color inside search can be changed within below css:
    #Top_bar .search_wrapper input[type="text"] { color: #000 !important; }
  • Ok at first that did not do a thing but then i removed the space between the !important declaration and the color hex code. But what that did was change the color of the input text - not the placeholder text.

    I modified your code and tried:

    #Top_bar .search_wrapper input-placeholder { color:blue!important; } 

    But that did not work. Is it possible to change the colour of the Placeholder text in the search field?
  • We have no idea where you get this code but definitely is wrong. You should use below css instead to change placeholder text:
    #Top_bar .search_wrapper input[type="text"] { color: #000 !important; }
  • I know you have given me the same css code again, but it did not work for me the first time. That's why I went and experimented with the code quite a bit.

    I give up. It's not important
  • As you want, but if you will send us url to your website then we can check what is the problem. There is only 3 reasons why this won't work on your side:

    1. You use cache

    2. You did mistake somewhere in your custom css and any code below broken css won't work

    3. You copied this code in wrong place or with unnecessary tags
  • edited April 2015
    rarch47 , this is what you need. Will change search placeholder text to white in all browsers. Cheers. John.


    #Top_bar .search_wrapper input[type="text"]::-webkit-input-placeholder {
    color: #ffffff;
    }

    #Top_bar .search_wrapper input[type="text"]:-moz-placeholder { /* Firefox 18- */
    color: #ffffff;
    }

    #Top_bar .search_wrapper input[type="text"]::-moz-placeholder { /* Firefox 19+ */
    color: #ffffff;
    }

    #Top_bar .search_wrapper input[type="text"]:-ms-input-placeholder {
    color: #ffffff;
    }

  • BAZZZINGA! Thanks John!
  • Thanks John!
    1. Spent 2 hrs trying to implement Albert's code #Top_bar .search_wrapper input[type="text"] { color: #000 !important; }

    + other suggested solutions with no luck. Finally found John's code which works fine !

  • Hello @georgetate,

    I'm glad that you solve your problem, is there anything else we can help you with?

    thanks

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.