Examples
Default
Displays with a subtle green background and a solid green bottom border indicating insertion.
1
<ins>This content has been inserted.</ins>
.diff
Enhanced styling for diff displays with padding and rounded corners, ideal for code comparisons.
1
<ins class="diff">added code</ins>
Document Revision
Pair <ins> with <del> to show before-and-after edits in running text.
1
<p>The meeting will be held on <del>Tuesday</del> <ins>Wednesday</ins> at 2pm.</p>
Code Diff Display
Use the .diff class on both <ins> and <del> for compact, pill-shaped diff lines.
12
<pre><code><del class="diff">const oldVariable = "deprecated";</del><ins class="diff">const newVariable = "current";</ins></code></pre>
Block-Level Insertion
When <ins> wraps block content (paragraphs, lists, tables, headings, <pre>, <blockquote>, <details>, <form>, <fieldset>, sectioning elements and similar), VB detects it with :has() and turns the change into a block with the tint, padding, and an inline-start edge bar, so the styling covers the whole change instead of breaking across each child. No class is needed.
1234
<ins datetime="2026-02-20"> <p>This entire paragraph has been added to the document.</p> <p>Multiple paragraphs can be inserted together.</p></ins>
Annotated Changes
data-reason shows a small uppercase tag before the change. data-author appends the author's name after it; the name appears on hover, when focus is inside the change, always on touch screens, and in print.
1
<ins datetime="2026-02-15" data-reason="review" data-author="Ana">Node.js 20 LTS</ins>
Announced Changes
Most screen readers do not announce <ins> at all by default, so a listener hears the inserted words with no hint that they are an edit. Add data-announce to the change, or to any ancestor such as an article, to insert visually hidden “insertion start” / “insertion end” text around it.
123
<article data-announce> <p>The release ships on <del>Friday</del> <ins>Monday</ins>.</p></article>
Translate the announced words with custom properties holding quoted strings, set on the element or any ancestor:
123456
:lang(fr) { --del-announce-start: "début de suppression"; --del-announce-end: "fin de suppression"; --ins-announce-start: "début d’insertion"; --ins-announce-end: "fin d’insertion";}
When the change also has a visible data-reason or data-author, that annotation stays visible and carries the announcement as its alternative text.
ins vs mark
Both elements use a background tint, but they carry different semantics and VB distinguishes them visually:
| Element |
Meaning |
VB Styling |
<ins> |
Editorial change — text was added to the document |
Green background tint + green bottom border |
<mark> |
Relevance highlight — not an edit |
Theme-colored background tint (no border) |
Use <ins> when the content was editorially added (contracts, changelogs, diffs). Use <mark> for search results, quotation highlights, or status badges.