when checking the source code of a site on firefox I got this on red
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Is my understanding that the red source sometimes means wrongly closed tags or errors of some type.
Can somebody explain why the “Transitional” tag is viewed in red while the “Strict” tag is viewed normally ?
Where can I find the rules for me to check which “DOCTYPE” tag I need to have on my site ?
It is relevant to have one ?
Thanks
The most important first: Yes, it’s relevant to have a doctype tag.
Without a doctype tag your page will be rendered in quirks mode. That basically means that the browser tries to be compatible with the oldest HTML version it knows, usually something like HTML 3.2, and the oldest Javascript version that it knows. In Internet Explorer it also means that it uses the non-standard box model, which can mess up your layout completely.
You can find valid doctype tags at the W3C Recommended list of Doctype declarations.