安卓手机微信页面position: fixed位置错误

摘要:
当我今天做这个项目时,我发现当我使用position:fixed作为弹出窗口,margin-top:50%作为外部边距来控制位置时,我在微信中打开了页面上的弹出窗口。手机上显示的弹出窗口的位置与手机上的实际位置不同,因此人们在单击它时没有做出反应。事实上,他的实际位置远远高于他的眼睛所看到的位置。当我点击上面的许多位置时,为什么它会触发一个元素在眼睛看到的地方被点击的事件?UC浏览器都正常。微信最近的更新是致命的吗?这让我调整了很长一段时间,

今天做项目的时候发现动用position: fixed做弹窗时,用margin-top:50%这样外边距来响应式的控制位置时,在微信里打开页面的弹窗,弹窗在手机上显示的位置和实际上在手机上的位置不一样,让人点击上面时并没有反应,其实他实际位置时在眼睛看到的位置上方许多,点击上方许多的位置时,才触发眼睛看到的地方的元素被点击的事件,这是为毛啊?UC浏览器都是正常的,微信最近更新作死吗,害我调整了好久,最好用top来代替margin-top了

贴上问题代码

<div class="pop_bg"></div>
<div class="pop_content">
    <div class="pop_message">
        <form id="baoming_from" name="" action="">
            <p>请填写您的个人信息</p>
            <ul>
                <li><label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</label><input type="text" name="name" myAttr="姓名"></li>
                <li><label>联系电话:</label><input type="text"  name="phone"  myAttr="联系电话"></li>
                <li><input type="button" value="报名" class="baoming_btn"></li>
            </ul>
        </form>
        <div class="baoming_tip">
            <div class="baoming_tip_box"><img src="images/xiaolian.jpg"><span>报名成功</span></div>
            <button value="关闭" class="baoming_close">关闭</button>
        </div>
    </div>
</div>

下面CSS

    /*公共弹窗样式*/
    .pop_bg{ position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #343434; opacity: 0.15; z-index: 9999; display: none;}
    .pop_content{ width: 73.75%; padding-bottom:53.4375%; position: fixed; top: 15%; left: 50%; margin-left: -36.875%; margin-top: 0%;  /*这里的margin-top用top代替了*/ background-color: #fff; z-index: 10000; max-width: 470px; display: none;}

.pop_message p{ text-align: center; margin-top: 10.42%; margin-bottom: 8.94%;}
    #baoming_from{ /*display: none;*/}
    .pop_message li{ margin-bottom: 5.1%;}
    .pop_message label{ width: 33.05%; font-size: 25px; line-height: 1.8; text-align: right; margin-bottom:0; font-weight: 500;}
    .pop_message input{ width: 59.3%; margin-right:7.65%;  line-height: 1.8; border: none; background-color: #f2f2f2; text-indent: 0.5em;}
    #baoming_from .baoming_btn,.baoming_close{ display: block; color: #fff; margin-left: 33.05%; width: 31.915%; background-color: #da2737; line-height: 2; text-align: center; border-radius: 4px;}
    .baoming_tip{ text-align: center; display: none;}
    .baoming_tip_box{ margin-top: 21.28%; margin-bottom: 17.02%;}
    .baoming_tip_box img{ margin-right: 6.8%; width: 15.11%;}
    .baoming_tip_box span{ line-height: 70px;}

免责声明:文章转载自《安卓手机微信页面position: fixed位置错误》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇cesium贴地代码pycharm之激活下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

vue-微信浏览器左上角返回按钮拦截

【需求】   在微信公众号开发中,有时需要对浏览器左上角返回按钮进行拦截处理相关的页面逻辑,而并不是让页面直接返回上一页,之前在这个细节点上的一直实现得不是很好。但看到京东购物公众号上的效果却实现得非常好,所以自己也开始了这方面的尝试。京东的效果如下图:      从上图京东购物效果上来看,在点击搜索拉起一个搜索界面,然后点击左上角反回,只是将搜索界面收起...

WPF DesiredSize &amp;amp; RenderSize

DesiredSize DesiredSize介绍 关于DesiredSize的介绍,可以查看最新微软文档对DesiredSize的介绍 DesiredSize,指的是元素在布局过程中计算所需要的大小。 通过调用方法Measure计算得到DesiredSize 1 element.Measure(availableSize); 2 var desi...

使用qt帮助 查看样式表stylesheet的帮助文档

QCreactor帮助文档中搜索的关键字 Qt Style Sheets Examples 有所有控件的样式例子 Qt Style Sheets Reference 控件的所有属性 The Style Sheet Syntax 使用setStyleSheet的语法 有所有控件的样式例子Style Sheet UsageCustomizing the For...

利用MongoDB进行地理坐标查询

BS的应用在生活中已经非常常见,我们打车,叫外卖,查个地图之类的都会查询附近的相关坐标位置,mongodb提供了原生的二维地图查询,极大地方便了大家的开发。 假定我们有一个定义了位置信息的集合location,给定a,b,c,d节点 db.location.find() { "_id" : "A", "position" : [ 0, 10 ] } { "...

Android BottomNavigationBar导航栏

基本属性 setActiveColor //选中item的字体颜色 setInActiveColor //未选中Item中的颜色 setBarBackgroundColor//背景颜色 setMode(BottomNavigationBar.MODE_FIXED) //填充模式,未选中的Item会显示文字,没有换挡动画 setMod...

bootstrap模态框,等待遮盖层

<div id="loadingModal"> <div style=" 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px"&...