0
Check out this code and explain me.What if i remove position attribute from #q why is that div resized?
<!doctype html> <html> <head> <style> #q{ height:10%; width: 10%; border: 10px solid #808080; position: absolute; padding: 0px 30px; } #t{ height:10%; width: 10%; border: 10px solid #808080; position: absolute; padding:10px 40px; } </style> </head> <body> <div id="t"></div> <div id="q"></div> </body> </html>
3 odpowiedzi
+ 11
Viewport Height.... Just another measurement unit....
100% means : get full height of parent
100vh means : full height of viewport
+ 10
You cannot use "%" on height without absolute/fixed position.... Try "vh" instead....
0
full form of vh?