I am trying to scale an image to 100% width of the div it is contained within (it is a responsive layout with the div changing size depending on window size, hence the need to scale the images).
This is my css:
.container {
width: 200px;
height: 200px;
overflow: hidden;
position: relative;
margin: 10px;
float: left;
}
@media (max-width: 520px) {
.container {
width: 100px;
height: 100px;
margin: 5px;
}
}
.container img {
width: 100%;
}
The images resize fine using this css, EXCEPT when they are links. Like this:
<div class="container">
<a href="http://andreaalice.com/index.shtml"><img src="images/image.jpg"></a>
</div>
Image links remain at their full size of 200px rather than scaling down to 100% of the div which is 100px.
Anyone know how I can get the linked images to scale?