移动应用的HTML5全局元标签/样式



我是一名c++开发人员,最近开始在我的移动应用程序中使用HTML5,我在web编程领域没有太多的知识,我非常希望得到一些建议,以便微调我的元标签。

我需要完美的元标签,将适合ios/android/windows phone/黑莓等移动应用程序。

问题是我不确定我到底需要什么,不需要什么,这是我到目前为止的列表:

html, body
{
     overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-overflow-scrolling: none;
    -webkit-backface-visibility: hidden;
    -webkit-transition: translate3d(0,0,0);
    transition: translate3d(0,0,0);
    -webkit-font-smoothing: antialiased;
    font-smoothing: antialiased;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
    -webkit-text-stroke: 1px
    -webkit-user-select: none; /* Chrome/Safari */        
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+ */
    /* Rules below not implemented in browsers yet */
    -o-user-select: none;
    user-select: none;
    margin: 0;
    padding: 0;
    border: 0;
    background-color:#202020;
}
* {margin:0; padding:0; border:0;}
<!DOCTYPE html>
<html>
    <head>
        <title>$Title</title>
        <meta charset="UTF-8">
        <meta name="keywords" content="Test">
        <meta name="description" content="Test">
        <meta name="subject" content="Test">
        <meta name="copyright" content="Test">
        <meta name="url" content="http://www.test.com">
        <meta name="language" content="en-GB">
        <meta name="robots" content="NOINDEX, NOFOLLOW">
        <meta name="pagename" content="$Title">
        <meta name="coverage" content="Worldwide">
        <meta name="distribution" content="Global">
        <meta name="target" content="all">
        <meta name="HandheldFriendly" content="True">
        <meta name="MobileOptimized" content="640">
        <meta name="format-detection" content="telephone=no">
        <meta http-equiv="cleartype" content="on">
        <meta name="apple-mobile-web-app-title" content="$Title">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-touch-fullscreen" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="ResourceLoaderDynamicStyles" content="">
        <meta http-equiv="Expires" content="0">
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Cache-Control" content="no-cache">
        <meta http-equiv="imagetoolbar" content="no">
        <meta http-equiv="x-dns-prefetch-control" content="off">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
        <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <!-- Set a shorter title for iOS6 devices when saved to home screen -->
        <meta name="apple-mobile-web-app-title" content="Ratchet">
        <script>
        document.ontouchmove = function(e)
        {
            e.preventDefault();
        }
        </script>

任何建议吗?

您需要:

<meta charset="UTF-8">
<title></title>
<meta name="description" content="Test">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

- user-scalable=no"这将阻碍你的应用程序缩放,我建议不要使用

<meta name="apple-mobile-web-app-title" content="$Title"> 

-启动器标题,如果你不想使用标题标签。

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

-这将隐藏浏览器界面

<meta name="apple-mobile-web-app-status-bar-style" content="black">

-这将改变ios状态栏的颜色


你应该加上:

<link rel="apple-touch-icon" href="apple-touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">

-iOs启动器图标

<meta name="msapplication-TileImage" content="icon.png">
<meta name="msapplication-TileColor" content="#222222">

- Windows图标

<link rel="apple-touch-startup-image" href="/startup-image.png">

ios startup-image

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

- Android/Chrome主界面


你不需要:

<meta name="keywords" content="Test"> 

-不需要这个,谷歌和其他搜索引擎不使用关键字meta

<meta name="subject" content="Test">

—页面主题。不推荐

<meta name="copyright" content="Test">

-你比别人更重要

 <meta name="url" content="http://www.test.com">

-这是您的完整域名或网址。对于SEO

<meta name="language" content="en-GB">

- W3C建议使用<html lang="en">而不是元标签

<meta name="pagename" content="$Title">

—附加页标题。html5规范中没有这样的标签?

<meta name="coverage" content="Worldwide">
<meta name="distribution" content="Global">

-定义爬虫的分布级别或程度,但如果没有可识别的元数据,则不应该使用它们。HTML5

无效
 <meta name="target" content="all"> 

- ? ?不知道那是什么:P一些疯狂的窗户,旧的旧的?html5规范中没有这样的标签?

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

-未来旧的Windows手机显示页面可以在小屏幕上显示

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

-关于什么尺寸的屏幕页面是为Windows优化的,但它是为旧手机而不是真正工作的声明。我建议使用媒体查询。

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

- iOS上Safari的电话号码检测(如果禁用此功能会导致糟糕的Ux)

<meta http-equiv="cleartype" content="on">

-移动IE平滑字体功能,但这不是标准的W3C标签。我建议在CSS中做字体平滑。

<meta name="apple-touch-fullscreen" content="yes">

—这在早期的演示中使用。你只需要<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="ResourceLoaderDynamicStyles" content="">

-这应该使浏览器在添加CSS之前标记DOM。我认为你不应该那样做。

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">

-缓存内容。现在这种事情是在服务器端完成的。

<meta http-equiv="imagetoolbar" content="no">

- IE6特性。显然没有必要

<meta http-equiv="x-dns-prefetch-control" content="off">

- DNS预取。

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> 

- IE8/9兼容模式。

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

-重复条目<meta charset="UTF-8">

   <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!-- Set a shorter title for iOS6 devices when saved to home screen -->
    <meta name="apple-mobile-web-app-title" content="Ratchet">

-重复条目

相关内容

  • 没有找到相关文章

最新更新