I want to have a div scale relative to the size of my window, whether that be because I am on mobile or I scale the browser. However when I try to set the size of my div to something like
div {
width: 80%;
height: 50%;
background-color: grey;
}
It doesn't work. I have read around and it seems that I need to define a reference div, but that wouldn't make this div scale to the screen. I think the <meta>
tag would fix things, but I am using codepen.io for this project and I don't know if I can include that since the only html they ask for is anything in the body.