Simple image code...

Status
Not open for further replies.
Joined
Mar 23, 2007
Messages
931
Reaction score
11
Hello. I'm looking for very simple script. I'm 0 @ html.

So my idea is VERY simple. I need to make page where is picture and when you click on picture opens some link. Like in old-style ragezone (month ago). Please help me, i know it's not hard, lol. :)
 
Hello. I'm looking for very simple script. I'm 0 @ html.

So my idea is VERY simple. I need to make page where is picture and when you click on picture opens some link. Like in old-style ragezone (month ago). Please help me, i know it's not hard, lol. :)

Open page in current window XHTML example
<a href="mypage.html" target="_self"><img src="mypicture.jpg" alt="A example picture" /></a>

Open page in new window XHTML example
<a href="mypage.html" target="_blank"><img src="mypicture.jpg" alt="A example picture" /></a>

Open page in new window XHTML + JavaScript example
<img src="mypicture.jpg" alt="A example picture" onClick="JavaScript:window.open('mypage.html','_self')" />

Open page in current window XHTML + JavaScript example
<img src="mypicture.jpg" alt="A example picture" onClick="JavaScript:window.open('mypage.html','_new')" />

As you can see there are multiple ways to achieve your goal. Try to find what suits best in your situation, one of the main differences between the XHTML and XHTML + Javascript examples is that without the JavaScript you will get a banner around your picture. This of course you can get rid of by using invalid XHTML (or in other words HTML) or CSS.
 
Last edited:
Using dreamweaver's features is a good way to learn html
That or just view source on random small pages (larger ones get confusing)
Look how it's put together and modify it to fit your needs. Pretty soon you'll be able to do it from scratch yourself
 
Status
Not open for further replies.
Back