【问题标题】:ipad detecting date as a telephone number and inserting a tel linkipad 将日期检测为电话号码并插入电话链接
【发布时间】:2014-08-15 22:51:16
【问题描述】:

对于响应式项目,我有以下内容:

<table>
            <tr>
                <td>Besteldatum</td>
                <td itemprop="description">
                    24-2-2014
                </td>
            </tr>
            <tr>
                <td>Losse editie</td>
                <td itemprop="description">
                    2014-02
                </td>
            </tr>
</table>

奇怪的是,ipad 将链接放在第一个,就好像它是电话一样,检查图像:

如果我在 ipad 中检查,我发现 HTML 已转换为以下内容:

<table>
            <tbody><tr>
                <td>Besteldatum</td>
                <td itemprop="description">
                    <a href="tel:24-2-2014">24-2-2014</a>
                </td>
            </tr>
            <tr>
                <td>Losse editie</td>
                <td itemprop="description">
                    2014-02
                </td>
            </tr>
</table>

我认为 ipad 将此日期检测为电话号码并自动放置此链接。我有其他与 tel 链接的链接,所以我想要一个不会取消其他 tel 链接的解决方案。

没见过,有人帮忙吗?

【问题讨论】:

  • 我尝试将数字放在
  • 题外话:截图的字体是什么?
  • @Mark 这是 Titillium Web,查看 Google 字体。我认为相当流行的字体。
  • 谢谢。以前没见过。 ;)

标签: ios ipad css responsive-design tel


【解决方案1】:

这是 iOS 中的默认行为。这意味着用户只需点击网页上的电话号码即可拨打电话。不幸的是,它有时会根据格式接收一些非电话号码。

您有几个选择。这里有一对。通过添加此元标记来禁用 iOS 电话号码检测:

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

这可能是个坏主意,因为它会删除整个页面的电话号码检测,使真实电话号码不可点击。

或覆盖正在应用的样式,例如...

a[href^=tel] {
    color: #your_color;
    text-decoration: none;
    pointer-events: none;
}

如果您在页面上有一些真实的电话号码,您可能希望为非电话父母添加一个类以区分:

    .date a[href^=tel] {
        color: #your_color;
        text-decoration: none;
        pointer-events: none;
    }

【讨论】:

  • 我正在使用元数据。你知道我是否在与 tel 的链接之后使用:即使我将此元数据应用于页面,它也会在 ipad 中工作?
  • 我相信是的。您可能需要测试。
猜你喜欢
  • 1970-01-01
  • 2012-07-10
  • 2011-05-30
  • 2020-10-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-29
  • 1970-01-01
相关资源
最近更新 更多