In this article, we will look at how to insert an image in HTML. Make sure the image to be loaded is in the same folder as the html code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Html images</title>
</head>
<body>
<h2>Html images</h2>
<img src="altum.jpg" alt="Description of the image" width="300" height="200" style="border: 1px solid #ddd;">
</body>
</html>
Here is the output below
You can also load an image from another source somewhere on the web as shown below.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Html images</title>
</head>
<body>
<h2>Html images</h2>
<img src="https://www.cars.com/images/car.jpg" alt="car" />
</body>
</html>
There you have it. Happy coding.