HTML Tag's Group - Text Content

HTML Tag's Group - Text Content

ยท

6 min read

Hi there everyone. ๐Ÿ‘‹ How's your weekend going?
Hope you are doing well. ๐Ÿ™‚

In this article, I'm going to share a brief description of a group of HTML tags - 'text content'


Prerequisites ๐ŸŽ’

  • Willing to code.

Definitions ๐Ÿ“˜

HTML tag:

  • In HTML, a tag is used to create an element.
  • A tag's name is enclosed within the angle brackets < and >
    Example - <p>, where p denotes a paragraph.

    Note that tags are used in a pair where there is an opening tag like <p> and a closing tag like </p>

HTML element:

  • An element is a part of a webpage.
  • It can be data, text, or an image.

Text content elements ๐Ÿท

  • These elements in HTML are used to organize blocks or sections of the content, which are placed within the pair of tags.
  • They help the browser to identify the purpose or structure of the content in a webpage.

Elements List ๐Ÿ“

โžค <blockquote>

  • It indicates that the enclosed text is an extended quotation.
  • Example:

    <blockquote>Never wait for an inspiration. Just get start to learn coding.<br>
    keep coding, keep growing...!</blockquote>
    

    Never wait for inspiration. Just start to learn to code.
    keep coding, keep growing...!

โžค <dd>

  • It provides the description or definition for the proceeding term <dt> in a description list. <dl>
  • Example:
    <dl>
    <dt>Term1</dt>
    <dd>Description of the term1.</dd>
    </dl>
    
  • Term1
    Description of the term1.

โžค <div>

  • It is a division element, which is used to add CSS styling to the content.
  • Example:
    HTML
    <div class="body">
    <h3>This is a heading</h3>
    </div>
    
    CSS
    .body{
    background color: lightgray;
    }
    

โžค <dl>

  • The element encloses a list of terms and their definitions.
  • Example:
    <dl>
    <dt>Term2</dt>
    <dd>Description of term2</dd>
    </dl>
    

โžค <dt>

  • It specifies a term in a description list followed by the tag <dl>
  • Example:
    <dl>
    <dt>Term3</dt>
    </dl>
    

โžค <figcaption>

  • It describes the contents of its parent element <figure>
  • Example:
    <figure>
    <img scr="">
    <figcaption>Some image from an image source.</figcaption>
    </figure>
    

โžค <figure>

  • It represents the content within itself, which optionally contain a <figcaption> tag.
  • Example:
    <figure>
    <img scr="">
    </figure>
    

โžค <hr>

  • This element represents a theme-based break between paragraphs.
  • Example:
    HTML
    <p>This is para1</p>
    <hr>
    <p>This is para2</p>
    
    CSS
    .hr{
    text-align: center;
    }
    .hr:after{
    content: '#'
    }
    

โžค <li>

  • It represents an item in a list.
  • It is followed by its parent element <ol>, <ul> or <menu>
  • Example:
    <ul>
    <li>Item1</li>
    <li>Item2</li>
    <li>Item3</li>
    </ul>
    

โžค <ol>

  • It represents an ordered list of items.
  • Used to represent number wise item list.
  • Example:
    <ol>
    <li>Item1</li>
    <li>Item2</li>
    <li>Item3></li>
    </ol>
    

โžค <p>

  • It represents a paragraph which is usually a block of text, separated from adjacent text blocks.
  • Example:

    <p>This is paragraph 1 with some text in it.</p>
    <p>This is paragraph 2 with some text in it.</p>
    


โžค <pre>

  • It is used to represent preformatted text which is displayed on the webpage at the exact position as written in the HTML file.
  • Example:
    <pre>
    L
    h
      a
    </pre>
    

โžค <ul>

  • It represents an unordered list.
  • It is used to display items with bullet lists.
  • Example:
    <ul>
    <li>Item1</li>
    <li>Item2</li>
    <li>Item3</li>
    </ul>
    


So that was a brief description of a group of HTML tags that are used to organize a section of elements to be displayed on the webpage.

Hope you like this article/tutorial of my series Random-Coding.
Please read my other articles of this series as well for more cool and fun projects.

I will meet you through my next article soon. Till then, stay connected with me through Twitter and Discord

Keep Coding, keep growing โ˜•๏ธ


References: ๐Ÿ“š