Archive for the ‘Tag’ Category

<!DOCTYPE >

Like <!– … –>, <!DOCTYPE >should be a familiar tag for web programers. <!DOCTYPE > defines the document type. As such it is the first thing that should be included in your web file. In HTML5 there is only one document type, HTML. This is different then in the previous version of HTML.

<!DOCTYPE > tells the browser what type of document and code to expect, allowing it to handle the coding properly. I believe this is the only tag that does not need to be accompanied by a closing tag.

The below example is taken from W3Schools and is a basic layout and framework of a basic webpage:

<!DOCTYPE HTML>
<html>

<head>
<title>Title of the document</title>
</head>

<body>
The content of the document……
</body>

</html>

“<!–…–>”

So the first tag is a simple one that any one who has done any type of web coding is probably familiar with.

“<!–…–>” is used to open a comment that can be seen in the source code and is not shown in the browser to the web viewer.  Any thing placed between the “<!–” and a closing tag of “–>” can be used by developers to write just about anything they’d like.  I have used the comment tag to help me divide up a web page and easily see where different parts or sections begin and end.  As far as I can tell, there is no difference in the use of this tag in HTML5 as in previous versions.  Below is an example of how the comment code could be used:

<div id="footer">

     <div id="copyright">

          <span>Copyright &#169; 2011 - <a href="http://dexterousdesigns.com">DexterousDesigns.com</a> - All rights reserved. </span>

     </div> <!-- End of Copyright -->

</div> <!-- End of Footer -->

While this may seem pointless in the above code, it can come in quite handy when you have several small sections of code opening within another section. Placing comments along side the closing of a section within another section will help you to remember what just what particular section is being closed.

Categories
May 2012
S M T W T F S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  
Archives