css in netscape 4 anyone?
hello
i've been trying to figure this out for hours but am failing miserably.
i have
<STYLE TYPE="text/css">
<!--
DIV.productmenu {PADDING: 10px; MARGIN-LEFT: 7px; MARGIN-RIGHT: 7px;
MARGIN-BOTTOM: 7px; BACKGROUND-COLOR: #CCCCCC; WIDTH: 170px;
FLOAT: RIGHT; BORDER-STYLE: SOLID; BORDER-WIDTH: 1px;}
-->
</STYLE>
according to a book i'm using padding & margin are both supported by netscape 4.x - but for some reason - with the padding...it works but the background color doesn't cover the padding area.
as for margins they don't work at all
in fact when i take the margin commands out at least my menu floats right like its supposed to - but with those stupid commands there it doesn't recognize the float comman either.
any ideas? please help
Thanks!
Suzanne posted this at 19:25 — 28th January 2003.
She has: 5,507 posts
Joined: Feb 2000
You are experiencing how it works.
Recommendations are:
1. live with the difference in display
2. design a different display for N4.x and hide the other display from it
3. don't use positioning with N4.x at all
ktown posted this at 19:32 — 28th January 2003.
They have: 34 posts
Joined: May 2001
unbelievable
i wish netscape didn't let people donwload old versions of their broswers... tho i think 7 is pretty bad as well
how would i go about designing a different display for NS4.x?
i heard somewhere that javascript broswer sniffers can be really bad. waht do you think?
thanks suzanne
Busy posted this at 20:19 — 28th January 2003.
He has: 6,151 posts
Joined: May 2001
there are ways around what your trying to do in NS4.* (like margin:7px) but can affect the newer browsers.
to have a different display in new and old use CSS.
use the method for the older and the import (@style.css) for the new
ktown posted this at 20:57 — 28th January 2003.
They have: 34 posts
Joined: May 2001
hi busy
what do you mean by
???
new and old what broswers? i've been wondering about that too...
how does that work?
do i need to write 2 separate stylesheets - one for ns4 & one for everythig else?
i'm a little confused.
does that mean that i need a broswer sniffer (or whatever they're called)? - so i attach the stylesheet that works in NS4 and then IF they are in a different browser i import anohter one?
sorry - i know basic css - this is the first time that i'm trying to do something that is more complex than controlling font sizes.
Suzanne posted this at 21:03 — 28th January 2003.
She has: 5,507 posts
Joined: Feb 2000
I think browser sniffers are horrific. I also think you need to learn a bit more about which browsers support what. N7 is head and shoulders above most other browsers for standards support.
Old Netscape browsers (4.x) came out just when CSS came out, and don't really support CSS, but rather their own JSS. CSS is translated through their JSS engine.
Yes, two stylesheets, but you can embed one in the other -- in the linked stylesheet (read by N4.x), at the very top put:
@import "advanced.css";
And put the rest of the styles (everything that hurts N4.x) in the advanced.css file.
Trying http://www.ericmeyeroncss.com for more information. Buy the book!
dk01 posted this at 21:31 — 28th January 2003.
He has: 516 posts
Joined: Mar 2002
I have been experimenting and apparently using
background: url(mycolor_1px.jpg) #fff;
will actually cover all areas. Apparently using a 1x1px gif or jpg image which repeats, actually performs normally in ns4.
-dk
dk01 posted this at 21:33 — 28th January 2003.
He has: 516 posts
Joined: Mar 2002
Just wanted to add that although this is a solution to one problem, you will eventually find more problems and require some sort of workaround (like the @import one mentioned above). These however are only compatible for now, and i have even gotten ns7 and it did not do the @import workaround correctly. I decided I'd just use php instead to serve the right css to the browser using a php browser sniffer. Good luck.
-dk
Suzanne posted this at 00:29 — 29th January 2003.
She has: 5,507 posts
Joined: Feb 2000
N6 and N7, while understanding @import, also understand the things you want to hide from N4.x. It most certainly does process @import correctly.
dk01 posted this at 21:39 — 5th February 2003.
He has: 516 posts
Joined: Mar 2002
Ahh mispoke there. That's what I meant. The actual problem was, as Suzanne said, that it processes all of the rules in both of the files (NS4 & Other).
One alternitive is a php browser sniff.
-dk
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.