My DIV element is adjusting its size based on the browser window. Inside this DIV, there is an image that should fill up the entire browser window without stretching out of proportion when the window dimensions change.
In addition, I want the image to be centered so that the viewer always sees the best part of the image, even if it becomes too large for the browser window.
I have tried various solutions and researched extensively, but I cannot seem to figure it out. Would using JavaScript or jQuery be a possible solution?
Below is the current CSS code for the DIV ID and IMAGE class:
#VisitUsSlides {
height:100%;
width:100%;
position:absolute;
top:0px;
left: 0px;
}
.resizingImage {
width:100%;
min-width:100px;
min-height:100%;
position:fixed;
top:0;
left:0;
}
The image is scaling up and down, but it starts to distort horizontally when the window becomes too narrow, and it is not aligning at the center as desired.