How to change the input cursor?

Asked

Viewed 473 times

1

Hello guys, I think it’s something very simple, but I’m still kind of layy in HTML I would like to know how I do for the moment that the person click the input that writes in the middle of the box or it can also be a few pixels left... summarizing I want the written value to be in the middle of the input box and not at the beginning.

1 answer

1

Just use the text-align styles to set, right, left or center. You can also use the padding to make room within the input, in this example I put 5px below and above, and 15px on the right/left.

Take the example

  
<input type="text" style="text-align: left; padding: 5px 15px;" placeholder="esquerda">
<input type="text" style="text-align: center; padding: 5px 15px" placeholder="centro">
<input type="text" style="text-align: right; padding: 5px 15px" placeholder="direita">
  

Browser other questions tagged

You are not signed in. Login or sign up in order to post.