可以使用CSS中的position属性来设置该span相对于div的位置。

例如,可以将div设置为position: relative,然后将span设置为position: absolute,并且使用top、bottom、left、right属性来调整其位置。

具体的CSS代码可以如下所示:

#map-responsive {
  position: relative;
}

.search-city {
  position: absolute;
  top: 10px;
  right: 20px;
}

上面的代码将span元素相对于div元素的右上角偏移10px和20px。您可以根据需要调整这些值来更改其位置。

id为map-responsive的div中存在一个class为search-city的span如何设置该span相对于div的位置

原文地址: https://www.cveoy.top/t/topic/bsLk 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录