To add a photo to an HTML document, you can use the <img> tag, which stands for "image." Here's the basic example for the <img> tag:
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<h1>Welcome to my webpage</h1>
<img src="images/my-image.jpg" alt="A beautiful mountain landscape">
</body>
</html>
Explanation: In the code above, the <img> tag is used to insert an image with the source file "image.jpg". The alt attribute provides a description of the image that is displayed if the image fails to load or if the user is using a screen reader.
Note: You can replace "image.jpg" with the URL or file path of the image you want to display on your webpage.
Tags:
HTML code