Review
- Open your Striped Umbrella site and download/unzip/file the lesson files.
- Open the activities.html page.
- If the about us page does not have the header image, nav and horizontal rule, copy and paste it from the index.html file
- Import, clean and spell check the text from activities.docx
- Click the attach styles button and attach the suStyles.css file
- At the beginning of the text, insert the family_sunset image. Style the image using .left and .imgBorder from suStyles.css.
- Just before the "And don't forget" insert the dolphin image. Style the image using .right and .imgBorder from suStyles.css
- Save and preview in the browser.
Link Basics (Video)
As previously discussed, the ability to provide links between pages in a web site is part of what makes the web so fun and interactive. In this lesson, we will review how to link to pages within the same site AND how to link to existing pages on other web sites.
- Create two new pages in the Striped Umbrella site (fishing.html and dolphinCruises.html).
- In the first paragraph of text, highlight the words "deep-sea fishing trips". Drag the Link target onto the fishing.html file. This creates a local link.
- In the second paragraph of text, highlight the words "dolphin cruises". Click on the folder next to the Link input and select dolphinCruises.html. This creates a local link.
- To make external links (links on the web), we need to tell the computer to go to the web. This is done with http://. Highlight the words Blue Angels in the third paragraph and, in the Link input, type the following "http://www.blueangels.navy". The link will not work without the http://.
- Repeat the process and link the words "USS Alabama" in the fourth paragraph to "http://www.ussalabama.com".
- Save and preview in the browser. Be sure to test all of the links.
Internal Links(Video)
Sometimes there is so much information on a page that it is hard for readers to find what they are looking for. In these cases, developers often implement the use of internal links. Internal links take the user to a location on the current page. This type of linking is also useful in the new trend of single page web sites that is emerging. In order to create internal links, we must first identify locations in a page to serve as the target, or anchor.
- Open the spa.html page.
- Insert the spa logo image at the top of the page and apply the .left class to it so the text floats.
- Place your cursor next to the word "Massages" that is the list title on the page. Choose Insert -> Named Anchor. Name the anchor "massages". You will notice that an anchor image appears. This image only appears in DW and will not appear on your actual web page.
- Repeat this process for Facials and Body Treatments. You can name the anchors whatever you want.
- Click on the level 2 heading Massages at the top of the page. Drag the Link target to the massages anchor.
- Repeat this process for the Facials and Body Treatment links.
- Save and view in browser.
Creating a Spry Menu Bar (Video)
Dreamweaver combines the power of HTML, CSS and Javascript (a web based programming language) to bring us a well styled, interactive menu bar to use for navigation on our web pages. Creating and editing the menu bar is easy and it provides our sites with a much more polished, professional look and feel.
- Open the index.html page. Highlight and delete the current menu and horizontal rule.
- Click on Insert -> Spry -> Spry Menu Bar. In the popup, select horizontal to create a menu bar that goes across the top. Click OK.
- Click on the label of the spry menu bar (SMB) and you should see the properties in the Properties panel below. The properties for the SMB look like a table of text.
- Each column in the table represents a level of navigation. Currently, the first column reads as Item1-Item4. Let's replace that text with our own. Click on Item 1 and in the Text box to the right, replace Item 1 with Home. Repeat this process replacing Item 2 with About Us, Item 3 with Spa and Item 4 with Cafe.
- We need to add one final option in the first column for Activities. So, click the + button at the top of the column and replace the default text with Activities.
- Now we need to create the links for each of these items. Click on Home in the first column and then click in the Link box, just below the text box at right. Replace any text with index.html. Do the same for each of the other level 1 items and point to their corresponding page. Another option would be to use the folder to find the page name instead of typing it out.
- SMB allow the use of submenus as well. In otherwords, menu dropdowns. At this point, we do not need any of the associated sub menu items that are currently attached to Home or Spa. So, click on home, and then in the second column, click on Item 1.1 and click the - button at the top. Continue this process for all sub items in the Home and Spa categories.
- We do need two sub items on the Activites menu item. So, highlight Activities, and click on the + button in the second column. Make one item called Fishing that points to fishing.html and another item called Dolphin Cruises that points to dolphinCruises.html.
- Save and preview in browser. There will be a popup talking about 7-8 files that need to be saved to your site. Click on OK.
Styling a Spry Menu Bar (Video)
Because SMBs are created using html, css and javascript, the programmers set up all styling for the SMB in a CSS file. By knowing which items to edit, we can alter the appearance of the SMB to better match our site and needs.
- In the CSS Panel, locate the SpryMenubaHorizontal.css file.
- Start with the ul.MenuBarHorizontal rule. This rule is global settings for the SMB. Double click on this style and change the following:
- Font Family: Trebuchet MS, Arial, Helvetica, sans-serif
- Font-size: 14px
Click OK.
- The ul.MenuBarHorizontal li rule controls the appearance of the menu item boxes. Here we will alter the width, height and text-alignment.
- Box -> Width: 190px
- Box -> Height: 25px
- Block -> Text-align: center
Click OK.
The ul.MenuBarHorizontal a rule controls the appearance of the links themselves. Here will will change their foreground and background colors.
- Type -> Color: #FFF
- Background -> Background-color: select a blue from the banner
Click OK.
- Two styles under the ul.MenuBarHorizontal a rule is a very long rule name that ends with MenuBarSubmenuVisible. This rule controls the colors and state of the buttons when a mouse is positioned over them. It is where we set the rollover effect.
- Type -> Color: #630
- Background -> Background-color: choose sand from banner
Click OK.
- The ul.MenuBarHorizontal ul li rule controls the appearance (width and height) of the sub menu items.
- Box -> Width: remove any text here
Click OK.
- Finally, we need to make a small change to prevent a space between the main menu and subitems. This is done by accessing the ul.MenuBarHorizontal ul class.
Click OK.
- Save and preview in browser.
- Once the menu bar is functioning properly, click on the identity tab, CTRL-C (copy) and paste it in place of the menu on each page
- If there is extra space between the menu bar and the banner image, edit the code to remove the p and /p tags surrounding the banner image.
- File -> Save All and preview in browser.