Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 DOCTYPE, how to use it?
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ZeroPaladn




PostPosted: Mon Nov 14, 2005 2:33 pm   Post subject: DOCTYPE, how to use it?

ive looked everywhere, but i still cant figure out how to use the syntax DOCTYPE, let alone find a point for it. can anyone shed some light on the subject, and maybe put up a few examples for me to look at. Greatly appreaciated.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Mon Nov 14, 2005 3:34 pm   Post subject: (No subject)

Why don't you look at the source of any page? If I am correct in assuming this is what you mean, here is the doctype line from compsci.ca:

code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
md




PostPosted: Mon Nov 14, 2005 4:02 pm   Post subject: (No subject)

the W3C has lots and lots of good resources for web stuff (given that they set teh standards...) http://www.w3.org
Tony




PostPosted: Mon Nov 14, 2005 4:06 pm   Post subject: (No subject)

w3schools explain
ZeroPaladn




PostPosted: Tue Nov 15, 2005 9:33 am   Post subject: (No subject)

ive looked at the code for a couple sites, and i checked W3, but they still dont tell me how to use it. i know what it is, and that it is required, but to add it to my own sites is impossible untill i can make my own from scratch, instead of just taking the code and pasting to my own sites.
md




PostPosted: Tue Nov 15, 2005 12:45 pm   Post subject: (No subject)

Why? If you know which standard your using (probably the latest xhtml) just copy and paste that one...
Tony




PostPosted: Tue Nov 15, 2005 1:02 pm   Post subject: (No subject)

ZeroPaladn wrote:
untill i can make my own from scratch

I think you misunderstood something..

doctype is a tag that specifies the type of the document you're rendering (HTML or XHTML) and links to the guideline for the format. W3 set the standarts for given formats, you don't make up your own, as browsers will not know what ZeroPaladnHTML is Laughing
rdrake




PostPosted: Tue Nov 15, 2005 3:37 pm   Post subject: (No subject)

All you need to do is place the doctype at the beginning of the page, before the html tag. This tells the browser what tags to render and which ones to ignore. W3C hosts them and you don't need to make them up, just choose one of the existing ones. For most HTML, the HTML transitional doctype will do you well.

The purpose behind them is to let the browser know which tags to include and not include, so your pages will render (hopefully) correctly in every browser now, and for years to come.

You don't need to remember how to make one up, just which one to use. I personally have not memorized the same doctype in the few years I've been using it, I just copy and paste it from other sites I have created.

Basically, just paste the following before the html page of your web pages, and it's all you need to do.
code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Sponsor
Sponsor
Sponsor
sponsor
md




PostPosted: Tue Nov 15, 2005 3:48 pm   Post subject: (No subject)

please use something more recent then transitional... xhtml 1.0 or better is what you should be using...
rdrake




PostPosted: Tue Nov 15, 2005 6:30 pm   Post subject: (No subject)

Cornflake wrote:
please use something more recent then transitional... xhtml 1.0 or better is what you should be using...
You're right, transitional is the very least he could be using, but it still works. Some people feel XHTML is not going to catch on, while others do. For most peoples' needs, HTML should do though.

It's really a matter of personal preference.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: