+ 1
How we can set any element width height as per device screen size?
when we open web page in PC similarly open in mobile or tablet!
2 Respostas
0
height: 100vh;
width: 100vw;
vh = view height
vw = view width
0
height:100%;
width:100%;
@media and screen (max-width:480px;){
height:100%;
width:100%;
the top is regular css
the bottom is if the screen is less than 480px
not that you do not need to write these again. it will still be 100%. the only time you would include these again is if you wanted to change them.