Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an offset for the text displayed in an input?

Tags:

html

css

input

I am creating a basic log in function, really nothing fancy. enter image description here

this is what I have right now, but this is what I would like to have:

enter image description here

I don't just want to add spaces, since, when the user clicks the input field it clears the input. But I don't just want to clear it to another space as the user would be able to delete that then. I want a premade property to have that little one space-offset on the left, preferably ignored if I evaluate the input later on. Thanks in advance.

like image 242
Folling Avatar asked Nov 22 '25 09:11

Folling


1 Answers

Did you try padding :

.username
{
  padding-left : 10px;
}
<input type = 'text' class='username' value='Enter username'>
like image 98
Shivam Arora Avatar answered Nov 24 '25 00:11

Shivam Arora