Image automatically resizing/rescaling based on browser

by KubiK
3 replies
  • WEB DESIGN
  • |
I have an issue with the image of my site. When I adjust the windows browser's size horizontally (ie: sneezing), the image's width is also squeezed without the length automatically adjusted. Is there any way to change it so it's in proportion?
#automatically #based #browser #image #resizing or rescaling
  • Profile picture of the author surreal
    Using CSS you can do this.
    Where you see <img src="fefeff">
    Make it look like this..
    <img style="width: 100%;">

    Assuming the image is in its own container, this should scale it appropriately.
    {{ DiscussionBoard.errors[8398737].message }}
    • Profile picture of the author KubiK
      Thanks, instead, I added the "height: auto" and changed the "max-width: 100%" to "width: 100%" in the CSS file and it works exactly the way I want.
      {{ DiscussionBoard.errors[8399158].message }}
      • Profile picture of the author haydentomas
        Originally Posted by KubiK View Post

        Thanks, instead, I added the "height: auto" and changed the "max-width: 100%" to "width: 100%" in the CSS file and it works exactly the way I want.
        I don't think height auto will make much different, but yes. Max width 100% will do the trick

        Another fantastic way of ensuring that you catch every element for responsive design is to use normalize css which includes the element you asked about. Just do a quick google search to find it!
        {{ DiscussionBoard.errors[8399835].message }}

Trending Topics