22 June 2009

HTML Elements

HTML Elements

An HTML element is everything from the start tag to the end tag:

Start tag *Element contentEnd tag *
<p>This is a paragraph</p>
<a href="default.htm" >This is a link</a>
<br />  

* The start tag is often called the opening tag. The end tag is often called the closing tag.

HTML Element Syntax

  • An HTML element starts with a start tag / opening tag

  • An HTML element ends with an end tag / closing tag

  • The element content is everything between the start and the end tag

  • Some HTML elements have empty content

  • Empty elements are closed in the start tag

  • Most HTML elements can have attributes

What is HTML?

What is HTML?

HTML is a language for describing web pages.

  • HTML stands for Hyper Text Markup Language
  • HTML is not a programming language,
    it is a markup language

  • A markup language is a set of markup
  • HTML uses markup tags to describe web pages


HTML markup tags are usually called HTML tags

  • HTML tags are keywords 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, the
    second tag is the end tag

  • Start and end tags are also called opening tags and closing

HTML Documents = Web Pages

  • HTML documents describe web pages

  • HTML documents contain HTML tags and plain text

  • HTML documents are also called web pages

The purpose of a web browser (like Internet Explorer or Firefox) is to read HTML
documents and display them as web pages. The browser does not display the HTML tags,
but uses the tags to
interpret the content of the page:



<h1>My First Heading</h1>

<p>My first paragraph</p>



Example Explained

  • The text between <html> and </html> describes the web page

  • The text between <body> and </body> is the visible page

  • The text between <h1> and </h1> is displayed as a heading

  • The text between <p> and </p> is displayed as a paragraph
Related Posts Plugin for WordPress, Blogger...