HTML is a makup language commonly used to create Web pages.HTML is developed and maintained by World Wide Web consortium(W3C) .
- Markup Language : A markup language provides a way to describe the structure of text and graphics on a Web page. HTML is derived from a general markup language called Standard Generalized Markup Language (SGML) , which is an International Organization for Standardization(ISO) technology that defines markup languages.
- Hyper Text : The term Hyper signifies the navigation from one location to another in a non-linear fashion.In other words , clicking a hypertext on a Web page takes us to the relevant page on the content, i.e. the structure and the layout of a Web page with the hwlp of elements and attributes.
- HTML 1.0→ Released in 1992. Provides the idea of seperation between the logical structure and presentational elements in a Web Page.
- HTML 2.0→ Released in 1995. Updated version of HTML 1.0 . It introduced new features such as file uploading through a form, tables and client side image maps.
- HTML 3→ Introduced in 1996. It includes the addition of FIG,LISTS, LINK and NOTE elements. It provides the support Updated version of HTML 1.0 . It introduced new features such as file uploading through a form, tables and client side image maps.
- HTML 4→ Introduced in late 1997. It refers to a version that has introduced new elements for style sheets, scripts, frames, embedded objects, complex tables and forms. Apart from this it has provided improved accessibility features, such as accessing a form.
- HTML 4.01 → It was introduced in late 1999 . This version has added the id attribute for all elements and has expanded the OBJECT element to include Java applets or any kind of external file in a Web page. It has also included the APPLET, EMBED, , and IMG elements and the feature of event capturing .
- HTML TAGs: HTML is written in form of TAGs , which are pair of angle brackets(< and >) and some text placed between these angle brackets. The text present between a pair of angle brackets defines an HTML elements.
- HTML Elements : Elements are building blocks of an HTML document. The browser interprets an HTML document on the basis of the element types that are added in the document. As a result, an HTML document is displayed with all the properties specified by the elements embedded in it.
- ATTRIBUTES of ELEMENTS: The Attributes of an HTML element are placed within the opening tag(after the element's name) . Most of the HTML attributes are name-value pairs, seperated by '=' sign. However , some attributes such as ismap attribute of the img element is written without specifying a value for it.Attribute values should be enclosed within either single or double quotes.
The Structure of HTML ELEMENT : 1)An Opening/Starting TAG , 2) A Closing / Ending TAG, and 3) The content of the element enclosed between opening and closing TAG. Properties of Html Elements : 1)Attributes and 2) Content.
<p> This is my first paragraph. </p>
<p>→ It is the Opening TAG.
</p>→It is the closing TAG.
This is my first paragraph →The content of the element enclosed between opening and closing TAG.
Example :
<p id = 'example' , lang="en"> This is an example of HTML </p>
Here,
Attributes: id , lang
Value of Attributes : example , en
HTML elements are predefined , which means we cannot create our own tags and must use these predefined tags only. HTML elements are categorized into the following types:
The !DOCTYPE element is the first element is the HTML document, which specifies the Document Type Definition (DTD) used by the document. A DTD is a seperate file containing formal definition of grammar, such as supported elements and attributes used in markup language. The browser checks the code of the document against the rules in the !DOCTYPE declaration. The !DOCTYPE doesnot have a closing tag.
Example :
<!DOCTYPE html>
The html element starts an HTML document and it comes after the !DOCTYPE element in an HTML document. It contains everything an HTML document contains except the !DOCTYPE element.
Example :
#------------------------------
<html lang="en" class="html_class" dir="rtl" id="1" version="1" xmlns="http://www.w3.org/1999/xhtml"
manifest="demo.appcache" draggable="true" contextmenu="mymenu" hidden="true" spellcheck="true" tabindex="1"
style="color: red;" title="MyTitle" accesskey="char" xml:lang="en">
</html>
#----------------------------------
Attribute | Explanation |
---|---|
class | Represents the class of the element. |
dir | Give the direction to directionally neutral text; We can set this attribute to ltr for left to right direction or rtl for right to left text direction. |
id | Represents unique alphanumeric identifier for the element. |
lang | Represents base language use for the element. |
version | Represents the version of the language used. #This attribute has been marked as deprecated. |
xmlns | Declares a XML namespace for custom tags in an HTML document. |
xml:lang | Specifies base language used for an element in the eXtensible Hypertext Markup Language(XHTML) documents. |
manifest | Define a URL(Universal Resource Locator) containing the document's cache information. #This attribute is depreciated. |
contenteditable | Specifies whether content is editatble or not. |
contextmenu | Specifies context menu for a specific element. |
draggable | Specifies whether or not we can drag an element. |
accesskey | Specifies keyboard shortcut to access an element. |
hidden | Declares an element as a hidden element. Hidden elements are not displayed in the document. |
spellcheck | Specifies whether an element should be checked for spelling and grammar or not. |
tabindex | Specifies taborder index of an element. |
style | Specifies inline style in the HTML document by using <style> element. |
title | Specifies title of an HTML document. |