I have a website that I need to fit to different screen sizes. Most of that is quite straightforward, but I have a slideshow that need to resize with screen size AND have the image centered on the page. The images are wider than the page, so as to have no white spaces on either side as the size changes.
The full size picture is 4800px wide, but this changes with browser size.
If it was a question of centering image at one size only, I would use
#image{left:50%, margin-left:2400px;}
But since I resize the picture according to availabe space, so I can show the full height of the picture at all times, the width of the displayed image changes and that method of centering is no good.
So how can I use javascript to check the current image width and change the margin-left property, or could it be done in css?
EDIT to add a bit of the css here:
This bit nice resizes the images to fit height wise in the available space depending on the browser/screen size. But the centering is missing.
#slideshow{
max-height:100%;
width:auto;
background-color: blue;
overflow: hidden;
text-align: center;
z-index:5;}
.size-4{
max-height:100%;
width:auto;}