Write an HTML document, which is making an image as a hyperlink to another document, which contains enlarged part of the same image.
Answers
Answer:
You can achieve this in two way.
Using only HTML
Using HTML + JavaScript
Since you asking for the HTML solution, I’ll explain the first (pure HTML) solution.
If I’m not wrong, “hyperlink to another document” means you have another HTML file containing the enlarged image. So, what you have to do is just wrap the <img/> tag with <a> tag and link that tag with your second HTML page which contains the enlarged image.
In your first HTML page,
<a href="enlarged_image.html">
<img src="small_image.png" alt="My Small Image" />
</a>
I suppose your second HTML page (enlarged_image.html) looks like this:-
- <div>
- <img src="large_image.png" alt="My Large Image" />
- </div>
You can achieve this in two way.
Using only HTML
Using HTML + JavaScript
Since you asking for the HTML solution, I’ll explain the first (pure HTML) solution.
If I’m not wrong, “hyperlink to another document” means you have another HTML file containing the enlarged image. So, what you have to do is just wrap the <img/> tag with <a> tag and link that tag with your second HTML page which contains the enlarged image.
In your first HTML page,
<a href="enlarged_image.html">
<img src="small_image.png" alt="My Small Image" />
</a>
I suppose your second HTML page (enlarged_image.html) looks like this:-
- <div>
- <img src="large_image.png" alt="My Large Image" />
- </div>