博客
关于我
ios中safari浏览器100vh带有滚动条?
阅读量:157 次
发布时间:2019-02-28

本文共 337 字,大约阅读时间需要 1 分钟。

在移动端Safari或Chrome浏览器中,使用100vh可能会引起滚动条的出现,这通常与浏览器的地址栏高度计算方式有关。

在Safari和Chrome中,100vh的定义通常指的是去掉地址栏后的可用高度。这种设计导致页面内容在满屏显示时仍会出现滚动条,影响用户体验。

对于移动端开发,Chrome的用户基数较小,若只考虑微信公众号等特殊场景,通常无需特别处理。然而,如果需在Safari中优化用户体验,可以采取以下方法:

  • 使用100%替代100vh:这种方式在所有浏览器中都能稳定地实现满屏布局,无滚动条。

  • 结合JavaScript 代替vh单位:通过动态计算可用高度,并根据浏览器的具体实现调整布局。

  • 建议根据项目需求选择最合适的方案,确保在目标浏览器中的最佳显示效果。

    转载地址:http://pgad.baihongyu.com/

    你可能感兴趣的文章
    ORCHARD 是什么?
    查看>>
    Struts2中使用Session的两种方法
    查看>>
    order by rand()
    查看>>
    Orderer节点启动报错解决方案:Not bootstrapping because of 3 existing channels
    查看>>
    org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement profile
    查看>>
    org.apache.commons.beanutils.BasicDynaBean cannot be cast to ...
    查看>>
    org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: not s
    查看>>
    sqlserver学习笔记(三)—— 为数据库添加新的用户
    查看>>
    org.apache.ibatis.exceptions.PersistenceException:
    查看>>
    org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned
    查看>>
    org.apache.ibatis.type.TypeException: Could not resolve type alias 'xxxx'异常
    查看>>
    org.apache.poi.hssf.util.Region
    查看>>
    org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
    查看>>
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
    查看>>
    org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    查看>>
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
    查看>>
    SQL-CLR 类型映射 (LINQ to SQL)
    查看>>
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    查看>>
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    查看>>
    org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded
    查看>>