HTML <ins> Tag

The <ins> tag is used to define a part of the text which has been inserted into the document. In the browser, tag content is displayed as an underlined text, although this can be changed with the CSS text-decoration property.

The <ins> tag is usually used with the <del> tag, which contains the deleted part of the text. The content of this element is displayed as crossed out text.

Most screen reading technology doesn’t announce the existence of the <ins> tag in the default configuration. To announce it, you can use the CSS content property with the ::after and ::before pseudo-elements.

Syntax

The <ins> tag comes in pairs. The content is written between the opening (<ins>) and closing (</ins>) tags.

Example of the HTML <ins> tag:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>She likes <del>violets</del> <ins>snowdrops</ins></p>
  </body>
</html>

Result

Example of the HTML <ins> tag with the CSS properties:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      ins {
        font-size: 16px;
        font-weight: bold;
        color: red;
      }
      ins::before {
        content: " - ";
        width: 1px;
      }
    </style>
  </head>
  <body>
    <p>
      <q>You only live once, but if you do it right, once is enough.</q>
      <ins>Mae West</ins>
    </p>
  </body>
</html>

Attributes

Attribute Value Description
cite URL Indicates the URL of the document, where it is explained why the text is edited or deleted.
datetime YYYY-MM-DDThh:mm:ssTZD Defines the date and time of deleting the text.

The <ins> tag also supports the Global Attributes and the Event Attributes.


Browser support



Do you find this helpful?

Related articles