Possible Duplicate:
HTML: What is the functionality of !DOCTYPE
hi
i am .asp web developer as a beginner,
i find many article for , but i not get a complete idea..
1.what the use of <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?
2.there is any need for use this in my classic asp page?
DOCTYPE is not needed, it’s an optional element of a web page (not ASP, PHP or other) and only helps the browser to render and use proper rendering mode.
As you mention you’re a beginner, the HTML code (the code that is rendered in any web browser) is divided in 2 main areas.
the
<doctype>that is added adove the<html>tag represents “Hey Browser, this how I made my code, please follow the standards of this type”It’s the same as you see a Navy Officer with it’s patent on the shoulders… It’s an optional thing to have (in the civil world) but if you see someone wearing it, your approach to that individual will be very different and many you don’t say: “Wazz’up” but “How do you do”.
It’s all about standards.
<doctype>it’s only come important with more ways to render the same things in the user browser, in 1990 all we knew was<html>and there was no difference between<br>and<br />, even today, the browser render engine does not care about the breaking space tag, but other might, as<img alt="" src="" >and<img alt="" src="" />Then, there is the difference between HTML and XHTML, though they are an XML language variants, XHTML is much more restrict and, for example, all tags need to be closed, so you do need to write
<br/>.I hope I can help you make some sense on the
<doctype>tag 🙂