- Source Code Formatting & your assignments
- Most assignments from the textbook will utilize images. There are
several ways to include the images in your turned-in assignment:
- If you post the assignment to your own web site, you may simply link to the images however you like. I will be able to see the images when looking at your site, and I will look at your HTML source code to see how you refer to the images.
- In "standalone" HTML files (or on your own web sites), you may use explicit (fully qualified) references in your page to refer to the images at http://instruct.tri-c.edu/rrichmond/html/exercises/tutorial.nn/casen/imagename.ext. This way, all images will still be visible when I save your HTML source and view the page.
- If you used relative links to that were images copied from the class website to your development environment, you may simply mention in your email that you are using relative references to the images, and I will save and view your web page in an environment where those images are available. You don't need to turn in your images.
- If your submitted assignment has multiple files, please zip-up your files. Don't send me separate attachments for each file, and don't upload multiple HTML or image files.
- In the HTML comment that identifies you and the assignment, please be sure to include
- your name,
- the course identifier (ITWM1010),
- the assignment number
- the assignment name or description (e.g. "Body Systems Web Site", "Tutorial 2 Case 4", etc.),
- the date, and
- any special notes about choices you made about options aspects of the assignment that are not revealed by the assignment description.
- Use the following techniques make your pages more uniform, and to enhance
their readability and maintainability:
- Use block tag ID's and HTML comments to annotate the major structural sections of the page, such as the masthead, the footer, the main content, and various components of the main content (e.g. "toc" or "tableofcontents", "definitions", "productlist", etc.).
- When the masthead consists of several HTML elements, use a single <div> to lump them into one logical unit. But if you really only need one <h?> tag, for instance, you can simply put your masthead ID on that tag.
- If the masthead and footer are well marked, and you use HTML comments appropriately, it is often not necessary for all of the main content to be collected in one <div> element.
- Use indentation to reveal the structure of your HTML. There are many indentation styles, as some people prefer to put extra blank lines in the file when then change indentation levels, or to keep some nested tags (for example, <ol> and <li>) at the same indentation level. We'll discuss specific indentation styles later in the semester as we discuss team development.
- Insert HTML comments freely, especially if a person reading your HTML code is likely to think "Huh? Why did they do it that way?"
- When there is a logo in the page header, make it be a hyperlink back to the home page of the site (and/or section of the site, as appropriate). There can certainly be more than one such link in the header, e.g. from an instructor's page back to the Tri-C home page, and back to the iWeb home page.
- Most assignments from the textbook will utilize images. There are
several ways to include the images in your turned-in assignment:
- Theme: Content vs Presentation
- <address>,<br />, and purity:
- The <address> tag is clearly about content rather than presentation. But the components of a street address (number, street, city, state, zip, etc.) need to be formatted for presentation, and there is no provision for labeling each component. Hence, additional formatting HTML tags (e.g. <br />, which is critical, but is really all about presentation) have to be deployed within an <address> element. This is one example of the notion that HTML is not ready for a complete separation of content and presentation. It is certainly possible to move in that direction, but separating content and presentation is still an imperfect art in HTML.
- XML and XHTML have provisions for the page author to create structures such as <line1><line2><city><state><zip> as subordinates of <address>, and to supply styles for those custom tags. So be aware that such provisions are coming in HTML, but they really aren't readily available at this point.
- The <b> and <i> tags are clearly about presentation, not
content. But they are still used regularly, even by people who
believe strongly in the separation of content and presentation.
Here's a rationalization for their use in certain situations:
- When an entire sentence, paragraph, heading, or section of the site is to be highlighted, then use a "logical" tag (such as <h?>, <address>, <cite>, etc.) that normally provides highlighting, and, if you want to control the highlighting, use styles that apply to that tag. (i.e. Don't use the "formatting" tags.)
- When a single word or letter is to be emphasized, try to use <em> or <strong>, which describes the text as needing emphasis, but doesn't explicitly say how to emphasize it. (Normally, <em> is italicized, and <strong> is bold.)
- Use <i> or <b> only on short text clips where you know you want that kind of emphasis.
- <address>,<br />, and purity:
- Jargon
We often use the terms "head" or "header", "content", and "body", to refer to components of the visible content of a page . That is, the web page, as viewed by the user, is likely to contain information that the user would characterize as a "header", a "body" and a "footer". But web pages have required "<head>" and "<body>" elements that don't correspond to what the user sees as the page header and page body. So the following jargon is often employed- A "masthead" is the graphic at the very top of a page, and is typically consistent across an entire site, or significant sections of a site. The term "masthead" is also used imprecisely to represent the entire page heading, including links and a page title, as well as the graphic. Though it is not precise, at least "masthead" isn't confused with the "<head>" element.
- The word "content" sometimes refers to "everything that the user sees", and sometimes just refers to the information that is distinct from the header, the footer, and other navigational elements. The terms "main body", "main content" or even "meat" refer to the latter meaning.
- Inline images; the <img> tag, and its attributes
- src = image source
- This is essentially the same as the "href" attribute of the "a" tag (and it is unfortunate that those two attributes don't use the same name). The source reference may be relative, absolute, or fully specified, just like hyperlink references, and the source reference doesn't have to refer to an image file. It may refer to a script that returns an image.
- The "standard" image types are .gif, .jpg, and .png. Some browsers can display others (such as .bmp and .tif, for example), and other browsers cannot.
- border = # of pixels
- By default, there is a one-pixel border that is normally white and invisible. But if the image is part of a hyperlink, the border will take on the hyperlink text colors (typically bluish and reddish), depending on whether the image has been visited.
- In most cases, if the image is hyperlinked, the border will be set to zero. Although the HTML border attribute is deprecated in favor of styles, it is common to specify border="0" in this circumstance.
- src = image source
- Entities
- The entities I expect
you to memorize are almost, but not exactly, the same as in table 1-29
on page 39 of the book:
Symbol Code Name Description   Non-breaking space < < < Less-than symbol (left angle bracket) & & & Ampersand > > > Greater-than symbol (right angle bracket) © © © Copyright mark ™ ™ ™ Trademark symbol ® ® ® Registered trademark symbol · · · Middle dot • • • bullet – – – en-dash π π π Pi -
Non-breaking spaces have two uses that are both superceded by styles,
but that are still in very common use:
- To prevent word-wrapping from occurring within a phrase or multi-word name or title. In this case, the entity replaces a space character, and
- To force extra horizontal spacing, since multiple whitespace characters are compressed to a single whitespace character.
- Note that some entities are defined in the HTML standard, some are supported by convention, some are really extended ANSI characters (and thus will vary from character set to character set), and some will be the same (with slight font variances) in different character sets.
- The entities I expect
you to memorize are almost, but not exactly, the same as in table 1-29
on page 39 of the book: