Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving the text within a text input

Tags:

css

input

I've made a form, but where I've added a 0px margin to it, it has also applied that margin to text inside the input (e.g. where you would put your name, for a username input) meaning that it's against the left hand edge of the box.

How can I added a margin to the text within the box, while keeping the margin on the box itself?

Thanks in advance.

like image 643
MozazDesign Avatar asked Apr 18 '11 19:04

MozazDesign


People also ask

How do I move text to the top in HTML?

The <marquee> tag in HTML is used to create scrolling text or image in a webpages. It scrolls either from horizontally left to right or right to left, or vertically top to bottom or bottom to top.


2 Answers

I dont think the people here understand your question completely. The OP is asking how he can apply a margin to the text inside the input form while also still having a margin on the input itself.

His question is stated a little wrong. What he's looking for is how to INDENT the text inside the input. Use:

text-indent: 10px; // or whatever size you need

EDIT: I do realize this is a 7 year old response, but there really aren't any other proper answers to this via google search.

like image 104
George Daniel Avatar answered Sep 24 '22 14:09

George Daniel


You're looking for padding not margin.

Margin is outside of the element and padding is on the inside

like image 39
locrizak Avatar answered Sep 23 '22 14:09

locrizak