zohaib82 — 2013-04-02T01:21:33-04:00 — #1
I am using Colorbox and other JQuery libraries in my project.
Doctype is important for JQuery library like Colorbox.
I want to know importance and why we need doctype in document.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
ralphm — 2013-04-02T01:38:25-04:00 — #2
Basically, if you have a doctype on your page, the browser sees it and thinks—OK, this web designer has some clue about what he's doing, so we'll render the page according to the prevailing web standards. If there's no doctype, the browser might decide to display your page in "quirks mode", as if it were built last century, and thus your layout will break in certain ways.
It doesn't really matter which doctype you use. These days, it's common to use the so called "HTML5" version, which is more of a generic doctype:
which ends up like this in the document:
sageshark — 2013-04-03T05:57:02-04:00 — #3
Doctype help browser understand if the page is written using strict, transitional or frameset type html. Depending upon this declaration the page code will be validated in w3c validator.
Also doctype is necessary to make few elements of html work properly. It is an idea practice to include the doctype in your html page.
rammurtee — 2013-05-30T02:51:02-04:00 — #4
Doctype specify the web standard you have used for writing code of your website.Each doctype has different rules and constraints