FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Menus/Navigation ??

 


Jaspa
When making site menus/nav is it a general rule to use the <ul> and <li> tags or is it just a more common way of doing it.

I ask because after studying several different menus I noticed that some use the <ul> and <li> tags and others don't.

Which way is best?
LukeakaDanish
There is generally speaking no functional benefit of using list type menus (ul and li combo) but it is said to be semantically good - a menu is after all a list of links, and therefore a list in the code is a good way to represent that.

There are no rules to what is better, however using list menus is my recommendation to make your code as easy to understand as possible.

There is no better way though, just pick whichever you prefer.
alalex
The good thing about using <ul><li> navigation is that it makes the html file more structured, and it makes more sense to do it that way too, as LukeakaDanish said, it is after all a list what you are doing...
ashok
And W3C recommends pure CSS layouts instead of tables, and Menu/Navigation strips are a breeze using unordered lists while creating layouts using pure CSS...
JakeMoore
I've actually just used plain <a> </a> links and styled those, without ever using a list. That should only be used if the menu is rather simple. When I say simple, I don't just mean colored text. Using a list is a bit more structural, but most of the menus that people make with a list can also be made with just styled <a> tags.
Stubru Freak
Using lists is easier to style, and also works much better in unusual environments, like mobile phones and speech browsers.
Jaspa
Frist of all, Thank you for all the responces.

I have opted for the <ul> <li> method, Meanly because my menu contains a few sub (nested) menus and using this method makes it more 'at a glance' obvious which part of the menu I'm looking at in the code.

Well... I think so anyway Very Happy

Quote:
W3C recommends pure CSS layouts instead of tables


Yes, this is my intention and so far, (not that the site is ready to lunch yet Rolling Eyes ) theres not a table in sight. Wink
escritor
Some people interpret the definition of a list in a peculiar way and say that the entire webpage is a list of elements, thus one may design a layout using only lists. P.J. Onori and Jason are some of them. Of course, this is an experimental technique and should not be used seriously.

About the menus, XHTML 2.0 will have special markeup for making them. The following is a quote from Develper Shed:

Developer Shed wrote:
The <nl> tag is coming and it represents the new navigational lists. Navigational lists work so well because users select them in order to see more. It works like a menu. It has a <label> element that defines the heading for the navigation list. Something like this would be a list:

Code:
<nl>
 <label>Heading</label>
 <li href="#section1">Section1</li>
 <li href="#section2">Section2</li>
</nl>



However, in the mean time the best way to do such a thing is to use common list tags. Smile
Jaspa
That's interesting to know, but would there be any issues with browser support for these new tags?

I ask because I read something about the js function 'getElementsByClassName();' not being supported by all browsers. I think FF3 beta is only just including it.
escritor
Jaspa wrote:
That's interesting to know, but would there be any issues with browser support for these new tags?

I don't know when XHTML2.0 will be launched, but at that time browsers will have to support it.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.