6

I am trying to change the text colour in the placeholder. It just works with the browser Firefox.

There is my HTML

<form name="sentMessage" class="form-horizontal" role="form"  novalidate>
<div class="control-group">
<div class="controls">
<input type="text" class="form-control" placeholder="Full Name" id="name" name="name" required data-validation-required-message="Please enter your name" style="resize:none; color: #BC987E; background-color: #808080; border-color:#808080"/>
<p class="help-block"></p>
</div>
</div>     
<div class="control-group">
<div class="controls">
<input type="email" class="form-control" placeholder="Email" id="email" name="email" required data-validation-required-message="Please enter your email" style="resize:none; color: #BC987E; background-color: #808080; border-color:#808080"/>
<p class="help-block"></p>
</div>
</div>  
<div class="control-group">
<div class="controls">
<textarea rows="10" cols="100" class="form-control" placeholder="How can I help you?" id="message" required data-validation-required-message="Please enter your message" minlength="5" data-validation-minlength-message="Min 5 characters" maxlength="999" style="resize:none; color: white; background-color: #808080; border-color:#808080"></textarea>
<p class="help-block"></p>
</div>
</div>        
<div id="success"> </div> <!-- For success/fail messages -->
<button type="submit" class="btn btn-primary pull-right">Send</button><br/>
</form>

and there my CSS

#name:-moz-placeholder,
#email:-moz-placeholder 
{
color:    white;
}

#name::-moz-placeholder,
#email::-moz-placeholder 
{
color:    white;
}

#name:-ms-input-placeholder,
#email:-ms-input-placeholder  
{
color:    white;
}

On the web page I have implemented Bootstrap. There is the link. Any suggestions that why my code is only working in Firefox. Thanks in advance.

David Moya
  • 107
  • 1
  • 2
  • 8
  • you should do some R&D first before asking question. This question is not really going to help for future Users. – Kheema Pandey Nov 15 '14 at 15:07
  • You are probably right. But none of the post I have checked and test make the colour changed in the rest of the browsers. It is probably something wrong in my code. That is the first time I have implemented a form. I am just trying to do my best. – David Moya Nov 15 '14 at 15:19

1 Answers1

3

http://css-tricks.com/snippets/css/style-placeholder-text/

::-webkit-input-placeholder {
   color: red;
}

:-moz-placeholder { /* Firefox 18- */
   color: red;  
}

::-moz-placeholder {  /* Firefox 19+ */
   color: red;  
}

:-ms-input-placeholder {  
   color: red;  
}
Vitorino fernandes
  • 15,794
  • 3
  • 20
  • 39