<input type="text" placeholder="Enter Username" />

as you can see in file. i have a filed and in that field i have a placeholder "Enter username". but placeholder is bit high. i want to lower it. i am not sure best way to go about this. iam think using css tags

Attachments tes.png 7.13 KB
5 Years
Discussion Span
Last Post by <M/>

does it make it differce if i use padding-top? do you know what is the diffence between line-height and padding-top


Line height is when you adjust the spacing of the text... as an example, have you ever had an english teacher that would make you force you to follow the MLA rules and make you double line spacing? That is an example of what line spacing looks like.

Padding on the other hand is would push everything in the div down, left, right, top (wherever it is set to)...

You should look more into line height and Paddings... you will get used to them later on!

It would make a difference later on if you use padding top and line height if your manipulating more lines of text :)

Visit some websites to learn more about them or use this site :)

Hope this helps!

Feel free to ask more questions!


In this particular example, if you set a line-height to something just under the height of the input field, then you can play around with any font face, font style, font size, etc. and it will vertically center the text.

If you use padding, instead, then you'll have to use your eye to figure out the best number of pixels to push the text down, and it might not look perfect for people in other operating systems that might not have the font installed (Arial for Windows vs Helvetica for Mac, for example).

It's a good idea for the input field to have 1 or 2 pixels of padding because it doesn't just control vertical spacing but horizontal spacing as well, and you don't want the text to rub right up against the edge of the textbox. (Most web browsers give input fields a few pixels of padding by default, but it's good practice to overwrite this for consistency among browsers.)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.