admin管理员组文章数量:1415460
community,
I've made a one-screen page and have an issue with depicting it on a smartphone. 100vh is calculated regardless of the Browser UI that takes space on the page, leading it to the situation where I do not have the entire content on the page, and I have ~60 pixels of scroll (to collapse the URL bar).
I tried different methods: dvh, svh
and so on.
Also, I tried window.innerHeight
suggested in the other post,
I tried
function setRealHeight() {
const realHeight = document.documentElement.clientHeight;
document.documentElement.style.setProperty('--real-vh', `${realHeight}px`);
}
window.addEventListener('resize', setRealHeight);
setRealHeight();
+
body {
height: var(--real-vh);
}
and const vh = window.visualViewport.height * 0.01;
But nothing helped.
The only band-aid solution I have "invented" - is to increase bottom padding and to hide the overflow - yet I do not feel it is a good solution.
本文标签: htmlSmartphone39s Viewport Height without Browser UI (URL Bar)Stack Overflow
版权声明:本文标题:html - Smartphone's Viewport Height without Browser UI (URL Bar) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745168428a2645824.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论