CIS86 2007 Fall Leaves Logo
More Reading Tips : CIS86 2007

About Comments in HTML Pages and CSS Stylesheets

You are encouraged to use comments liberally in your HTML and CSS files. This will be a big help as you make changes on your sites, and it is invaluable when you return to it after time has passed. If you ever have to pick up someone else’s code, you will love them if they put in comments, and hate them if they did not. You use different groups of characters to denote comments, depending on where the comment appears:

About Whitespace in HTML

When displaying HTML, browsers will ignore multiple spaces (unless they are non-breaking spaces) and newlines. Except inside quotes, you can pretty freely add whitespace to make your HTML more readable.

About Images

The most common media type other than text is the image. Currently, the two most common image types used on the Web are GIF and JPEG. (A third image type, PNG, is a superior format to GIF, but has yet to achieve widespread usage because of poor support in Internet Explorer.)

About Colors

Colors are represented in a number of ways in Web pages, but these are notational differences that describe the same thing. Color on computer monitors is represented with varying amounts of 3 fundamental colors: Red, Green, and Blue (also called RGB). By varying the amount of each of the 3 components, it is possible to produce the appearance of a vast array of colors. Each of the 3 components has a value from 0 to 255 (the range that can be represented in one byte = 8 bits = 2^8). The larger the number, the lighter the color (255 is the brightest for any of the 3 basic colors, while 0 is the darkest.)

The most common representational scheme for color uses the hexadecimal (base 16) notation, where each number runs from #00 to #FF. For example, #FFFFFF means that the Red/Green/Blue components are all #FF, and #0099FF means that Red is #00, Green is #99, and Blue is #FF. Here is a handy decimal-to-hexadecimal chart from Elizabeth Castro's site.

Here are the primary ways you can refer to a color in HTML:

About Fonts

Fonts are one of the more problematic areas of Web design. Since fonts are not embedded in pages, it is always possible that some users' computers will not have the font chosen by the designer. In HTML, you can specify a list of fonts to try, and the Web browser will choose the first one that is found on the computer. There is little commonality in fonts available across PCs, Macs, and Unix boxes. Accordingly, the Web designer must take care to specify a comprehensive list of fonts that will achieve the desired look on each platform. The apparent size of the same font will vary across platforms, as well. Web browsers often allow users to scale the size of fonts up or down.

Given these factors, it takes some care to achieve a cross-browser, cross-platform look. Here are some guidelines:

Here are some possible ways to specify the size of fonts:

CIS86 2007 HomeLinksContact DFF • Site by Monolith Design