Login | Register | FAQ
Anonymous

Need help with Lesson 9: Images

+ Post a reply

Page 1 of 1


Need help with Lesson 9: Images

by Amit » Sun Jun 03, 2012 6:03 pm

Hi,

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.

Thanks.
User avatar

Amit

  • Posts: 2
  • Joined: Sun Jun 03, 2012 5:48 pm

Re: Need help with Lesson 9: Images

by XainPro » Sun Jun 03, 2012 6:20 pm

alt="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.
User avatar

XainPro

  • Posts: 3311
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Need help with Lesson 9: Images

by Amit » Sun Jun 10, 2012 8:42 pm

Hi,
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?
User avatar

Amit

  • Posts: 2
  • Joined: Sun Jun 03, 2012 5:48 pm

Re: Need help with Lesson 9: Images

by XainPro » Mon Jun 11, 2012 12:16 pm

yah maybe but i am happy that its works now move on to next lectures and happy learning !
User avatar

XainPro

  • Posts: 3311
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1