Russel Monzur
Russel Monzur

Reputation: 153

Placeholder value not showing in chrome?

Here is my code. I don't understand why placeholder not shown in explorer. Please help.

HTML CODE

<form  method="post" >
  <input type="text" class="field" name="nom" placeholder="Votre Nom">
  <input type="text" class="field" name="telephone" placeholder="Téléphone">
  <center><input type="submit" id="submit_btn" value="Valider" class="btn_submit"></center>
</form>

Upvotes: 9

Views: 30508

Answers (2)

Matthew Wilcoxson
Matthew Wilcoxson

Reputation: 3622

Make sure you have the right colours set up, and one on focus, and the focus one comes later (for higher specificity). For instance:

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

input:focus::-webkit-input-placeholder {
    color: #888;
}

Upvotes: 8

HEEN
HEEN

Reputation: 4721

try OnFocus rather than using placeholder it will work

<input name="nom" type="text" value="Votre Nom" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">

Let me know whether it works or not

Upvotes: 19

Related Questions