<doctype> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:doctype

Introduction

You begin HTML document with a <doctype> element.

The doctype element tells the browser that it will be dealing with HTML.

The doctype Element summary

Item Value
Element doctype
Element TypeN/A
Permitted Parents None
Local Attributes None
Contents None
Tag Style Single open tag
New in HTML5 No
Changes in HTML5 The DTD that was required in HTML4 is obsolete in HTML5
Style Convention None

Using the doctype Element

<!DOCTYPE HTML>

Using the <doctype> Element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <p>
          I like 
         <code id="myId">HTML</code>
          and CSS. <!--from w  ww .j  a v  a 2 s .  co  m-->
      </p> 
      <a href="http://java2s.com">Visit java2s.com</a>  
   </body>
</html>

Related Tutorials