Basic Box Class Exercise


In several of the steps, I ask you to changes to do something new that erases whatever you did in the previous step. Don't worry about it! Just go through all of the steps and submit whatever you end up with by linking to the page and (of course) uploading it.

  1. Start with a new html file. You choose the name.
  2. Create a div tag with an id set to central (<div id="central">).
  3. Use css to set the width and height of #central to 30rem, but the ACTUAL (as in pixel) width and height in pixels should be equal to 300px.  For this to happen, you must set the root element (html {} ) to a pixel value. Your first challenge/job is to figure out the appropriate pixel value for the html element and to set it. This technique was explained in an earlier lesson.

    This page is a good starting point for the remainder of this exercise.

  4. Add this background image to #central.
  5. Change your CSS so that the background image appears just one time, but in the very center of #central.
  6. Change the size of the background image with CSS so that it is twice as large in all dimensions (200%).
  7. Change the size again so that the background image completely fills #central. It will be pixelated but don't worry about that.
  8. Get rid of the background image and use linear-gradient to create a shocking background that you really can't stand. Take a look at it.
  9. Use border-radius to turn the #central div into a circle.
  10. Get rid of that linear gradient and create a radial gradient that you do like.
  11. Change the default property of the radial gradient so that it  becomes circular as well, instead of elliptical.
  12. Still have time? Create a link, it doesn't matter what it links to. Use CSS to set things up so that a black, 15 pixel outline appears around the link when a user mouses over it.
  13. Optional Challenge: Finished that and still have time?!! Clearly you need a challenge. Figure out how to change the background properties of #central by clicking on a button (javascript of course). But only if you are looking for a challenge. This one is optional.