移动 HTML 渲染数

发布于 2024-09-19 04:59:01 字数 1078 浏览 6 评论 0原文

我有一个移动网页,显示银行对账单。像这样的事情:

DATE          | DESCRIPTION              | AMOUNT
--------------|--------------------------|---------------
Jan 2nd 2010  | Clothes                  |  USD 1.839.000
Sep 23rd 2010 | Drinks                   |  USD 2.837.000

我使用 . 作为千位分隔符,因为这是我们的区域设置配置。

HTML 非常简单。像这样的事情:

<table>
   <tr>
      <td>DATE</td>
      <td>Clothes</td>
      <td>AMOUNT</td>
   </tr>
   <tr>
      <td>Jan 2nd 2010</td>
      <td>Clothes</td>
      <td>USD 1.839.000</td>
   </tr>
   <tr>
      <td>Sep 23rd 2010</td>
      <td>Drinks</td>
      <td>USD 2.837.000</td>
   </tr>
</table>

我遇到的问题是 iPhone 的 Safari、Android 浏览器和一些诺基亚浏览器正在思考(错误地)数字,例如 1.839.0002.837 .000电话号码,因此将它们呈现为拨打电话或发短信的链接。

我的问题:是否有特殊的标签/属性/CSSSTYLE 来告诉移动浏览器将这种文本显示为纯文本

多谢。

I have a mobile WEB Page showing a bank statement. Something like this:

DATE          | DESCRIPTION              | AMOUNT
--------------|--------------------------|---------------
Jan 2nd 2010  | Clothes                  |  USD 1.839.000
Sep 23rd 2010 | Drinks                   |  USD 2.837.000

I am using . as a thousand separator since that's our locale configuration for that.

HTML is very simple. Something like this:

<table>
   <tr>
      <td>DATE</td>
      <td>Clothes</td>
      <td>AMOUNT</td>
   </tr>
   <tr>
      <td>Jan 2nd 2010</td>
      <td>Clothes</td>
      <td>USD 1.839.000</td>
   </tr>
   <tr>
      <td>Sep 23rd 2010</td>
      <td>Drinks</td>
      <td>USD 2.837.000</td>
   </tr>
</table>

The problem I am having is that iPhone's Safari, Android Browsers and some Nokia Browsers are thinking (erroneously) numbers such as 1.839.000 and 2.837.000 are phone numbers hence rendering them as links to make phone calls or do some texting.

My question: Is there a special TAG/ATTRIBUTE/CSSSTYLE to tell mobile browser to show that kind of text as plain text?

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

迷鸟归林 2024-09-26 04:59:01

我不知道 Android 或诺基亚,但对于 iPhone,您可以使用 元标记

<meta name="format-detection" content="telephone=no">

禁用将任何内容检测为电话号码。

I don't know about Android or Nokia, but for iPhone you could use the meta tag:

<meta name="format-detection" content="telephone=no">

to disable detecting anything as a phone number.

漫雪独思 2024-09-26 04:59:01

以下是针对 iPhone 的操作方法< /a>,似乎也适用于 Android ;它可能在其他浏览器中工作,这就是我目前必须测试的:

<meta name="format-detection" content="telephone=no" />

Here's how you do it for the iPhone, which seems to work for Android as well; it may work in other browsers, that's all I have to test with at the moment:

<meta name="format-detection" content="telephone=no" />
情场扛把子 2024-09-26 04:59:01

如果您想保留识别电话号码并允许您点击它的功能,请使用以下解决方案:

由于 iOS 在电话号码周围添加了 标签数字,您所要做的就是制定一个 CSS 规则来设置此标签的样式:

a[href^=tel] { color:继承; }

功劳 这篇 Razor Edge Labs 文章

In case you want to keep the functionality that recognises the phone number as such and allows you to tap it, use this solution:

Since iOS adds a <a href="tel123456789"> tag around the number, all you have to do is make a css rule that styles this tag:

a[href^=tel] { color: inherit; }

credit goes to this Razor Edge Labs article.

怪异←思 2024-09-26 04:59:01

不太可能,但是,尝试将句点写为 . - 有智能代码可以禁用移动 Safari 等,但这只适用于一到两个设备。如果幸运的话,您将绕过他们的正则表达式。

Longshot, but, try writing the period as . - there are smart codes that can disable that for mobile safari, etc, but that only works for one-two devices. If you're lucky, you'll bypass their regex.

不…忘初心 2024-09-26 04:59:01

正如评论中所讨论的,添加任意跨度似乎会破坏对相关浏览器的检测:

<span>2</span>.837<span>.000</span>

但是,以“不解析此”属性或元标记形式的显式解决方案当然会更好,因为它会更有把握在未来适用于所有/大多数平台。

As discussed in the comments, adding arbitrary spans seems to break detection for the browser in question:

<span>2</span>.837<span>.000</span>

however, an explicit solution in the form of a "don't parse this" attribute or Meta tag would of course be preferable, as it would be more certain to work in the future and for all/most platforms.

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