I have an div
which I keep box shaped all the time using:
div{
float:left;
width: 447px;
height: 445px;
background-color: blue;
}
div:after{
content: "";
display: block;
padding-bottom:100%
}
the problem occurs when I want to add an image to the div
<div><img src="as.jpg"></div>
using:
img{
width:100%;
height:100%;
}
Does one of the two things:
the image does not cover whole div
the image does not cover whole div and box shape is ruined
Is there a way how to fix this? Demo