Easy To Learning
  • Login
  • Sign Up
  • Q&A
  • Home
  • Php Tutorial
  • MySql Tutorial
  • Object-Oriented Programming
  • Java Tutorial
  • HTML Tutorial
  • React JS Tutorials
  • Free Projects
  • Blogs & Articles
  • Others
    • About Us
    • Contact Us
HTML Image
Easy To Learning

Education Needs Complete Solution

Online Ask Question Question And Answer
  1. Home
  2. HTML Tutorials
  3. HTML Image

HTML Tutorial

Basic HTML Fundamentals

  • HTML Table Content
  • Introduction To HTML
  • What Is HTML
  • HTML Tags
  • HTML Formatting
  • HTML Heading
  • HTML Paragraph
  • HTML Anchor
  • HTML Image
  • HTML Table
  • HTML Lists
  • HTML Ordered List
  • HTML Unordered List
  • HTML Description List
  • HTML Form

HTML Tags

  • Marquee HTML
  • HTML Textarea
  • HTML Quotes
  • HTML Style
  • HTML Title Or HTML Doctype
  • HTML Div Tag
  • HTML Pre Tag
  • HTML Code Tag
  • HTML Label Tag
  • HTML Input Tag
  • HTML Button Tag
  • HTML Hr Tag
  • HTML Br Tag
  • HTML Script Tag
  • HTML NoScript Tag
  • HTML Bold Tag

HTML Image

HTML Image

The HTML img tag is used to display an image on the web page. The HTML img tag is an empty tag that contains attributes only, closing tags are not used in the HTML image element.

Image Tag

Example of HTML image.

<h2>HTML Image Example</h2> 
<img src="http://www.easytolearning.com/images/logo.png" alt="Easytolearning Logo"/> 

Output:

Html Image Example

Easytolearning Logo


The src and alt are important attributes of the HTML img tag. All attributes of the HTML image tag are given below.

src

It is a necessary attribute that describes the source or path of the image. It instructs the browser where to look for the image on the server.

The location of the image may be on the same directory or another server.

alt

The alt attribute defines an alternate text for the image if it can't be displayed. The value of the alt attribute describes the image in words. The alt attribute is considered good for the SEO perspective.

width

It is an optional attribute that is used to specify the width to display the image. It is not recommended now. You should apply CSS in place of width attribute.

height

It specifies the height of the image. The HTML height attribute also supports iframe, image and object elements. It is not recommended now. You should apply CSS in place of height attribute.

Supporting Browsers

Element  Chrome  IE  Firefox  Opera  Safari
<h1> to <h6> Yes Yes Yes Yes Yes

 

HTML Images Tag Uses

  • Use the HTML <img> element to define an image
  • Use the HTML src attribute to define the URL of the image
  • Use the HTML alt attribute to define an alternate text for an image, if it cannot be displayed
  • Use the HTML width and height attributes to define the size of the image
  • Use the CSS width and height properties to define the size of the image (alternatively)
  • Use the CSS float property to let the image float
  • Use the HTML <map> element to define an image-map
  • Use the HTML <area> element to define the clickable areas in the image-map
  • Use the HTML <img>'s element use map attribute to point to an image-map
  • Use the HTML <picture> element to show different images for different devices

HTML Image Tags

Tag Description
<img> Defines an image
<map> Defines an image-map
<area> Defines a clickable area inside an image-map
<picture> Defines a container for multiple image resources
Series: HTML Tutorials Hub
All Topics
Free Download Projects
Previous Chapter
Next Chapter

Ask a Question

Have a coding query or doubt? Ask here and get help from our community.

500 characters remaining
Submitting...
Free Download Projects
Join Telegram Group Join WhatsApp Group
Related Topics:
html image link html image center how to insert background image in html how to insert image in html using notepad img src url hyperlink image html html image link to url html image size percent

Member Sign In

Forgot?
Signing in...

Don't have an account? Register here

Create Free Account

Register Captcha
Registering...

Already have an account? Sign In

Ask a Question

500 characters remaining
Submitting...

About Easy To Learning

Easy To Learning is a comprehensive programming learning portal offering free, practical, developer-driven tutorials for PHP, Java, Python, Spring, MySQL, CSS, Bootstrap, CakePHP, and more.

Explore community-contributed questions and answers, and download ready-to-run source code projects.

Quick Links

  • Home
  • Questions & Answers
  • Download Projects
  • Blog & Articles
  • Member Login

Community

  • Telegram Group
  • WhatsApp Community
  • Ask a Question
  • Join as Member

Connect With Us

Stay updated with our newest programming tutorials and free open source projects.

© 2026 Easy To Learning. All Rights Reserved.