html - Is there a way to change the color of an HTML5 textbox watermark? -


this question has answer here:

if have html5 text box follows

<form>     <input type="text" name="mytextbox" placeholder"mytextbox"/> </form> 

is there way using html or css change color of placeholder/watermark default light gray?

see this answer.

long story short, need use css selectors apply rules each browser, handles process differently.

input.mytextbox::-webkit-input-placeholder {    /* webkit browsers */    color: red;  }    input.mytextbox:-moz-placeholder {    /* mozilla firefox 4 18 */    color: red;    opacity: 1;  }    input.mytextbox::-moz-placeholder {    /* mozilla firefox 19+ */    color: red;    opacity: 1;  }    input.mytextbox:-ms-input-placeholder {    /* internet explorer 10+ */    color: red;  }
<input class="mytextbox" type="text" name="mytextbox" placeholder="mytextbox"/>


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -