PDA

View Full Version : styling a textbox



jarv
Mar 8th, 2010, 01:28 PM
hi,

I have been told never to use PADDING and WIDTH together.

I am trying to style a textbox and I want it about 99% width and I want the text to be in the middle of the box but don't want to use padding, is there any other way?

J

abduraooft
Mar 8th, 2010, 01:30 PM
I am trying to style a textbox and I want it about 99% width and I want the text to be in the middle of the box but don't want to use padding, is there any other way? Do you see anything wrong with your current display? if so please post your code or a link.

met
Mar 8th, 2010, 03:31 PM
I have been told never to use PADDING and WIDTH together.


this is incorrect information, you can use padding and width together with no problems, providing you take in to account the box model (total_width= margin + border + padding + width)


as for what you are asking ~



<input type="text" style="width:99%; padding:5px; text-align:center;" name="textfield" id="textfield" />


works fine.