zoukankan      html  css  js  c++  java
  • 关于苹果手机微信端 position: fixed定位top导航栏问题

    在移动端,position: fixed定位一般不被识别,或者在ios系统中,获取input焦点时,会导致position: fixed的top失效,下面是我验证过的方法,大家可以试试.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>无标题文档</title>
    </head>
    <style>
    header, footer, main {
    display: block;
    }

    header {
    position: fixed;
    height: 50px;
    left: 0;
    right: 0;
    top: 0;
    }

    footer {
    position: fixed;
    height: 34px;
    left: 0;
    right: 0;
    bottom: 0;
    }

    main {
    / main绝对定位,进行内部滚动 /
    position: absolute;
    top: 50px;
    bottom: 34px;
    / 使之可以滚动 /
    overflow-y: scroll;
    300px;
    border:#3299D3 5px solid; / main区分 /
    }

    main .content {
    height: 2000px;
    border:#A45052 5px solid;/ .content区分 /
    90px;
    }
    </style>
    <body class="layout-scroll-fixed">
    <!-- fixed定位的头部 -->
    <header>

    </header>
    
    <!-- 可以滚动的区域 -->
    <main>
        <div class="content">
               <input type="text" placeholder="Footer..."/>
        <!-- 测试看看... -->
        </div>
    </main>
    
    <!-- fixed定位的底部 -->
    <footer>
        <input type="text" placeholder="Footer..."/>
        <button class="submit">提交</button>
    </footer>

    </body>
    </html>
    在android中 overflow-y: scroll的导航框可能会显示不出来(可能是部分吧!没有测试过,我的手机是显示不出来),但是它确实是存在的


    作者:
    链接:https://www.imooc.com/article/5969
    来源:慕课网

  • 相关阅读:
    HTML编码规范(转)
    ASP.NET连接MySQL数据库方法(测试可行)
    Redis源码解析05: 压缩列表
    Redis源码解析04: 跳跃表
    Redis源码解析03: 字典的遍历
    Redis源码解析02: 字典
    Redis源码解析01: 简单动态字符串SDS
    小象垃圾分类小程序从开始到结束
    spring boot踩坑记
    spring boot打包问题
  • 原文地址:https://www.cnblogs.com/snowhite/p/9682282.html
Copyright © 2011-2022 走看看