+ 1
why height don't work if I give % in one div?
when I give one div width:50% and height:40% the div don't show the given value; please tell me why? https://code.sololearn.com/WzmbVZh4pLTN/?ref=app
2 Respuestas
+ 5
Css % refers to parent tag width/height values, make sure parent tag width/height is set, before use %
Try to add the following css:
html, body {
height: 100%;
}
body {
width: 100%;
}
+ 3
thanks