"I am Saqib Jahangir. A passionate vlogger, software engineer, and avid traveler with a deep love for exploring the hidden gems of our beautiful planet. With a strong foundation in Application Development, Application Architecture & Database Design and Product Management, I bring over a decade of hands-on experience building secure, scalable, and resilient web applications for a diverse range of industries."

Images

 Images are an essential part of any web page, helping to make the content more engaging and visually appealing. In HTML, we use the <img> tag to display images.

🔹 Basic Syntax:

<img src="image-path" alt="description">

·         src: (source) The path or URL to the image file.

·         alt: (alternative text) A description of the image that is shown if the image can't load or for screen readers (important for accessibility).

🧪 Example:

Let’s say you have a file called flower.jpg inside the htdocs folder of XAMPP or www folder in WAMP:

<img src="flower.jpg" alt="A beautiful flower">

This will display the image on your page.

💡Tip: Make sure the image file is in the same folder as your HTML file, or provide the correct path.

🌐 Using Online Images:

You can also use images hosted online:

 
<img src="https://example.com/images/cat.jpg" alt="A cute cat">

️ Optional Attributes:

·         width and height: To resize images.

 
<img src="flower.jpg" alt="Flower" width="300" height="200">

·         title: Shows a tooltip when you hover over the image.

 
<img src="flower.jpg" alt="Flower" title="Click to enlarge">

 

Popular Posts

Setting Up Your First Project Folder and Installing XAMPP or WAMP

Frontend vs Backend vs Full Stack