-4

How to make a webpage the size of the client device screen, and make it insensitive to the browser viewport size, in a simple and cross-browser way ?

with flexible divs the size of the container the size of the device screen.

thanks

1 Answers1

0

This is pretty easy to find with a quick search...

You'll need javascript and use the screen object

Specification

Duplicate Question

Community
  • 1
  • 1
Colby Sargent
  • 331
  • 2
  • 6
  • yeah thanx, I've seen those post just before ask :p. I try a lot of think. and it doesn't work. I need to replace this: html, body { height:100%; width: 100%; padding: 0px; margin: 0px; border: 0px; } By something like this document.style.width = screen.width+"px"; document.style.height = screen.height+"px"; document.body.style.width = screen.width+"px"; document.body.style.height = screen.height+"px"; – garcia venture May 09 '17 at 00:06
  • You need to apply the width to the HTML element, you can get this in a few ways. [Here's an example](https://codepen.io/anon/pen/LyQPRv) how to apply screen width and height. Find more info [here](https://www.w3schools.com/js/js_htmldom_elements.asp) and [here](https://developer.mozilla.org/en-US/docs/Web/API/Element). – Colby Sargent May 09 '17 at 17:26
  • Also, be sure to include relevant code in your questions, you'll get better and quicker help :) [check this out](https://stackoverflow.com/help/how-to-ask) – Colby Sargent May 09 '17 at 17:29