HTML Elements – Tags and Attributes

HTML Elements – Tags and Attributes

In this post learn about HTML Elements, about HTML Tags and attributes. Know the differences between Empty and Non-empty Tag. And most importantly, get the links of all the Tag and Attribute resources.

HTML Tags & Attributes

HTML Elements

1. Tags with content
An HTML element usually consists of a start tag and end tag, with the content inserted in between.

<tagname>Content goes here…</tagname>

2. Empty Tags

HTML elements with no content are called empty elements.
Empty elements do not have an end tag, such as the <br> element (which indicates a line break).


All HTML tags refrence

HTML empty tags refrence

Some important properties of HTML elements

  • HTML elements can be nested (elements can contain elements). All HTML documents consist of nested HTML elements.
  • The <html> element defines the whole document.
  • Although HTML5 does not require lowercase tags, but it is W3C recommendation.

HTML Attributes

  • All HTML elements can have attributes
  • They provides additional information about an element
  • Attributes are always specified in the start tag
  • They usually come in name/value pairs like: name=”value”

HTML Attribute Reference

<a href=””>This is a link</a>

In the above example, a is a tag for converting This is a link text into hyperlink, href is an attribute name and is the link address.

<img src=”abc.jpg” alt=”abc” title=”girl” width=”500″ height=”600″>

In the above example, img is a tag for displaying an image, title describes the image title (title will only be displayed when you hover over the image), alt is to define an alternate text (will be displayed only if the image is not loaded for some reason)


Leave a Reply

Your email address will not be published. Required fields are marked *