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
    来源:慕课网

  • 相关阅读:
    Future
    Vim 打开多个文件
    turboc报错:"unable to open file:c0s.obj "
    JNI(1)
    数据绑定控件ListView
    数据绑定控件ListView事件
    数据库取图片拼接ImageUrl
    数据绑定控件Reperter
    数据绑定控件ListView事件ItemCreated的Bug
    数据库系统为什么使用三级模式结构
  • 原文地址:https://www.cnblogs.com/snowhite/p/9682282.html
Copyright © 2011-2022 走看看