Forum Moderators: not2easy
The main navigation on this site I'm working on uses images for the main navigation links. The images are set as background images in a class so each <li> has a unique class. There is no visible content within the <li></li> tags (unless css is off) and I'm trying to have the list elements link to their respective pages.
I'm having problems getting the anchor element to act in the space it has in each <li>
<div id="egonav"><!-- HARDCODE EGO MENU -->
<ul class="egomenu">
<li id="egohome" class="egohome"><div><a href="../blog"><span class="hidden">HOME</span></a></div></li>
<li id="egofun" class="egofun"><div><a href="../fun"><span class="hidden">FUN</span></a></div></li>
<li id="egoshop" class="egoshop"><div><a href="../shop"><span class="hidden">SHOP</span></a></div></li>
<li id="egoinfo" class="egoinfo"><div><a href="../info"><span class="hidden">INFO</span></a></div></li>
<li id="egocontact" class="egocontact"><div><a href="../contact"><span class="hidden">CONTACT</span></a></div></li>
<li id="egolinks" class="egolinks"><div><a href="../links"><span class="hidden">LINKS</span></a></div></li>
<li id="egoguestbook" class="egoguestbook"><div><a href="../guestbook"><span class="hidden">GUESTBOOK</span></a></div></li>
</ul>
</div>
I thought it might be as simple as giving my <a href.. a block display but that didn't do it. Any ides?
unique classes and id's as each class has a difference background image, so when css is on menu made of images, when off, it falls back to the text.
Id's are there as there is a class change onMouseOver
in regards to the fix, it was a pretty straight forward one, i'll just give you a snippet
<li id="egohome" class="egohome"><a href="/blog"><span class="hiddenNav">HOME</span></a></li>
<li id="egofun" class="egofun"><a href=".net/fun"><span class="hiddenNav">FUN</span></a></li>
hidden nav is set to display:block; but visibility is off
<li id="egohome" class="egohome">
<ul id="egomenu">
<li><a href="/blog/" id="egohome"><b>Home</b></a></li>
...etc
The menu is an include, so I'd usually put some php in with the inc_menu.php to check the current location, do a series of if/else's to print a value into relevant variable, therefore echo "-on" within the chosen items ...class="egohome<?php echo$nav4;?>"... then have an egohome-on class in addition to egohome and ego:hover.
Just interested to know if anyone has any neater ideas?