Forum Moderators: mack
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> Your Title Here </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="Keywords" content=" your, keyword, list, here ">
<meta name="Description" content=" Your Description Here. ">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="imagetoolbar" content="no">
</head>
Of the en-gb part, the first two letters come from the code list in ISO 639 and the last two letters come from the code list in ISO 3166.
See also ISO 4217 for codes for representing currency, and then ISO 8601 for formats for date and time.
Code within the page:
I use: <a href="somepage.html" title="some text here"></a> for links.
I use <img src="somefile.png" alt="some text"> for images.
Headings are done with <hx> ... </hx> tags, properly used from <h1> ... </h1> downwards.
I haven't used the full !DOCTYPE here, just a shortened version. The short version is enough to help you validate your code at [validator.w3.org...] as I have found that some browsers give problems with CSS when the long version is used.
Recently I visited a page on French site and I saw only an empty page. Then I checked the source and noticed the last letter of the title was an e acute. So my browser missed the '<' of the "</title>" and therefore no page was shown.
I haven't used the full!DOCTYPE here, just a shortened version
Just to clarify: the 'full' doctype for HTML4.01 Transitional is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
All on one line, as the very first thing in your document (above the <html> tag).
Using the full doctype means the page will be rendered in 'standards' mode. Without a doctype, or with a short doctype the page is rendered in 'quirks' mode - which emulates all the old rendering bugs of the browser.
Read [alistapart.com...] for more info.
I have found that some browsers give problems with CSS when the long version is used
I've never come across any problems that are made worse by having the full doctype. Quite the opposite in fact. :) It sounds like you are used to a buggy rendering behaviour and you are getting confused when the correct, standards-compliant rendering is applied. But if you've got an example I'll eat my words...
Some typical quotes:
a lot of our code is based on what I learned 5 years ago, with work-arounds when things didnt look good in IE5, NS4, NS6, and laterlly Opera.
'work-arounds' - no wonder it looked weird when rendered properly.
All <p> text had a blank line above and below it within table cells, and every graphic on the page had a 5-10 pixel space beneath it. Needless to say my menubar wasn't looking too hot.
Space around <p> tags = standard.
Space under graphic caused by whitespace in html - also standard!
also having changed the doctype to the above, now stuff is not centering as it used to
Probably using <div align="center"> or text-align:center to center stuff. The standard compliant way is auto for left and right margins ( i.e. {margin: 0 auto 0 auto;} ).
Still not seen any evidence of anything getting worse by using the correct doctype. As far as I can tell it only causes problems if you don't write standards compliant code in the first place.