我在页面上使用height="100%"
和width="100%"
在全角谷歌地图。我想知道一些css div的东西顶部它。我读到使用负值(例如margin-top: -500px;
)可以工作,但他们这样做,但是当我尝试为div的背景分配一种颜色时,它不会在地图上显示它,而是在它下面显示它,我想要什么。有针对这个的解决方法吗? 代码:全宽Google地图和CSS
<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?hl=en&ie=UTF8&ll=37.0625,-95.677068&spn=56.506174,79.013672&t=m&z=4&output=embed"></iframe>
<div class="content"> I want this text to be in a div box that has a black background. <br /> </div>
风格:
.content {
margin-top: -500px;
width: 390px;
background-color: black;
}
这上面的DIV是修复[设为谷歌地图集装箱DIV宽度和高度100%](http://stackoverflow.com/a/18147172/782535) – 2013-08-09 13:10:44