回答
的解决方案是使用viewport-fit=cover
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
这将使用全屏幕,但缺口如何。
创建一个类
.iphoneX{
padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
}
,并把它添加到网站包装和做了什么?是
号全宽度图像,并用不同颜色的全宽度的div会在我的网站被切断
,我用<section>
添加背景图像或颜色,并在部分中添加一个div的内容,所以不是.iphoneX
网站上的包装,我就在div
.iphoneX_rl{
padding: 0 constant(safe-area-inset-right) 0 constant(safe-area-inset-left);
}
这需要的正确的护理添加.iphoneX_rl
留下怎么样的底部
.iphoneX_footer { 填充:0 0常数(安全区 - 内陷式底部)0
}
这在你的页脚添加到-The最后一个div(容器)
现在我的网站看起来很不错的iPhone X/10 ,看着我的网站上的iPhone 8的内容走向边缘?没有安全区时间JS/jQuery的
if (navigator.userAgent.match(/(iPhone)/)){
if((screen.availHeight == 812) && (screen.availWidth == 375)){
if((window.innerHeight == "375") && (window.innerWidth == "812")){
$('.someClass,.someClass,.someClass').addClass("iphoneX_rl");
alert("ok iphone X - L");
}else{
$('.someClass,.someClass,.someClass').removeClass("iphoneX_rl");
alert("ok iphone X - P");
}
}
}
navigator.userAgent.match(/(iPhone)/)
如有iPhone
(screen.availHeight == 812) && (screen.availWidth == 375)
如果iPhone 10
((window.innerHeight == "375") && (window.innerWidth == "812"))
如果景观
没有自己的网站使用谷歌地图 一下添加到景观$('#map_section').addClass("gm_iphoneX");
class
.gm_iphoneX div.gmnoprint{
margin-right: 40px !important;
}
,如果有更好的方式来做到这一点,或者我错过了什么告诉我 THANKS
https://stackoverflow.com/questions/2934269/google-maps-api-v3-custom-controls-position –
https://www.designernews。co/stories/87581-another-solution-for-iphone-x-scrolling-by-embracing-the-notch –
http://stephenradford.me/removing-the-white-bars-in-safari-on-iphone- x/ –
注:在iOS中的UIWebView中,screen.availHeight等于768 在iOS系统WKWebView中, screen.availHeight总是812.
我不确定这与JavaScript有关吗? –
https://developer.mozilla.org/en-US/docs/Web/API/Screen/availHeight – lincolnge
对不起,以为这是你所指的Apple API –
- 1. 网站安全
- 2. 网站安全
- 3. 安全网站
- 4. 网站安全
- 5. Joomla网站安全
- 6. 安全性网站
- 7. 将不安全网站重定向到安全网站
- 8. iphone x:将搜索栏保持在安全区内
- 9. iPhone X安全区出现在不透明工具栏下方
- 10. iOS 11 iPhone X不尊重安全区域的工具栏
- 11. 安全ASP.NET MVC 3网站
- 12. P2网站安全策略
- 13. 手机网站安全
- 14. 安全测试网站
- 15. 刮网站,安全登录
- 16. 网站安全问题
- 17. 安全Laravel网站托管
- 18. 安全相关网站
- 19. SharePoint 2010:网站安全
- 20. 安全的社交网站
- 21. 网站可以完全安全吗?
- 22. MAC-OS X的网络安全性
- 23. IE7如何确定网站的安全区域
- 24. 什么是社区网站的安全措施?
- 25. 刮的网站内容与安全登录特定区域
- 26. iphone安全的网络标识
- 27. 安全iPhone
- 28. 网站安全性与服务器安全性有多大?
- 29. 用户在我的网站上得到“网站不安全”
@Krunal安全区的网站,而不是ios应用程序,感谢您的评论 –
@Krunal这是一个如何使用'meta' content ='viewport-fit = cover'如此友善的例子不要删除meta –