1

Is it possible to set same height as width?

css

img{
    width:90%;
    height: same as width;
}

since screen width and height is not same so if width is 90% height should be same height in pix

m-farhan
  • 1,436
  • 13
  • 14
hidia
  • 11
  • 1
  • seems duplicate question. check this SO link. http://stackoverflow.com/questions/5445491/height-equal-to-dynamic-width-css-fluid-layout – Kheema Pandey Mar 18 '14 at 06:12
  • @KheemaPandey I read that question and tried Nathan's solution. but its not work on images.. – hidia Mar 18 '14 at 06:45

1 Answers1

0

Use width and height in pixels

img {
    max-width: 100%;
    height: auto;
    width: auto\9; /* ie8 */
}
user3004356
  • 870
  • 4
  • 16
  • 49