Lesson Practice 3-3:
Working with Layout Elements
Task 1: Add Div Elements to a Page
- Open your buttontest file.htm in notepad++.
- Resave this file in your layout folder as divtest.htm.
- Remove the background image from the page.
- Change the title and h1 elements to say: Using Div Tags for Controlling Layout
- Add div Elements:
- Add a div element around the h1 element, giving it a style attribute with a medium color background, and a height of 80.
- You will remember that you originally divided the text on the page into roughly three sections with an image in each.
- Add a div element around each third of the text, including the image in that section.
- Add a style attribute with a different light color background to each div.
- Add a div around the remaining elements on the page, including the buttons and links.
- Add a style attribute to the div with the same color as the top div.
- Resave the file, and keep it open for the next task.
Task 2: Use the Span Element
- Resave the file as spantest.htm
- Change the title and h1 elements to say: Using Span Tags
- Add div tags:
- Choose one phrase or sentence in the first paragraph of text and place a span tag around it. Add a style attribute with the value "font-weight: bold;"
- Choose one phrase or sentence in each remaining paragraph and use a span element with a style attribute to make its text a different color.
- Do not make a change in the last div element (with the buttons).
- Save the file and preview your page in the browser. Make any color adjustments needed and save the file.
Task 3: Add the div and span file-links to your Index file
- Open your index.htm file.
- To the Layout section of the page, add a hyperlink to your two new files, using the same pattern of link text and title attributes as your other links.
- Save the file and test your new link.
- Publish your finished files in your folder of the class Share file.
- Open the index file in the new location and test your links.
|