real vh viewport hight code example
Example 1: vh and vw
/*vh viewport height and vw viewport width*/
/*example*/
div
{
display: inline-block;
height: 100vh; /*THis will set height equal to the height of windows*/
width: 100vw/*This will set width equal to width of windows*/
}
Example 2: css vw not working on mobile
//In your js file:
window.addEventListener('resize', () => {
document.querySelector(':root').style
.setProperty('--vw', window.innerWidth/100 + 'px');
})
//Css
width: calc(100 * var(--vw));