Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Usability

  • Print
  • + Share This
This chapter is from the book

Containing the Menu with <div> Tags

Things still aren't looking pretty yet. That's because the navigation hyperlinks are defined to use the descendant selector #divMenu a.menuButton. This means that only anchors with a class of aMenuButton within an element identified as divMenu will be styled the way you've defined. Using a descendant selector allows you to give only the buttons inside your navigation layer the fancy styling you're after. You already have all the anchors using the aMenuButton class; now put them inside a <div>. First you'll add tags to contain the entire Toggle-O-Matic menu system. In the next section, you'll add the <div> tags for the submenus.

  1. In Design view, select all three menu button hyperlinks.

  2. In the Layout category of the Insert bar, click the Insert Div Tag icon.

Figure 2.8Figure 2.8

  1. Leave the Class field blank. In the ID drop-down, select divMenu, which is the only available id defined in the CSS file.

Figure 2.9Figure 2.9


Only unused ids are made available in the ID drop-down list. If you've used that id on the page once before, it will be removed from the list to help ensure that your ids are unique to the page.

  1. Make sure Insert is set to Wrap Around Selection, and click OK. Choosing Wrap Around Selection will ensure that all of your hyperlinks are placed inside the newly inserted <div>.

  2. Save your work.

Figure 2.10Figure 2.10

  • + Share This
  • 🔖 Save To Your Account