"John Larronn said:
How can I put a photo in the middle of a new page using the following -
usual - code?
<a href="studie_tree.jpg">
Using this code, the photo is aligned at the left of the new page. But I
want to put it in the middle of the new page. Any ideas?
If you use links to enlargements a lot, from say, thumbnail
images on a website page, it is a great time saver to simply have
a link directly to the image. But, alas, you thereby lose control
over where the image get placed, most browsers default to top
left.
You can spend time to fix your problem in various ways. You can
make yourself a template html page with simple code to get
horizontal centring (to keep it simple for the moment) using such
as:
<div><img style="margin:auto; display:block;" src="..."
alt=""></div>
or
<div style="text-align: center;"><img src="..." alt=""></div>
And simply fill in the dots with the name of the image file when
you want to use such a link. Useful for galleries of thumbnails.
But time consuming because you need to name each destination html
file uniquely.
If you don't want to go to the trouble of this, there is one
simple technique to get a bit of grace from pics being displayed
jammed up to the left - *if* you already prepare your own
pictures and know your plan. You can include a bit of top and
left spacing outside of the substantial image content. The
browser does not know it is being tricked. You won't get centring
this way easily, but it looks better in many browsers.
There would be other ways perhaps, using javascript or
server-side scripting and organising.