Image

The HTML img element is used to embed an image in an HTML document. Images are a great way to make your web pages more visually appealing and engaging. They can also be used to convey information that would be difficult to describe with text alone.

To use the img element, you simply need to specify the URL of the image in the src attribute. You can also specify the width and height of the image in the width and height attributes, respectively. If you do not specify the width and height, the browser will use the intrinsic dimensions of the image.

The following is an example of how to use the img element:

<img src="https://www.learnwebstack.com/wp-content/uploads/2023/09/pexels-cong-h-1404819.jpg" alt="This is an image of a cat." />

The alt attribute is used to specify an alternate text for the image. This text will be displayed if the image cannot be loaded for some reason, such as if the user has a slow internet connection or if they are using a screen reader. It is important to provide meaningful alt text for all of your images, as this will make your web pages more accessible to all users.

Task

Refer to the blog article on how to upload an image to GitHub and upload an image of yours. Create an img element after the h1 element with the text Welcome to My Portfolio, add src attribute with URL of the uploaded image, and alt attribute with the text of your name.

Great! Now you have reached the stage where you have created a basic portfolio landing page showcasing your skills. Run the code to see the final results and experiment with the code to get used to it.

ADVERTISEMENT
ADVERTISEMENT