Saturday 22 November 2014

HTML Know The Basics

HTML language have a pattern in which the content is edited. Everyone who codes in HTML language should follow the same principle provided by the HTML standards. HTML language consists of different sections in which each section is coded.

Here is a sample code written in HTML

<html>

<head>
Head of the document...
</head>

<body>
Body of the document...
</body>

</html>

HTML Versions

Since the beginning of the web, there have been many versions of HTML, each one of them better than the previous with more functions and efficiency.

  1. HTML - Released in 1991
  2. HTML+ - Released in 1993
  3. HTML 2.0 - Released in 1995
  4. HTML 3.2 - Released in 1997
  5. HTML 4.01 - Released in 1999
  6. XHTML 1.0 - Released in 2000
  7. HTML5 - Released in 2012

HTML Declaration

The Declaration is the first thing to be coded in your HTML page. It defined the document type of the HTML page that you are coding. It is also prompted to add the declaration to your HTML page, so that the browser can determine what type of document the webpage is.

The Declaration is not an HTML tag, it is just used to instruct the web browser about the version of HTML used to code the webpage.

in HTML 4.01, the declaration refers to DTD, because HTML 4.01 was based on SGML. The DTD is used to specify the rules for the markup language, so that the browser can render the contents correctly. In HTML5 it does not require a reference to a DTD because it is not based on SGML. Here are some of the common DOCTYPE Declaration of HTML

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

HTML <html> Tag

The <html> tag is used to describe the webpage. It is used to tell the browser that this is an HTML document.

The <html> tag is the root of an HTML document and is also the container for all other HTML elements except the declaration.

HTML <head> Tag

The <head> element is used to include the header files of the webpage. It is a container for all head elements.

The following elements can go inside the head section :

  • <title>
  • <style>
  • <base>
  • <link>
  • <meta>
  • <script>
  • <noscript>

HTML <body> tag

The <body> tag is used to define the document's body. It is used to describe the visible webpage contents coded using HTML language.

The <body> tag contains all the contents of an HTML document, such as text, hyperlinks, images, tables, forms etc.

HTML Comments

Comments are used to place details and information about HTML elements. comments are not displayed by the browser but is visible in the source code. Comments are used using the comment tag <!-- and -->. Note that an exclamation mark (!) is written in the starting but not in the ending.

For example:
<!--This is a comment-->

0 comments:

Post a Comment