Mastering HTML: Top 12 Unique HTML Tags with Examples

  • html
  • 263 Views
  • 7 Min Read
  • 4 May 2024

In this article, we will learn about the top 12 unique HTML tags that many developers don't know about. By using these tags, you can create your website in a more optimized way.

 

So let's get started.

 

Top 12 Unique HTML Tags List

 

  1. Details tag
  2. Mark tag
  3. Output tag
  4. Datalist tag
  5. Video and Audio tags
  6. Progress tag
  7. Pre tag
  8. Marquee tag
  9. Blockquote tag
  10. Fieldset tag
  11. Del and Ins tag
  12. Area tag

 

 

1. Details tag

 

The <details> tag in HTML creates a widget that lets users open and close content by clicking on it. It's like a toggle button. By default, the content is closed. You can put any type of content inside it. Usually, it's used with <summary> to give a title or summary of the content.

 

<body>
    <details>
        <summary>Click here to see more Category</summary>
        <ul>
            <li>HTML</li>
            <li>CSS</li>
            <li>JavaScript</li>
        </ul>
    </details>
    <br>
    <details>
        <summary>Click here to visit our site.</summary>
        <a target="_blank" href="https://codemafias.com">Codemafias</a>
        <img src="https://codemafias.com/img/post_imgs/1672495305758.png" width="40%" alt="codemafias-image">
    </details>
</body>

 

CSS details attribute

 

The <details> tag works well in all modern browsers, but it's not compatible with Internet Explorer. If you want to support Internet Explorer, you'll need to use a JavaScript library or polyfill to make it work.

 

 

2. Mark tag

 

The <mark> tag highlights text with a default yellow background color, but you can customize its appearance using CSS to change colors, font, and more.

 

<body>
    <p>Lorem ipsum, dolor sit amet <mark>Important item</mark> consectetur adipisicing elit.</p>
</body>

 

HTML mark tag

 

The <mark> tag highlights text with a default yellow background color but you can customize its appearance using CSS to change colors, font, and more.

 
mark {
    background-color: black;
    color: lime;
    font-weight: bolder;
}
 
HTML mark tag

 

 

3. Output tag

 

The <output> tag in HTML is indeed used to display the result of a calculation or the output of a script. However, it's typically used in conjunction with JavaScript rather than directly in HTML markup. Here's an example:


<form onsubmit="return false">
    <input type="number" id="a" value="0"> *
    <input type="number" id="b" value="0"> =
    <output id="result"></output>
    <button type="submit" onclick="result.value=parseInt(a.value)*parseInt(b.value)">Calculate</button>
</form>

 

HTML output tag

 

After entering values in both input boxes, clicking the "Calculate" button triggers a JavaScript function to perform the calculation and update the output element's value.

 

 

4. Datalist tag

 

The <datalist> tag helps create autocomplete suggestions for input fields. When users type, it shows a list of options matching their input. To use it, define options with <datalist>, then link it to an input using the list property. As users type, matching options appear for selection.

 

<body>
    <label for="languages">Type your favorite Programming languages:</label>
    <input list="Programming_languages" id="languages">

    <datalist id="Programming_languages">
        <option value="Python">
        <option value="C++">
        <option value="Swift">
        <option value="Kotlin">
        <option value="Java"></option>
    </datalist>
</body>

 

HTML datalist tag

 

 

5. Video and audio tags

 

Using the <video> and <audio> tags in HTML, you can play video and audio files right on your webpage without needing any players or plugins.

 

To use the <video> tag, you specify the video file's location with the src attribute and set its width and height. You can also add the Controls attribute to let users easily play, pause, and adjust the volume.

 
<body>
    <video src="video.mp4" width="600" height="500" controls> </video>
</body>

 

HTML video tag

To use the <audio> tag, specify the audio file's source with the src attribute. Also, include the controls property to show user controls like play/pause and volume adjustments.

 
<body>
    <audio src="audio.mp3" controls></audio>
</body>

 

HTML audio tag

 

Both the <video> and <audio> tags come with extra options. You can set multiple media sources, add a poster image for the video start, include captions or subtitles, and more.

 

 

6. Progress tag

 

The HTML <progress> tag shows a progress bar to users, letting them see how far along a task is and what percentage is done.

 

To implement the progress element, define the current progress with the value attribute and set the maximum progress value with the max attribute. The value should range from 0 to the max value, reflecting the current progress, while the max attribute specifies the total steps or end goal of the task.

 

<body>
    <label>Downloading progress: 80%</label>
    <progress value="80" max="100"> 80% </progress>
</body>

 

HTML progress tag

 

In the example, the progress bar fills to 80% as the current progress value (80) is set relative to the maximum progress value (100).

 

You can display an indefinite progress bar by either removing the value and max attributes or setting the value property to null.

 

<body>
    <progress>Waiting...</progress>
</body>

 

HTML progress tag

 

 

7. Pre tag

 

The <pre> tag is used to display pre-formatted text in HTML. Text within this tag is shown in a fixed-width font, maintaining the spacing and formatting exactly as it appears in the HTML source code.

 
<body>
    <pre>This is pre      tag Lorem
     ipsum dolor sit amet
     consectetur, adipisicing elit.
          Doloribus, voluptatibus?    Lorem </pre>
</body>

 

HTML pre tag

 

 

8. Marquee tag

 

The <marquee> tag in HTML is used to create a scrolling text effect. You can make text move horizontally or vertically across the screen by wrapping it inside the <marquee> tag. Use the direction attribute to specify the scroll direction ("left," "right," "up," or "down"), and set the scroll speed using the scrollamount attribute.

 

<body>
    <marquee direction="right" scrollamount="10">This text will scroll from left to right.</marquee>
</body>

 

HTML marquee tag

 

In the same way, you can create vertically scrolling text by setting the direction attribute of the marquee element to "up" and adjusting its height and width using CSS.

 

<body>
    <marquee width="50%" direction="up" height="200px">
        vertically scrolling effect
    </marquee>
</body>

 

 

9. Blockquote tag

 

The <blockquote> tag in HTML is used to represent a longer quote from another source. It is commonly used to separate the quote from the rest of the text on the page and to highlight it.

 
<body>
    <p>Lorem ipsum dolor sit amet.</p>
    <blockquote> 
        Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil amet velit distinctio neque similique
        repellat quaerat nemo illum. Quia molestias rerum libero aliquam iure assumenda dignissimos quidem
       deserunt aperiam quis! Lorem ipsum dolor sit amet consectetur adipisicing elit. Provident itaque qui nostrum,
      repellat culpa esse quasi doloribus doloremque? Ex omnis corporis laudantium quaerat optio possimus
     voluptatibus eos ipsum saepe? Voluptates! </blockquote>
</body>

 

HTML blockquote tag

 

You can also include an optional cite attribute to provide a reference or link to the source of the quotation.

 

<body>
    <blockquote cite="https://codemafias.com/How-to-use-Your-Browser-as-a-Text-Editor">
        Although there are so many such tricks these three are very simple and effective. The three methods
        described below can be used to use the Chrome browser as a notepad.
    </blockquote>
</body>

 

HTML blockquote tag

 

 

10. Fieldset tag

 

The <fieldset> tag in HTML groups related elements, often within a form. It's paired with <legend> to give a title to the group. This tag also draws a box around the grouped elements, visually separating them from other content.

 

<body>
    <form>
        <fieldset>
            <legend>Personal Information:</legend>

            <label for="fname">First name:</label>
            <input type="text" id="fname" name="fname"><br><br>

            <label for="lname">Last name:</label>
            <input type="text" id="lname" name="lname"><br><br>

            <label for="email">Email:</label>
            <input type="email" id="email" name="email"><br><br>

            <label for="contact">Contact:</label>
            <input type="contact" id="contact" name="contact"><br><br>

            <input type="submit" value="Submit">
        </fieldset>
    </form>
</body>

 

HTML fieldset tag

 

The <fieldset> tag puts a border around form parts, and <legend> acts as a title. This helps organize forms, making them clear and easy to fill out.

 

You can also group non-form items using <fieldset>, with <legend> acting as a caption. With CSS, you can style it to create appealing forms.

 

 

11. Del and Ins tag

 

The <del> tag is used to show text that has been deleted from a document and the <ins> tag highlights text that's been newly inserted into the document. 

 

<body>
    <del>This text has been deleted</del>
    <ins>This text has been inserted</ins>
</body>

 

HTML del and ins tag

 

Both the <del> and <ins> tags can be used with the datetime attribute, which specifies the date and time at which the deletion or insertion was made.


<body>
    <del datetime="2023-01-01T12:00:00">This text was deleted on January 1, 2023 at 12:00 AM</del>
    <ins datetime="2023-01-01T12:00:00">This text was inserted on January 1, 2023 at 12:00 AM</ins>
</body>

 

HTML del and ins tag

 

Both of these tags are used to highlight changes in documents, especially in legal, technical, and collaborative writing contexts.

 

 

12. Area tag

 

The <area> tag in HTML is used to define clickable areas, called "hotspots," within an image map. An image map is an image with multiple clickable regions that link to other pages or perform actions when clicked.

 

Each <area> element specifies the shape, size, and location of a hotspot within the image map. It's always placed inside a <map> element, which defines the entire image map.

 

The <area> element includes multiple attributes that can be used to determine the shape, size, and location of the hotspot, as well as the link or script that should be executed when the hotspot is clicked. Some of the most commonly used attributes are:

 

shape: This attribute specifies the shape of the hotspot. Possible values include "rect" (rectangle), "circle" (circle), and "poly" (polygon).

 

coords: This attribute specifies the coordinates of the hotspot. The format of the coordinates depends on the shape of the hotspot. For a rectangle, the format is "x1,y1,x2,y2", where (x1,y1) is the top-left corner and (x2,y2) is the bottom-right corner. For a circle, the format is "x,y,r", where (x,y) is the center of the circle and r is the radius. For a polygon, the format is "x1,y1,x2,y2,x3,y3,...", where each (xi, yi) pair specifies a vertex of the polygon.

 

You can see the image's distance value by opening it in paint, the distance in the bottom left is extreme when you drag the mouse over the image from one corner to the other.

 

HTML area tag

 

The first value is x, and the second value is y.

 

href: This attribute specifies the URL of the page or resource that should be loaded when the hotspot is clicked.

 

<body>
    <img src="./image/Image.jpg" alt="office" usemap="#map" width="50%">
    <map name="map">
        <area shape="rect" coords="0,0,200,225" href="leptop.html" alt="Computer">
        <area shape="rect" coords="245,0,355,170" href="mobile.html" alt="Phone">
        <area shape="circle" coords="300,300,40" href="coffe.html" alt="Coffee">
    </map>
</body>

 

HTML area tag

 

In the above example, when we click on the area of the laptop in this image, the image of the laptop will appear because we have linked the HTML file of the image of the laptop, just like when we click on the phone, the image of the phone will open, and if we click on coffee, the image of coffee will open. In short, one file redirects to another file.

 

 

Conclusion

 

All the tags given above have their own merits, you can enhance your website by using them. As you practice, you will gain knowledge of all these tags. We are sure you would have liked this article.

 

If you have any questions about this article or anything related to web development, you can ask them using the question box given below.

Didn't find your answer? Add your question.

Share

Comments (0)

No comments yet. Be the first to comment!

About Author

Username

Vanvir Singh Devda ( vanvirsinh )

Full Stack Developer | MERN Stack

Joined On 12 Feb 2024

More from Vanvir Singh Devda

How to Upload Code to GitHub: Quick Steps and Detailed Instructions for Beginners

github

16 Sep 2024

In order to upload (push) your project to GitHub, it involves multiple steps that need to ....

How to create working responsive navbar with multilevel dropdown menu in React Js

react-js

9 Jul 2024

Have you ever found yourself stuck in the complexity of creating a working and responsive ....

Exploring What Web Developers Need to Know For The Future

web-development

17 May 2024

The entire world is experiencing a technological revolution, and web development as a crea....

 10 JavaScript String Methods You Must Know

javascript

9 May 2024

JavaScript provides several methods for manipulating strings. These include splitting stri....

How to install MongoDB on windows in 2024

mongodb

2 May 2024

MongoDB is a Database Management System based on NoSQL (Not Only SQL) and utilizes JSON-li....

JavaScript concepts for beginner web developer

javascript

9 May 2024

This tutorial is going to be very helpful specially for beginners in JavaScript. Throughou....

Popular Posts from Code Mafias

10 Fun Websites for Stress Relief and Relaxation During Coding Breaks

programming

11 Nov 2024

Top 10 fun websites for coders to relax during breaks. Recharge with interactive games, ar....

Mastering HTML: Top 12 Unique HTML Tags with Examples

html

4 May 2024

Through this article, learn those essential HTML tags that many developers do not know abo....

Top 60 Eye-Catching Button Designs Users Can’t Wait to Click - With Source Code

ui-ux

11 Oct 2024

Discover 60 eye-catching button designs with source code, crafted with HTML and CSS to enh....

How to Upload Code to GitHub: Quick Steps and Detailed Instructions for Beginners

github

16 Sep 2024

In order to upload (push) your project to GitHub, it involves multiple steps that need to ....

How to install MongoDB on windows in 2024

mongodb

2 May 2024

MongoDB is a Database Management System based on NoSQL (Not Only SQL) and utilizes JSON-li....

How to Implement Undo Functionality for Deleting Items in Your React App

react-js

28 Sep 2024

Learn how to implement undo functionality for deleting items in React. Follow a step-by-st....