How do we make a full screen SVG in HTML5? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do we make a full screen SVG in HTML5?

When we add <!DOCTYPE html> to the code, the SVG does not occupy the full screen despite setting its parameters (height and width) to 100%. When we remove it will take the full screen. Why?

24th Aug 2020, 11:16 AM
Hadjer
Hadjer - avatar
2 Answers
+ 1
Height don't work with % well if parent has no fix height Use vh Mean 100vh height And 100vw width May it help you.
24th Aug 2020, 12:19 PM
Divya Mohan
Divya Mohan - avatar
0
It worked perfectly with height=100vh Thank you for your help
24th Aug 2020, 12:31 PM
Hadjer
Hadjer - avatar