472,984 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

What the best choice of DOCTYPE for new pages ?

I need an opinion. I have to add NEW pages to an existing site.

The site has - also - some ASPX pages. These pages, I have seen, have
the following doctype:

<!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" >

These pages are very recent and generated by VS 2005 (most modern tool
for asp.net pages), so I guess Microsoft used that doctype to ensure
some compatibility (?).

For the brand new pages (containing HTML/CSS and Javascript only) I am
going to create, what is the most wise and competent choice for the
DOCTYPE. Should I try to be as strict as possible? And in case why?

-P

Aug 20 '07 #1
8 4024
On Mon, 20 Aug 2007, pamela fluente wrote:
<!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" >

These pages are very recent and generated by VS 2005 (most modern tool
for asp.net pages), so I guess Microsoft used that doctype to ensure
some compatibility (?).
Compatible with what?

XHTML is only partially compatible with HTML, and XHTML 1.0 will not be a
subset of later versions of XHTML.
For the brand new pages (containing HTML/CSS and Javascript only) I am
going to create, what is the most wise and competent choice for the
DOCTYPE.
There are long discussions and a long controversy about this topic. I am
not an expert -- so my perception of this controversy is skewed by
ignorance. Here is what a dummy like me believes to have understood:

XHTML is not HTML, only XHTML 1.0 has the same set of tags as HTML 4.0 in a
slightly different syntax. So the answer is: use a doctype XHTML if it is
XHTML and served as such, and use a doctype HTML if it is HTML and served as
such. Serving XHTML as HTML is not recommended (see
http://www.hixie.ch/advocacy/xhtml).

The syntax differences between XHTML 1.0 and HTML 4.0 are small enough that
one can try to comply with both at the same time. (The most important
exception are the "/>" tag delimiters, but it is hardly conceivable that
there will ever be browsers interpreting them the SGML way -- these would
break with most "tag soup" pages, and "tag soup" is de facto the only
feasible way to interpret HTML, given the mess of not standard-compliant Web
pages.)
Should I try to be as strict as possible? And in case why?
More important as strictness is honesty. If your page validates against the
strict DTD, call it strict. If it validates only against the transitional
DTD, call it transitional. If does not even validate against the
transitional DTD, fix it.

Yes, if you have the choice of ensuring that your page validates against the
strict DTD, do it.

--
Helmut Richter
Aug 20 '07 #2
rf
"pamela fluente" <pa***********@libero.itwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
>I need an opinion. I have to add NEW pages to an existing site.
HTML 4.01 strict.

--
Richard.
Aug 20 '07 #3
On 20 Ago, 13:13, Helmut Richter <hh...@web.dewrote:
On Mon, 20 Aug 2007, pamela fluente wrote:
<!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" >
These pages are very recent and generated by VS 2005 (most modern tool
for asp.net pages), so I guess Microsoft used that doctype to ensure
some compatibility (?).

Compatible with what?

XHTML is only partially compatible with HTML, and XHTML 1.0 will not be a
subset of later versions of XHTML.
For the brand new pages (containing HTML/CSS and Javascript only) I am
going to create, what is the most wise and competent choice for the
DOCTYPE.

There are long discussions and a long controversy about this topic. I am
not an expert -- so my perception of this controversy is skewed by
ignorance. Here is what a dummy like me believes to have understood:

XHTML is not HTML, only XHTML 1.0 has the same set of tags as HTML 4.0 in a
slightly different syntax. So the answer is: use a doctype XHTML if it is
XHTML and served as such, and use a doctype HTML if it is HTML and served as
such. Serving XHTML as HTML is not recommended (seehttp://www.hixie.ch/advocacy/xhtml).

The syntax differences between XHTML 1.0 and HTML 4.0 are small enough that
one can try to comply with both at the same time. (The most important
exception are the "/>" tag delimiters, but it is hardly conceivable that
there will ever be browsers interpreting them the SGML way -- these would
break with most "tag soup" pages, and "tag soup" is de facto the only
feasible way to interpret HTML, given the mess of not standard-compliant Web
pages.)
Should I try to be as strict as possible? And in case why?

More important as strictness is honesty. If your page validates against the
strict DTD, call it strict. If it validates only against the transitional
DTD, call it transitional. If does not even validate against the
transitional DTD, fix it.

Yes, if you have the choice of ensuring that your page validates against the
strict DTD, do it.

--
Helmut Richter
Thanks, Helmut, for your valuable opinion and pointers. They are very
interesting.

-P

Aug 20 '07 #4
On 20 Ago, 13:24, "rf" <r...@invalid.comwrote:
"pamela fluente" <pamelaflue...@libero.itwrote in message

news:11**********************@w3g2000hsg.googlegro ups.com...
I need an opinion. I have to add NEW pages to an existing site.

HTML 4.01 strict.

--
Richard.
Ok. so I will use this doctype. :-)
When done, what is the most recommandable way to check that my page
fully comply ?

-P

Aug 20 '07 #5
rf

"pamela fluente" <pa***********@libero.itwrote in message
news:11*********************@o80g2000hse.googlegro ups.com...
On 20 Ago, 13:24, "rf" <r...@invalid.comwrote:
>"pamela fluente" <pamelaflue...@libero.itwrote in message

news:11**********************@w3g2000hsg.googlegr oups.com...
>I need an opinion. I have to add NEW pages to an existing site.

HTML 4.01 strict.

--
Richard.

Ok. so I will use this doctype. :-)
When done, what is the most recommandable way to check that my page
fully comply ?
http://validator.w3.org

From there you will also find the CSS validator.

--
Richard.
Aug 20 '07 #6
On 20 Ago, 13:38, "rf" <r...@invalid.comwrote:
"pamela fluente" <pamelaflue...@libero.itwrote in message

news:11*********************@o80g2000hse.googlegro ups.com...
On 20 Ago, 13:24, "rf" <r...@invalid.comwrote:
"pamela fluente" <pamelaflue...@libero.itwrote in message
>news:11**********************@w3g2000hsg.googlegr oups.com...
I need an opinion. I have to add NEW pages to an existing site.
HTML 4.01 strict.
--
Richard.
Ok. so I will use this doctype. :-)
When done, what is the most recommandable way to check that my page
fully comply ?

http://validator.w3.org

From there you will also find the CSS validator.

--
Richard.
Quite busy eh ?!
Anyway, I found another one on the web (WDG)

Line 1112, character 134:
.... png" width="300" height="50" /></div>
^Warning: net-enabling start-tag;
possibly missing required quotes around an attribute value

Line 1114, character 215:
<br /><a style="color:#c0c0c0" href ...
^

It is essentially complaining for the /found in some tag as IMG or
BR
that I used imitating the xhtml generated by VS...

-P
Aug 20 '07 #7
On 20 Aug, 11:29, pamela fluente <pamelaflue...@libero.itwrote:
The site has - also - some ASPX pages. These pages, I have seen, have
the following doctype:
I really don't know what the best doctype is to use here. HTML 4.01
Strict is a good answer (and almost always the best one), bit there
are issues in getting ASP.NET to behave itself if you're not using
XHTML. Apparently these are surmountable, but you'd need to talk to an
ASP.NET expert who also understands what a doctype is. These people
are rare, and most people hereabouts are HTML experts not ASP. You'll
get an answer (HTML 4.01 Strict), but it may not be an easy or
practical one to impose on Visual Studio.

Real advice on how to really do this properly, by someone skilled in
the ASP.NET arts, would be appreciated.

Otherwise XHTML is a nuisance that's best avoided. You can do good
work with it, but it's not useful and it's extra complexity. It's
certainly not a simple "one or the other" choice. It's much discussed
in c.i.w.a.h so search the archives.

If (and only if) your pages are valid Transitional but not valid
Strict (and you can't afford the time to fix that), then it might be
worthwhile to use Transitional instead. If you do this, make sure you
still use a doctype declaration (the thing on your page that
references the doctype itself) that sets your page to "standards-mode
CSS rendering". Read this too:
http://hsivonen.iki.fi/doctype/

Aug 20 '07 #8
rf

"pamela fluente" <pa***********@libero.itwrote in message
news:11**********************@a39g2000hsc.googlegr oups.com...

<snip stuff about validators>
Quite busy eh ?!
?
It is essentially complaining for the /found in some tag as IMG or
BR
that I used imitating the xhtml generated by VS...
You are using XHMTL syntax. Don't. Use HTML.

--
Richard.
Aug 20 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony T | last post by:
I'm not a regular here - strictly an amateur web developer - but I've got so frustrated I'd really appreciate any help anyone can give. I'm working on a PC platform with Win ME. I'm developing a...
13
by: CJM | last post by:
I am building several (common) db-driven intranet sites (so I cant post URL), using a 3-frame layout; header, menu & main pages. The styling and some of the positioning is done via CSS. Up until...
18
by: Raymond Alexander | last post by:
I produce a couple of simple web sites on Frontpage 2002 and when attempting to validate the pages via W3C.org I get the FATAL ERROR message because the pages don't have the proper DTD's. My pages...
13
by: Monty | last post by:
I've been searching for guidance on which of the approaches used for skipping repetive links (e.g., link as normal text, link as alt text on invisible image, link with same forground and background...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
133
by: Alan Silver | last post by:
Hello, Just wondered what range of browsers, versions and OSs people are using to test pages. Also, since I don't have access to a Mac, will I have problems not being able to test on any Mac...
29
by: AndyZa | last post by:
According to the w3c specs a web page is not valid if the DOCTYPE declaration is missing. So, if I add the following doctype to my pages they will be "compliant": <!DOCTYPE HTML PUBLIC...
11
by: rfr | last post by:
When I add a transitional doctype to the weather page on my community website, I loose certain Js scripts, but not all of them. This puzzles me. The main menu is powered by a js script and...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.