I am trying to resize the wallpaper to fit in a div. The problem is that I want the image to fit the height of the div and keep relationship. For example, I have a div that I don’t want it to expand to fit the width of the screen (so that scrollbars do not appear), and the image I want to use is 1024px X 400px. If I try to set the height of the image, it will make the width also fit, and it will lose the ratio. I do not like it if parts of the image are not displayed. In fact, this is what I want to do.
What tags do I need to use? HTML5 or CSS
source
share