How to set the height of an input (text) field in CSS?

Arrie picture Arrie · Oct 15, 2012 · Viewed 130.9k times · Source

Sorry for this question but I can't seem to find an answer anywhere. I have CSS code that should set the height of my text box. I am using VS2010 Express for Windows phone, coding in HTML/CSS/Javascript/C#.

HTML

<input class="heighttext" type="text" id="name">

CSS

.heighttext{
  height:30px
}

I can set the height to anything I like, but the text box will stay the same! Please help, or at least send me a link that can!

Answer

Dipak picture Dipak · Oct 15, 2012

Try with padding and line-height -

input[type="text"]{ padding: 20px 10px; line-height: 28px; }