Home » Posts tagged 'doctype'

Tag Archives: doctype

HTML 5 Document Structure

General Synax of html5 is

<!DOCTYPE html> specifies that this document is html 5 document and you can use all html5 tags here.

<html> is root tag of html document it contains two child tags <head> and <body>

<head> specifies that this portion contains heading information of page we can use many other tags here like <title> which is used to specify the title of page and may other.

<body> we put the contents which you would like to display on browser.
Inside body tag we use many different html tags to proper formatting the data.

Example

In above syntax start and end tags are optional.

if you dont want to use any attribute with root tab ie <html lang=”en”> then you can omit this

So syntax with out root tag

Exampe of html document

Example

In the XHTML syntax we have to specify the xmlns to declare that it is a HTML namespace.

We can use lang or xml:lang attribute to specify the language

Syntax with xmlns

Example

Example

Please follow and like us:
error