4
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>
Wishing to stretch the image without it losing its proportion, I decided to do the stretching in that 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 property position
for the class wideStretch
.
Why does this happen? How does the tag position <a>
affects <img>
?
Very well pointed out of having to apply the changes to the previous elements. It was enough to do the same for the div that contained
a
that worked perfectly, thank you (:– Guilherme Agostinelli