Forum Moderators: open

Message Too Old, No Replies

NS 4.7 CSS / mouseover problem

4.7 mouseover/css conflicts

         

sparky

8:21 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



I have designed a site that works perfectly in IE 5.5+ but has a peculiar problem in netscape 4.7.

The site in question employs a navigation bar consisting of a table with one row and 11 columns / cells. Each table cell (td) contains a mouseover image for site navigation.

For some reason netscape 4.7 keeps extending the height by about 10 pixels of each cell, with the mousover graphic aligning to the bottom. This leaves a row of 'padding' along the top of the navigation bar, which causes the background image in the table row to tile and look chronic.

It works fine in Explorer 6, but not in netscape 4.7.

My web stats recorded over the last year show that out of 1000's of visitors only just over 1% use netscape. I have so far only succeeded in eliminating the problem by removing the css sheet altogether. But it's such a pain that I have to deleberately deconstruct good design to make it work for such a tiny minority. I used to be a devotee of Netscape, but these days I just wish it would quietly fade away.

Are there any friendly techies out there that can suggest a js workaround/fix, or anything else to make netscape behave itself?

DrDoc

8:41 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World [webmasterworld.com]!

You might want to take a look at the CSS Forum [webmasterworld.com]

Also, for problems with CSS in NN4, consult the thread on how to make style sheets work in NN4 [webmasterworld.com]

Add this to your style sheet, and you'll see that it'll look better:

td img {
display: block;
}

sparky

10:24 pm on Mar 16, 2003 (gmt 0)

10+ Year Member



Many thanks Doc. I've tried your suggestion, and read all the relevant posts I could find in the css forum.

I've not been able to solve the problem yet.

The problem seems to be that in NN4 if you specify a line height for text in the <td> tag of the style sheet, images placed in <td> tags will never align correctly. Extra space is placed above the image, the latter being forced to align at the bottom.

As I see it, this leaves me a stark choice of removing line heights to please NN4, or stick with them for IE5+ and let my 1% of NN4 visitors view default times new roman etc.

I even tried to force Netscape to at least display the correct font size with a basefont tag, but that doesn't work when a style sheet's attached.

DrDoc

8:56 am on Mar 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I think I ahve the solution for you then :)

Do this in your style sheet:

...
font-size: (whatever works in NN4)
/*/*/
(additional styles/changes that mess up the layout in NN4)
/* NN4 */
...

NN4 will ignore anything put between /*/*/ and /* NN4 */

sparky

7:42 pm on Mar 17, 2003 (gmt 0)

10+ Year Member



Well I have to take my hat off to you Sir! That's shut the little bugger up.

It worked. Strangely though, I had read your post about this technique in the Style sheets in NN4 discussion, and tried it yesterday - but couldn't make it work.

I tried it again today, and now it works, I suspect I had typed a wee syntax error first time.

Yours, indebted.

DrDoc

12:30 am on Mar 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're welcome! ;)

The trick is that there can't be any spaces between the characters on the /*/*/ line. That will "lock" the style sheet for NN4 until it encounters a normal comment, which will "unlock" it, and NN4 will continue parsing.

sparky

12:38 pm on Mar 18, 2003 (gmt 0)

10+ Year Member



That's been a great learning curve for me... but now I'm wondering will style sheets work properly in earlier versions of IE, such as IE4. I currently test on IE6.