I am using the img
tag for my slider images. I need the image to be full width and height and centered inside its container.
My problem is, when I resize the window width, my image becomes small and its height doesn't follow the window height. I need the same behaviour as background-size: cover
but with the image tag.
background: url(../images/slider/002.jpg) center center;
background-size: cover;
If I make the image a background, everything works fine, but the slider will not. I need to use the <img>
tag.
Here is my example.