Write HTML Code for Displaying Image and Hyperlink (DWPD Sem 5 Practical 1)

This practical demonstrates how to use HTML image tag (<img>) and hyperlink tag (<a>). These are the most basic and important elements in web development and are commonly asked in exams and viva.

👉 Follow the code below to understand how images and links work in HTML.


DWPD Practical 1

Code: Index.html

HTML Code
<!DOCTYPE html>
<html>
<body>

<a href="https://suretocode.blogspot.com">
I'M Hyperlink And I can redirect you to another web address
</a>

<br>

<img src="yourImageName.jpg" alt="Image Example" width="500" height="377">

</body>
</html>

Output

HTML Image and Hyperlink Output Example

Practical Description

HTML <img> Tag

  • The <img> tag is used to display images in a web page.
  • It requires two main attributes: src (image path) and alt (alternative text).
  • This tag does not have a closing tag.
  • The src attribute specifies the image location.
  • The alt attribute displays text if the image cannot load.

HTML <a> Tag

  • The <a> tag is used to create hyperlinks.
  • It allows users to navigate from one page to another.
  • The href attribute defines the destination URL.

Why This Practical is Important

Understanding images and hyperlinks is the foundation of web development. Every website uses images and links to improve navigation and user experience. Mastering these basics helps you build real-world websites and score better in exams.


💡 Share This Practical

If this helped you, share it with your classmates and help them learn faster.

Comments