I have the following html code:
<figure>
<div id="test">
<a href="#">
<img class="wideStretch" src="caminhodaimagem/img1.jpg" alt="Img 1" />
</a>
</div>
</figure>
Stretching the image without it losing its aspect ratio, I decided to do the stretching this way:
#test a {
position: absolute;
}
.wideStretch {
/*position: absolute;*/
height: 100%;
width: auto;
}
figure {
max-width: 889px;
height: 500px;
position: relative;
overflow: hidden;
margin: 100px auto;
}
However, the image is only properly stretched in Internet Explorer when I change the position
property to the wideStretch
class.
Why does this occur? How does the position of the <a>
tag affect <img>
?