Forum Moderators: not2easy
#menu p {display: block; border: 1px solid; border-color: #ccc #888 #555 #bbb; margin:0; padding:2px 3px; color:#000099;
text-align:center; background:url("../images/background5.gif"); font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px;
font-weight:bold;}
#menu ul ul .level2{ display:block; border:1px solid; border-color:#ccc #888 #555 #bbb; margin:0; color:#000099;
background:#FFFFFF; text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold;
padding-left:1px; padding-top:3px; padding-bottom:3px; text-decoration:none; width:250px;}
#menu a{display:block; border:1px solid; border-color:#ccc #888 #555 #bbb; margin:0; color:#000099; background:#FFFFFF;
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; padding-left:1px; padding-top:3px;
padding-bottom:3px; text-decoration:none;}
#menu ul ul .level2:hover {color:#000099; background:#FFFF99;}
#menu a:hover {color:#000099; background:#FFFF99;}
#menu li:hover {position:relative; z-index: 500;}
#menu ul ul {position:absolute;}
#menu ul ul ul {top:-1px; left:100%;}
div#menu ul ul,
div#menu ul li:hover ul ul,
div#menu ul ul li:hover ul ul {display: none;}
div#menu ul li:hover ul,
div#menu ul ul li:hover ul,
div#menu ul ul ul li:hover ul {display: block;} <ul>
<li><p>About Us <img src="new_arrow_down.gif" alt="Arrow down" border="0"></p>
<ul>
<li class="level4"><a href="guestbook_2011.htm">Holiday makers comments and tips</a></li>
<li class="level4"><a href="about_us.htm">About Us</a></li>
<li class="level4"><a href="example.htm">maintenance company</a></li>
</ul>
</li>
</ul>
<ul>
<li><p>Properties <img src="new_arrow_down.gif" alt="Arrow down" border="0"></p>
<ul>
<li class="level2">Town Center <img src="new_arrow.gif" alt="Arrow right" border="0">
<ul>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a> </li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
</ul>
</li>
<li class="level2">example <img src="new_arrow.gif" alt="Arrow right" border="0">
<ul>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a> </li>
<li class="level3"><a href="example.htm">example</a></li>
<li class="level3"><a href="example.htm">example</a></li>
</ul> [edited by: alt131 at 6:04 pm (utc) on Feb 5, 2012]
[edit reason] Thread Tidy [/edit]
Plus it is possible to code a hover menu using just css (no javascript). Given you are trying to reach the widest number of devices, you may consider avoiding all the potential issues associated with javascript by not using it - which may also avoid the need to serve a different menu to smallscreens
I guess the main issue is how the wide variety of devices deal with :hover, or if they provide a "hover "equivalent". Quirksmode has mobile compatibility tables [quirksmode.org], but they haven't been updated for a while and wading through the developer documentation for each possible device is a bit of a chore. However, given the menu "looks fine", I wonder if an easy way to accomodate a wider range of devices is to use :active as well as :hover.
[edited by: alt131 at 7:34 am (utc) on Feb 11, 2012]
I think the "a#" you are referring to is the href attribute of a link (<a>). (Tell me if I have that wrong). That is different to the dynamic pseudo-classes, so you can set li:hover and li:active even though there is isn't an <a> or href.
I think the "a#" you are referring to is the href attribute of a link (<a>). (Tell me if I have that wrong). That is different to the dynamic pseudo-classes, so you can set li:hover and li:active even though there is isn't an <a> or href.
active without touch is awful, as soon as you stop having the button in the mouse pressed down the menu disappears, so its imposible use,:) - hence setting :hover as well!