Forum Moderators: mack
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
since I'm using HTML 4.
I am wondering what else I should put in? Do i put in
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
i know that i need to put in some meta http equiv thing but i just dont know what? i mean ive seen utf-8, iso-8859-1 and ive seen widowns 1252 or sumthin like that? what the hell does it all mean, i just want to make up an HTML webpage.... :-(
Can someone tell us what i need to stick in for it to be compliant!?
Cheers guys
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="/includes/css/site.css" type="text/css" />
<!--[if IE 7]>
<link rel="stylesheet" href="/includes/css/ie.css" type="text/css" /><![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" href="/includes/css/ie6.css" type="text/css" />
<![endif]-->
</head>
the above is the code i always use, any reason why you would use transitional over Strict?
UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. It is able to represent any character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is backwards compatible with ASCII. For these reasons, it is steadily becoming the preferred encoding for e-mail, web pages, and other places where characters are stored or streamed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
also, you use utf-8 however you are using xhtml so it may not be right for me? and i dont hav a clue what that wikipedia description is going on about!
i just want to learn basic html coding,but which is correct, i would like the bit which is to go before the body cos i dont understand any of it. can anyone help please?
Thanks!
Actually for basic site without any styling you will probably find it working fine without a DOCTYPE at all. In my early days I never bothered and those pages are still working fine on all browsers.
ISO-8859-1 is a (Latin : A,B,C,D, etc) subset of characters from UTF-8.
if your site is just going to be in english then it's alright to just use iso-8859. if it's going to be multi-lingual, you should really use utf-8.
i'd stay away from 'windows-#*$!x', as i assume that it's microsoft only.
i personally always use utf-8 as you never know when a client comes back and asks for a multi-lingual!
hope this makes things a bit clearer....
[alanwood.net...]
might help...
Can someone tell us what i need to stick in for it to be compliant!?
Many of these answers are probably confusing to a newcomer - maybe this will sort it out.
You can be compliant in 4.0 or XHTML, strict or transitional, this is a decision you make based on the requirements of the project at hand. To clarify, what you have there is a valid 4.01 document type definition. What this means in terms of your pages is that the pages will render in standards compliance mode, as opposed to quirks mode. In quirks mode, some of the features in CSS will fail to work as expected. In standards mode, if the css is not assigned correctly, it also will not work - the simplest example being color. #ff00ff is a valid color assignment in standards mode, ff00ff is not.
More info - Choosing the best document type for your site [webmasterworld.com]
If you are in Firefox, right now, right-click the background somewhere on this page and select View Page Info, then the General tab. It will tell you the render mode of this page.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
The answer here is similar, "it depends." ISO is fine if you plan on always using standard ASCII characters, and do not foresee using "special characters" outside the standard ASCII character set, such as Microsoft "curly quotes". If your documents will contain foreign languages, you are definitely going to need another document type. This is also complicated by what type of encoding documents are served as by your web host
More information - Character Encoding, Entity References, and UTF-8 [webmasterworld.com]
I will add one thing: note you have an XML-style ending to your content-type:
/>
This is not valid 4.01 syntax. These are only required for XHTML documents. Pet peeve of mine. :-)
4.01
<br /> should be <br>
<img /> should be <img>
<hr /> should be <hr>