Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:22:31+00:00 2026-05-11T04:22:31+00:00

So, I’ve been ‘collecting’ CSS menus for a while now (another term would be

  • 0

So, I’ve been ‘collecting’ CSS menus for a while now (another term would be ‘borrowing’, yet another would be ‘blatantly ripping off’), to learn from them and to potentially reuse some of the leetness in my own projects.

Being an oldschool HTML purist, I love the idea of styled <ul>s and <ol>s, and the better menus and tab interfaces tend to use this method, for accessibility or semantic soundness or whatever reason. I mainly like the method because it keeps my HTML source nice and clean.

Now, I’ve actually refactored my collection of CSS menus to fit one ‘master’ markup pattern that I’ve extrapolated from the most flexible examples out there, such as the CSS Zen Garden. It looks like this:

<div class='menustyle'> <ul>     <li class='current'><a href='#' title='Page 1'><span>Home</span></a></li>     <li><a href='#' title='Page 2'><span>Toys</span></a></li>     <li><a href='#' title='Page 3'><span>About Us</span></a></li>     <li><a href='#' title='Page 4'><span>Contact</span></a></li> </ul> </div>  <span class='clearit' /><br /> 

(the ‘clearit’ span at the end is used to set clear:both after menus that require it)

Anyway, I’ve seen variations on this markup on many sites, some with an extra enclosing <div>, some using a different word than current, some attaching the current class to the <a> tag rather than the <li>, and some leaving out the inner <span>. Everyone seems to have their own way of doing menu markup that’s just a tiny bit different.

Anyway, after tinkering with a lot of menus, the above is what I’ve come up with, but I’m trying to figure out if there is an actual established best practice for this. I’d like to set up a simple CSS menu foundry at some point, and it would be nice to get some input on the markup before going any further.

EDIT: The question is not about Javascript menus. I know there are excellent scripted menus out there, and that they allow you to have submenus, more advanced animations and hover timing, shortcut keys, drop shadows, and everything else. But 90% of menus don’t need those features, and are much better off using CSS for styling and hover effects.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:22:32+00:00Added an answer on May 11, 2026 at 4:22 am

    Other than stripping out the span tags I think its fine.

    There is no reason to have them becasue with your setup you can style the text however you want with

    li a {/*styles*/} 

    You should also be able to remove the

    <span class='clearit' /><br /> 

    section as well. If you’re trying to float just the ul inside of the div you might as well scrap the div. If you need the clear for some other reason you can do a

    <br clear='all'/> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 87k
  • Answers 87k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If it's a user-facing document, don't worry about the 'staying… May 11, 2026 at 5:34 pm
  • Editorial Team
    Editorial Team added an answer Ruby already has an established mechanism for code sharing i.e.… May 11, 2026 at 5:33 pm
  • Editorial Team
    Editorial Team added an answer You can register the DLL with regsvr32.exe from the C:\Windows\SysWOW64… May 11, 2026 at 5:33 pm

Related Questions

So, I've read that it is not a good idea to install VS2008 on
So I am writing a registration form and I need the display name to
So, I know that try/catch does add some overhead and therefore isn't a good
So, I am seeing a curious problem. If I have a function // counter
So, I am a total beginner in any kind of Windows related programming. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.