A Definition List Menu
copyright © stu nicholls - CSS play
This menu is just a definition list with styling.
I know that I have advocated not using list for menus, but that was before I had fully investigated the alternatives. I still disagree with the use of unordered lists but I will concede that definition lists are a better way to go.
With definition lists you have the option of two different methods of use (maybe three).
- use the 'dt' for the navigation title and the 'dd' for the navigation links - as my menu above
- use the 'dt' for the navigation links and the 'dd' to elaborate on each link.
- use the 'dt' for the navigation links and the 'dd' to elaborate on each link and place further links within the 'dd' text if appropriate.
This allows definition lists to be much more flexible than unordered lists and gives more 'layers for styling. It is also easier to style as you can just style the link and ignore the 'dl' and 'dt', the only styling that may be necessary is to remove the indent on the 'dd'.
The above menu has a background image in the 'dl', a background image in the 'dt' and background images in the 'dd' links and it will not break when larger font sizes are selected.