立即学习:https://edu.csdn.net/course/play/27397/366013?utm_source=blogtoedu
- html和body元素默认没有高度,高度是根据内容高度变化的。如果要使div元素的高度与窗口等高,需要从html开始一级一级设置height=100%,并且body元素有默认间距,需要padding=0;margin=0;使div完全贴合窗口。
立即学习:https://edu.csdn.net/course/play/27397/366013?utm_source=blogtoedu