Friday, 3 January 2014

Tutorial 3: HTML Introduction

Now lets see the basic body of a HTML program......

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

Now lets see the working of the above code...
  • The DOCTYPE declaration defines the document type
  • The text between <html> and </html> describes the starting and ending of the web page respectively.
  • The text between <body> and </body> is the visible page content.
  • The text between <h1> and </h1> is displayed as a heading. Here 'h' stands for Heading and you can further define more heading like h2,h3,etc.
  • The text between <p> and </p> is displayed as a paragraph. Here 'p' stands for paragraph.
NOTE=> The <!DOCTYPE html> declaration is the doctype for HTML5. HTML 4.01 or XHTML 1.0                have different declaration.

HTML Tags

HTML markup tags are usually called HTML tags
  • HTML tags are keywords (tag names) surrounded by angle brackets like <html>
  • HTML tags normally come in pairs like <b> and </b>
  • The first tag in a pair is the start tag(<b>), the second tag is the end tag(</b>).
  • The end tag is written like the start tag, with a forward slash before the tag name.
  • Start and end tags are also called opening tags and closing tags.
So the basic syntax of a tag in HTML is,
<tagname>content</tagname>

HTML Elements

An HTML element is everything between the start tag and the end tag, including the tags:
EXAMPLE:
<p>This is a paragraph.</p>

Web Browsers

The purpose of a web browser (such as Google Chrome, Internet Explorer, Firefox, Opera) is to read HTML documents and display them as web pages.
The browser does not display the HTML tags, but uses the tags to determine how the content of the HTML page is to be presented/displayed to the user.



HTML Versions

Different versions of the HTML since 1991.

VersionYear
HTML1991
HTML+1993
HTML 2.01995
HTML 3.21997
HTML 4.011999
XHTML 1.02000
HTML52012
XHTML52013

No comments:

Post a Comment