You will learn more about images and the <img> tag later in this tutorial.

alt Attribute:-

The alt attribute specifies an alternative text to be used, when an image cannot be displayed. The value of the attribute can be read by screen readers. This way, someone “listening” to the webpage, e.g. a blind person, can “hear” the element.

<img src=”s1school.jpg” alt=”s1school.jpg” width=”104″ height=”142″>

suggestion:- Use Lowercase Attributes

The HTML5 standard does not require lowercase attribute names. The title attribute can be written with uppercase or lowercase like title or TITLE.

At s1school we always use lowercase attribute names.

Suggestion:- Quote Attribute Values

The HTML5 standard does not require quotes around attribute values. The href attribute,

demonstrated above, can be written as:-

<a href=https://www.s1school.net>

Sometimes it is necessary to use quotes. This example will not display the title attribute correctly, because it contains a space. Using quotes are the most common. Omitting quotes can produce errors.

At W3Schools we always use quotes around attribute values.

<p title=About s1school>

what is Single or Double Quotes?

Double quotes around attribute values are the most common in HTML, but single quotes can also be used.In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes:-

<p title=’WEb “designer” ali’>

or

<p title=”web ‘designer’ ali”>

HTML Attributes:-

Attribute

Description

alt

Specifies an alternative text for an image, when the image cannot be displayed

disabled

Specifies that an input element should be disabled

href

Specifies the URL (web address) for a link

id

Specifies a unique id for an element

src

Specifies the URL (web address) for an image

style

Specifies an inline CSS style for an element

title

Specifies extra information about an element (displayed as a tool tip)