我知道我可以使用 <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/