Front-end Web Development

Assignment for Week 4

  1. Follow the steps in Assignment 1 (or use your work from last week).
  2. Change the <p> element to a <div> element.
  3. Duplicate the <div> element.
  4. Add a class attribute to the first <div> tag, with the value box-one.
  5. Add a class attribute to the second <div> tag, with the value box-two.
  6. Add a CSS rule that makes elements with either class box-one or box-two have a width and height of 200px, and a color of white.
  7. Add a CSS rule that gets rid of the default spacing that is built-in to the main document container.
  8. Add a CSS rule that gives elements with a class of box-one a red background.
  9. Add a CSS rule that gives elements with a class of box-two a blue background.
  10. Modify a single existing rule such that the page looks exactly like this (text content can be different). The second box is 20px from the top and left of the first box:

Extra credit:


Solution