0

I have a Gall-Peters projection on my website. I want to give the image 100% of available width while keeping the height correct so that countries do not get elongated. What is the right CSS to keep the aspect ratio?

Tim
  • 8,669
  • 31
  • 105
  • 183

2 Answers2

2
img {
  width: 100%;
  height: auto;
}
Michael Theriot
  • 994
  • 7
  • 13
0

Simply width: 100%. The height of an image should automatically be set to keep the original aspect ratio.

James Coyle
  • 9,922
  • 1
  • 40
  • 48