Jump to content

How to style placeholder


newcoder1010

Recommended Posts

Hi,

 

I did google for the below request. I am lost. If you could help me with the css.

<div class="CallMe_Name_R">
  <label class="control-label" for="edit-submitted-name">Name </label>
 <input placeholder="Enter your name" class="CallMe_Name_C form-control form-text" 
   type="text" id="edit-submitted-name">
</div>

I like to make the placeholder white color and place in the center? I tried this and did not work.

::-webkit-input-placeholder {
   color: white;text-align:center;
}

:-moz-placeholder { /* Firefox 18- */
   color: white;text-align:center;
}

::-moz-placeholder {  /* Firefox 19+ */
     color: white;
text-align:center;
}

:-ms-input-placeholder {  
    color: white;
text-align:center;
}
#edit-submitted-name{  
    color: white;
text-align:center;
}

Thanks.

Link to comment
Share on other sites

Seems to work for me? but it does require input background colour other than a whitish colour to see effect, IE has a problem if you use id ref for input text colour it will override placeholder colour, Firefox also applies opacity to placeholder text so you might want to add opacity: 1.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...