移動web開發中meta標籤作用,web開發meta標籤
今天在嘗試做移動頁面的時候遇到了一個問題,<meta content="telephone=no,email=no" name="format-detection">,不知道這句話具體含義是什麼就查了下,
並且查到其他的一些<meta>標籤的相關內容,記錄在這裡,方便以後常常查看。以下是關於format-detection的解釋,如有錯誤請大家指出。
format-detection翻譯成中文的意思是“格式檢測”,顧名思義,它是用來檢測html裡的一些格式的,那關於meta的format-detection屬性主要是有以下幾個設定:meta name="format-detection" content="telephone=no"meta name="format-detection" content="email=no"meta name="format-detection" content="adress=no" 也可以連寫:meta name="format-detection" content="telephone=no,email=no,adress=no"每個設定的作用:
一、telephone
你明明寫的一串數字沒加連結樣式,而iPhone會自動把你這個文字加連結樣式、並且點擊這個數字還會自動撥號!想去掉這個撥號連結該如何操作呢?這時我們的meta又該大顯神通了,代碼如下:
telephone=no就禁止了把數字轉化為撥號連結!
telephone=yes就開啟了把數字轉化為撥號連結,要開啟轉化功能,這個meta就不用寫了,在預設是情況下就是開啟!
二、email
告訴裝置不識別郵箱,點擊之後不自動發送
email=no禁止作為郵箱地址!
email=yes就開啟了把文字預設為郵箱地址,這個meta就不用寫了,在預設是情況下就是開啟!
三、adress
adress=no禁止跳轉至地圖!
adress=yes就開啟了點擊地址直接跳轉至地圖的功能,在預設是情況下就是開啟!
Meta 之 apple-mobile-web-app-capable
<meta name=”apple-mobile-web-app-capable” content=”yes” />
這meta的作用就是刪除預設的蘋果工具列和功能表列。content有兩個值”yes”和”no”,當我們需要顯示工具列和功能表列時,這個行meta就不用加了,預設就是顯示。
加了該meta的情況
4、Meta 之 apple-mobile-web-app-status-bar-style
<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
作用是控制狀態列顯示樣式
status-bar-style:black
status-bar-style:black-translucent
原文地址:http://blog.sina.com.cn/s/blog_6d48e77101015kqr.html