|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2004
Location: Earth
Posts: 391
|
Notice: This is a discussion thread for comments about the SitePoint article, Nifty Navigation Using CSS.
__________ "but you're also locking out text-only devices such as screen readers" A screen reader is NOT a text-only device, and frankly, it's pretty sad to see this myth is still being perpetuated. The dropdown menus example will be inaccessible to the most popular screenreaders because they can't read content which is not displayed. Quite apart from the the fact that such menus are inaccessible to keyboard users. Pure CSS menus have extremely poor accessibility and usability, and should never be used. |
|
|
|
|
|
#2 | ||
|
padawan
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Victoria, Australia
Posts: 2,734
|
Quote:
I've used the keyboard to move around CSS only menus fine and dandy, Quote:
![]() |
||
|
|
|
|
|
#3 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2004
Location: Åsnorrbodarna
Posts: 11,581
|
Quote:
|
|
|
|
|
|
|
#4 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Jul 2007
Location: Perth, Australia
Posts: 350
|
By 'pure CSS', you mean keeping navigation items in plain (possibly nested) lists, and then styling them however?
This is the first time I've heard them be described as bad, and I don't understand why at all. |
|
|
|
|
|
#5 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2004
Location: Earth
Posts: 391
|
By "pure CSS" I mean menus with only list-item :hover triggers and no additional behavior layer. In order to be useable by mouse users, and accessible to keyboard users, menus need behavioral scripting, to implement things like open/close delays and focus triggers.
The assumption that "works without javascript" == "more accessible" simply doesn't hold true; the situation is more complex than that. Care to show me an example of such a menu? |
|
|
|
|
|
#6 | ||||
|
padawan
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Victoria, Australia
Posts: 2,734
|
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
#7 |
|
SitePoint Community Guest
Posts: n/a
|
UDM menus rock my world.
I would give any "css animated" menus the "dont use it" label. |
|
|
|
#8 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2004
Location: Earth
Posts: 391
|
I should probably clarify my point - I'm not levelling my criticism at all forms of CSS navigation, not at all, and the vast majority of what's being taught in this article is solid best-practise.
All I'm saying is that CSS is not suitable for defining behaviors - it doesn't have the capability, and that's what JavaScript is for. Pure CSS navigation bars and other static navigation structures: ![]() Pure CSS dropdown/flyout menus: ![]() |
|
|
|
|
|
#9 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2006
Location: Nottingham, UK
Posts: 2,522
|
Why would you put a <div id="navigation"> around the <ul> in the first example, when <ul id="navigation"> would work just as well?
|
|
|
|
|
|
#10 |
|
Posts rarely
![]() Join Date: Jan 2002
Location: Swindon UK
Posts: 596
|
At this point, I should just throw this in:
http://www.accessify.com/tools-and-wizards/developer-tools/list-o-matic/ It does a lot of what Rachel refers to here and makes the process of creating horizontal or vertical navigation a doddle. |
|
|
|
|
|
#11 |
|
Object Not Found
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2002
Location: northern MI
Posts: 1,468
|
A great resource I use is Listamatic http://css.maxdesign.com.au/listamatic/ Seems like some of the examples here is taken from there so it's worth a visit.
|
|
|
|
|
|
#12 | |
|
In memoriam
![]() ![]() Join Date: May 2006
Location: Aurora, Illinois
Posts: 15,648
|
Quote:
![]() Furthermore, I'd change "navigation" to "menu" but that's just a personal choice. |
|
|
|
|
|
|
#13 |
|
SitePoint Zealot
![]() ![]() Join Date: Oct 2004
Location: Sydney, Australia
Posts: 175
|
If you want a css drop down that works in IE6 checkout http://tutorials.alsacreations.com/deroulant/menu-horizontal.htm
|
|
|
|
|
|
#14 |
|
padawan
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Victoria, Australia
Posts: 2,734
|
Bling, there's better options for dropdown menus than that,
http://www.htmldog.com/articles/suckerfish/ Anything that suggest inline javascript like onmouseover="javascript:montre();" is out of date. Keep the content / presentation and beharioural layers completely separate. |
|
|
|
|
|
#15 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2005
Location: Brisbane, QLD
Posts: 4,008
|
|
|
|
|
|
|
#16 |
|
SitePoint Community Guest
Posts: n/a
|
that wrapping div is unnecessary, you can have id attribute for the ul itself.
|
|
|
|
#17 |
|
SitePoint Hero
![]() ![]() ![]() Join Date: Jan 2001
Location: England
Posts: 339
|
Lots of occurences of
Code:
& # 8 9 4 2 ; Last edited by Drinky; Aug 15, 2007 at 07:59. |
|
|
|
|
|
#18 | |
|
SitePoint Member
Join Date: Jul 2007
Location: New York, NY
Posts: 12
|
Quote:
like maybe in the first sentence? but good article otherwise... |
|
|
|
|
|
|
#19 |
|
Team SitePoint
![]() Join Date: Oct 2005
Location: Melbourne, Australia
Posts: 566
|
Thanks Drinky, not sure what happened there. All fixed.
|
|
|
|
|
|
#20 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2005
Location: Hacienda Heights, CA
Posts: 51
|
Skimming through the article, This will be useful in my collection of bookmarks :) I love the idea of CSS menus without Javascript.
|
|
|
|
|
|
#21 |
|
SitePoint Community Guest
Posts: n/a
|
Cool article!
|
|
|
|
#22 |
|
SitePoint Community Guest
Posts: n/a
|
Many many good techniques here though nothing really new or revolutionary. Plus pure CSS drop downs are pointless without IE 6 support.
Nice job spreading the word on these techniques though. |
|
|
|
#23 |
|
SitePoint Member
Join Date: Nov 2005
Location: Vellore-Chennai-TN
Posts: 15
|
it is great one to know about more on css
|
|
|
|
|
|
#24 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2006
Posts: 213
|
A really good article, thanks!
A few things to add... The technique you use to give flyout or drop-down menus can be enhanced by the use of Javascript to make it work in IE6 - detailed in http://www.alistapart.com/articles/dropdowns/. What this does is uses Javascript to apply a class to the sublist when you 'mouseover' the parent element, and to remove the class onMouseOut. This gives the same effect in IE6 as using :hover does in better browsers. If you're going to make it really accessible, of course, you should repeat it for onFocus/onBlur so that keyboard users (on any browser) can access the submenus. Another good thing to do is linked in with the technique of using <body id=...> to style the current tab - you can also use <body class=...> to make the current submenu always visible. ie, if you had a page on menus in the CSS section of your site, you might have, within your menu: ... <li id="css">CSS <ul><li id="menus">Menus</li> ...</ul> </li> ... then at the top, have <body id="menus" class="css">. You can then use CSS to keep the relevant submenu on the screen at all times, eg body.css ul#nav li#css ul { display:block; padding-left:12px; (other display styles) } Specificity rules mean that this should override the :hover declaration. Obviously, you can apply the one declaration to all the different submenus by repeating the element line and swapping "css" for the names of the other submenus. Disclaimer - this is all off the top of my head and may have one or two unforeseen bugs in the implementation. But the general principle is sound! |
|
|
|
|
|
#25 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2006
Posts: 61
|
I was working with the simple horizontal menu example and noticed that, in IE 7, the bottom padding of the links weren't being rendered, so the buttons looked like the bottoms were 'cut off' (no problems in FF). Anyone else see this and/or know how to fix it?
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 14:16.


















Linear Mode
