ALT attribute!


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

  src= alt= A brown bear />


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


I just changed that, it still is not showing up


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


haha I did that too:(


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


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


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.


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


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.


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