什么标签应该用于通用消息中的特定值(例如 "Do you want to delete <tag>ABC</tag>?")?

What tag should be used for specific values in a generic message (e.g. "Do you want to delete <tag>ABC</tag>?")?

假设我有一条通用消息,例如

Do you want to delete {object} from {environment}?

我想强调非通用部分(object/environment)。
目前我使用 <em>,但它缺少关于 为什么 强调的任何语义,因此强调变得比语义更文体。

是否有更好的选择 - 一些标签,其中将其定义为显式用例?

你可以使用强标签。 strong 标签表示对所附文本的高度重要性。 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong

我认为b element在这里很合适。

用于"text to which attention is being drawn"、"without conveying any extra importance and with no implication of an alternate voice or mood"。

我不认为 strong element is appropriate; it might be for the whole warning, but not specifically for the name of the thing that gets deleted. And neither is the em element,因为没有强调。

在某些情况下,根据实际内容,也可能会使用 abbracite 等元素,但这将是 添加,而不是替代。