Browser Compatability

D

Desmond

Can anyone shead some light on this. I copied some of this from a
website that claimed it works in all browsers. This is not the case.
It only works in IE but not in

Fire Fox 1.5.0.11
Netscape 7.2
Opera 8.5

http://www.des-otoole.co.uk/Menu/Menu.htm

Any ideas it passes w3c validator.

Desnmond.
 
D

Desmond

Isn't the body-tag in a bit weird place?

...
</head>
<div id="logo">
<img src="banner.jpg" alt="banner">
</div>
<body> <!-- NOT HERE!-->
<div id="menu">
<ul id="nav">
...

Ari

Don't know what happened there. I was still working on it at the time,
but the problem is still there.
Still does not work in FF Netscape or opera
 
J

John Hosking

Desmond said:
Can anyone shead some light on this. I copied some of this from a
website

Which? A trustworthy one? (Hint: no.)
that claimed it works in all browsers. This is not the case.

Uh huh.
It only works in IE but not in

Fire Fox 1.5.0.11
Netscape 7.2
Opera 8.5

http://www.des-otoole.co.uk/Menu/Menu.htm

Any time you're comtemplating "browser compatibility," you
(1) can expect that if only one browser is doing something wrong, it's
IE; and
(2) make sure you're in standards mode rather than quirks mode.

Replace your doctype with e.g.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Any ideas it passes w3c validator.

Only the HTML, not the CSS. Visit http://jigsaw.w3.org/css-validator/
and make the changes to fix the errors listed there.

Make additional changes to your CSS like the following:
#nav a
{ display: block;
width: 6.3em; /*was 50px, instead of 101px*/
}
#nav li
{ float: left;
width: 101px; /*was *50px, not 101px (images) or 6.3em (equiv text)*/
MARGIN: 0px; /*one of the validation errors. Add semi-colon */
border: 0;
padding: 0;
}

#nav li ul
{ position: absolute;
width: 6.3em; /*was 50px, instead of 101px*/
left: -999em;
border: 6; /*one of the validation errors. Remove the line */
border-left: 1px solid; /*what color border do you want? */
}

Note also that your menu will not be useful to those who can't see the
images. You could use texts instead, which would probably load faster as
well as being more accessible to more users.

You also don't need to use an image (remainder.jpg) for the gray
background. To your #menu rule, you could add background-color: #d4cbcc;
width:800px; height:25px; (where the px values should change to em
values if you swap the menu graphics for text or drop the idea of a
fixed-width site). Then you can discard the entire "menu-right" div in
the HTML and CSS.

HTH
 
E

Edwin van der Vaart

Desmond said:
Can anyone shead some light on this. I copied some of this from a
website that claimed it works in all browsers. This is not the case.
It only works in IE but not in

Fire Fox 1.5.0.11
Netscape 7.2
Opera 8.5

http://www.des-otoole.co.uk/Menu/Menu.htm

Any ideas it passes w3c validator.
In the div menu-right you forgot to add an "alt" attribute by the img.
In the style sheet for the #nav li ul you got border: 6; 6 What? px, em, %?
Try to use display: inline for #nav li ul. That way you get a horizontal
menu.
--
Edwin van der Vaart
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://www.evandervaart.nl/ Edwin's persoonlijke web site
Explicitly no permission given to Forum4Designers, onlinemarketingtoday,
24help.info, issociate.de, velocityreviews, umailcampaign.com,
gthelp.com, webfrustration.com, excip.com and many other to duplicate
this post.
 
D

Desmond

Which? A trustworthy one? (Hint: no.)


Uh huh.




Any time you're comtemplating "browser compatibility," you
(1) can expect that if only one browser is doing something wrong, it's
IE; and
(2) make sure you're in standards mode rather than quirks mode.

Replace your doctype with e.g.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">




Only the HTML, not the CSS. Visithttp://jigsaw.w3.org/css-validator/
and make the changes to fix the errors listed there.

Make additional changes to your CSS like the following:
#nav a
{ display: block;
width: 6.3em; /*was 50px, instead of 101px*/}

#nav li
{ float: left;
width: 101px; /*was *50px, not 101px (images) or 6.3em (equiv text)*/
MARGIN: 0px; /*one of the validation errors. Add semi-colon */
border: 0;
padding: 0;

}

#nav li ul
{ position: absolute;
width: 6.3em; /*was 50px, instead of 101px*/
left: -999em;
border: 6; /*one of the validation errors. Remove the line */
border-left: 1px solid; /*what color border do you want? */

}

Note also that your menu will not be useful to those who can't see the
images. You could use texts instead, which would probably load faster as
well as being more accessible to more users.

You also don't need to use an image (remainder.jpg) for the gray
background. To your #menu rule, you could add background-color: #d4cbcc;
width:800px; height:25px; (where the px values should change to em
values if you swap the menu graphics for text or drop the idea of a
fixed-width site). Then you can discard the entire "menu-right" div in
the HTML and CSS.

HTH

Thanks John. I am copied this code from an authour on the website
without fully understanding blocks and floats. I take it
1 em = about 16 px. Will test site using other browsers first as IE
seems to be more forgiving.

Thanks. Desmond.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top