I am attempting to place an image within a frame.
DESIGN
#wrapper {
border: 2px solid black;
width: 600px;
height: 400px;
overflow:hidden;
position: relative;
display: inline-block;
}
img{
position: absolute;
height:auto;
}
CODE
<div id="wrapper">
<img src="https://example.com/image1.jpg" alt="image one" />
</div>
<br>
<div id="wrapper">
<img src="https://example.com/image2.jpg" alt="image two" />
</div>
Is there a method to ensure that the image appears centered within the frame like in this example?