html - 已更改(但未添加/删除)的内容的正确 HTML 标记是什么?

标签 html

我知道我可以使用 <ins>识别添加的内容和<del>识别删除的内容。但是,如果没有关于添加或删除内容的更多详细信息,我应该使用什么来标记已更改的内容?

例如:

同时提供添加和删除的内容 ( del/ins ):

Cost: <del>$10</del><ins>$20</ins>.

只提供新的内容,用什么来表示有变化?

Cost: <?>$20</?>.

我想到了<mark> , 但这并不像 <mark> 那样有效添加原作者无意添加的语义,但在这种情况下,我确实打算在创作时将其标记为已更改。

最佳答案

The s element represents contents that are no longer accurate or no longer relevant.

来自 https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-s-element

<p>Buy our Iced Tea and Lemonade!</p>
<p><s>Recommended retail price: $3.99 per bottle</s></p>
<p><strong>Now selling for just $2.99 a bottle!</strong></p>

The s element is not appropriate when indicating document edits; to mark a span of text as having been removed from a document, use the del element.

关于html - 已更改(但未添加/删除)的内容的正确 HTML 标记是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56385797/

相关文章:

php - WooCommerce:当元素为空时隐藏 css 属性

javascript, css, z-index, div 堆叠

javascript - 将事件附加到动态生成的 HTML?

html - 带页眉和页脚的 CSS 100% 高度

javascript - 根据给定条件对表 tr 进行排序

html - 使用css制作下拉菜单和子菜单导航

html - Web 浏览器如何翻译 html 中的嵌套标签以及嵌套标签的顺序如何处理?

javascript - 404 错误。 Ajax 网址太长

javascript - HTML5 视频播放器进度条更新

html - CSS 龙门式响应头