Homework: creating and applying CSS classes and ids

Copy and edit this chunk of text

After you open the file in DW, move the existing style rules in that page into an external stylesheet: Right-click in the styles area and choose "Move styles".

  1. Define a .hangingindent class for the bibliographic citations at the end of the text.

    Set the margin-left to a few em units to push the whole paragraph right, and then set the text-indent to a negative number of em units to push just the first line left.

    Apply this class to the final two paragraphs in the chunk of text.

  2. Create a .pulloutquote class which you'll apply to the short paragraph beginning "More than one million....". Create the class definition using float, width, padding, font-size and possibly others so that the text in such a paragraph is larger, and the body text will wrap around to the right of this pull-out quote. (This class will be a lot like the .photobox class we had previously.)

  3. Create and apply a .warning class for the very first paragraph, to make that text look in some way distinctive and different from the rest of the document.

  4. Currently the main layout box is this division:

    <div style="margin-left: 100px; margin-right: 100px;...">.

    Instead of a locally-defined style, let's make these rules into an id definition called #maincolumn. Once you've defined your new id with the rules above, change the division to read:

    <div id='maincolumn'>

    Your page should now be displaying as before (with 100px-wide left and right margins).