Have the following code:
Which is an image 1280px wide. The site is set up so that it has a max / min number of pixels. 1280 is the max, 800 is the min. When the window is compressed the image is cropped on the right side off as the window collapses - so no scroll bar.
Is there a way in CSS to do this but have the image crop from both sides not just the right side so the image is effectively always centered no matter what the window size.
Code:
<div style="text-align: center; width: 100%; height: 300px; margin: 0px; padding: 0px; background:url(<web_root>/images/banners/banner1.jpg);"> </div>
Is there a way in CSS to do this but have the image crop from both sides not just the right side so the image is effectively always centered no matter what the window size.



Comment