Reputation:
How do I make the text box width look uniform across all browsers?
Please help me,
Upvotes: 2
Views: 986
Reputation: 19636
If I understand correctly you are specifying a size in pixels and it is not working (if not, just set a pixel value using "width" in css)?
<input type="text" size="20">
This should be the same size across all browsers, but so should a pixel value specified in a CSS document. Can you post some code and the specific issues you are having with each browser?
Upvotes: 0
Reputation: 24182
If it needs to be EXACTLY the same in every browser possible, then you will need to use flash or silverlight, as HTML inputs are supposed to be rendered as the user chooses them to be (according to the OS style). You could do tricks with style to remove the system border and set them to the width you wich in pixels. For example see here: http://freeyourdesign.com/css/css-custom-search-field-or-textfield/
Upvotes: 1
Reputation: 54605
What do you mean a <textarea>
?
Then just use css and set the width. e.g.
<textarea ..other stuff.. style="width:500px">
Upvotes: 1
Reputation: 187030
What about setting the width attribute in style
<input type='text' id='txt1' style='width: 100px;' />
Better create a class and apply that to the textbox
<style>
.txtBox { width: 100px; }
</style>
<input type='text' id='txt1' class='txtBox' />
Upvotes: 0