Tuesday, 9 October 2012

How to use input placeholder

Using input placeholders is confusing. However, it’s worth putting placeholders into your site no. Please refer to the website and code below
http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css/2610741#2610741

----------------------------------------------------------------------------
<HTML><input class="search-query" type="text" maxlength="200" size="30" value=""placeholder="Search"></input>
----------------------------------------------------------------------------
<CSS>

input.search-query {
           background-color: #596872 !important;
}
  
input.search-query::-webkit-input-placeholder {/* WebKit browsers */
           background-color: #596872 !important;
           color: #fff !important;
}

input.search-query:-moz-placeholder { /* Firefox 18- */
           background-color: #596872 !important;
           color: #fff !important;
}
input.search-query::-moz-placeholder {  /* Firefox 19+ */
           background-color: #596872 !important;
           color: #fff !important;
}
input.search-query:-ms-input-placeholder {  /* IE 10 */
           background-color: #596872 !important;
           color: #fff !important;
}
----------------------------------------------------------------------------

No comments:

Post a Comment