Home › Forums › JavaScript › Setting a Div height to the window viewport size › Reply To: Setting a Div height to the window viewport size
May 21, 2015 at 3:46 am
#202650
collyg
Participant
why not just use CSS alone:
div
{
width = 100vh;
height = 100vw;
}
Where 100 is the full size (100% of the screen dimension – X(vw) or Y (vh) axis). and 10 would be 10% of same.
These are an uncomplicated and constant means to set elemetns at a specific percentage of the screen width and the screen height respectively, and this also responds to screen re-size elegantly!!
CollyG