Centering an image

Associate
Joined
6 Feb 2003
Posts
751
Location
Sutton
I have a webpage, using dreamweaver 4, with a white background and one single image.

I want the image to appear in the centre of the whole page no matter what screen resolution will be used.

Is this possible and if so how.
 
The horizontal centering part is easy but vertical centering can be a little tricky sometimes. I can't think of a way of doing it off the top of my head with CSS but you could very easily do it with some nested tables. :)
 
You could set the image as the background for the page:
Code:
<style type="text/css">
body { background: white url(image.jpg) no-repeat middle center; }
</style>
I think that's right. Add it to your code between <head> and </head>
 
Last edited:
Back
Top Bottom