Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 05-03-2011, 05:53 AM What's DOCTYPE for?
Novice Talker

Posts: 12
Trades: 0
Hi everyone,

I've seen websites without Doctype so I'm wondering, Does it matter what DOCTYPE to use? What if I don't use it, will it matter? Can someone tell me the purpose of it please, thanks.
PickleWabbit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-03-2011, 06:15 AM Re: What's DOCTYPE for?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
http://www.w3schools.com/tags/tag_doctype.asp
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 05-03-2011, 03:27 PM Re: What's DOCTYPE for?
Giselle's Avatar
"Happy Trails"

Posts: 10,228
Name: Giselle
Location: Washington State
Trades: 0
Here's another Article on DOCTYPES you might find interesting as well.
Giselle is offline
Reply With Quote
View Public Profile
 
Old 05-05-2011, 02:09 PM Re: What's DOCTYPE for?
Skilled Talker

Posts: 59
Name: Lisa Forgan
Location: Colorado
Trades: 0
Doctypes are important. It is an instruction to the web browser about what version of the markup language the page is written in.

The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers render the content correctly.


There are various types of doctype: http://www.w3schools.com/tags/tag_DOCTYPE.asp



Just remember when you have no define doctype, then you will be in quirks mode and some problems may develop:
  • (Quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode. en.wikipedia.org/wiki/Quirks_mode)
Puddlemut is offline
Reply With Quote
View Public Profile
 
Old 05-06-2011, 05:31 AM Re: What's DOCTYPE for?
Novice Talker

Posts: 12
Trades: 0
thank you so much everyone, this forum is great! I'm learning a lot. Thanks for being so accommodating with my questions.


About html5, it's seems html5 looks awkward in some browsers, what do you suggest...should I be using it or better stick to html4?
PickleWabbit is offline
Reply With Quote
View Public Profile
 
Old 05-06-2011, 08:28 AM Re: What's DOCTYPE for?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Realistically until IE8/IE9 supports more HTML5 elements 4.01 is "safest".

http://wufoo.com/html5/

Earlier IE browsers will be in "quirks mode"

MS should have a new slogan for their browsers.

"Internet Explorer by Microsoft - Holding web developement back by a decade"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-09-2011, 05:17 AM Re: What's DOCTYPE for?
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
a DOCTYPE that is respected provides you 'code safety'. You will know what's wrong when you have a problem and, if everything it's valid, it's just a CSS problem (you will be 99% sure of this). If you don't have a valid document you will hardly control unclosed tags or other problems... especially when you have big HTML pages.

Quote:
MS should have a new slogan for their browsers.
"Internet Explorer by Microsoft - Holding web developement back by a decade
Well... I think they should also make mixers, TVs and refrigerators.
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 05-09-2011, 05:46 AM Re: What's DOCTYPE for?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Well you must know the old joke:

If Microsoft made cars

Quote:
1. For no reason whatsoever your car would crash twice a day.

2. Every time they repainted the lines on the road you would have to buy a new car.

3. Occasionally your car would die for no reason, and you would just accept this, close all the windows, restart and drive on.

4. Occasionally, executing a maneuver such as a left turn, would cause your car to shut down and refuse to restart, in which case you would have to reinstall the engine.

5. Only one person at a time could use the car, unless you bought “Car95″ or “CarNT.” But then you would have to buy more seats.

6. The oil, water temperature and alternator warning lights would be replaced by a single “general car default” warning light.

7. The airbag system would say “Are you sure?” before going off.

8. Occasionally for no reason whatsoever, your car would lock you out and refuse to let you in until you simultaneously lifted the door handle, turned the key, and grab hold of the radio antenna.


9. Every time new model was introduced buyers would have to learn how to drive all over again because none of the controls would operate in the same manner as the old car.

10. You’d press the “start” button to shut off the engine.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-13-2011, 05:22 AM Re: What's DOCTYPE for?
Novice Talker

Posts: 12
Trades: 0
you are awesome Chris!

I needed a laugh and you made it possible

Most probably, eliminating compatibility issues in browsers is the main goal of DOCTYPE?
PickleWabbit is offline
Reply With Quote
View Public Profile
 
Old 11-16-2011, 12:44 AM Re: What's DOCTYPE for?
Banned

Posts: 27
Trades: 0
Thanks! Not sure why one of the leading open source CMS products is doing it this way. Must be a reason. Anyone have any ideas?
Cashan is offline
Reply With Quote
View Public Profile
 
Old 11-16-2011, 12:56 AM Re: What's DOCTYPE for?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Quote:
Originally Posted by PickleWabbit View Post
you are awesome Chris!

I needed a laugh and you made it possible
Yeah, we all laugh at Chris around here....
Quote:
Originally Posted by PickleWabbit View Post
Most probably, eliminating compatibility issues in browsers is the main goal of DOCTYPE?
No, the main goal of the DOCTYPE is to tell the browser what it's reading so it knows how to parse the page.

Without a DOCTYPE, your mileage may vary in how the page displays; some browsers are better than others at interpreting the page than others without the explicit declaration. Internet Exploder is the worst at it.

What I have been doing is using a HTML5 DOCTYPE and XHTML Strict syntax. The beauty of it is that works because HTML5 is backward compatible that way. Seems to work pretty well. As support becomes broader for what else HTML5 can do (and as I learn to implement it) I can add it.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 11-16-2011, 08:50 PM Re: What's DOCTYPE for?
Extreme Talker

Posts: 168
Name: James
Location: Australia
Trades: 0
I object to having the need to have a doc type tag.

They where not in when I started, and I never use them. Mostly by habit, but also because I can only see one version of HTML.

Given that all old and redundant tags must retain supported anyhow, and that the only change from one version of HTML to the next is the addition of brand new tags. In theory, any website should work in all modern browsers.
__________________
** Directory of my other websites ***

Please login or register to view this content. Registration is FREE
- for screen devices

Please login or register to view this content. Registration is FREE
- for mobile devices
TRANZIT JIM is offline
Reply With Quote
View Public Profile Visit TRANZIT JIM's homepage!
 
Old 11-17-2011, 04:26 PM Re: What's DOCTYPE for?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Without repeating what anybody else has already said (I'm late to the party), try running a margin:0px auto; css code on a div, or something similar, without a DOCTYPE. You'll see that it won't work, but with a DOCTYPE, it will.

DOCTYPES tell the browser what type of code the document is. It's the DOCument's TYPE.
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-17-2011, 06:10 PM Re: What's DOCTYPE for?
Extreme Talker

Posts: 168
Name: James
Location: Australia
Trades: 0
I was wondering why those Auto things did not work.

But, If a browser was to encounter a keyword to that point, then it must understand what that keyword means. It can only mean one thing no matter what the doctype says.

I understand with Javascript, you have a risk that a new keyword may have been used as a variable in an old webpage. Or when you merge two standards together where they both share one same tag.

But other than that, 99% of the HTML and 99.9% of CSS, should only have one version or one meaning of that keyword.

Sorry I will continu this later. My blood is still boiling from a nasty fight on facebook, and can not focus. I shall give this quality thread and its website due respect and continu with this post later.
__________________
** Directory of my other websites ***

Please login or register to view this content. Registration is FREE
- for screen devices

Please login or register to view this content. Registration is FREE
- for mobile devices
TRANZIT JIM is offline
Reply With Quote
View Public Profile Visit TRANZIT JIM's homepage!
 
Old 11-17-2011, 08:31 PM Re: What's DOCTYPE for?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
True. Although yes, margin:0px auto; should only mean one thing, and it means only one thing to us humans, the computer doesn't know what it is. It's just a string that can be parsed, somehow. I couldn't put
Code:
<div href="margin:0px auto;">center</div>
, because margin:0px auto isn't a valid URL. The parser is looking for a URL within an href attribute. The same goes for the entire document. If you don't specify a DOCTYPE, it's like telling the parser
Code:
<div margin:0px auto;>umm?</div>
. It might work in some browsers, if it assumes that the lack of an attribute tag is style, but not all. Similarly, all browsers assume that a .html or something similar is going to be HTML, but that doesn't stop me from using XML in a .html file. It just won't work.

Sorry if I'm a little unclear right now, too. I'm scattered, as always.
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-18-2011, 08:05 AM Re: What's DOCTYPE for?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Unrelated question:
Quote:
My blood is still boiling from a nasty fight on facebook, and can not focus.
Why do people get annoyed by posting on Facebook.

You have a choice - You either lower yourself to the level of idiot and continue a verbal (text) battle with an "unkown person" or close your browser.

I am always amused/amazed at people who whinge and moan about being told the truth about themselves in forums (usually by me)
Hey they know they are stupid and childish, I know they are stupid and childish, so why do they need to continue proving it??

Anything that anyone "says" to me in the "virtual world" that is deemed to be insulting is pretty much ignored or will only lead me into questioning their intelligence level and or their maturity, which for some strange reason seems to irritate them even more.
I mean let's face it is pretty dumb behaviour to be infuriated by someone you don't know, don't care about and can simply ignore as if it was somebody's "darling" pet pooch sha**ing your leg.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-20-2011, 07:12 PM Re: What's DOCTYPE for?
Extreme Talker

Posts: 168
Name: James
Location: Australia
Trades: 0
Ok, it was somewhat off topic for me to state the facebook thing.


To:Physicsguy,

If you wanted to use inline CSS, the standards require that you have it following 'style= and to put it inside quotation marks.

A browser should see a href tag as a link tag as you said. That is just not the place to put a line of CSS.
__________________
** Directory of my other websites ***

Please login or register to view this content. Registration is FREE
- for screen devices

Please login or register to view this content. Registration is FREE
- for mobile devices
TRANZIT JIM is offline
Reply With Quote
View Public Profile Visit TRANZIT JIM's homepage!
 
Old 11-20-2011, 10:09 PM Re: What's DOCTYPE for?
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Quote:
Originally Posted by TRANZIT JIM View Post
If you wanted to use inline CSS, the standards require that you have it following 'style= and to put it inside quotation marks.

A browser should see a href tag as a link tag as you said. That is just not the place to put a line of CSS.
Exactly
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-21-2011, 02:01 AM Re: What's DOCTYPE for?
vultren's Avatar
Webmaster Talker

Posts: 583
Name: Tony
Location: Seattle Washington
Trades: 1
Quote:
Originally Posted by chrishirst View Post
Unrelated question:
Why do people get annoyed by posting on Facebook.
It's because Facebook is important to them. When you're on Facebook, you're not anonymous, you are representing yourself. If you look stupid in real life, you put a negative on your personal image. Same goes for Facebook and your image.

Then it goes into the theory of you not being yourself online because you're behind a computer... which leads to another theory, which goes on and on. Point is- people react differently when they have something to lose. I have screen shots of users cussing me out and telling me how much they hate me. It's just amazing how they thought they could affect me... I laughed.

Sorry- off topic.
__________________

Please login or register to view this content. Registration is FREE

I am here to give advice as well as learn.

Please login or register to view this content. Registration is FREE
.
vultren is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to What's DOCTYPE for?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.73944 seconds with 12 queries