HTML Building Blocks

Building Block of HTML

HTML is the standard markup language used to structure and present content on the web.

HTML documents are built using a set of building blocks called elements. Each element represents a specific structure or type of content within the document. The basic building blocks of HTML document are described below:

  1. Tags: HTML elements are defined using tags. Tags are enclosed in angle brackets (< >) and come in pairs: an opening tag and a closing tag. The opening tag denotes the start of an element, and the closing tag denotes the end. For example, <p> is the opening tag for a paragraph element, and </p> is the closing tag.
  2. Elements: Elements are the basic building blocks of HTML. They consist of an opening tag, content, and a closing tag. The content is the text or other elements nested within the tags. For example, the following is a paragraph element with the text “Welcome!“:
    <p> Welcome! </p>
  3. Attributes: Attributes provide additional information about an element. They are specified within the opening tag and consist of a name and a value. Attributes are used to modify the behavior or appearance of an element. For example, the href attribute in an anchor (<a>).
    <a href ="https://baruuf.com"> Learn to code, make a difference </a>

General Syntax:

<tagname attribute_name ="attribute_value"> Your content goes here... </tagname>