How to limit max width and height to screen size in CSS?

To set the height and width to be 100% of the window (viewport) size, use:

height: 100vh;//100% view height
width: 100vw;// 100% view width

.

div {
  background-color: blue;
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
  color: white;
}
<div>some content here</div>  

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)