首頁 > web前端 > H5教程 > 主體

行動端meta行的總結

零下一度
發布: 2017-06-27 10:04:30
原創
1248 人瀏覽過
<code class="hljs django"><span class="xml"><span class="hljs-tag"><span style="font-size: 16px"><</span><span class="hljs-name"><span style="font-size: 16px">meta </span><span class="hljs-attr"><span style="font-size: 16px">name=</span><span class="hljs-string"><span style="font-size: 16px">"viewport" <br/></span><span class="hljs-attr"><span style="font-size: 16px">content=</span><span class="hljs-string"><span style="font-size: 16px">"width=device-width, initial-scale=1, user-scalable=no, minimal-ui" /></span> </span></span></code>
登入後複製

 
width: viewport 的寬度(範圍從200 到10,000 ,預設為980 像素)

height: viewport 的高度(範圍從223 到10,000 )

initial-## scale: 初始的縮放比例(範圍從>0到10 )

minimum-scale: 允許使用者縮放到的最小比例

maximum-scale: 允許使用者縮放到的最大比例

user-scalable: 使用者是否可以手動縮放

 

#

#<meta name="apple-mobile-web-app-capable" content="yes" />#

<meta name="renderer" content="webkit">

#

<meta http-equiv="X-UA-Compatible" content="IE=edge">

#

<meta name="HandheldFriendly" content="true">

####################################################################################################################################################### ########################################################### ########################################################### ############# ####################### ##################################################

<meta name="MobileOptimized" content= "320">

## ################################################################################# ########################################################### #########################

meta name="x5-orientation" content="portrait">

#

# #<meta name="全螢幕"content="是">

############################## #################### ####################################### ########

<meta name="x5- fullscreen" content="true">

############################################ ########################################################### ########################################################### ########################################

##

#<meta name="browsermode" content="application">##

#< !-- QQ application mode-->

<meta name="x5-page-mode" content="app">#

#

#<meta name="msapplication-tap-highlight" content= "no"> ##

1. apple-touch-icon
< link rel= "apple-touch-icon" sizes= "76x76" href= "touch-icon-ipad.png">
如果 apple-mobile-web-app-capable 设置为 yes 了,

那么在苹果机的safari上可以通过添加到主屏按钮将网站添加到主屏幕上。

而设置相应 apple-touch-icon 标签,则添加到主屏上的图标就会使用我们指定的图片。

2. apple-touch-startup-image
< link rel= "apple-touch-startup-image" href= "/startup.png">
基于 apple-mobile-web-app-capable 设置为 yes ,

可以为WebApp设置一个类似NativeApp的启动画面。

和 apple-touch-icon 不同,

apple-mobile-web-app-capable 不支持sizes属性,

要使用media来加载不同的启动画面。

 

// iPhone
<link href="apple-touch-startup-image-320x460.png" media="(device-width: 320px)" rel="apple-touch-startup-image" />
登入後複製

 

<code class="hljs cpp"><span class="hljs-comment">// iPhone Retina
<link href=<span class="hljs-string">"apple-touch-startup-image-640x920.png" media=<span class="hljs-string">"(device-width: 320px) and (-webkit-device-pixel-ratio: 2)"<br/> rel=<span class="hljs-string">"apple-touch-startup-image" /></span></code>
登入後複製

 

以上是行動端meta行的總結的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!