Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Dreamweaver Developer Center /

Designing with CSS – Part 5: Building site navigation

by Adrian Senior

Adrian Senior
  • www.webade.co.uk
  • www.communitymx.com
  • www.ukcsstraining.co.uk

Created

16 April 2007

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
best practiceCSSDreamweaver CS3Dreamweaver CS4navigationwebsite
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

This tutorial describes how to create site navigation using Dreamweaver CS3 and assumes you are familiar with working with both Internet Explorer and Firefox browsers. This is Part 5 of a six-part tutorial series—be sure to review Part 4 of this tutorial to review the topics discussed in that section before continuing.

User level

Beginning

Required products

  • Dreamweaver (Download trial)

Sample files

  • css5_samples.zip (23 KB)

Note: This tutorial was written for Dreamweaver CS3. Although Dreamweaver CS4 adds new CSS functionality (revised Property inspector, Code inspector, related files), the CSS panel in Dreamweaver CS4 has not changed, and you should still be able to follow this tutorial using Dreamweaver CS4.

In this fifth section of the Designing with CSS tutorial series, we’ll build a navigation bar in our sample website. To accomplish this, we’ll use an unordered list. Using lists to create site navigation helps keep your pages accessible, as well as making the navigation content easy to update. If you missed any of the previous sections, it may be helpful for you to review them to become familiar with the concepts previously discussed before beginning this part:

  • Part 1: Understanding CSS design concepts
  • Part 2: Defining style properties and working with floats
  • Part 3: Using CSS Positioning for site layout
  • Part 4: Styling headers and main content

In this article, we’ll discuss CSS tips and design considerations. After we complete the navigation bar, we’ll take a look at a minor display issue with the image in the header div that occurs when the page is viewed in Internet Explorer—and we’ll discover how to quickly and easily resolve the issue.

Building a vertical unordered list navigation

If you haven’t already, download the provided sample files, or open the files we used in Part 4 of this tutorial series. Launch Dreamweaver and open index.html with the Document window in Design view. At the moment, the sidebar1 div holds some default content; this content consists of a heading followed by three links in paragraph text content. First, we’ll remove the paragraph text. You can complete this task by following the steps below:

  1. Click inside the paragraph text, immediately below the Sidebar1 Content heading.
  2. Select the <p> tag in the Quick Tag Selector at the bottom of the Document window.
  3. The paragraph text in the sidebar1 Content is highlighted because it is selected, (see Figure 1).
Dreamweaver screen shot
Figure 1. After selecting the <p> tag in the Quick Tag Selector, the paragraph text is highlighted to indicate it is selected
  1. Press the delete key.
  2. The paragraph text is removed from the page design.
  3. Repeat the above steps and remove the second paragraph, (see Figure 2).
Dreamweaver screen shot
Figure 2. Delete the two paragraphs of text below the header in the sidebar1 Content div

After you’ve removed the placeholder content in the sidebar1 Content div you are ready to begin building your site navigation.

  • Play the demo: Vertical list navigation

Here are the steps reviewed in the demo:

  1. Click to the right of the Sidebar1 Content heading.
  2. Press the enter (or return) key.
  3. Type the following text: Link 1
  4. In the Property inspector, select the unordered list button.
  5. The paragraph with the text "Link 1" has been changed to an unordered list.
  6. Press the enter (or return) key to add a new set of <p> tags.
  7. Type the following text: Link 2
  8. Press the enter (or return) key to add a new set of <p> tags.
  9. Type the following text: Link 3
  10. Click the cursor within the unordered list, (Link 1, Link 2, Link 3).
  11. Open the CSS Styles panel by selecting Window > Styles.
  12. Click the New CSS style button.
  13. Dreamweaver has created the descendant selector for you. It is displayed in the Selector text field.
  14. Make sure the menu option for Define in: is set to the external CSS style sheet for this project (the twoColElsLtHdr.css file in the CssFiles folder of the sample files).
  15. Click OK.
  16. In the CSS Rule Definition dialog box, select the List item in the Category column.
  17. In the drop-down menu next to Type: select none.
  18. In the drop-down menu next to Position: select inside.
  19. In the Category column, select Type.
  20. In the text field next to Size: type: 80
  21. In the drop-down menu next to Size: select %.
  22. Click OK.
  23. The page design updates to reflect the recent changes

Next, we’ll add a little left margin to the li elements, to move the navigation away from the edge of the page and give the design some breathing room.

  • Play the demo: Setting the links in the list navigation

Here are the steps reviewed in the demo:

  1. Select the first linked text item, (Link 1).
  2. In the Property inspector, type the number sign (#) into the Link field.
  3. Repeat steps 1 and 2 twice, for Link 2 and Link 3.
  4. Click the cursor inside one of the link items.
  5. Click the New CSS style button.
  6. Select the Type option from the Category column.
  7. Click the Color Picker cube.
  8. Select the blue header background color using the eyedropper tool in the Color Picker.
  9. In the Decoration option, select none.
  10. Select the Box option from the category column.
  11. Deselect the "Same for all" option in the Margin section.
  12. In the Right: text field, type 1.
  13. In the adjacent drop-down menu, select ems.
  14. Select the Background option from the Category column.
  15. Click the Background Color Picker cube.
  16. Select the hexadecimal value #FFFFCC (a pale yellow color).
  17. In the margin-left text box, type: 1
  18. From the adjacent drop-down menu, select ems.
  19. Click the cursor in Design view.
  20. The page design updates to reflect the recent changes
  21. In the CSS Styles panel, expand the Box section and select the padding option.
  22. In the padding option text field, type: 2px.
  23. In the CSS Styles panel, expand the Display section.
  24. In the drop-down menu, select block.
  25. Selecting the block option makes the links act like buttons.
  26. Save index.html and the CSS style sheet.

Let’s take a moment to review what we just did. We created the basis for our navigation; we’ve added the unordered list and the text that will be used for the links. Next, we’ll change the text into navigation links.

Now that we’ve created a style for the linked text in the navigation bar, we’ll add a hover effect that will interact with the users cursor when they run their mouse over the links.

  • Play the demo: Adding the a:hover rule

Here are the steps reviewed in the demo:

  1. Click the cursor inside one of the links in the sidebar1 div.
  2. In the CSS Styles panel, click the New CSS style button.
  3. In the New CSS Rule dialog box, click to the right of the a element, (see Figure 3).
New CSS Rule dialog box
Figure 3. Create the hover selector for the linked text in the New CSS Rule dialog box
  1. In the Selector text field, type: :hover with no space after the a element.
  2. Make sure your CSS style sheet is selected in the Define in: drop-down menu.
  3. Click OK.
  4. In the CSS Rule Definition box, select the Type: option from the Category column.
  5. Click the Color Picker cube and select the hexadecimal value #000000 (black).
  6. Select the Background option from the Category column.
  7. Set the background color to the hexadecimal value #FFFFCC.
  8. Save the CSS style sheet.
  9. Press F12 to view the index.html page in a browser. Test the navigation buttons by rolling your cursor over the linked text to check the rollover effects, (see Figure 4).
Browser screen shot
Figure 4. The navigation links use a hover effect to create rollover buttons

The navigation system for the sample site is now complete.

If you’ve been examining the sample project in different browsers, you may have noticed that the image in the header displays a small gap beneath it, (see Figure 5). This gap also appears in Internet Explorer, but does not exist in Firefox. We’ll fix this minor display issue now.

Dreamweaver screen shot
Figure 5. The header image is displayed with a small gap when the page is viewed using Internet Explorer browser.
  • Play the demo: Correcting the header image

Here are the steps reviewed in the demo:

  1. Click on the header image to select it.
  2. In the CSS Styles panel, click the New CSS style button.
  3. In the New CSS Rule dialog box, note that Dreamweaver has already created the selector for you.
  4. Click OK.
  5. Select the Block option from the Category column.
  6. In the Display: drop-down menu, select the block option.
  7. Click OK.
  8. The page design updates in the Design view and the gap below the header image disappears.
  9. Save the CSS Style Sheet.
  10. Select File > Preview in browser to view your page using Internet Explorer.
  11. Notice that the issue is resolved: The gap under the image has disappeared, (see Figure 6).
Dreamweaver screen shot
Figure 6. View the page in Internet Explorer to check that the gap below the header image has disappeared.

You may have noticed that much of the work we’ve done in this tutorial series has involved the use of descendant selectors. If you plan to use the new CSS Layouts included in Dreamweaver CS3, I recommend becoming as familiar as possible with using descendant selectors. While we’ve seen how well Dreamweaver handles the CSS for you, it is also great to be able to edit the code and modify the style sheet by hand when desired.

Where to go from here

After you’ve experimented with the settings described in this tutorial, proceed to Part 6 of this tutorial series. The final article will examine the code you’ve created in the sample site and describe best practices for creating sites that use CSS for site layout and design. Get started by going to, Designing with CSS – Part 6: Using Dreamweaver CS3 compatibility checks for browser compatibility.

Also, if you want to learn more about topics described in this tutorial, see a previous article I wrote, CSS design basics with Dreamweaver – Part 6: Defining and using descendant selectors.

More Like This

  • Simple styling with CSS
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 2: Styling the web page
  • Taking a Fireworks comp to a CSS-based layout in Dreamweaver – Part 2: Markup preparation
  • Taking a Fireworks comp to a CSS-based layout in Dreamweaver – Part 3: Layout and CSS
  • Creating your first website – Part 3: Styling the header and navigation menu
  • Small web team uses CSS to develop big-time magazine site
  • Using the Adobe Widget Browser
  • Tableless layouts with Dreamweaver CS4
  • Creating a simple three-column design
  • Working with images in Dreamweaver CS4

Tutorials and samples

Tutorials

  • Working with updated responsive layout features in the Dreamweaver CS6 update
  • Creating your first website – Part 3
  • Creating your first website – Part 2
  • Creating your first website – Part 5

Samples

  • Responsive design with jQuery marquee
  • Customizable starter design for jQuery Mobile
  • Customizable starter design for HTML5 video
  • Customizable starter design for multiscreen development

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement