0

CSS

input[type=text] {font-size:1.5em;}

HTML

<input type="text" placeholder="some text">

The CSS code makes 1.5em size for data, which is entered in the text box. But this code also changes size of placeholder text. How to prevent CSS from changing placeholder text's size? I want CSS to, only change size of original data, which entered by my website visitors.

rndus2r
  • 496
  • 4
  • 17
user8575948
  • 23
  • 1
  • 7

1 Answers1

0

Reset the values with ::placeholder pseudo

::-webkit-input-placeholder { /* WebKit, Blink, Edge */
   font-size:    0.5em;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   font-size:    0.5em;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
   font-size:    0.5em;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
   font-size:    0.5em;
}
::-ms-input-placeholder { /* Microsoft Edge */
   font-size:    0.5em;
}
<input type="text" placeholder="some text">

Credits: Change an HTML5 input's placeholder color with CSS

rndus2r
  • 496
  • 4
  • 17