Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

netscape, ie, and input boxes

netscape seems to display vastly different sizes for input boxes than ie does in forms - is there anything to do about this (such as maybe through stylesheets) so that I don't have to do browser detection everytime i want to make a form

thanks,

justin
0
newstandard
Asked:
newstandard
  • 2
4 Solutions
 
cheekycjCommented:
a few options:

STYLE="width:150px;" SIZE=150

or

http://www.faqts.com/knowledge_base/view.phtml/aid/14184/fid/337

CJ
0
 
anandkpCommented:
Use width attribute in style sheets for IE
& use "Size" attribute to netscape

eg : STYLE="width:100px;" SIZE=20

that shld be it -

PS : they both cannot be same ... as 150 wld be tooooooooo big for netscape

Hope that helps

K'Rgds
Anand
0
 
cheekycjCommented:
I used 150 as an example.. Any size can be used there :-)

But in essense STYLE and SIZE combination is the solution I was getting at.

CJ
0
 
mrichmonCommented:
I would recommend NOT using the SIZE attribute in them, instead use CSS and a stylesheet to define the width of the element in pixels or do it in the style of the element.

In general I prefer to have a class that defines the width.

You can either define a named class and then apply it using the class attribute like this :

(in the stylesheet)
.myclassname {width: 200px;}

<input type="text" name="test" class="myclassname">

Or you can have the stylesheet apply the class by default to inputs like this :

(in the stylesheet)
input { width:200px;}


However, I have found that it works more reliably if you use the first option and name the class as some browsers have trouble with applying a default style to certain types of form elements.
0

Featured Post

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now