Tips for HTML Markup with CSS
Here are some tips for marking up your document with HTML when you're planning to use style sheets:
- Use HTML to specify context of text or the structure of the document only. That is, you'll use H1, H2, H3... H7 to specify headlines, P to specify paragraphs, BLOCKQUOTE to indicate blockquotes, EM for emphasized text, STRONG for strong text, etc.
- Always include closing tags, even those that are technically optional such
as </LI> and </TR>. The proper way to markup a paragraph is:
<P>Some paragraph of text. Blah, blah, blah, blah, blah,blah, blah,blah, blah,blah, blah,blah, blah,blah, blah,blah, blah,blah, blah,blah, blah,blah, blah.</P> - Don't set alignment attributes. Use CSS to specify alignment.
- Avoid using any tags that specify presentation such as FONT and CENTER.
- For bold text, generally use STRONG.
- For italicized text, use EM, unless the text being marked up must always be displayed in italics. For instance, the title of a book or article. If you're using italics to lend emphasis to the text, EM is more appropriate.
- Mark up programming code and the like using PRE for multiple lines of code, and CODE for short single-word or single-line snippets of code.
- Use UL and LI tags for bulleted lists. Use OL and LI for numbered lists.
- Avoid using tables to layout your page.
- Set the WIDTH, HEIGHT, and ALT attributes on your images as you normally would. You may occassionally want to still use ALIGN=left and ALIGN=right on your images. That's ok. I think this is appropriate until the browsers provide better support for alignment of inline elements.
- Stick to the basics and keep it simple!
Remember: HTML was always meant to indicate document structure only. Stylesheets were always intended to specify presentation details. Keep this overall goal in mind when you mark up your documents with HTML, and coding will be simpler.
Copyright © 2001 by Tina McDuffie. All rights reserved.

