CPSCI 107: Applications, Implications, and Issues

Homework 5

due: February 13, 2006


Document Structure

Make modifications to the XHTML markup you've done on your Michalko document. Add a class attribute to each paragraph element to distinguish the different types of paragraph in your document.

Remember that the type of paragraph is determined by its content—e.g., a summary paragraph, an opinion paragraph, etc. Don't overdo it—it probably doesn't make sense for every individual paragraph in the document to be put into a different class. The idea is that for each chapter you discuss, there's a similar structure to your discussion, and that's what you want to capture.

Give your class attributes meaningful values, e.g., <p class="summary">, <p class="my-opinion">, etc. (Syntactic rules for class names are suggested below.)

Add a class attribute to any other elements of your document for which it makes sense.

Do the same for both your website usability document and for your browser comparison document.

Run your documents through the validator to make sure you haven't inadvertently messed up the syntax of your document. Remember that the changes you make won't have any visible effect on the displayed document—at this point, you're preparing your documents so that it will be easy to apply style to them later.


Class Names

It's a good idea to use names for your classes that follow the XML rules for the names of XML tags and attributes. (We'll discuss why in class.)

These are the naming rules for tags and attributes in XML:

(Incidentally, the rules given above apply to any identifiers used in your XHTML documents, i.e., the value of any id attribute.)

Additionally, don't use the name of any XHTML tag as the name of a class.

Finally, the W3C offers some excellent tips on picking effective class names.


[ Return to the CPSCI 107 homepage ]

Brian J. Rosmaita <contact me>
This page was last modified Friday, 10 February 2006 at 03:28 UTC.
Valid XHTML 1.0 ! Valid Cascading Style Sheets! This page is in AAA Conformance with the Web Content Accessibility Guidelines