why font-sizing vw not working in safari?

随声附和 提交于 2019-12-10 15:54:36

问题


I'm using vw as the unit for my font size, so that it will look nicely when resize the browser. However, when I browse it at Safari, the content run, anyone know how to solve it? thanks

CSS

.flatNav {
    background-image: url(../img/navBar.png);
    background-repeat: repeat-x;
    width: 90%;
    margin-right: auto;
    margin-left: auto;
    font-size: 0.8vw;
    height: 48px;
    position: relative;
    top: 28px;
    background-position: center;
}

.flatNav ul {
    list-style-type: none;
    height: 48px;
    width: 75%;
    margin-right: 1.46vw; 
    margin-left: 1.46vw; 
    position: relative;
    top: -47px;
}

回答1:


REM is a font value which works well for browser resize but there are certain browser compatibility issues.

EMs could very well be used and they will do a good job during browser resizing and in responsive websites too. This works across browsers too.

Check out this website if you want to convert your pixels to EM values and use the same: http://www.pxtoem.com/

Hope this helps.



来源:https://stackoverflow.com/questions/24926145/why-font-sizing-vw-not-working-in-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!