HTML stands for “Hyper Text Markup Language” used to design or develop web pages.
- HTML is a markup
- HTML is the language interpreted by the Browser.
- Web pages are also called HTML document.
- HTML is a set of special code that can be embedded in text to add formatting and linking information.
- HTML is specified as Tags in an HTML document.
- Made up of tags that specify the structure of the document (this section is a heading, this section is a paragraph, etc.)
<!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <h1>Heading</h1> <p>paragraph.</p> </body> </html>
Each line in above example is described below:
Line 1: DOCTYPE is used to define the type of document that is in this case html.
Line 2: All html document starts with html tag everything written between these tags consider as the part of html.
Line 3: head in html used to define those elements or objects that are not going to be visible on page. Anything defines in this tag will give information about the document.
Line 4: title tag is used to describe the title of the document (that’ll be show on browser title bar or tab title)
Line 6: body tag is used to define those elements that are the actual part of the document.
Line 8: h1 tag is used to define headings.
Line 9: p tag is used to define paragraph.
HTML tags are keywords (tag names) surrounded by angle brackets:
- Tags are instructions that are embedded directly into text of the document.
- An HTML tag is a signal to a Browser that it should do something.
- By convention all HTML tags begin with an open angle bracket (<) and end with a close angle bracket (>).
HTML tags can be of two types
- Paired Tags: Paired tags in html comes along with the end tag e.g. <h1></h1>
- Singular Tags: Singular tags are stand-alone tags they don’t have any end tag e.g. <br>
DOCTYPE tells the validator which version of HTML to use in checking the syntax of document. It defines the type of document. DOCTYPE declaration is not case sensitive.
Below are few types of DOCTYPE declaration
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">