ALT attribute!


#1


https://www.codecademy.com/courses/learn-html-css/lessons/common-elements/exercises/img-alt?action=lesson_resume


I added an ALT attribute to caption the picture for for some reason it is not showing up and I am pretty sure I did it right


<img
  src=https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg alt= A brown bear />


#2

Should have quotes around your alt atributes value. alt="A brown bear"


#3

I just changed that, it still is not showing up


#4

Oh, the src attribute value needs to be in quotes as well.


#5

haha I did that too:(


#6

Well, you don't actually see alt attributes when you add them. They are used for devices like screen readers.


#7

no it should be a caption under the picture, I typed it wrong one time and the caption showed up but the picture disappeared


#8

If there is a caption under your picture with the alt tag in place then you have done something wrong. Trust me, you are not supposed to actually see alt tags. If an alt tag appears then your src link is probably broken.


#9

but the instructions said the alt tag is made for people who are visually impaired or something, or if you're picture doesn't show up people can read the caption and read what the picture was, how are you suppose to do that is the alt tag isn't there haha


#10

Screenreaders are smart enough to read from the html and find alt tags without needing to visually see them on a page. And yes, if the picture has an error and is unable to render then the alt tag will appear as to give the user information on what the image would have represented.

If you want an actual caption try using something like figure's figcaption.
http://www.w3schools.com/tags/tag_figcaption.asp


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.