HTML FOR BEGINNERS
About Lesson

3.0     HTML Structure

HTML uses tags and attributes to tell a browser how a to display the contents of a web page. The HTML page is divided into mainly two parts i.e. Head and Body

  • HEAD: This section contains the information about the HTML document. For example, the Title of the page, version of HTML, Meta Data, etc.
  • BODY: This section contains everything you want to display on the Web Page. For example paragraphs, images, tables, forms etc.

3.1     Tags

HTML tags are the keywords enclosed within angle brackets on a web page that define how your web browser must format and display your web page e.g. <h1>. There are generally two types of tags in HTML:

  • Paired Tags: These tags come in pairs i.e. they have both opening (< >) and closing (</ >) tags. The closing tag has a forward slash with in the angle brackets. An example of a closing tag is </h1> Opening tags begin a section of content on a page while a closing tag ends it.

  • Empty Tags: These tags do not require to be closed. These tags do not have contents and also can not have any child. Empty tags are also known as void tags, self-closing tags, singletons tags, etc. i.e.Examples of empty tags are <img />, <input />, <br />, <hr />.

3.2     Attributes

Attributes are additional properties of html tags that define the property of any html tags. i.e. width, height, controls, loops, input, and autoplay. These attributes also help us to store information in meta tags by using name, content, and type attributes. 

Attributes:

  • provide additional information about elements
  • are always specified in the start tag
  • usually come in name/value pairs like: name=”value”

Below is the image tag with 3 attributes, src, width and height. <img src=”img_girl.jpg” width=”500″ height=”600″>