Thursday, April 2, 2020

HTML document - DOC type Tutorial

HTML DOCTYPE
HTML DOCTYPE 

***Below is a simple HTML document and each part will be described in detail :

01.<!DOCTYPE html>
02.<html>
03.<head>
04.<!--- JS/CSS file is to be added here -->
05. 
06.</head>
07.<body>
08. 
09.<h1>Webcoachbd demo heading</h1>
10. 
11.<p>demo content goes here.</p>
12. 
13.</body>
14.</html>

The first line is the <! DOCTYPE html> which is meant to convey the kind of document (to the browser). This declaration is based on what version of HTML you use. For example, the above document is a document of HTML 5. So if it were version 1.0 of XHTML then the declaration would have been

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


This means that everything that is transitional ie HTML can be written in this document as well as deprecated elements like font. Frameset cannot be used.

However, instead of "xhtml1-transitional.dtd" instead of "xhtml1-strict.dtd", deprecated elements cannot be used.***



*** Now when HTML5 comes out they are no longer commonly used. Declaration of HTML 5 is given.

1.<!DOCTYPE html>

However, this is not very important. Copy and paste (X) HTML documents into the beginning of writing. But you have to pay because if something does not output properly in the browser such as Internet Explorer (IE).

Currently XHTML is being used more and more, so this site is also providing HTML tutorial of XHTML itself, although the HTML is actually the HTML we have followed in all HTML tutorials. Another useful thing is that since the latest version of HTML 5 came out, it is now being used all over the world.***


Disqus Comments