HTML - <ins> Tag



HTML <ins> tag represents a range of text that has been inserted into an HTML document. This inserted text is rendered as underlined text by the web browsers. HTML <ins> tag can be used with the <del> tag.

Syntax

<ins> .... </ins>

Attribute

HTML ins tag supports Global and Event attributes of HTML. Some specific attributes as well which are listed bellow.

Attribute Values Description
cite URL This attribute defines the URL of a resource that explains the change.
datetime YYYY-MM-DDThh:mm:ssTZD It is used to specify the date and time of the inserted text.

Examples of HTML ins Tag

In the bellow examples we will see the different examples of ins elements. Each example will illustrate the use cases of html ins tag.

Implementing ins with del Tag

In the following example lets, see the usage of the <ins> tag along with <del> tag.

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
</head>
<body>
   <h1>Tutorialspoint</h1>
   <h2>HTML ins element</h2>
   <p>
      tutorialspoint is a <del>physic classes</del>
      <ins>EdTech company</ins> that provides more 
      than 6000 courses and tutorials
   </p>
</body>
</html>

Styling ins and del Element

Considering the following example, we are creating an HTML document and using the <ins> tag with the <del> tag. We are also using the CSS properties to style the content of the ins and del tags.

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
</head>
   <style>
   del {
      background-color: #fbb;
      color: #555;
   }

   ins {
      background-color: #d4fcbc;
   }
   </style>
</head>
<body>
   <p>
      There is <del>nothing</del>
      <ins>no code</ins> either good or bad, but 
      <del>thinking</del> <ins>running it</ins>
      makes it so.
   </p>
   <p>
      <del>
         When an unknown printer took a galley of type 
         and scrambled it to make a type specimen book
      </del>.
   </p>
</body>
</html>

Implementin ins element with accepted Attributes

Let's look at the following example, we are creating an HTML document and using the <ins> tag along with the attribute "cite" and "datetime".

<!DOCTYPE html>
<html>
<head>
   <style>
      del {
         color: red;
      }

      ins {
         color: green;
      }
   </style>
</head>
<body>
   <h1>tutorialspoint</h1>
   <h2>HTML ins Tag</h2>
   <p>
      tutorialspoint is a <del>physics classes</del>
      <ins cite="https://www.tutorialspoint.com/" datetime="2023-06-14T13:50:03Z"> EdTech company</ins> 
      that provides more than 6000 courses and tutorials
   </p>
</body>
</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
ins Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements