Check out this code and explain me.What if i remove position attribute from #q why is that div resized? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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>

28th Jul 2017, 4:35 PM
AKASH JOSHI
AKASH JOSHI - avatar
3 Answers
+ 11
Viewport Height.... Just another measurement unit.... 100% means : get full height of parent 100vh means : full height of viewport
28th Jul 2017, 5:00 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 10
You cannot use "%" on height without absolute/fixed position.... Try "vh" instead....
28th Jul 2017, 4:53 PM
Valen.H. ~
Valen.H. ~ - avatar
0
full form of vh?
28th Jul 2017, 4:55 PM
AKASH JOSHI
AKASH JOSHI - avatar