w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



img src attribute

The src attribute on the img element:

Examples

<imgattribute="value(s)" >Examples
7.src=URL<img src="images/puppy.jpg" alt="a grey puppy in the middle of a room"> (relative path)
<img src="http://www.domaine.com/images/puppy.jpg" alt="a grey puppy .."> (absolute path)

Video demonstration img src attribute

HTML5 img src attribute Tutorial

min video details
00:02 src attribute on img: video tutorial
00:08 the src attribute represents the source of the image you want to embed into your page = the path of the image

this attribute is required !!
00:21 in this case the value of the src attribute WHICH REPRESENTS THE PATH corresponds with the name of the image because both the html file (index.php) and the image are located in the same place = on desktop
00:32 the path of the image is correct → the image has been successfully embedded into our html page
00:40 moving the image from desktop to a folder called "images" without changing the path of the image in our code
01:49 the image does not display because the path is not correct: src="sky.jpg" instead of src="images/sky.jpg"
01:59 the path is correct → the image is displayed again
img intro img optional img occurrences img browser display img parents server-side image map (ismap) vs client-side image map (usemap) img syntaximg alt attributeimg ismap attributeimg usemap attributeimg width, height attributesimg accesskey attributeimg class attributeimg draggable attributeimg hidden attributeimg id attributeimg lang attributeimg style attributeimg tabindex attributeimg title attributeimg translate attribute