0
我试图居中我的谷歌地图,但它不想从左对齐移动。每当我尝试改变它,它会删除我的标题。中心谷歌地图下的标题块中的网页
我的CSS代码
#mapCanvas {
width: 960px;
height: 150px;
margin-left: auto;
margin-right: auto;
}
header {
width: 960px;
height: 150px;
margin-left: auto;
margin-right: auto;
background-color: #339966;
font-family: Garamond;
font-weight: bold;
font-style: italic;
}
h1{
color: white;
font-family: Garamond;
font-weight: normal;
font-style: italic;
text-align: center;
font-size: 40px
}
p {
color: white;
font-family: Garamond;
font-weight: normal;
font-style: italic;
text-align: center;
font-size: 20px;
}
我在我的HTML代码
<body>
<header>
<h1>
Find a user's location using HTML5 Geolocation
</h1>
<p> If Geolocation sercive is failed, the University of Maryland Campus will be displayed on a map</p>
</header>
<div id="mapCanvas">
</div>
</body>
[1]:https://i.stack.imgur.com/6WZiy.jpg [我目前的成绩] [1]
没有工作。没有任何变化 –
Google地图如何进入DIV?有更多的代码吗? (必须有...) – Johannes
通过一个API密钥,并给出经纬度 –