Monday, 29 December 2014

Doctype

10:27 Posted by Unknown No comments

Syntax

<!DOCTYPE html>

Definition and Usage 

A document type declaration or doctype is not a HTML tag. It is an instruction to the web browser about the version of HTML, the page is written in. It is very first thing in html document. All doctypes are case insensitive. There are different doctypes associate with different versions of html.
Some common doctypes are:

HTML5

<!DOCTYPE html>

HTML4.01 Strict 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML1.0 Strict 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML1.0 Transitional

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

XHTML1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Reference Page:  w3school

Sunday, 28 December 2014

html tag

20:39 Posted by Unknown No comments

Syntax

<html></html>

Definition and Usage

The <html> tag tells the browser that this is an HTML document. <html> tag represents the root of HTML document. All other code (except for the <!doctype>) will go between html tag.

Try it Yourself

<!doctype html>
<html>
      <head>
     <title>Title</title>
</head>
<body>
     <h1>Hello World</h1>
</body>
</html>

Saturday, 27 December 2014

head tag

21:04 Posted by Unknown No comments

Syntax

<head></head>

Definition and Usage

The <head> tag is a container for all the the tags and meta data that you do not want to show on your browser screen. The following tag can go inside the <head> tag:

<meta>:  The <meta> tag provides metadata(general information) about HTML document.
<title>:    The <title></title>  tag shows the title in title bar of the browser.
<link>:    The <link> tag is used to include other HTML or CSS document.
<style>:   The <style></style> tag is used to write CSS in HTML document.
<script>: The <script></script> tag is used to define a client-side script, like JavaScript.

Try it Yourself


<!DOCTYPE html>
<html>
<head>
     <meta charset="UTF-8">  <!-- Defines charset for html document -->
     <title>This is a title</title>
 <!--     <link rel="stylesheet" type="text/css" href="style.css"> Links external stylesheet -->
     <script type="text/javascript">
            console.log("Hello World");
     </script>
</head>
<body>
      <h1>Hello World!</h1>
</body>
</html>