3 ms·
For the first paragraph: Put your outermost container as { box-sizing: border-box; width: 100vw; height: 100vh; overflow: none;
by Macha 5y ago
For the first paragraph:
Put your outermost container as
{
box-sizing: border-box;
width: 100vw;
height: 100vh;
overflow: none;
}
vw/vh are units based on the viewport width and height. 1vw is 1% of the viewport interior width, 1vh is the same for height. The border box box model ensures that padding and borders subtract from the interior dimensions rather than add to the exterior
dimensions.
You may also want to use <meta viewport> to control zooming on mobile devices: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_m...
Then you can use grid to divvy up that internal space without having to deal with the kind of rounding issues that using ems or %s used to have
- gfxgirl 5y agoyou failed :P height: 100vh does not work on mobile http://google.com/search?q=100vh+mobile http://google.com/search?q=100vh+mobile Grid might solve some issues that Flexbox didn't but my experience is that without fail, I try to make the various panes, then I try to put some content inside the panes and either (a) the content doesn't correctly fill the panes (b) the panes get warped in ways I wasn't expecting because of the content. And, it's always a bunch of trial and error and unintuitive crap like "max-width: 0" to get it to work