Bluepearl Design
Go Back   Bluepearl Design > Misc > Tutorials > HTML, XHTML, Javascript, CSS

Choosing a DOCTYPE

HTML HyperText Markup Language.
XHTML Extensible Hypertext Markup Language.
JAVASCRIPT object-based scripting programming language.
CSS Cascading Style Sheets.

    

Reply
 
LinkBack (2) Thread Tools Rate Thread Display Modes
Old 04-10-2007, 12:00 PM   2 links from elsewhere to this Post. Click to view. #1 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,916
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Arrow Choosing a DOCTYPE

So that your site can be properly validated for standards - each page on your site requires a document type declaration which begins at the top of every XHTML page and and tells a validator which version of HTML to use in checking the document's syntax.

The 2 most popular DOCTYPEs i have seen for developers wanting to accomplish 100% validation is:

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

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Where the first one declares the page XHTML 1.0 Strict and the second one declares the page XHTML 1.0 Transitional.
Of the 2 i personally use Transitional more as i find it alot more friendly when coding complex sites in 100% CSS.

There is also HTML DOCTYPEs for developers not using XHTML but now adays i think every one serious about Web Site validation is using XHTML
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-10-2007, 10:16 PM   #2 (permalink)
 
Fragalot's Avatar
 
Title: Ipood
Join Date: Nov 2004
Location: belgium west-flandres
Age: 19
Posts: 4,445
Images: 1
Rep Power: 9 Fragalot is on a distinguished road
Send a message via ICQ to Fragalot Send a message via MSN to Fragalot Send a message via Yahoo to Fragalot
Re: Choosing a DOCTYPE

Quote:
<!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" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{title}</title>
<script src="script/prototype.js"></script>
<script src="script/custom.js"></script>
<link href="css/application.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
</div>
</body>
</html>
that's what I use alot lately.
using Transitional on this example because of the target="" in links.
Strict nolonger allows for target, so ... either you find a way arround it, or use transitional.
Fragalot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-10-2007, 10:20 PM   #3 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,916
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: Choosing a DOCTYPE

I use Javascript for external links so that my pages still Validate:

Code:
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;
And the URL:

Code:
<a href="" rel="external">anchor</a>
The target attribute is no longer valid.
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2007, 12:46 AM   #4 (permalink)
 
Fragalot's Avatar
 
Title: Ipood
Join Date: Nov 2004
Location: belgium west-flandres
Age: 19
Posts: 4,445
Images: 1
Rep Power: 9 Fragalot is on a distinguished road
Send a message via ICQ to Fragalot Send a message via MSN to Fragalot Send a message via Yahoo to Fragalot
Re: Choosing a DOCTYPE

sure, but JS doesn't work on all websites.

atm i'm making an AJAX website, which works perfectly fine without JS enabled aswell.
it works either way. you only won't have fancy effects without javascript.
Fragalot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2007, 01:41 AM   #5 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,916
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: Choosing a DOCTYPE

U mean JS doesnt work on all Browsers

A Survery i read somewhere, reckons that 15-20% of users still disable Javascript in their browser settings ...
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2007, 02:17 AM   #6 (permalink)
 
Fragalot's Avatar
 
Title: Ipood
Join Date: Nov 2004
Location: belgium west-flandres
Age: 19
Posts: 4,445
Images: 1
Rep Power: 9 Fragalot is on a distinguished road
Send a message via ICQ to Fragalot Send a message via MSN to Fragalot Send a message via Yahoo to Fragalot
Re: Choosing a DOCTYPE

yep.
Fragalot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2007, 12:10 PM   #7 (permalink)
 
Title: Bryan
Join Date: Jan 2004
Location: Dundee
Age: 22
Posts: 3,543
Rep Power: 8 wasahobo is on a distinguished road
Send a message via AIM to wasahobo Send a message via MSN to wasahobo
Re: Choosing a DOCTYPE

Personally I like using...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
As Sean stated it seems to work very well when creating a 100% CSS site. I find I only use strict when I need to implament XML into a page.
__________________
BluePearl-Design + 3sStudios = Unlimited Possibilities.


Current Project: http://www.3sstudios.com/cloud.htm
wasahobo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2007, 09:40 PM   #8 (permalink)
 
Fragalot's Avatar
 
Title: Ipood
Join Date: Nov 2004
Location: belgium west-flandres
Age: 19
Posts: 4,445
Images: 1
Rep Power: 9 Fragalot is on a distinguished road
Send a message via ICQ to Fragalot Send a message via MSN to Fragalot Send a message via Yahoo to Fragalot
Re: Choosing a DOCTYPE

agreed.
Fragalot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.bluepearl-design.com/forums/html-xhtml-javascript-css/2996-choosing-doctype.html
Posted By For Type Date
Digg - Choosing a DOCTYPE This thread Refback 08-28-2007 07:41 AM
Bluepearl Design This thread Refback 04-11-2007 12:47 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: Choosing a DOCTYPE
Thread Thread Starter Forum Replies Last Post
Choosing a DOCTYPE and Validation Bluepearl Feeds RSS Feeds 0 06-25-2007 09:27 AM


  
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Bluepearl Templates

All times are GMT +11. The time now is 11:06 AM.

 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52