Solved

which is the best dtd in xhtml?

Posted on 2011-09-02
5
370 Views
Last Modified: 2012-05-12
which is the best dtd in xhtml?

what is the main difference of below dtd declaration:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

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

which one is the best dtd for webpage?and how?...plz send me comments
0
Comment
Question by:codeoxygen
5 Comments
 
LVL 11

Expert Comment

by:Rajesh Dalmia
ID: 36472516
it depends on what type of html document you are making... you can get more details at

http://www.w3schools.com/tags/tag_DOCTYPE.asp

normally for xhtml... your 3rd doctype should be used...
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 36472520
Please ref . Look at here
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 36477418
If you don't need xhtml and can use html5 here is some info http://www.html-5.com/tags/doctype-declaration/index.html
0
 
LVL 25

Accepted Solution

by:
Rouchie earned 250 total points
ID: 36490444
which is the best dtd in xhtml?

None of the above.  If you are serious about writing quality XHTML then you should use the STRICT XHTML DocType.  This will force better quality code as transitional code (a mixture of different versions) generally won't validate

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Open in new window


0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 250 total points
ID: 36490735
Which ever you choose, it is a personal preference. They will all display your content. There are reasons for using one over the other that depend on your project.  This chart may help.  http://www.zvon.org/xxl/xhtmlReference/Output/comparison.html.  Now you can use html5 which requires no declaration and that will be the trend.  

There will be good arguments for and against "strict" but this is what the top sites are using...

www.nytimes.com, cnn.com, chicagotribune.com, latimes.com, ebay.com uses

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


Match.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >


wordpress.com

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

MSN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Google,youtube, facebook,yahoo,wikipedia, linkedin.com,apple.com
uses html5
<!doctype html>.  


0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now