2016-12-02 54 views
3

我一直在谷歌搜索了很多,但没有发现我的问题。我有一个小小的网站(仅html/css),这在移动Chrome上看起来不错。但是在Android 5.0的Instagram应用内浏览器上,有些填充会出现填充错误。有什么办法通过媒体查询或前缀来处理应用内浏览器?到目前为止,我找不到任何东西。希望有人能帮助我。提前致谢。如何调整instagram应用内浏览器的html/css布局?

P.S.对不起,我的英语不好,我正在努力。

回答

0

您可以使用JavaScript检测包含Instagram的用户代理,并为该情况请求特定的CSS。

示例代码:

<script> 
var isInstagram = navigator.userAgent.match(/instagram/i); 
if (isInstagram) { 
    var head = document.querySelector('head'); 
    var link = document.createElement('link'); 
    link.rel = 'stylesheet'; 
    link.href = 'your-file-with-instagram-fixes.css'; 
    head.appendChild(link); 
} 
</script>