Welcome to WebmasterWorld Guest from 54.226.246.160

Forum Moderators: incrediBILL

Message Too Old, No Replies

how to center a photo, back to previous page button, and add text

how to center a photo, back to previous page button, and add text

     

yetoyeto

9:58 am on Aug 25, 2011 (gmt 0)

5+ Year Member



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<a href="http://www.example.com/image2.JPG">
<img src="http://www.example.com/image1.JPG">
</a>

I have the above code working but I would like when a customer clicks on image1 -- image2 will open in the center of the page (not using css but something like <center></center> or align="middle"). Also, I would like for a (Back to Previous Page) button to show when image2 opens and I would also like to be able to have some text. So basically when image2 opens I would like the customer to see the photo centered, a "Back to Previous Page" button, and some text.

<INPUT TYPE="button" VALUE="Back to Previous Page" onClick="history.go(-1);">

Thanks in advance for any help,
yeto

Sub_Seven

6:31 am on Aug 29, 2011 (gmt 0)

5+ Year Member



Hey there...

One thing, if you link directly to the image file you wont be able to assign attributes to the image (to center it for example), it will just be displayed by the browser as is.

Having said that, this is probably what you need, inline css in it but seems to be a quick way to make it

index.html:


<html>
<head>
</head>
<body>
<a href="page.html"><img src="image1.jpg" /></a>
</body>
</html>


page.html (the page holding the image and back link):


<html>
<head>
</head>
<body>
<p style="text-align: center;"><img src="image2.jpg" /></p>
<p style="text-align: center;"><a href="index.html">Back to previous page</a></p>
</body>
</html>


Hope that helps a little :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month