mzc6838吧 关注:7贴子:239
  • 4回复贴,共1

网页界面设计= =(备忘)

取消只看楼主收藏回复

1楼233


IP属地:陕西1楼2016-12-29 17:57回复
    判断设备以实现自动跳转
    <script>
    if(navigator.platform.indexOf('Win32')!=-1){
    //pc
    //window.location.href="电脑网址";
    }else{
    //shouji
    window.location.href="手机网址";
    }
    </script>


    IP属地:陕西2楼2016-12-29 17:58
    回复
      手机界面自适应方式
      加在<head></head>之间
      向浏览器声明该网页为移动设备自适应网页的meta标签为:
      <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
      <meta name="apple-mobile-web-app-capable" content="yes">
      <meta name="apple-mobile-web-app-status-bar-style" content="black">
      <meta name="format-detection" content="telephone=no">


      IP属地:陕西4楼2016-12-29 17:59
      回复
        IP属地:陕西5楼2016-12-29 18:00
        回复

          CSS 网页背景自动拉♂伸
          <head></head>之间加入
          <style type= "text/css">
          body {
          background-attachment: fixed;
          background-image: url(index.files/bg.png);
          background-size: cover;
          overflow: hidden;
          background-repeat: no-repeat;
          }
          </style>


          IP属地:陕西6楼2017-03-07 11:12
          回复