CSS: Are view height (vh) and view width (vw) units widely supported?

前端 未结 6 1510
庸人自扰
庸人自扰 2020-11-30 04:01

I\'m using 100vh to center a div vertically with line-height. This site puts support for vh and vw at around 70%, is that a fair assessment? Would you recommend using viewpo

6条回答
  •  抹茶落季
    2020-11-30 04:31

    Viewport units are great but most mobile browser vendors managed to make vh unusable in practice.

    When you start scrolling or change scrolling direction, the address bar will either disappear or come back; then you stop, release your finger and the vh value will suddenly be updated alongside any element using it resulting in a UX nightmare (user not expecting anything to resize at the end of scrolling, changing proportions of existing elements, re-layout of content, etc).

提交回复
热议问题