Prev | Current Page 277 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

parentNode and .nextSibling you
like??”here??™s an example:

When you load the web page in a browser, an alert message will be displayed. This will
detail what the target element is, based on the path defined in the previous code block.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
194
In this section, you??™ve seen a bare-bones, unstyled version of how to work with collapsible
content. Later in the chapter, this method will be used to create collapsible sections for a
navigation bar.
Creating navigation bars
The chapter has so far largely concentrated on inline navigation, so we??™ll now turn our
attention to navigation bars. Before getting immersed in the technology, you need to
decide what names you??™re going to use for your navigation bar??™s items. When designing
the basic structure of the site, content should be grouped into categories, and this is often
defined by what the user can do with it. It therefore follows that navigation bar links tend
to be one of the following:
Action-based (buy now, contact us, read our history)
Site audience??“based (end users, resellers, employees)
Topic-based (news, services, contact details)
Whenever possible, keep to one of the preceding categories rather than mixing topics and
actions. This sits easier with readers. Navigation links should also be succinct, to the point,
and appropriate to the brand and tone of the website.


Pages:
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289