“SEO”
The term "SEO" is beginning to piss me off. A client's "SEO guy" recently suggested that my web developing skills are below par, because "I use <p> tags, which search engines don't highly rank. [....blah blah blah....] and it's best to put content in <h4> tags". Honestly? I asked him to source that, but I never did get a response. I suppose I just never knew that headings and paragraphs were the same thing.
Which doctype SHOULD I use? (Or, HTML vs XHTML)
Any web designer should know what a doctype is, but the big question is, WHICH one? This is what I have heard bounced around the office (I work for idiots):
- <!DOCTYPE html> isn't a real doctype
- XHTML is the future and HTML is obsolete
- The only difference between HTML and XHTML is the latter requires indenting
I'm not sure where that came from, but none of it is true. Allow me to correct it:
- <!DOCTYPE html> is the real doctype for HTML5
- HTML is not obsolete
- The third one is too dumb for me to comment on
Now, on to HTML and XHTML. Right now, the difference isn't huge. XHTML is harder to validate, but it forces you to use cleaner code. However, nothing is stopping you from using said clean code in HTML. For example, HTML 4 and 5 will accept either <br> or <br />. The second one is a better choice, XHTML forces it.
In the future, maybe in ten years, XHTML will be the norm. The idea is to integrate HTML with XML (hence the "X"), and be able to include other markup languages such as MathML. XHTML has been around since 1999 (something like that), and it's made little progress since then, so, you decide what to think of that.
At this point, in January of 2010, I believe HTML5 is the best way to go. Why? It's moving quickly, the doctype isn't a pain in the ass to type (I still copy and paste XHTML's from W3Schools......), and it has some awesome tags. Just to make it the focal point of this blog entry:
Yes, HTML5. Remember, being a newer standard, you CANNOT use old presentational tags such as <font>, <u>, and <center>, and, while valid, you shouldn't use tables for layout. Fun factoid: HTML was never intended to have these tags, they were added in HTML3 and this caused nightmares. They were removed again in HTML4.
If you aren't comfortable with current web standards, I recommend you use an HTML4 doctype. Here are the three to choose from:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML4 Strict: Don't bother with this one, just use HTML5 (<!DOCTYPE html>).
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML4 Loose/Trans: Allows use of presentational elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
HTML4 Frameset: Allows use of presentational elements, and frames (Remember, SSI > Frames)
I hope this gives you some idea of which to use.