I have been attempting to center an <img>
element horizontally within a <div>
that is narrower than the image itself. The <div>
has overflow: hidden
applied to it.
For example, if the image is 500px
wide and the DIV is 250px
wide, is there a neat solution (that works for images of all sizes) to center the image so that only the central portion is visible inside the div?