Heim  >  Artikel  >  Web-Frontend  >  求助:有谁解决过微信内置浏览器不兼容浮动的_html/css_WEB-ITnose

求助:有谁解决过微信内置浏览器不兼容浮动的_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:26:141472Durchsuche

<!DOCTYPE HTML><html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><title>浮动测试</title><style type="text/css">	#mcover {background: none repeat scroll 0 0 rgba(0, 0, 0, 0.7); text-align:right; display:block; height: 100%;left: 0; position: fixed; top: 0; width: 100%; z-index: 2000000;}</style><meta name="description" content="" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /></head><body>	<div style="width:310px; height:1000px; margin:0px auto; border:1px #000000 solid">			<div  onclick="document.getElementById('mcover').style.display='';" id="mcover"><img  src="http://img.my.csdn.net/uploads/201401/11/1389420919_5249.png" alt="求助:有谁解决过微信内置浏览器不兼容浮动的_html/css_WEB-ITnose" ></div>			</div></body></html>

这个页面,pc机和移动设备的普通浏览器都能浮动,也就是鼠标滚动的时候,最上面的层保持不动,但是在微信内置的浏览器中,无效,特来求助,不胜感谢。


回复讨论(解决方案)

这个问题吧,你看看是不是因为固定定位惹得祸。

把固定定位改成绝对定位,然后看看是不是能正常,如果能正常那就是微信浏览器不支持固定定位了。

搜一下:IE6下解决固定定位。这个,看下IE6是怎么处理不支持fixed属性的。

然后改到这边试试。

还有,这段去掉再试试。不要去强制定义浏览器的解析模式。

这个问题吧,你看看是不是因为固定定位惹得祸...
其实无需兼容pc机的浏览器,只需要兼容移动设备浏览器,现在移动设备浏览器几乎能全部兼容,除了 微信的内置浏览器,现在就是在解决这个问题呢

我就是在说,解决你这个问题的啊,微信浏览器,是用的腾讯自己的浏览器,腾讯的浏览器都是IE的内核。

所以才考虑一下,是不是因为不支持fixed的属性,导致的这个问题。

还有你添加的强制以IE的最新模式和chrome=1的模式解析,这个会不会有影响,这只是为了去进一步确认问题的根源而已。

我就是在说.......
哈哈   我知道什么问题了   原来是手机系统版本问题   我找了其他手机测试了  代码没有任何问题的  感谢啊

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn