Definition
The <ins>
HTML element is used to mark inserted or added text within a document or content. It indicates that the enclosed text is an addition or insertion compared to the original content.
Here’s an example of how to use the <ins>
element:
<p>The price of the product has been <del>$100</del> <ins>$80</ins>.</p>
In this example, the <ins>
element is used to mark the inserted or added text “$80”. The <del>
element is also used to mark the deleted or removed text “$100”. When rendered in a web browser, the deleted text is typically displayed with a strike-through, and the inserted text may be displayed with an underline or different color, depending on the browser’s default styles or any custom CSS styles applied.
The <ins>
element can also be used to indicate a change or revision in a document, such as showing edits made to a piece of text or highlighting new information.
It’s worth noting that the visual presentation of the <ins>
element may vary depending on the browser and CSS styles applied. To achieve consistent styling, it is recommended to use CSS to define the desired appearance for inserted text.
Additionally, it’s good practice to provide appropriate alternative text for screen readers and other assistive technologies using the title
or aria-label
attribute to convey the meaning of the inserted text.