What are the other CSS definitions happening here that constrain the <img>
element?
Here is an example, I'm only defining width and height, but you will see that the element uses the entirety of the image and scales it to fit, while the <div>
element uses the image at 100% scale and clips around the width and height.
How can I control the <img>
to behave more like the <div>
?
<img src="http://i.eho.st/pjw35bzm.jpg" width="140" height="140" />
<div id="img"></div>
<style>
#img{
width: 140px;
height: 140px;
background: url(http://i.eho.st/pjw35bzm.jpg);
}
</style>