How to Insert An Image in HTML

how to add images in html
<!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.

Leave a Comment

Your email address will not be published. Required fields are marked *