微格式和外语

发布于 2024-11-19 10:12:53 字数 666 浏览 1 评论 0原文

过去,当我决定在英语网站中标记微格式(对他们来说相当新)时,它会是这样的:

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖竹 2024-11-26 10:12:53

看起来 microformats.org 网站现在已关闭,但当它恢复时,您将在此处看到解决方案:

http://microformats.org/wiki/value-class-pattern

它看起来像这样:

<span class="tel">
  <span class="type"><span class="value-title" title="home"> </span>Home Phone in Chinese</span>:
  <span class="value">1234567</span>
</span>

基本上,当它与您的标题字段不匹配时,您会隐藏标题字段中的机器可读类型人类可读的类型(由于语言或只是不同的术语)。请注意,值标题范围中的空格对于防止某些工具在元素为空时忽略该元素非常重要。

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:

<span class="tel">
  <span class="type"><span class="value-title" title="home"> </span>Home Phone in Chinese</span>:
  <span class="value">1234567</span>
</span>

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文