tags:

views:

17

answers:

1

I'd like to have a logo (say it's square for simplicity) with 4 links that pop up when it is moused over. These would be positioned Above, Below and to the sides of the menu/logo.

Is this achievable with only CSS? Any suggestions for how one might go about doing it?

Semantically I'd like to order them with in the page something like:

<ul><li><a href="Homepage">Logo</a>
    <ul><li class="north"><a href="north">North</a></li>
        <li class="west"><a href="west">West</a></li>
        <li class="east"><a href="east">East</a></li>
        <li class="south"><a href="south">South</a></li>
     </ul>
    </li>
</ul>

But have them show up on the page like:

             North
       West  Logo   East
             South
+2  A: 

Yes.

HTML

<ul><li><a href="Homepage">Logo</a>
    <ul id="map"><li class="north"><a href="north">North</a></li>
        <li class="west"><a href="west">West</a></li>
        <li class="east"><a href="east">East</a></li>
        <li class="south"><a href="south">South</a></li>
     </ul>
    </li>
</ul>

CSS

#map li a {
    display: none;
}

#map li:hover a {
    display: block;
}

Note that IE6 won't fire the :hover pseudo class on anything but links (you might want to change your markup).

Also simply use absolute positioning to position the popups.

See the general idea here.

alex
Frankly, I don't give a damn about IE6. I've got to make some stuff I do at work look at least halfway decent in it at work, but I'm not going to pay the slightest bit of attention to it for my personal projects.Anyways, thanks, I will try your suggestion.
aslum
@aslum It's a start, but it should give you the general idea. Once you've got it working with CSS only, you can add some pretty JavaScript stuff too (like animations).
alex