anon
anon

Reputation: 2313

Move the cursor for input text to the right

I want the the point at which a user types text into a textfield to be moved to the right without moving the margin of the text field to the right. I want this because the search button lies on top of the text field for styling purposes and currently when a user begins to type text it starts underneath the search button. So I need the default point of the cursor to be moved to the right by a few pixels. Is this possible with CSS?

Upvotes: 1

Views: 7357

Answers (3)

mwl
mwl

Reputation: 1488

input {
    box-sizing: border-box;
    padding-left: 10px;
    width: 200px;
}
<input type="text" />

Upvotes: 0

Repo
Repo

Reputation: 1745

I would definately use

text-indent: 20px;

=)

Upvotes: 9

Joe
Joe

Reputation: 6416

Padding is what you are looking for.

.search-box{padding-left: 25px;}

Upvotes: 1

Related Questions