HTML Tags and Structure

HTML Tags and Structure

Published by: Anil K. Panta

HTML Headings

HTML headings are defined with the <h1> to <h6>. <h1> displays largest text and <h6> displays smallest. For example,


HTML Paragraphs

HTML paragraphs are defined with <p> tag. For example, 

HTML Rules (Lines)

We use <hr /> tag to create horizontal line


HTML Comments

We use comments to make our HTML code more readable and understandable. Comments are ignored by the browser and are not displayed. Comments are written between <!-- and -->. For example,


HTML Line Breaks

If you want a new line (line break) without starting a new paragraph, use <br /> tag.


HTML Formatting Tags

We use different tags for formatting output. For example, <b> is used for bold, <i> is used for italic text, Some other tags are <big>, <small>, <sup>, <sub> etc

Note: Please practice these tags in VS Code for better understanding.


HTML Styles

It is a new HTML attribute. It introduces CSS to HTML. The purpose of style attribute is to provide a common way to style all HTML elements. For example,


HTML Links

A link is the address to a resource on the web. HTML links are defined using an anchor tag <a>. We can use this tag to point to a resource (an HTML page, an image, a sound file, a movie etc.) and an address inside a document. We can use href attribute to define the link address. For example,


We can use the target attribute to define where the linked document will be opened. For example, 


The _blank will open the document in a new window. 


HTML Images

HTML images are defined with <img> tag. To display an image on a page, you need to use the src attribute. We can also use width and height attributes with img tag. For example, 


We can use alt attribute to define an alternate text for an image.



The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will  then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on a page, To improve the display and usefulness of your document for people who have text‐only browsers.

We will get back to you via email or phone call