By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,446 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,446 IT Pros & Developers. It's quick & easy.

Horiz. navigation ul problem in IE

P: n/a
Hey everyone.

First the requisite links:

site: http://www.joshrenaud.com/bodies/index.html
css: http://www.joshrenaud.com/bodies/stylesheets/style.css

I have a UL that I'm using for a horizontal navigation bar on a website. It
looks decent in most browsers I've checked, except for IE5.

In IE5, the links break and wrap onto a second line. But the links on the
second line overlap the upper ones.

In what is probably a related problem, I've also noticed that the navigation
bar seems to float up too high, touching the top of the page. Other browsers
(Safari, Netscape, etc) don't do this. The margin isn't set on the nav bar
itself (#MainContent ul#Menu) but on the parent div (#MainContent).

Can anyone suggest solutions to either of these problems (or a solution for
them both?)

Thanks for any help anyone can offer.

--Josh

Jul 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Josh Renaud wrote:
Hey everyone.

First the requisite links:

site: http://www.joshrenaud.com/bodies/index.html
css: http://www.joshrenaud.com/bodies/stylesheets/style.css
Yes, but that's not your only style. You might have saved me a lot of
time by mentioning

http://www.joshrenaud.com/bodies/sty...ts/styleNN.css
There's something I don't quite get. From style.css:

* html div#LeftSidebar {
position: absolute; /* property for IE5.x/PC */
p\osition: absolute; /* property for IE6/PC, IE5/Mac */
}

I don't see what that accomplishes. You've set the same value in both
properties. Why do you need them both? And you also set that value in
sytleNN.css.

div#LeftSidebar {
position: fixed; /* property for other browsers */
}

This will do nothing in conforming browsers. Because

* html div#LeftSidebar

has greater weight than

div#LeftSidebar

the value for the first selector will always be used. If you want some
browsers to use position: fixed, you need to change the css.

#MainContent ul#Menu li a:link { color: #933; }
#MainContent ul#Menu li a:visited { color: #933; }

NB: You should always set both color and background color (or set
neither) at every level of specificity.
I have a UL that I'm using for a horizontal navigation bar on a website. It
looks decent in most browsers I've checked, except for IE5.

In IE5, the links break and wrap onto a second line. But the links on the
second line overlap the upper ones.
Ditto for IE 5.5/Win. :( I cannot figure out what's wrong by looking
at the code. I'll confess I'm having a hard time processing the 2
stylesheets because they have so much overlapping material.

#MainContent {
width: 460px;

Ugh! Width fixed in pixels. This is bad practice. I wanted to test
IE/Win at wider widths, but the fixed width of content made that all but
impossible. Change the width to em units. Find a value that approximates
what you have now. Then, increase the width, and see if that changes the
behavior of the menu.

Other issues.

I looked at the HTML. Why do you use any positioning at all? It looks
like you can simply float the sidebar left. BTW,

<img src="graphics/logo.gif" alt="logo" />

alt="logo" does not help Googlebot much, nor a text browser. The alt
should be empty (but not removed).

<img src="graphics/logo.gif" alt="" />

On the same topic, your photo of the instructor is missing the alt
attribute. Add alt="" to the tag.
In what is probably a related problem, I've also noticed that the navigation
bar seems to float up too high, touching the top of the page.


This one's got me stumped at the moment. I'll reply again if I figure it
out, but you may want to simplify things on your end before continuing.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

P: n/a
Josh Renaud wrote:
Hey everyone.

First the requisite links:

site: http://www.joshrenaud.com/bodies/index.html
css: http://www.joshrenaud.com/bodies/stylesheets/style.css
Yes, but that's not your only style. You might have saved me a lot of
time by mentioning

http://www.joshrenaud.com/bodies/sty...ts/styleNN.css
There's something I don't quite get. From style.css:

* html div#LeftSidebar {
position: absolute; /* property for IE5.x/PC */
p\osition: absolute; /* property for IE6/PC, IE5/Mac */
}

I don't see what that accomplishes. You've set the same value in both
properties. Why do you need them both? And you also set that value in
sytleNN.css.

div#LeftSidebar {
position: fixed; /* property for other browsers */
}

This will do nothing in conforming browsers. Because

* html div#LeftSidebar

has greater weight than

div#LeftSidebar

the value for the first selector will always be used. If you want some
browsers to use position: fixed, you need to change the css.

#MainContent ul#Menu li a:link { color: #933; }
#MainContent ul#Menu li a:visited { color: #933; }

NB: You should always set both color and background color (or set
neither) at every level of specificity.
I have a UL that I'm using for a horizontal navigation bar on a website. It
looks decent in most browsers I've checked, except for IE5.

In IE5, the links break and wrap onto a second line. But the links on the
second line overlap the upper ones.
Ditto for IE 5.5/Win. :( I cannot figure out what's wrong by looking
at the code. I'll confess I'm having a hard time processing the 2
stylesheets because they have so much overlapping material.

#MainContent {
width: 460px;

Ugh! Width fixed in pixels. This is bad practice. I wanted to test
IE/Win at wider widths, but the fixed width of content made that all but
impossible. Change the width to em units. Find a value that approximates
what you have now. Then, increase the width, and see if that changes the
behavior of the menu.

Other issues.

I looked at the HTML. Why do you use any positioning at all? It looks
like you can simply float the sidebar left. BTW,

<img src="graphics/logo.gif" alt="logo" />

alt="logo" does not help Googlebot much, nor a text browser. The alt
should be empty (but not removed).

<img src="graphics/logo.gif" alt="" />

On the same topic, your photo of the instructor is missing the alt
attribute. Add alt="" to the tag.
In what is probably a related problem, I've also noticed that the navigation
bar seems to float up too high, touching the top of the page.


This one's got me stumped at the moment. I'll reply again if I figure it
out, but you may want to simplify things on your end before continuing.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #3

P: n/a
On Sat, 17 Apr 2004 14:05:32 -0400, Brian
<us*****@julietremblay.com.invalid> wrote:

(quoted CSS)

* html div#LeftSidebar {

Apologies if I'm way off, and feel free to dope-slap me if I am, but does
this make sense? I read this as selecting the id'ed div if it is a
descendant of html if html is a descendant of any element. But html, being
the root element, is never a descendant of any element. Should this be
legal?
Jul 20 '05 #4

P: n/a
On Sat, 17 Apr 2004 14:05:32 -0400, Brian
<us*****@julietremblay.com.invalid> wrote:

(quoted CSS)

* html div#LeftSidebar {

Apologies if I'm way off, and feel free to dope-slap me if I am, but does
this make sense? I read this as selecting the id'ed div if it is a
descendant of html if html is a descendant of any element. But html, being
the root element, is never a descendant of any element. Should this be
legal?
Jul 20 '05 #5

P: n/a
Neal wrote:
On Sat, 17 Apr 2004 14:05:32 -0400, Brian
<us*****@julietremblay.com.invalid> wrote:

(quoted CSS)

* html div#LeftSidebar {

Apologies if I'm way off, and feel free to dope-slap me if I am, but does
this make sense? I read this as selecting the id'ed div if it is a
descendant of html if html is a descendant of any element. But html, being
the root element, is never a descendant of any element. Should this be
legal?


Some versions of Internet Explorer have a "phantom" element outside of the
root element, so this is a simple way of providing styles just for them. A
quick browse of the various CSS filter sites should tell you exactly which
versions this applies to (I suspect 5.0+ on Windows).

It's syntactically correct (remember, CSS isn't only used with HTML),
however it cannot select any elements in a conforming browser when applied
to an HTML document.

--
Jim Dabell

Jul 20 '05 #6

P: n/a
Neal wrote:
On Sat, 17 Apr 2004 14:05:32 -0400, Brian
<us*****@julietremblay.com.invalid> wrote:

(quoted CSS)

* html div#LeftSidebar {

Apologies if I'm way off, and feel free to dope-slap me if I am, but does
this make sense? I read this as selecting the id'ed div if it is a
descendant of html if html is a descendant of any element. But html, being
the root element, is never a descendant of any element. Should this be
legal?


Some versions of Internet Explorer have a "phantom" element outside of the
root element, so this is a simple way of providing styles just for them. A
quick browse of the various CSS filter sites should tell you exactly which
versions this applies to (I suspect 5.0+ on Windows).

It's syntactically correct (remember, CSS isn't only used with HTML),
however it cannot select any elements in a conforming browser when applied
to an HTML document.

--
Jim Dabell

Jul 20 '05 #7

P: n/a
On Sat, 17 Apr 2004 20:03:55 +0100, Jim Dabell <ji********@jimdabell.com>
wrote:
Neal wrote:
* html div#LeftSidebar {

But html, being
the root element, is never a descendant of any element. Should this be
legal?


Some versions of Internet Explorer have a "phantom" element outside of
the
root element, so this is a simple way of providing styles just for them.


Interesting. Thanks for this explanation. It could prove useful.
Jul 20 '05 #8

P: n/a
On Sat, 17 Apr 2004 20:03:55 +0100, Jim Dabell <ji********@jimdabell.com>
wrote:
Neal wrote:
* html div#LeftSidebar {

But html, being
the root element, is never a descendant of any element. Should this be
legal?


Some versions of Internet Explorer have a "phantom" element outside of
the
root element, so this is a simple way of providing styles just for them.


Interesting. Thanks for this explanation. It could prove useful.
Jul 20 '05 #9

P: n/a
Neal wrote:
Brian wrote:

* html div#LeftSidebar {


I read this as selecting the id'ed div if it is a descendant of html
if html is a descendant of any element. But html, being the root
element, is never a descendant of any element.


Oops. That one got right by me. The op's css included a commented link
explaining it; I should have read it before replying. After reading Jim
Dabell's post in this thread, I now see that it is some way to fool some
version of MSIE/Win.

Obviously, that part of my reply about selector weight should only be
considered in light of Neal and Jim Dabell's additions/corrections.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #10

P: n/a
Neal wrote:
Brian wrote:

* html div#LeftSidebar {


I read this as selecting the id'ed div if it is a descendant of html
if html is a descendant of any element. But html, being the root
element, is never a descendant of any element.


Oops. That one got right by me. The op's css included a commented link
explaining it; I should have read it before replying. After reading Jim
Dabell's post in this thread, I now see that it is some way to fool some
version of MSIE/Win.

Obviously, that part of my reply about selector weight should only be
considered in light of Neal and Jim Dabell's additions/corrections.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.