×

HTML <sub> tag

The sub element in HTML is used to describe one or more subscript texts. If The sub tag shows the text which is presented in a smaller font and below the standard line.
We must either use the tiny tag or the sub tag when writing formulas like H2o text in chemistry.

Syntax:

<body>
<p>……………. 
<sub>…………….. </sub>
…………….</p>
</body>

Example 1:

In this example, we will learn how to use the sub tag to print any subscript text in any document:

<!DOCTYPE html>
<html>
<head>
<title> html sub tag </title>
</head>
<body>
<p>This document also contains <sub>some subscript</sub>information in it. </p>
</body>
</html>

Output:

HTML sub tag

Example 2:

<!DOCTYPE html>
<html>
<head>
<title> html sub tag </title>
</head>
<body>
<p>you can use <sub>multiple</sub>subscript tags in a <sub> document </sub>. </p>
</body>
</html>

Output:

HTML sub tag

Default CSS Settings

The following CSS values are saved as default in most of the browsers:

Example

sub {
  vertical-align: sub;
  font-size: smaller;
}

Browser support:

List of browsers that support html <section> tag are discussed below:

Chrome: Yes

Microsoft Edge: Yes, version 12 needed

Firefox: Yes, version 1 needed

Safari: Yes

Opera: Yes


Related Topics

HTML Unordered List

In HTML, we have <ul> tag which defines the unordered list. And it is also known as bulleted list, because as we know it is not ordered list therefore it...

2 minutes read.

HTML Search Box

The HTML search box is also known as the search bar. It is an input text field that is used to search the content. If the users want to explore...

7 minutes read.

How to insert spaces/tabs in text using HTML/CSS

What is HTML? HTML or HyperText Markup Language is used to design web pages. It was released in 1993. The file extension name for HTML file is “.html”. An HTML file...

4 minutes read.

HTML Images

HTML has <img> tag to display image on the web pages or web application. This tag is an empty tag i.e. we don't have to close this tag while using. SYNTAX: <img src="source address" attributes="alt, height, width"> Example: <html>   <body>   <center>Image tag Example</center>   <img src="https://www.tutorialandexample.com/resources/images/favicon.png"    alt="tutorialandexample"/>   </body>   </html> Output: Image...

1 minute read.

HTML <section> tag

The section element in HTML is used to define sections in a document. Syntax of Section Tag: <body> <h1>……….</h1> <section> <h2>……….</h2> <p> …………………………</p> </section> <section> <h2>………..</h2> <p>…………………………. <p> </section> </body> Examples of Section Tag Example 1: In this example, we use the HTML "section" element...

3 minutes read.

Most Commonly used Tags in HTML

In this tutorial, we'll look at the most popular HTML tags. We know HTML is a fundamental requirement for creating a website. As a result, it is essential to remember...

9 minutes read.

HTML Elements

An HTML element is nothing but a starting tag and then some content and then the closing tag. So we can say HTML elements is everything from the starting tag...

3 minutes read.

Font tag in HTML

HTML stands for Hypertext Mark-up Language and is used to create web pages and other information that can be later displayed in a web browser. It also consists of a...

4 minutes read.

How to insert image in HTML

An image (technically digital image) in HTML or even in general technical aspects is a binary representation of visual information. By visual information we mean, in the form of drawings/pictures,...

5 minutes read.

HTML Links

It consist of anchor element which is used to create a link between a source anchor and destination anchor. The anchor tag can be embedded between text, image, video or...

2 minutes read.

HTML <source> tag

For media attributes, such as <video> tag, <audio> tag, and <picture> tag, we use the <source> tag in html for adding such type of multiple media html elements in our...

4 minutes read.

HTML Background Image

Inserting image in HTML An image (technically digital image) in HTML or even in general technical aspects, is a binary representation of visual information. By visual information we mean, in the...

8 minutes read.

HTML Data Tag

HTML Data Tag: The HTML < data > tag is used to transmit its content to a machine-readable version. The data are presented in a particular format. It is useful...

3 minutes read.

HTML <strong> tag

The strong element in HTML is used to display the real significant information in bold so that the user or reader will understand it easily. Syntax: <p> <strong>………… </strong> </p> Example Here, we will demonstrate how to...

2 minutes read.

HTML Youtube

<object> element: It embed the object within the HTML documents and embed plug-ins such as Java applets, PDF readers, Flash Players etc in web pages. Example: <object width="100" height="100" data="bookmark.swf"></object> <embed> element: It defines an embedded...

1 minute read.

HTML Form Input Types

HTML Form Input Types An important element of the HTML form is < input type= "> in HTML. The type attribute of the input element can be of different types, which...

8 minutes read.

HTML Paragraphs

In html, there are some elements which starts with new line and one of them is paragraph. Which is said to be a block of text. In html <p> tag...

4 minutes read.

HTML Charsets

In this tutorial, we are going to discuss about the charsets in the HTML. The letters, numbers, and several other symbols are shown correctly by the web browser. All of this...

2 minutes read.

How to add JavaScript to HTML

JavaScript is one of the most important languages today. It is a high-level, interpreted, lightweight programming language that makes web pages more interactive. It is a language of the web....

5 minutes read.

Design a tribute page using HTML and CSS

A tribute page is a webpage based on a person who inspired us in our life. In this article, we will create a webpage of Mahatma Gandhi. We are going...

5 minutes read.