建立3G/h5/wap网页其实很简单( quite easy to write mobile web page)

访问量: 1057

只需要把下列代码加到页面中就好:

<!DOCTYPE html>
<html>
<head>
<title> your web site </title>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-title" content="">
<link rel="apple-touch-icon" href="http://2008mail.sina.com.cn/images/mobile/icon_touch.png">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<style type="text/css">html,body{min-height:100%;overflow:hidden;}</style>
<body>
<header>

<metaname="viewport"content="width=device-width, initial-scale=1">
</header>
  <%= yield %>
</body>
</html>

否则页面的文字大小会特别难看。

注意: 在开发过程中,不要增加下面这行,否则会无法开发(scroll bar missing) : 参考:http://www.dreamincode.net/forums/topic/331528-scroll-bar-missing-when-open-on-mobile-browser/

<style type="text/css">html,body{min-height:100%;overflow:hidden;}</style>

订阅/RSS Feed

Subscribe

分类/category