Forum Moderators: open

Message Too Old, No Replies

OL's/UL's as navigation

Is it really necessary

         

Marshall

11:55 am on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have read a lot of posts in the CSS forum about people having trouble with spacing OL/UL navigation. After looking at their CSS, I usually do not see anything special, i.e. fancy hover effects or slide-out/drop-down menus. So why, I ask, do people use OL/UL navigation? IMHO, is this not just an unnecessary waste of time given the cross-browser issues? What is wrong with simple <br> between each new line of links or each link being in a <p> when the navigation is simple.

Opinions?

Marshall

janharders

12:15 pm on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if you use ol/ul, you have a clear markup identifying each element (a br could mean "give me a linebreak here in this navpoint" or "this navpoint is finished") and still keeping them together in a parent element. you can achieve the design without lists, using p and br, but lists will give the added value of content markup, not just markup to create a design.

Fotiman

2:04 pm on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Semantically speaking, navigation often consists of a "list" of links, thus it makes sense to use OL/UL. Don't forget, there are other browsers out there besides just visual ones (ie - screenreaders).

[edited by: Fotiman at 2:06 pm (utc) on July 19, 2008]

rocknbil

6:10 pm on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is wrong with simple <br> between each new line of links or each link being in a <p> when the navigation is simple.

What's wrong with <br><br><br><br><br><br> to space an item out?
or &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to intend copy?
Or <font>, or inline CSS, or nested tables?

Really, I think it's all about semantics, using the right tool for the job.

encyclo

6:21 pm on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What's wrong with <br><br><br><br><br><br> to space an item out?

It is above all about accessibility - that's why we use semantic markup. The markup should express clearly the purpose of the content, and the reason why you should use a list for a menu is evident when you disable CSS rather than apply it. :)

SuzyUK

6:45 pm on Jul 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The markup should express clearly the purpose of the content

exactly!

it even "strongly recommended" in the HTML 4.01 recs under LISTS [w3.org]

note this is the section on the <dir> and <menu> elements both of which where deprecated as they were only extra containers for <li> elements

The
DIR
element was designed to be used for creating multicolumn directory lists. The
MENU
element was designed to be used for single column menu lists. Both elements have the same structure as
UL
, just different rendering. In practice, a user agent will render a DIR or MENU list exactly as a UL list.

We strongly recommend using UL instead of these elements

the <br> element is possibly the most unnecessary element in HTML, except for the much debated point about poetry and addresses, and I see that is exactly what HTML5 says about the usage of <br> [w3.org]

for:

br elements must be used only for line breaks that are actually part of the content, as in poems or addresses.

against:

The following examples are non-conforming, as they abuse the br element:

<p><a ...>34 comments.</a><br>
<a ...>Add a comment.<a></p>

it is accessibility pure and simple try listening to a list of links separated only by a comma, or a br then try listening to a list as a list :)

ronin

1:20 pm on Jul 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Asking the question: "As long as it looks right to a sighted human, why does it matter how its marked up?" is to confuse web-based publishing with WYSIWYG desktop publishing.

The web is intended to be interpreted by all sorts of user-agents which are not sighted humans.

If you don't mark up elements to describe what they are, then any user-agent which does not conceptualise your web-page as a 2D tablet to be read like a newspaper page will not understand what those elements are, nor what role they play on the page.

janharders

2:00 pm on Jul 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



isn't it mandatory in the us for business websites to be highly accessible so that screenreaders have a chance?
I know most countries have ruled that all governmental organisations must conform certain accessability standards - how's that in private business?