Answers for "100vh height css"

0

css 100% height

<!DOCTYPE html>
<html>
  <head>
    <title>100% height</title>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
      }
      .container {
        height: 100%;
        background: #000; /* to see the effect */
      }
    </style>
  </head>
  <body>
    <div class="container"></div>
  </body>
</html>
Posted by: Guest on June-13-2020
0

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));
Posted by: Guest on November-01-2020

Browse Popular Code Answers by Language