在网络应用的帮助/说明和错误消息中,我们经常需要引用页面的某些部分。
示例:在“正文”字段中输入您的消息 示例:“正文”字段的内容不能超过250个字符
问题:就html标记而言,将<q>
元素用于上面的“body”单词是否有意义?什么是语义正确的标记使用?
Enter your message in the <q>body</q> field.
The <q>body</q> field's content cannot exceed 250 characters
寻找意见和建议。
注意:
<span class="something">body</span>
,因为它很长,并且不会对其内容赋予任何语义含义。当提到单词的形式而不是其含义时,请使用引号引起读者的注意 http://termiumplus.gc.ca/tcdnstyl-chap?lang=fra&lettr=chapsect8&info0=8.11#zz8
结论
选择好老<span class="reference">body</span>
。我想我希望有一个类似“文本引用”之类的html标签。感谢您的反馈。
马克
答案 0 :(得分:2)
不要以为它会。 如果您有实际报价,这将有所帮助。
字段名称实际上不是引用。你不同意吗?
答案 1 :(得分:0)
就个人而言,如果您指的是input
字段,我建议您使用label
元素:
<span class="errorMessage">Please enter information in the <label for="body">body</label> field.</span>
<!-- other content -->
<label for="body">body</label>
<input type="text" id="body" name="body" />
我不确定,但是我觉得您考虑使用q
,因为您使用引号作为审美/表达选择,但它不是引用,它删除了使用引号的语义参数q
元素。如果要使用引号,可以使用CSS:
.errorMessage label:before,
.errorMessage label:after {
content: '"';
}
答案 2 :(得分:-1)
我同意akond。
请考虑使用此标记之一<em> <strong> <dfn> <code> <samp> <kbd> <var> <cite>
或<span>
标记以及特定的类属性。我更喜欢后者。