微格式和外语
过去,当我决定在英语网站中标记微格式(对他们来说相当新)时,它会是这样的:
<span class="tel">
<span class="type">Home</span>:
<span class="value">1234567</span>
</span>
但是,当涉及到外语时,我不确定我是否可以这样做:
<span class="tel">
<span class="type">Home Phone in Chinese</span>:
<span class="value">1234567</span>
</span>
或者我必须这样做(或其他):
<span class="tel">
<span class="type" style="text-indent:-9999em;">Home</span>Home Phone text in Chinese:
<span class="value">1234567</span>
</span>
提前致谢!
In the past when I decided to mark up microformats (pretty new to them) in english websites it would be like this:
<span class="tel">
<span class="type">Home</span>:
<span class="value">1234567</span>
</span>
However, when it comes to foreign languages I'm not sure if I can just do this:
<span class="tel">
<span class="type">Home Phone in Chinese</span>:
<span class="value">1234567</span>
</span>
or must I do this (or something else):
<span class="tel">
<span class="type" style="text-indent:-9999em;">Home</span>Home Phone text in Chinese:
<span class="value">1234567</span>
</span>
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 microformats.org 网站现在已关闭,但当它恢复时,您将在此处看到解决方案:
http://microformats.org/wiki/value-class-pattern
它看起来像这样:
基本上,当它与您的标题字段不匹配时,您会隐藏标题字段中的机器可读类型人类可读的类型(由于语言或只是不同的术语)。请注意,值标题范围中的空格对于防止某些工具在元素为空时忽略该元素非常重要。
Looks like the microformats.org site is down right now, but when it comes back up, you'll see a solution to this here:
http://microformats.org/wiki/value-class-pattern
It looks like this:
Basically, you hide the machine-readable type in a title field when it doesn't match your human-readable type (either because of language or just different terminology). Note that the space in the value-title span is important to prevent some tools from ignoring the element when it's empty.