Posted on 2000-03-11
Last Modified: 2010-04-09
My input tags look fine in NN but in MSIE they are considerably shorter and it's a real pain. Is there any way to force MSIE to display INPUT tag lengths in the same way as NN does?
Question by:lhutton

Expert Comment

ID: 2609017
You can try this script to make the input box longer :
<input type = text name = myTextBox style = "width : 100">

and this code will make a 100 pixel width text box in IE
-- Holy Spirit

Expert Comment

ID: 2609348
or you can try this:
<input type="text" name="myTextBox" size="100">
...this should achieve the same effect as Holy Spirit's suggestion.

Expert Comment

ID: 2609494
HolySpirit's suggestion is different from chaduka's suggestion. The former specifies the exact size in pixels.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 2610565
Explanations, please! I've just discovered some things I wasn't aware of...

It seems that without a size (or style) attribute, NN automatically makes the width of my input tag the width of the table cell. Is it supposed to do that? When I use a style tag, IE takes notice but NN still makes it the width of the table cell, whether the width is set to 2 or 2000!!

This is really bizarre. I would love to hear from someone, some explanations as to what's happening here :)
LVL 10

Expert Comment

ID: 2612925
<input type="text" name="myTextBox" &{"size=4"}; size="4">

Accepted Solution

nettrom earned 25 total points
ID: 2615278
size="100" and style="width:100px" aren't equivalent since the input is of type "text", see

Netscape will ignore the style setting since it's not good at applying style properties to form elements.

I'd say that it's impossible to get the input field to be the exact same size in both IE and Netscape.  create it with a size that fits (in other words, set it to be the default number of characters you'd like), and then see how it works out.  if IE sizes it incorrectly, try applying a width using the style attribute.  using values relative to the font size of the user might be what you're looking for, e.g:

<input type="text" name="test" size="40" style="width;40em;">

for more information regarding style & CSS, see or the CSS2 spec (the part where values is defined is )

Author Comment

ID: 2616213
Thanks nettrom. That explains things better :)

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Little bit of help styling my heading 3 31
Can't get second accordion on page to work 2 13
Ouput in html in powershell 2 20
Bootstrap 3 - Style a dropdown 1 13
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question