1

I know that I can do add color, padding... by styling the input. Are there vendor pseudo elements to style the text itself like there are for placeholder? I want to like translateY the text in the input but not using vertical-align or affecting input's height.

Community
  • 1
  • 1
ryanve
  • 50,076
  • 30
  • 102
  • 137

1 Answers1

1

I've searched before, and just now searched again, but I don't believe there are any vendor pseudo elements targeting the values of text inputs like there are for placeholder text.

Being able to apply CSS transform properties to text input values is, to the best of my knowledge, not currently possible with CSS only. There may be some way to achieve what you want with JS, but I haven't seen it done before.

This post delves into the issue, offers some creative workarounds, and may provide you with useful guidance: Is there a way to style part of an input field's value?

Community
  • 1
  • 1
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701