• 关于苹果手机微信端 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
    来源:慕课网

  • 相关阅读:
    c# partial 关键字的使用
    动软代码生成器基础使用
    T-SQL :编程理论 (一)
    T-SQL :SQL Server系统数据库(二)
    T-SQL :SQL Server 定义数据完整性 6大约束(三)
    T-SQL:SQL语句处理顺序的坑(四)
    c#实战开发:以太坊私链搭建(一)
    T-SQL :TOP和OFFSET-FETCH筛选 (五)
    T-SQL:谓词和运算符(六)
    T-SQL:是NULL不是NULL(七)
  • 原文地址:https://www.cnblogs.com/snowhite/p/9682282.html
Copyright © 2020-2023  润新知