zoukankan      html  css  js  c++  java
  • android wap网站自动适应

     做个整理。


    研究了一下新浪的wap网站,发现原来我们的head存在着这样的差异……
    <%@page contentType="text/html;charset=UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta name="viewport" content="width=device-width; initial-scale=1.4;  minimum-scale=1.0; maximum-scale=2.0"/>
    <meta name="MobileOptimized" content="240"/>
    </head>

    在手机网站的head里加入以下标签,在iPhone的浏览器中页面将以原始大小显示,并不允许缩放。

    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> 

    其中:
          width - viewport的宽度 

    height - viewport的高度 

    initial-scale - 初始的缩放比例
          minimum-scale - 允许用户缩放到的最小比例 //嘎嘎,终于知道我们的网站为什么不能缩小了,哈哈,原来我们缩放的最少比家里就是我们的默认比例啊……wap网站屏幕自适应的问题
          maximum-scale - 允许用户缩放到的最大比例
          user-scalable - 用户是否可以手动缩放



    ===========

    供大家参考,如果大家有好的方法请留言。



  • 相关阅读:
    Median Value
    237. Delete Node in a Linked List
    206. Reverse Linked List
    160. Intersection of Two Linked Lists
    83. Remove Duplicates from Sorted List
    21. Merge Two Sorted Lists
    477. Total Hamming Distance
    421. Maximum XOR of Two Numbers in an Array
    397. Integer Replacement
    318. Maximum Product of Word Lengths
  • 原文地址:https://www.cnblogs.com/new0801/p/6175908.html
Copyright © 2011-2022 走看看