9/15 HTML Where do I put the alt text attribute within the image code?


Hi All-
I'm working on exercise 9/15 in the html intro section, where it is asking us to insert the alt text attribute into the photo link. Where do we insert it into the image link? at the beginning, middle, end? The sample they give is presented out of context, so it's hard to tell exactly where to put the alt text attribute in the image link. Here is the link to the exercise in question:




There is no steadfast rule about order of attributes. An element is an object, and its attributes have no definitive order, so can be written in any way.

<img alt="" src="">

is the same as,

<img src="" alt="">


There are some popular HTML style guides that can help you make these sorts of decisions.

For example, you might want to look at:




These are only guidelines, and as you get more experienced you will become more confident in deciding when (and when not) to follow them.

Moreover, if you are coding as part of a team, it is very likely that the team will have agreed some coding style guidelines at the beginning of the project.


The best guide is your own intuition. Form good habits and the rest will follow. Consistency is what makes for a readable writing style. We have two readers... The computer and whatever API's are involved; and, the reader, a human trying to make sense of our code.