Print Page | Close Window

VS.NET and Firefox

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11856
Printed Date: 29 March 2026 at 11:03pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: VS.NET and Firefox
Posted By: Mart
Subject: VS.NET and Firefox
Date Posted: 18 September 2004 at 3:15pm
Hey guys,

I'm having some trouble with the way that Mozilla firefox shows form fields that were designed in the Visual Studio.NET 2003 Designer.
Basically if I have a Textarea (just a normal .NET Textbox with TextMode set to Multiline) and I drag it to the size I want it looks fine in IE, however firefox seems to ignore it and display it as a tiny field.
How am I supposed to define the size of form fields in Mozilla?



Replies:
Posted By: Mart
Date Posted: 18 September 2004 at 3:26pm
Just incase you have no idea what I am going on about (like usual) I have uploaded a image showing it. Those fields should be a lot bigger (and are in IE)




Posted By: dpyers
Date Posted: 18 September 2004 at 7:19pm

Text boxes and such vary by font and character size - they are sized for x characters/columns wide by y lines tall. The gecko browsers, at least at larger screen resolutions, tend to display text smaller than ie does. So, a box that's 50 characters wide looks smaller in gecko than in ie.

On my 1600x1200 display, I have to increase font's by 120-125% in mozilla/firefox to get them close to ie visual representations.

One solution might be to use css to define font sizes by % - e.g. normal = 100% and change the css to increase the size by 20-25% if gecko's are detected. - Note that some font's scale better than others, and some scale well in certain sizes, put poorly in other sizes. You'll have to do a little experimentation.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Mart
Date Posted: 19 September 2004 at 5:04am
hmm From what I see it likes ignoring me, I set the width to 100% and it still  displays it small


Posted By: Mart
Date Posted: 19 September 2004 at 5:06am
Actually it seems to like it when I use CSS


Posted By: dpyers
Date Posted: 19 September 2004 at 4:26pm
Might have something to do with the doctype. Don't think width="" is supported for textboxes in 4.01 strict and xhtml. Might want to try width="" and specify the doctype as 4.01 transitional.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Mart
Date Posted: 19 September 2004 at 4:34pm
As its a server control I think ASP.NET translates it to style="WIDTH:xxxpx". I will check though


Posted By: Mart
Date Posted: 19 September 2004 at 4:41pm
Yes, as far as I can see it is being translated to a style tag


Posted By: sjb189
Date Posted: 11 November 2004 at 5:13pm

With regards to Mart's issue of textboxes created in .NET and displaying incorrectly Firefox, I am having similar problems. Mart mentioned that using CSS seemed to work. I have tried setting the width directly and using a CSS file instead, none seem to be working. All my text boxes are being displayed with a default length in Firefox.

Any suggestions on how to solve this issue using CSS or otherwise?



Posted By: Mart
Date Posted: 11 November 2004 at 5:36pm
I fixed it in the end by using relative widths (%) and not absolutes widths (px) which VS likes to use.


Posted By: jookyone
Date Posted: 16 November 2004 at 1:30pm
This may be something of a dirty workaround to some people, but to avoid having to associate css rules with my textboxes or other input fields I simply would define a textbox like this:
<asp:textbox id="Textbox1" runat="server" columns="10" width="50px">


IE uses the width attribute to render the input control, and Firefox uses the columns attribute, ignoring the width attribute completely. Of course, as mentioned in a previous post, Firefox computes the width of an input field using the columns attribute by multiplying the number of columns with the width of the font characters. So keep that in mind, but if you use a consistent font size for your form controls throughout your application, it should be no trouble to figure out the relation of width in pixels to the columns value.

Hope that helps you out.


Posted By: sjb189
Date Posted: 16 November 2004 at 2:02pm

Thanks for the replies, I am currently busy with other things, but will certainly try these suggestions out next week...

Thanks.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net