473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Setting textbox width for Netscape 4.7

I'm trying to set the width of a textbox via a style sheet but it isn't working for Netscape 4.7

This is what the page looks like:
<form>
<input type="text" class="t1">
</form>
This is what the style sheet looks like:

..t1 {
width: 15;
}
It works in IE and Netscape 7 but not in Netscape 4. In NS4, it appears that the "width" property of a textbox doesn't work at all.... you have to use "size". I tried using "size" in the style sheet but it doesn't work.

Any advice would be greatly appreciated. Thanks!

--
Jeff Nibler
Jul 20 '05 #1
20 4200
Jeff Nibler wrote:
This is what the style sheet looks like:

.t1 {
width: 15;
}
15 what? Units are required for non-zero lengths.

<http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you>
It works in IE and Netscape 7 but not in Netscape 4.


Netscape 4 is a browser with tiny market share and very poor support for
CSS. Many (probably most) authors who use CSS don't worry about the
appearance in NS4 and use the multiple media type or @import hack to hide
the styles from that browser.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #2
"Jeff Nibler" <dj******@spam-me-not-hotmail.com> wrote:
I'm trying to set the width of a textbox via a style sheet but it isn't working for Netscape 4.7
Netscape 4 has very poor CSS support. It supports virtually no styles
at all on input elements. And it frequently screws up what few styles
it does try to support.
.t1 {
width: 15;
}
All non-zero lengths must have units.
I tried using "size" in the style sheet but it doesn't work.


Of course not, size isn't a CSS property.

Best advice is to stop worrying about NN4 and let your pages go
unstyled in that relic.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
Thanks for the reply. Unfortunately, I am forced (by clients) to write this
site with Netscape 4.7 in mind. For some reason, many of our clients still
use Netscape 4.7 in their operations and absolutely refuse to upgrade to
newer versions even though it is free to do so.

As for units... it doesn't matter. I have tried width: 15px; but that
doesn't work either.

--
Jeff Nibler

"David Dorward" <do*****@yahoo.com> wrote in message
news:cf*******************@news.demon.co.uk...
Jeff Nibler wrote:
This is what the style sheet looks like:

.t1 {
width: 15;
}


15 what? Units are required for non-zero lengths.

<http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you>
It works in IE and Netscape 7 but not in Netscape 4.


Netscape 4 is a browser with tiny market share and very poor support for
CSS. Many (probably most) authors who use CSS don't worry about the
appearance in NS4 and use the multiple media type or @import hack to hide
the styles from that browser.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Jul 20 '05 #4
On Mon, 9 Aug 2004 13:22:44 -0700, Jeff Nibler
<dj******@spam-me-not-hotmail.com> wrote:
Thanks for the reply. Unfortunately, I am forced (by clients) to write
this
site with Netscape 4.7 in mind. For some reason, many of our clients
still
use Netscape 4.7 in their operations and absolutely refuse to upgrade to
newer versions even though it is free to do so.

As for units... it doesn't matter. I have tried width: 15px; but that
doesn't work either.

Please don't put quoted material in a signature.

Tell them that the only way to support modern browsers AND NN4 is to set
up separate stylesheets and that's going to double the cost. Because
that's exactly what you'll have to do here.
Jul 20 '05 #5
Jeff Nibler wrote:
Unfortunately, I am forced (by clients) to write this
site with Netscape 4.7 in mind.


Then you should forget about trying to use much CSS, since NS 4.x has
rather limited CSS support, and what it *does* support tends to be buggy.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 20 '05 #6
"Jeff Nibler" <dj******@spam-me-not-hotmail.com> wrote:

Please don't top post in this group [manually corrected this once] and
trim down the quoted bit to the minimum required. Only your sig should
follow your sig delimiter, quoting below a sig delimiter screws up other
people's ability to follow up properly.
Netscape 4 is a browser with tiny market share and very poor support for
CSS. Many (probably most) authors who use CSS don't worry about the
appearance in NS4 and use the multiple media type or @import hack to hide
the styles from that browser. Thanks for the reply. Unfortunately, I am forced (by clients) to write this
site with Netscape 4.7 in mind.
That doesn't mean that you have to give NS4 users styled content.
Properly marked up content sans styling will work fine for NS4 users.
Educate your client if they have a problem with that. If that fails,
consider not using CSS at all and create a tag soup site.
As for units... it doesn't matter. I have tried width: 15px; but that
doesn't work either.


It does matter, even though it may not solve your immediate problem.

--
Spartanicus
Jul 20 '05 #7
On Mon, 9 Aug 2004, Jeff Nibler wrote:
Thanks for the reply.
Those who are genuinely grateful show their thanks by taking advice,
and even sometimes repaying the compliment by passing it on to others.
Unfortunately, I am forced (by clients) to write this
site with Netscape 4.7 in mind.
I think we all have NN4.* "in mind". Sometimes, it's just not capable
of the more interesting parts of stylesheets, but that doesn't
necessarily mean you can't make content accessible (and, within
certain limits, even cosmetically attractive) if you put your mind to
it (and charge your customer accordingly, natch).
As for units... it doesn't matter.
OH YES IT DOES...

Any client which does anything other than to ignore a non-zero value
without units is in a State of Sin as far as CSS is concerned. So if
it ever does what you want, it's a bug - and that's official.
I have tried width: 15px; but that doesn't work either.


"doesn't work"? There's a lot of that about nowadays: lounging around
on the couch, drinking beer and watching TV all day.

Which is just a way of saying "don't you realise you just triggered a
standard response"? I recommend perusal of
http://www.catb.org/~esr/faqs/smart-questions.html

In this case, especially
http://www.catb.org/~esr/faqs/smart-...html#id2888580

good luck
Jul 20 '05 #8
"Neal" <ne*****@yahoo.com> wrote in message
news:op**************@news.individual.net...
On Mon, 9 Aug 2004 13:22:44 -0700, Jeff Nibler
Tell them that the only way to support modern browsers AND NN4 is to set
up separate stylesheets and that's going to double the cost. Because
that's exactly what you'll have to do here.

That is exactly what I am trying to do. I have a js include (on each page)
that detects the browser version, then uses document.write to write the link
to the appropriate style sheet. The problem is that I cannot find a way to
set the width of a textbox in a style sheet for Nestscape 4.7. I've been
searching the web and usenet archives all day and am finding that Netscape
4.7 doesn't support any size/width attributes in CSS for a textbox. It is
looking like the only way around this is create two completely separate
pages; one for NS4 and one for all others. The NS4 page will have it's
textbox widths set via the "size" property directly on the page, and the
other version of the page will use a CSS. I will use ASP, CGI, or JavaScript
to automatically detect their browser version and display the appropriate
page. It is ridiculous, but I can't find any other way to accomplish the
desired result.

I hear a lot of people saying how obsolete Netscape 4.7 is, but you would
not believe how many large corporations still use it (especially for
intranets) and refuse to upgrade to a newer browser. The issue for many of
them is that their IS department would need to handle the roll-out which can
cost a lot of money depending on the size of the organization.

Jul 20 '05 #9
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in message
news:Pi*******************************@ppepc56.ph. gla.ac.uk...
As for units... it doesn't matter.


OH YES IT DOES...

Any client which does anything other than to ignore a non-zero value
without units is in a State of Sin as far as CSS is concerned. So if
it ever does what you want, it's a bug - and that's official.
I have tried width: 15px; but that doesn't work either.


"doesn't work"? There's a lot of that about nowadays: lounging around
on the couch, drinking beer and watching TV all day.

Which is just a way of saying "don't you realise you just triggered a
standard response"? I recommend perusal of
http://www.catb.org/~esr/faqs/smart-questions.html

In this case, especially
http://www.catb.org/~esr/faqs/smart-...html#id2888580


When I said "it doesn't matter" and "doesn't work," I was referring to the
specific behavior I am experiencing with Netscape 4.7. Your links refer to
someone who asks a question with no information. If you read my original
question, you would understand that in my reply, "doesn't work" means
"Netscape doesn't change the width of a text box when I use width: 15 and it
ALSO doesn't change the width of the textbox when I use width: 15px," which
is what I meant by "doesn't matter." If I had said, "it doesn't work"
without first giving a detailed explanation (in my original post), then I
would understand your flame. But thanks anyway.

Jeff


Jul 20 '05 #10
On Mon, 9 Aug 2004 22:41:17 +0100, Alan J. Flavell wrote:

('doesn't work')
http://www.catb.org/~esr/faqs/smart-...html#id2888580


They missed my favorite response!
"Flog it with a whip".. ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #11
On Mon, 9 Aug 2004 15:05:45 -0700, Jeff Nibler wrote:
That is exactly what I am trying to do. I have a js include (on each page)
that detects the browser version,
This is a bad way to go. JS gurus generally advocate
'object/feature detection' to ascertain what can and
cannot be done in a particular browser, but..
..then uses document.write to write the link
to the appropriate style sheet.


This is better handled using pure CSS/HTML..

<link rel="...." type='text/css'>

...can be read by old IE and NN, whereas..

<style type='text/css'>
@import ...
</style>

...will be completely ignored ny the old browsers.

HTH

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #12
On Mon, 9 Aug 2004 15:17:48 -0700, Jeff Nibler wrote:
If I had said, "it doesn't work"
without first giving a detailed explanation (in my original post),
Which readers of later posts may not have access to..

Whereas if you'd said "it doesn't resize",
everybody has a chance of being on the same
page.
..then I
would understand your flame.
(chuckles) You'll know a flame when
your ass is smoldering..
..But thanks anyway.


But feel free to give a back-hand response that
indicates you are 'so much better' than the
person who'm you perceive to have slighted you.

<dripping with..>
I'm sure everybody will be convinced..
</dripping with..> ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #13
On Mon, 9 Aug 2004 15:05:45 -0700, "Jeff Nibler"
<dj******@spam-me-not-hotmail.com> wrote:
"Neal" <ne*****@yahoo.com> wrote in message
news:op**************@news.individual.net...
Tell them that the only way to support modern browsers AND
NN4 is to set up separate stylesheets and that's going to
double the cost. Because that's exactly what you'll have to do here.


That is exactly what I am trying to do. I have a js include...
that detects the browser version...


Bad move; stay on CSS only and read up on the @import directive.
(see Andrews post below for details)

You may also want to read the following article...

<http://www.css.nu/articles/About-JSSS.html>

....and make sure to follow the link to 'JSSS'.

A full understanding of what 'JSSS' has to "offer" as specified, will
also tell you what level of CSS that NS4x browsers can handle so don't
expect much luck with styling for form elements as it is.

Anyway; and this is just a silly idea, if you can find a way to have all
other browsers but NS4x to ignore a 'JSSS' style sheet, you could write
one to be served specifically for NS4x, it would work as a fact :-)

--
Rex
Jul 20 '05 #14
On Mon, 09 Aug 2004 22:58:01 GMT, Andrew Thompson
<Se********@www.invalid> wrote:
On Mon, 9 Aug 2004 15:05:45 -0700, Jeff Nibler wrote:

[...]
..then uses document.write to write the link
to the appropriate style sheet.


This is better handled using pure CSS/HTML..

<link rel="...." type='text/css'>

..can be read by old IE and NN, whereas..

<style type='text/css'>
@import ...
</style>

..will be completely ignored ny the old browsers.


While what you say is completely true of course, I would still recommend
that the @import directive should be a part of the linked external style
sheet.

The STYLE element is in reality not a good design, after all we are
supposed to keep markup and presentational suggestions as separate
resources.

--
Rex
Jul 20 '05 #15
Alan J. Flavell wrote:
Jeff Nibler wrote:
As for units... it doesn't matter.


OH YES IT DOES...


OH NO IT DOESN'T!

Yeah, I know it's months from Christmas, but I just couldn't help myself.
that doesn't work either.


"doesn't work"? There's a lot of that about nowadays: lounging
around on the couch, drinking beer and watching TV all day.


Hm, that describes me, minus the beer (who can afford it?) and the TV
(who can afford it?). Ah, unemployment, how I have grown to know you too
well.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #16
Jeff Nibler wrote:
I have a js include (on each page) that detects the browser version,
then uses document.write to write the link to the appropriate style
sheet.


This does not look good.

1) what if javascript is off?
2) how reliable is a js browser sniffer?
3) why use document.write when a simple @import will do?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #17
On Mon, 9 Aug 2004 15:05:45 -0700, Jeff Nibler
<dj******@spam-me-not-hotmail.com> wrote:
"Neal" <ne*****@yahoo.com> wrote in message
news:op**************@news.individual.net...
On Mon, 9 Aug 2004 13:22:44 -0700, Jeff Nibler
Tell them that the only way to support modern browsers AND NN4 is to set
up separate stylesheets and that's going to double the cost. Because
that's exactly what you'll have to do here.

That is exactly what I am trying to do. I have a js include (on each
page)
that detects the browser version, then uses document.write to write the
link
to the appropriate style sheet.


Eww. Javascript cannot be relied upon for this.

Simplest way I can think of is to link to a screen CSS which is set up so
NN4 renders properly, then import a stylesheet which cancels everything
out explicitly which needs to be and sets the proper values. Not exactly
simple though.
I hear a lot of people saying how obsolete Netscape 4.7 is, but you would
not believe how many large corporations still use it (especially for
intranets) and refuse to upgrade to a newer browser. The issue for many
of
them is that their IS department would need to handle the roll-out which
can
cost a lot of money depending on the size of the organization.


Still, it's not smart for businesses to avoid new technology. That's the
surest path to Chapter 11 in this economy. Especially when it can be done
as cheaply as it can, I can't really excuse sticking to NN4 - not that you
have much choice in the matter.
Jul 20 '05 #18
On Mon, 9 Aug 2004, Jeff Nibler wrote:
When I said "it doesn't matter" and "doesn't work," I was referring to the
specific behavior I am experiencing with Netscape 4.7.
When you code:

.t1 {
width: 15;
}

and a browser does nothing in response, then the browser *is* working
as designed. CSS is *supposed* to be ignored when incorrectly
specified.

Any browser which behaves differently with and without the above
(incorrect) CSS is broken. It's not working, it's a dead parrot,
it's expired... well, you get the idea.

That only reinforces the advice that every problem description needs:

1. a clear statement of what you did (we got that OK here, although in
many cases around here we would need an online sample in order to get
the complete picture),

2. What you *expected* to happen

3. What you *observed* to happen

Then you stand a good chance of getting properly advised (i.e that
maybe it was your expectation which was at fault).
If you read my original question,
Whaddyer mean, "if"?
you would understand that in my reply, "doesn't work" means
"Netscape doesn't change the width of a text box when I use
width: 15
But that *is* working. OK, OK, I concede that it's working for the
wrong reason (because NN4 doesn't implement it at all, rather than
because it's deliberately ignoring the improper specification), but
that doesn't change the fact that *in this particular instance*, NN4's
behaviour is just what CSS wants. (It doesn't happen to be what you
wanted, but now you know better, right?)
would understand your flame. But thanks anyway.


You haven't seen a Usenet flame yet, it seems.

good luck

Jul 20 '05 #19
On Tue, 10 Aug 2004 00:16:30 -0400, Neal <ne*****@yahoo.com> wrote:
Still, it's not smart for businesses to avoid new technology. That's the
surest path to Chapter 11 in this economy.
As a general statement, I'd have to disagree with you. There's a good
deal of "new technology" floating around which companies can avoid with
little harm, and in some cases with considerable benefit.
Especially when it can be done
as cheaply as it can, I can't really excuse sticking to NN4 - not that you
have much choice in the matter.


OTOH in the specific case of NN4 I can agree with you.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #20
Jeff Nibler wrote:
I'm trying to set the width of a textbox via a style sheet but it isn't
working for Netscape 4.7

This is what the page looks like:
<form>
<input type="text" class="t1">
</form>
This is what the style sheet looks like:

.t1 {
width: 15;
}
It works in IE and Netscape 7 but not in Netscape 4. In NS4, it appears
that the "width" property of a textbox doesn't work at all.... you have
to use "size". I tried using "size" in the style sheet but it doesn't work.

Any advice would be greatly appreciated. Thanks!

--
Jeff Nibler


What I do is use html 4.01 transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
and hide css from Netscape 4.7 with
<link type="text/css" rel="stylesheet" href="style.css" media="all">
and
<body lang="en-US" text="#000000" link="#355e00" vlink="#000000"
bgcolor="#ffffff" background="mint.gif" dir="ltr">
An example is at
http://www.a-wee-bit-of-ireland.com/eire_jan_2004/

I hope this helps.
Jul 20 '05 #21

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Laura | last post by:
Hello, Newbie question: Does anyone know how to dynamically set the screen width in an applet? I have an applet that creates a horizontal bar menu on a webpage, and I would like the width to be...
2
by: Jay Vinton | last post by:
A server control textbox width displays in IE6 the same as in the 2003 IDE. But in Netscape 8 and Firefox 1.0.4 the width is only about 1/3 of it's design setting. I've tried putting the textbox...
2
by: Paresh Dhakan | last post by:
Hi ! I am facing a wierd problem in setting the width of a form to 20. Suppose I create two forms Form1 and Form2. Form1 is the container, meaning this.IsMdiContainer = true; Form2 is...
2
by: Harry | last post by:
Hi I'm trying to set the width of a textbox from the server side. I've tried dim tb as new Textbox() tb.width = "80" but this gives me an error saying that the "value of string cannot be...
1
by: craigkenisston | last post by:
I'm creating a form with asp.net. I have my inputs like this : <label for="USER_COMPANY">Company Name:</label> <asp:textbox id="USER_COMPANY" runat="server" cssclass="inputBox"...
0
by: Stuart | last post by:
Hi there Someone please put me out of my misery... I am attempting to offer a graphical view of some data in an aspx page by using the width property of some colored text boxes. The data is...
2
by: Jacques Leclerc | last post by:
What's the trick to dynamically setting the width of a textbox? In the code behind page Page_Load function I'm trying to dynamically set the width of a textbox. TextBox1.Width = "75px" I...
0
by: mutlyp | last post by:
I have a PreRender event to set the width of my textbox when the Edit button is pressed on my grid here is the code: Private Sub grdPBC_PreRender(ByVal sender As Object, ByVal e As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.