...

View Full Version : how to handle DOCTYPE?



naeembhatti
12-08-2006, 01:15 PM
hi friends h r u?
i am in trouble, please help me out.
------------------------------
when ever i try to include this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
on top of my page it disturbs the whole site css and design issues.
-------------------------------
thanx in advance

Capone
12-08-2006, 03:02 PM
This is the doctype i use

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

and it works fine.


Some of the newer browsers need this new doctype to read properly (at least thats what Ive been told).

felgall
12-08-2006, 07:56 PM
The STRICT DOCTYPE would be a better choice than the TRANSITIONAL one. Transitional is only there to allow you to add DOCTYPEs to old pages that contain tags that used to be needed but which have been replaced by something better.

If adding a DOCTYPE messes up your page in Internet Explorer then it means that your page was already messed up in all other browsers since adding the DOCTYPE tells IE to display the page the way other browsers do. Not that IE matches exactly to the output that real web browsers do without a few special IE only tweaks. Which is why you should check the page in other browsers first until you get it right and then tweak it for IE7 and then tweak it a lot more for IE6. (you can put the tweaks inside IE conditional comments so that only the browsers they are intended for will read them).

croatiankid
12-08-2006, 09:31 PM
The STRICT DOCTYPE would be a better choice than the TRANSITIONAL one. Transitional is only there to allow you to add DOCTYPEs to old pages that contain tags that used to be needed but which have been replaced by something better.
I disagree. You can't use HTML to open links in new windows using the STRICT DOCTYPE, since it doesn't support the A's TARGET attribute

rmedek
12-08-2006, 11:25 PM
when ever i try to include this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
on top of my page it disturbs the whole site css and design issues.

A doctype is nothing more than a reference for the browser to describe the type of language you plan on using… sorta like a dictionary for code. If you code your design without a doctype, or using a transitional doctype, the browser interprets what you code as well as it can; if you use a Strict doctype, the browser tends to follow the rules laid out for it in the doctype.


You can't use HTML to open links in new windows using the STRICT DOCTYPE, since it doesn't support the A's TARGET attribute

Not true… you can, it just won't validate.

rpgfan3233
12-08-2006, 11:30 PM
You could always use your own things, like XHTML 1.1 is module-based. Extend the definition of the element to allow for the target attribute. From what I've heard, it won't validate, but it is technically valid.

felgall
12-09-2006, 07:28 PM
Opening a new window is a behaviour and not content.

There are three languages for defining a web page.

1. HTML defines the content
2. CSS defines the appearance
3. Javascript defines the behaviour

That is why the target attribute was deprecated - because it should be done using Javascript and not HTML.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum