0

How to display a portrait image in html? I used an img tag. My portrait image is being rotated 90 degrees and shown in landscape.

How can an image be shown in its original orientation?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
  • 1
    Without more context it is not easy to help. If you have a simple html tag `` AFAIK the image is displayed how it was taken - so a portrait image should be displayed as a portrait. If you add code and more information it is easier to help. – surfmuggle Jul 12 '15 at 20:00
  • I am using the simple html tag however the portrait images are not shown properly. – Amardeep Pawar Jul 13 '15 at 07:39
  • From browsing the related questions i [found](http://sethfowler.org/blog/2013/09/13/new-in-firefox-26-css-image-orientation/) `A ... mismatch exists between the web, where the orientation of an image is determined by how its pixels are stored, and digital photography, which increasingly relies on metadata to mark the image as rotated, storing the pixels in the same orientation no matter what.` You might find more info in [extract image orientation](http://stackoverflow.com/questions/18632356/) or [correct orientation in mobile browser](http://stackoverflow.com/questions/19463126/) – surfmuggle Jul 13 '15 at 18:43

1 Answers1

0

Try this CSS for your element:

-ms-transform: rotate(90deg);
-webkit-transform: rotate(90deg); 
transform: rotate(90deg);`
calvinf
  • 3,754
  • 3
  • 28
  • 41
user3669714
  • 90
  • 1
  • 1
  • 8