modify placeholder text css code example

Example 1: placeholder text css

input {
  border: 1px solid black;
  padding: 3px;
  height: 20px;
}

input:placeholder-shown {
  border-color: teal;
  color: purple;
  font-style: italic;
}

Example 2: placeholder text css

input {
  border: 1px solid black;
  padding: 3px;
  height: 300px;
}

input:placeholder-shown {
  border-color: teal;
  color: purple;
  font-style: italic;
}

Example 3: html css placeholder input font-size

Placeholder text will automatically inherit the font family and font size of the regular input text, but you may be in a situation where you want to change the placeholder text color. You can accomplish that with the ::placeholder pseudo-element.

Tags:

Html Example