I'm working on an CSS menu but I've hit a couple of problems:
1) I want the links to work and the text color to change when rolling over anywhere in a <li>. RIght now, this only happens if the cursor is over the text. Is there some way to do this with CSS only (no images and no Javascript)? I tried putting the <a> tags around the <li> tags (can't be good) and it worked in Safari OS X, but not in IE or FF.
2) The CSS lowercases the sub-sub-department names and then uppercases the first letter. In Safari OS X the first letters do not change color when rolling over. (The department names are all cap and are in a database that I don't have access to. Server-side scripting not an option either.)
1) I want the links to work and the text color to change when rolling over anywhere in a <li>. RIght now, this only happens if the cursor is over the text. Is there some way to do this with CSS only (no images and no Javascript)? I tried putting the <a> tags around the <li> tags (can't be good) and it worked in Safari OS X, but not in IE or FF.
2) The CSS lowercases the sub-sub-department names and then uppercases the first letter. In Safari OS X the first letters do not change color when rolling over. (The department names are all cap and are in a database that I don't have access to. Server-side scripting not an option either.)
Code:
<html>
<head>
<style type="text/css">
#leftnav
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Arial, "trebuchet ms", Helvetica, sans-serif;
font-size: 12px;
line-height: 12px;
letter-spacing:0px;
margin: 0px;
padding: 0px;
text-indent: 0px;
font-weight: bold;
list-style-type: none;
width:150px;
}
#leftnav a
{
color:#000000;
text-decoration: none;
}
#leftnav a:hover
{
color:#AA0000;
}
#leftnav li
{
border-top: 1px dotted #222;
text-indent: 0px;
margin: 0px;
padding: 4px 0px 4px 0px;
}
#leftnav li:hover
{
background-color:#DEDEDE;
}
#leftnav ul
{
font-size: 10px;
margin: 0px;
padding: 0px 0px 1px 0px;
list-style-type: none;
}
#leftnav ul li
{
margin: 3px 0px 0px 0px;
padding: 4px 0px 1px 0px;
text-indent: 8px
}
#leftnav ul ul
{
font-size: 10px;
text-transform:lowercase;
margin: 0px;
padding: 0px;
}
#leftnav ul ul li
{
border-top: none;
margin: 3px 0px 0px 0px;
padding: 1px 0px 2px 0px;
text-indent: 16px
}
#leftnav ul ul li:first-letter
{
text-transform: capitalize;
}
</style>
</head>
<body>
<div style="transparent; padding:0px; margin:0px">
<ul id="leftnav">
<li><a href="#">DEPARTMENT 1</a></li>
<li><a href="#">DEPARTMENT 2</a></li>
<ul>
<li><a href="#">DEPARTMENT 2.1</a></li>
<ul>
<li><a href="#">DEPARTMENT 2.1.1</a></li>
<li><a href="#">DEPARTMENT 2.1.2</a></li>
<li><a href="#">DEPARTMENT 2.1.3</a></li>
</ul><li><a href="#">DEPARTMENT 2.2</a></li>
<li><a href="#">DEPARTMENT 2.3</a></li>
</ul>
<li><a href="#">DEPARTMENT 3</a></li>
<li><a href="#">DEPARTMENT 4</a></li>
</ul>
</div>
</body>
</html>