Click to See Complete Forum and Search --> : CSS Menu Help Please


grimmylina
05-08-2008, 03:59 PM
Hello,

I found this menu by Stu Nicholls:

http://www.cssplay.co.uk/menus/flyout_wall.html

I tried to adapt it to my site:

http://www.catalinahotel.com/allie/v2/index_copy.html

Couple of questions:

1.) Can everybody see it properly?
2.) Is it a good choice?
3.) I got the first 2 links to work properly (maybe because there are no sub-levels). On the 3rd (Amenities) I'm having trouble. I was trying to get the rollover to work for "pool" but haven't been able to.

There's a line in the css that points to a face1.gif...face2.gif, etc. I am not sure what that points to. Could that be my problem? :confused:

Thanks!!

Allie

KDLA
05-08-2008, 09:04 PM
In Firefox/Windows, when you attempt to hover over the second level links, they disappear once the cursor is moved from the first level to hover the second level.

WebJoel
05-08-2008, 09:14 PM
I noticed a missing !doctype, and several unexpected "</a>"s, and the usual dismissable 'warnings' (about 45 of them).

When I placed borders upon all block-level elements, I noted that there seems to be alot going on here. Hmm... might take some time to sort out.

Centauri
05-09-2008, 03:02 AM
Not sure why you are messing about with all those images and subsequent classnames. The Stu Nicholls' method of illegally nesting tables inside <a> links with conditional comments is very messy and not recommended - the suckerfish method is much better and cleaner. You also have a very confusing text and structure that does not match the graphics at all.

Consider this demo - no graphics at all :<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
<!--
#nav, #nav ul {
margin: 0;
padding: 0;
width: 208px;
}
#nav li {
list-style: none;
position: relative;
margin-bottom: 4px;
float: left;
width: 100%;
}
#nav a {
text-decoration: none;
display: block;
height: 30px;
line-height: 30px;
padding-left: 20px;
color: #FFFFFF;
font-weight: bold;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
border-right: 4px solid #FFF;
}
#nav li a:hover {
background-color: #ED2124;
}
#nav .top1 a {
background-color: #867D78;
}
#nav .top2 a {
background-color: #867D78;
}
#nav .top3 a {
background-color: #958C85;
}
#nav .top4 a {
background-color: #9C938C;
}
#nav .top5 a {
background-color: #A79D94;
}
#nav .top6 a {
background-color: #B0A69D;
}
#nav .top7 a {
background-color: #BAADA5;
}
#nav .top8 a {
background-color: #C1B5A9;
}
#nav .top9 a {
background-color: #CBBDB2;
}
#nav .top10 a {
background-color: #DED0C5;
}
#nav .top11 a {
background-color: #DDDBCE;
}
#nav .top12 a {
background-color: #E7E4D1;
}
#nav ul {
position: absolute;
top: 0px;
left: -999em;
}
#nav li:hover ul, #nav li.sfhover ul {
left: 208px;
}
-->
</style>
<!--[if lt IE 7]>
<script type="text/javascript">
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
<![endif]-->

</head>

<body>
<ul id="nav">
<li class="top1"><a href="#">about us</a></li>
<li class="top2"><a href="#">catalina manifesto</a></li>
<li class="top3"><a href="#">amenities</a>
<ul>
<li><a href="#">rooms</a></li>
<li><a href="#">pool</a></li>
<li><a href="#">bikes</a></li>
<li><a href="#">bamboo garden</a></li>
</ul>
</li>
<li class="top4"><a href="#">calendar of events</a>
<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</li>
<li class="top5"><a href="#">catalina red book</a>
<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</li>
<li class="top6"><a href="#">book it</a></li>
<li class="top7"><a href="#">meetings/events</a></li>
<li class="top8"><a href="#">maxine's bistro</a></li>
<li class="top9"><a href="#">kung fu sushi</a>
<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</li>
<li class="top10"><a href="#">press</a></li>
<li class="top11"><a href="#">virtual tour</a></li>
<li class="top12"><a href="#">catalinalife</a></li>
</ul>
</body>
</html>

Much easier to change and maintain. The css and javascript should be linked to external files.

grimmylina
05-09-2008, 04:52 AM
Yeah, I see the disappearing sublevel menu too. I don't know why that is happening because it doesn't seem to happen on his??

They want me to use images because they want the greys in the menu to all be different and they want to use a specific font too. But there's no real good way to do that in css is there?

Thank you everyone for your feedback. Thanks Centauri for the example!!!! I will try it out and show it ot them.

Centauri
05-09-2008, 05:18 AM
They want me to use images because they want the greys in the menu to all be different and they want to use a specific font too.

The different grey shades is not a problem, as demonstarted in the example, but if they want to start using gradients or something, then it might be an issue. If the font in question is what is currently in the graphics, then it seems pretty close to the Georgia font I used in the example. You might make the client aware that using graphics will slow the site loading down, and markedy increase the amount of coding required to make it properly accessible.

KDLA
05-09-2008, 05:34 AM
The different grey shades is not a problem, as demonstarted in the example, but if they want to start using gradients or something, then it might be an issue.

All you'd need to do is create several gradient backgrounds, assign ids to the <li> (or <a>) and apply the various backgrounds. I have to do that all the time.

(Using Centauri's code):

#nav a {
text-decoration: none;
display: block;
height: 30px;
line-height: 30px;
padding-left: 20px;
color: #FFFFFF;
font-weight: bold;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
border-right: 4px solid #FFF;
background-repeat: repeat-x;
background-color: #eee;}/*this is a gray to use in case images don't load*/
}
#nav a#light {background-image: url(ltgray.jpg);}
#nav a#med {background-image: url(medgray.jpg);}

grimmylina
05-09-2008, 07:44 AM
Thanks guys!!!! I will try that out right now...will let you know how it goes.

grimmylina
05-09-2008, 08:46 AM
Perfect!!!!

http://www.catalinahotel.com/allie/v2/index_copy.html

Thank you Centauri & KDLA!!!!!!

KDLA
05-09-2008, 08:57 AM
(You may want to set the height to "em" rather than "px" -- if you resize the text, the <li>'s height isn't expanding to accommodate the text size.)

Centauri
05-09-2008, 10:17 AM
To prevent the dropout when hovering between submenu items in IE, put a background on the <ul> - common IE bug.#nav, #nav ul {
margin: 0;
padding: 0;
width: 208px;
background: #FFF;
}

grimmylina
05-09-2008, 01:53 PM
Question....who would resize the text? The px on the:

#nav a {
text-decoration: none;
display: block;
height: 30px;
line-height: 30px;
padding-left: 20px;
color: #FFFFFF;
font-family: "Century Gothic", Arial, Helvetica, sans-serif;
font-size: 12px;
border-right: 4px solid #FFF;
}


Also, looked up dropout in Yahoo. That means some of the text just disappears in IE? Sorry, just want to understand the reasoning behind the code. Helps me for next time. : ))))

Centauri
05-09-2008, 08:28 PM
People with deteriated eyesight would want to resize text to be able to read the site, but as the line-height as well as the height on the <a>s is set, the resize would have to be large to cause problems.

The dropout I refer to is when hovering between submenu items in IE, the flyout dissappears when the mouse moves over the gaps between the <a>s, as IE doesn't seem to recognise this is still part of the parent <li> unless the dropdown <ul> has a background.

grimmylina
05-09-2008, 08:56 PM
Ohhh....I added the dropout code. So I guess there's no way to make the change for the text resize...

Centauri
05-09-2008, 09:25 PM
Well, the height and line height of the <a>s could be specified in ems if you like - that would make the menu totally flexible to accommodate any text size, but the total height of the menu will also vary with text size which could break the whole page layout. If two steps of text resize doesn't break the layout,that usually satisfies me.