0% found this document useful (0 votes)
30 views

SRC Alt Width Height : "Sample - JPG" "Sample Image" "100" "100"

The document defines how to add images to HTML using the <img> tag and describes its attributes. The <img> tag uses the src attribute to specify the image path, the alt attribute provides image description, and the width and height attributes set the image dimensions. Attributes in general provide additional information for HTML elements and consist of attribute name-value pairs that can be surrounded by single or double quotes. The title attribute adds a tooltip when hovering over an element.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

SRC Alt Width Height : "Sample - JPG" "Sample Image" "100" "100"

The document defines how to add images to HTML using the <img> tag and describes its attributes. The <img> tag uses the src attribute to specify the image path, the alt attribute provides image description, and the width and height attributes set the image dimensions. Attributes in general provide additional information for HTML elements and consist of attribute name-value pairs that can be surrounded by single or double quotes. The title attribute adds a tooltip when hovering over an element.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Images:

We can define images by using <img> tag. Image tag contains the below
attributes.
1) Src : We need to give the path of the image. The path can be
absolute or relative path.
2) Alt : This attribute is used to give some description about the image.
When the image is not available or not properly loaded in the
browser then this text will be displayed.
3) Width : It defines the width of the image.
4) Height: It defines the height of the image.
Example:

<img src="sample.jpg" alt="sample image" width="100" height="100"/>


Attributes:
1. Attributes provide additional information to the html elements.
2. Different html elements have different attributes. Some attributes
are specific to some html elements.
3. Attributes will be used with key value pair.
Ex: AttributeName = value
4. Attribute value can be surrounded with either single quote or double
quotes.
Examples:
Title: This attribute adds title to the html element. Whenever we hover on
a html element a tool tip will appear.

You might also like