设置地图div为全屏时需要将其父容器的百分比也设置成100%,如果不设置,div设置的百分比无效果。 html, body, #map { margin: 0; width: 100%; height: 100%; }