homepage Welcome to WebmasterWorld Guest from 50.16.165.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
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




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

<!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




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

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 :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved