-3

I want to center a map. I have it on "width: 50%;" and it is showing one the left side. How do I do this?

I have tried to create a "wrapper" div on it an set text-align to center. This did not work. I also tried it on the .map class... Anybody tried this before?

#wrapper {
  text-align: center;
}
.map {
   height: 400px;
   width: 50%;
}

The reason i want to do this is because i do not want it to fill the whole screen on my webpage. it should be a smaller size window.

1 Answers1

0

Set the margins on your wrapper div.

#wrapper {
  text-align: center;
  margin: 0 auto;
}
Dave
  • 5,108
  • 16
  • 30
  • 40