有没有一种方法可以防止IE 10移动版创建电话和地址链接。类似于:
<meta name="format-detection" content="telephone=no">
的方法。<meta name="format-detection" content="telephone=no">
的方法。<meta name="format-detection" content="telephone=no">
在IE11中似乎运行良好。
虽然我在IE10 Metro/Modern WIN8中没有看到任何电话号码自动检测,但我想它在IE10移动版上确实可以(这对手机来说很合理)。由于我无法测试,我会相信您的话...
话虽如此,您可以使用以下样式将传真号码(888) 999-666
进行特定的格式化:
(888) 999<span style="letter-spacing:-1em">-</span>-6666
不太优雅的解决方案:将文本显示为实时渲染的图像。类似的方法也可用于避免电子邮件收割机获取联系信息。
对于 PHP,您可以尝试使用 GD 库。
以下示例来自 PHP.net 页面:
<?php
// Set the content-type
header('Content-Type: image/png');
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
(555)<span> </span>555-5555
的内容,或者插入一个随机的不可打印字符,例如
。我不会将其发布为答案,因为我无法测试它并且认为这不是一个好的解决方案。 - Wesley Murch