Need help with Lesson 9: Images
Page 1 of 1
Need help with Lesson 9: ImagesHi,
first of all, im new here and this site is the best since i had extremely minimal knowledge of HTML. it covers most things but I have a question.
on Lesson 9 example 1, it says <img src="david.jpg" alt="David" />
what exactly does the alt="David" bit do?
I am working offline and have an image on the desktop called vanpersie. I have therefore entered the following between the body text tags:
<img src="vanpersie.jpg" alt="vanpersie" />
if i save and refresh firefox, all i can see is the text 'vanpersie'.
I also have a link as follows:
<p><a href="page2.html">click here to go to page 2</a></p>
and that automatically detects 'page2' as being on the desktop so i dont understand why the image is not being taken from the desktop. I have checked the image name is identical and it is is a .jpg in the image properties.
Any help would be appreciated.
Re: Need help with Lesson 9: Imagesalt="David"
code means that if the image not load then alternate text shows in the place of image like in your case it is showing.
2nd benefit of an alt attribute is when google and other search engine visit your website they do not know what's in this image and they just index the alt text in their database.
make a folder in your desktop and put all files in that folder try try again and do not add spaces in file name or in image name.
Re: Need help with Lesson 9: ImagesHi,
thanks for the help. I dont know why it wasnt showing up before, i tried again today and it works fine.
maybe its because i moved the image into the folder while i was editing the HTML file?
Re: Need help with Lesson 9: Imagesyah maybe but i am happy that its works now move on to next lectures and happy learning !
Page 1 of 1