Today, we will learn how to change style of placeholder in textbox. so we will give you a simple example of how to custom change in placeholder using style. CSS through we can change in text placeholder like as font-color, font-size, and font-weight.
Different pseudo selectors are used in different browsers such as Chrome, Safari, and Opera for used to “-webKit-input-placeholder” pseudo selectors, Firefox for used to “-moz-placeholder” pseudo selectors and IE 10+ for used to “-ms-input-placeholder” pseudo selectors.
custom style doing it in placeholder then textbox look will be attractive. in this below example help through you can change in placeholder text.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* Chrome, Safari, Opera */ ::-webkit-input-placeholder { color: red; font-size: 13px; } /* Firefox */ ::-moz-placeholder { color: red; font-size: 13px; } /* IE 10+ */ :-ms-input-placeholder { color: red; font-size: 13px; } ::placeholder { color: red; font-size: 13px; } |