0
Je tente de centrer ma carte google, mais elle ne souhaite pas être alignée à gauche. Chaque fois que j'essaie de le modifier, il supprime mon en-tête.Centre Google map sous le bloc d'en-tête au centre sur la page Web
Mon code 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;
}
Mon code dans mon 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 [Mes résultats actuels] [1]
ne fonctionnait pas. rien n'a changé –
Comment la carte Google entre-t-elle dans cette DIV? Y a-t-il plus de code? (il doit y avoir ...) – Johannes
grâce à une clé API et donnée lat & lng –