Pacific Trails Resort Case Study
In this chapter’s case study you will use the existing Pacific Trails ( Chapter 4 ) website as a starting point to create a new version of the website that incorporates images.
You have five tasks in this case study:
1. Create a new folder for the Pacific Trails Resort website.
2. Update the pacific.css external style sheet file.
3. Update the Home page: index.html.
4. Update the Yurts page: yurts.html.
5. Create a new Activities page: activities.html.
Task 1: Create a folder called ch5pacific to contain your Pacific Trails Resort website files. Copy the index.html, yurts.html, and pacific.css files from the Chapter 4 Case Study ch4pacific folder. Copy the following files from the chapter5/casestudystarters/pacific folder in the student files and place them in your ch5pacific folder: coast.png, favicon.ico, marker.gif, sunset.png, trail.png, and yurt.png.
Task 2: The External Style Sheet. Launch a text editor and open the pacific.css external style sheet file.
1. The body element selector. Add a declaration that configures Arial, Helvetica, or sans-serif font typeface.
2. The header element selector. Add declarations to display the background image named sunset.png on the right without any repeats. Also configure styles for the header element selector with 400% line-height and 1em text-indent.
3. The nav element selector. Add a declaration to configure bold text.
4. The nav a element selector. Code styles to eliminate the display of the underline for hyperlinks (hint: use the nav a descendant selector with text-decoration: none; )
5. The h1 element selector. Add a declaration to display text in Georgia, Times New Roman, or serif font typeface.
6. The h2 element selector. Add a declaration to display text in Georgia, Times New Roman, or serif font typeface.
7. The h3 element selector. Code styles to display text in Georgia, Times New Roman, or serif font typeface.
8. The ul element selector. Code styles to display the marker.gif as the list marker (bullet).
9. The footer element selector. Code styles to configure 75% font size, italic font style, centered text, and Georgia, Times New Roman, or serif font typeface.
10. The resort class selector. Add a declaration to display bold text.
11. The contact id selector. Code styles to display text with 90% font size.
Save your pacific.css file. Check your syntax with the CSS validator ( http://jigsaw.w3.org/css-validator ). Correct and retest if necessary.
Task 3: The Home Page. Launch a text editor and open the home page, index.html. Remove the b, small, and i tags from the page. Code an tag below the h2 element. Configure the tag to display the coast.png image. Configure the alt, height, and width attributes for the image. Save and test your page in a browser. It should look similar to Figure 5.24 .
Task 4: The Yurts Page. Launch a text editor and open the yurts.html file. Remove the b, small, and i tags from the page. Next, you will modify this file to display the yurt.png image below the h2 element and configure it in a similar manner as you configured the coast.png image on the home page. Save and test your new yurts.html page. It should look similar to the one shown in Figure 5.25 .
Task 5: The Activities Page. Launch a text editor, open the yurts.html document, and save the file as activities.html—this is the start of your new activities page.
1. Modify the page title area as appropriate.
2. Change the h2 text to be Activities at Pacific Trails.
3. Modify the tag to display the trail.png image.
4. Delete the description list.
5. Configure the following text using h3 tags for the headings and paragraph tags for the sentences.
· “Hiking
· Pacific Trails Resort has 5 miles of hiking trails and is adjacent to a state park. Go it alone or join one of our guided hikes.
· Kayaking
· Ocean kayaks are available for guest use.
· Bird Watching
· While anytime is a good time for bird watching at Pacific Trails, we offer guided birdwatching trips at sunrise several times a week.”
Save your activities.html file. Launch a browser and test your new activities.html page.
Pacific Trails Resort Case Study
In this chapter’s case study you will use the existing Pacific Trails ( Chapter 5 ) website as a starting point to create a new version of the website. The new design is a centered page layout that takes up 80% of the browser viewport with a featured hero image on each page. You’ll use CSS to configure the new page layout, a background gradient, hero image, and other styles, including margin and padding. Figure 6.34 displays a wireframe with the wrapper div, which contains the other web page elements.
Figure 6.34 New wireframe.
You have five tasks in this case study:
1. Create a new folder for the Pacific Trails Resort website.
2. Edit the pacific.css external style sheet.
3. Update the Home page: index.html.
4. Update the Activities page: activities.html.
5. Update the Yurts page: yurts.html.
Task 1: Create a folder called ch6pacific to contain your Pacific Trails Resort website files. Copy the files from the Chapter 5 Case Study ch5pacific folder. Copy the coasthero.png, yurthero.png, and trailhero.png files from the chapter6/starters folder in the student files into your ch6pacific folder.
Task 2: The External Stylesheet. Launch a text editor and open the pacific.css external style sheet file.
· The body element Selector. Change the background color to a light blue (#90C7E3). linear gradient. Add style declarations to display a liner gradient that blends from white (#FFFFFF) to light blue (#90C7E3) and does not repeat.
· The wrapper id Selector. Add a new selector for an id named wrapper. Configure the wrapper id to be centered (see Hands-On Practice 6.4 ) with a width of 80%, white background color (#FFFFFF), a minimum width of 960 pixels, a maximum width of 2048px, and a 3px offset dark (#333333) box shadow.
· The header element Selector. Remove declarations for line height and indented text. Add declarations to configure 60px height, centered text, and 15px top padding.
· The h1 element Selector. Add a style declaration to configure zero top margin.
· The nav element Selector. Change the background color to white (#FFFFFF). Add declarations to configure centered text and 10px padding.
· The main element Selector. Add a new selector for the main element. Code declarations to configure 1px top padding, 20px right padding, 20px bottom padding, and 20px left padding. At the time this was written, Internet Explorer did not support default styles the HTML5 main element, so add the following style declaration using the display property (see Chapter 7 ) to nudge this browser to display as expected: display: block;
· The h2 element Selector. Add a style declaration to configure 1px offset gray (#CCCCCC) text shadow.
· The footer element Selector. Add a declaration to configure 20px of padding.
· The homehero id Selector. Add a new selector for an id named homehero. Code declarations to configure 300px height and to display the coasthero.png background image to fill the space (use background-size: 100% 100%;) without repeating.
· The yurthero id Selector. Add a new selector for an id named yurthero. Code declarations to configure 300px height and to display the yurthero.png background image to fill the space (use background-size: 100% 100%;) without repeating.
· The trailhero id Selector. Add a new selector for an id named trailhero. Code declarations to configure 300px height and to display the trailhero.png background image to fill the space (use background-size: 100% 100%;) without repeating.
Save the pacific.css file. Use the CSS validator ( http://jigsaw.w3.org/css-validator ) to check your syntax. Correct and retest if necessary.
Task 3: The Home Page. Launch a text editor and open the index.html file.
· Code div tags to add a wrapper div that contains the content of the web page. Use Hands-On Practice 6.4 as a guide.
· Configure a div element to display the homehero.png image. Code an opening div tag assigned to the id named homehero after the closing nav tag. Next, code a closing div tag. As shown in the wireframe in Figure 6.34 , this div is located between the nav element and the main element. There is no HTML or text content for this div. The purpose of this div is to display the hero image.
· Remove the img tag for the coast.png photo.
Save and test your page in a browser. It should look similar to Figure 6.35 .
Figure 6.35 Pacific Trails Home Page.
Task 4: The Yurts Page. Launch a text editor and open the yurts.html file.
· Code div tags to add a wrapper div that contains the content of the web page. Use Hands-On Practice 6.4 as a guide.
· Configure a div to display the yurthero.png image. Code an opening div tag assigned to the id named yurthero after the closing nav tag. Next, code a closing div tag. As shown in the wireframe in Figure 6.34 , this div is located between the nav element and the main element. There is no HTML or text content for this div.
· Remove the img tag for the yurt.png photo.
Save and test your page in a browser. It should look similar to Figure 6.36 .