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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

735 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