You start your sentences with a capital letter; start your HTML with a DOCTYPE. It’s just basic grammar.
You benefit. Many of the tips in the rest of this series will require you to know what version of HTML you’re using, because the instructions will be slightly different. So figure it out now, or add one if you don’t have one.
You may already have a DOCTYPE. View source on your home page; your DOCTYPE (if you have one) will be at the very top, even before the <html> tag.
DOCTYPE will probably include the phrase “XHTML 1.0 Transitional“. This is fine.DOCTYPE will probably include “HTML 4.01 Transitional“. This is also fine.DOCTYPEs include phrases like “HTML 4.01 Strict“, “XHTML 1.0 Strict“, “XHTML 1.1“, and a few others. These are all fine.If you have a DOCTYPE, don’t change it. However, if your source shows no DOCTYPE before your <html> tag, add this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
For technical reasons that I would rather not go into at the moment (see the further reading
section below if you’re interested), it is possible that you will see slight changes in your page layout after adding this DOCTYPE. If (and only if) this happens to you, you can compromise and use half a DOCTYPE instead, like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Note that every page of your weblog should include a DOCTYPE, so you should check all your templates.
DOCTYPE in your main template. If your “Archive template” is a separate page (that is, if it has an <html> tag at the top), it should also have a DOCTYPE.The important thing to know for the rest of the series is whether you’re using HTML 4 (any variant), XHTML 1.0 (any variant), or XHTML 1.1. You’ll see why tomorrow.
§
I am no longer accepting public comments on this post, but you can use this form to contact me privately. (Your message will not be published.)
§
© 2001–present Mark Pilgrim