Note: the following material is from an older, outdated version of the web design curriculum pack. Please read about the revised and updated version of our Introduction to Web Design Curriculum.
At the end of this lesson, you will be able to:
- Apply the CSS box model to position and size XHTML elements
Instructions: Use document-level styling to create the following pages.
- Make a red div that is 100% wide and 50 pixels tall.
- Under that, make a white div that is 100% wide and 300 pixels tall.
- Under that, make a blue div that is 100% wide and 100 pixels tall.
- Name your file practice_a.html
- Make the background of the page gray.
- Make a div that is 100 pixels from the top of the window and 50 pixels from the left of the window.
- The div should be 400 pixels wide.
- The background of the div should be yellow.
- Place the following text inside the div:Good record keeping will help you maintain your budget. Set aside an hour each week to work on your budget. Try to keep your budget relatively simple so that it works for you. Too much detail can make your budget unmanageable. Put items in a category since if you combine too many expenses under miscellaneous, you will find it difficult to plan your expenses.
- Name your file practice_b.html.
- Download any public domain or Creative Commons image you’d like from Google Images.
- Place the image 150 pixels from the top of the window and 100 pixels from the right side of the window.
- Place a red border that is 5 pixels wide and dotted around the image.
- Name your file practice_c.html.
- Place an image at the top of your webpage.
- Place the following sentence 100 pixels below the image and 50 pixels from the left of the window:US High Schools Serve Grades 9 – 12.
The PADDING is the distance between the content of the box and the box’s border
The BORDER is a visible line between the PADDING and the MARGIN.
The MARGIN is the area AROUND (outside of) the box
Image Copyright (C) 1997 World Wide Web Consortium. All rights reserved.
For full projects and source code, download the updated version of our Introduction to Web Design Curriculum.