WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 What is DOCTYPE? on Wed Dec 30, 2009 9:50 am

karna

avatar
Registered Member
Registered Member
Why do we need to give a doctype? Cant browsers render properly without them?

2 Re: What is DOCTYPE? on Wed Dec 30, 2009 12:34 pm

ankillien

avatar
Administrator
Administrator
A doctype is telling the browser what type of code you have (HTML 4.01 Strict, HTML 4.01 Quirks Mode, XHTML 1.1 Strict, XHTML 1.1 Transitional, etc.) This will change the way the browser looks at the code, and how it renders it.

3 Re: What is DOCTYPE? on Thu Dec 31, 2009 9:02 pm

karna

avatar
Registered Member
Registered Member
Thanks for the info ankillien. I wonder how come pages work properly even without a doctype?
I have seen many pages that have no doctype but they work properly in browser.

4 Re: What is DOCTYPE? on Sat Jan 02, 2010 9:15 am

ankillien

avatar
Administrator
Administrator
If you don't have a doctype, it assumes HTML 4.01 Transitional.
And thats why it work properly for most pages Razz

5 Re: What is DOCTYPE? on Wed Jan 11, 2012 4:42 pm

bryanbell


Registered Member
Registered Member
DocType is used to declare the type of document. You cannot say that DocType is an HTML or XML element. The declaration of DocType is always on the very top of the documents.

For i.e.

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



Last edited by bryanbell on Tue Sep 11, 2012 6:14 pm; edited 1 time in total

6 Re: What is DOCTYPE? on Thu Mar 15, 2012 4:34 pm

lailagwb


Banned Member
Banned Member
The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag.

The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML 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.

Tip: Always add the <!DOCTYPE> declaration to your HTML documents, so that the browser knows what type of document to expect.

http://www.gowebbaby.com/

7 Re: What is DOCTYPE? on Fri Jan 11, 2013 5:57 pm

ahamadhussain


Registered Member
Registered Member
Hi....

!DOCTYPE declaration is a top-level tag-like reference known as a Public Text Identifier
!DOCTYPE declaration is called a Formal Public Identifier (FPI.)
General Format:

<!DOCTYPE [Top Element] [Availability] "[Registration]// [Organization]// [Type] [Label]// [Language]" "[URL]">

8 Re: What is DOCTYPE? on Wed Jan 30, 2013 3:21 pm

rhae29


Registered Member
Registered Member
The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag.

The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.

In HTML 4.01, the <!DOCTYPE> declaration refers to a DTD, because HTML 4.01 was based on SGML. The DTD specifies the rules for the markup language, so that the browsers render the content correctly.

HTML5 is not based on SGML, and therefore does not require a reference to a DTD.

Tip: Always add the <!DOCTYPE> declaration to your HTML documents, so that the browser knows what type of document to expect.

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum