HTML Tags
HTML Doctypes
HTML doctype is a declaration that tells the web browser which version of HTML the web page is written in. The doctype declaration is the first line of an HTML document and begins with <!DOCTYPE>
followed by the type of document. Here are some examples of HTML doctype declarations
- HTML5
This is the doctype declaration for HTML5, which is the latest version of HTML.
- HTML 4.01 Strict
This is the doctype declaration for HTML 4.01 strict, which is an older version of HTML. This doctype specifies that the document must follow strict HTML 4.01 rules.
- HTML 4.01 Transitional
This is the doctype declaration for HTML 4.01 transitional, which is also an older version of HTML. This doctype allows for more flexibility in coding and permits the use of non-standard tags.
- XHTML 1.0 Strict
This is the doctype declaration for XHTML 1.0 strict, which is a reformulation of HTML as an XML application. This doctype specifies that the document must follow strict XHTML 1.0 rules.
- XHTML 1.0 Transitional
This is the doctype declaration for XHTML 1.0 transitional, which allows for more flexibility in coding and permits the use of non-standard tags.
It is important to include the correct doctype declaration at the beginning of an HTML document to ensure that the web page is rendered correctly in different web browsers.
HTML anchor Tag
The HTML <a> tag is used to create hyperlinks, which allow users to navigate between web pages.
Here is an example of how to use the <a> tag:
In this example, the <a> tag is used to create a hyperlink to the website “https://www.example.com“. The text “Click here to visit Example.com” is the visible link text that the user can click on.
The “href” attribute is used to specify the destination URL that the user will be taken to when they click on the link. In this case, the destination URL is “https://www.example.com“.
HTML abbr Tag
The HTML <abbr> tag is used to define an abbreviation or acronym. It can be used to provide an explanation of the abbreviation or acronym when a user hovers their mouse over the text.
Here is an example of how to use the <abbr> tag:
The WHO is a specialized agency of the United Nations.
Output
The WHO is a specialized agency of the United Nations.
In this example, the <abbr> tag is used to define the abbreviation “WHO” for the World Health Organization. The “title” attribute is used to provide the full text of the abbreviation, which will be displayed as a tooltip when the user hovers their mouse over the abbreviation.
The resulting text will look like this: “The WHO is a specialized agency of the United Nations.”
When a user hovers their mouse over the “WHO” text, they will see a tooltip with the full text “World Health Organization”.
HTML acronym Tag
The HTML <acronym> tag was used in older versions of HTML to define an acronym, similar to the <abbr> tag. However, it is now deprecated in favor of using the <abbr> tag.
Here is an example of how to use the <acronym> tag:
The HTML is used to create web pages.
The HTML is used to create web pages.
In this example, the <acronym> tag is used to define the acronym “HTML” for Hypertext Markup Language. The “title” attribute is used to provide the full text of the acronym, which will be displayed as a tooltip when the user hovers their mouse over the acronym.
The resulting text will look like this: “The HTML is used to create web pages.”
HTML address Tag
The HTML <address> tag is used to provide contact information for the author or owner of a web page. This tag can contain the physical address, email address, phone number, or any other relevant contact information.
Here is an example of how to use the <address> tag:
Ravi kumar
123 Main Street
Anytown, USA
Phone: (555) 555-1234
Email: ravi.doe@example.com
123 Main Street
Anytown, USA
Phone: (555) 555-1234
Email: ravi.doe@example.com
In this example, the <address> tag is used to provide contact information for John Doe. The tag contains multiple lines of information, separated by the <br> tag to create line breaks.
The <address> tag is a semantic tag that is used to indicate that the enclosed content provides contact information for the author or owner of the web page. However, it is important to note that the <address> tag should not be used for general contact information, such as a website’s customer support email or phone number. Instead, these types of contact information should be included in the website’s footer or contact page.
HTML applet Tag
The <applet>
tag is an HTML element used to embed Java applets in a web page. However, the <applet>
tag is now deprecated and no longer supported in modern web browsers. Instead, modern web development uses alternative technologies such as HTML5, CSS, and JavaScript.
Here’s an example of how the <applet>
tag was used in the past:
Output
In this example, the code
attribute specifies the name of the Java applet class file that should be loaded. The width
and height
attributes define the dimensions of the applet. If the browser does not support Java applets, the text “Your browser does not support Java applets.” will be displayed instead.
Again, please note that the <applet>
tag is deprecated and should not be used in modern web development.
HTML area Tag
The HTML <area>
tag is used to define an area inside an image map that is clickable and navigates to a specific URL when clicked. Here is an example:
Image Map Example
Image Map Example
Image Map Example

HTML5 article Tag
The <article>
tag in HTML5 is used to define a self-contained piece of content that could potentially be distributed or reused independently of the rest of the page. It’s often used to mark up blog posts, news articles, forum posts, and other types of content that can stand alone.
Here’s an example of how you might use the <article>
tag to mark up a blog post:
My Blog
My Blog
My First Blog Post
Posted on January 1, 2023
Here's the content of my first blog post...
And here's some more content...
My Blog
My First Blog Post
Posted on January 1, 2023
Here’s the content of my first blog post…
And here’s some more content…
In this example, the <article>
tag is used to contain the content of the blog post. The <header>
and <footer>
tags are used to define the header and footer of the article, respectively. Within the article, we have several paragraphs of content, and we also include some tags at the end of the article in the footer.
Note that the <article>
tag should only be used for content that is self-contained and could be distributed or reused independently of the rest of the page. If the content is not self-contained, you should use a different tag, such as <div>
or <section>
.
HTML5 asideTag
The <aside>
tag in HTML5 is used to mark up content that is tangentially related to the main content of the page. It’s often used for things like sidebars, callouts, or supplementary information.
Here’s an example of how you might use the <aside>
tag:
My Website
My Website
My Article
Posted on January 1, 2023
Here's the content of my article...
And here's some more content...
My Website
My Article
Posted on January 1, 2023
Here’s the content of my article…
And here’s some more content…
HTML5 Audio Tag with Example
In this example, the <audio>
tag contains a nested <source>
tag that specifies the location of the audio file (in this case, “audiofile.mp3”) and its file type (in this case, “audio/mpeg”). The controls
attribute is used to show the default audio controls (play, pause, volume, etc.). If the user’s browser doesn’t support the <audio>
tag, the text “Your browser does not support the audio element.” will be displayed instead.
Note that you can also include multiple <source>
tags within the <audio>
tag, each with a different file type, to ensure that the audio can be played in different browsers. For example:
In this example, the browser will try to play the MP3 file first, and if that doesn’t work, it will try the OGG file. If neither file type is supported, the fallback text will be displayed.
A to Z list of HTML tags with examples:
Tags | Description | Example |
---|---|---|
< a > | creates a hyperlink to another web page, file, or location | Try it |
< abbr > | defines an abbreviation or acronym | Try it |
< address > | defines contact information for the author or owner of a document |
Try it |
< area > | defines a clickable area within an image map | Try it |
< article > | defines an independent, self-contained content unit | Try it |
< aside > | defines content aside from the main content of the document | Try it |
< audio > | defines sound or audio content | Try it |
< b > | defines text as bold | Try it |
< base > | specifies the base URL and target for all relative URLs in a document |
Try it |
< bdi > | isolates a span of text that might be formatted in a different direction from other text outside it |
Try it |