Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Punctuation on Image attributes

Should you use punctuation on Image attributes or avoid it?

         

LinkedUp

7:46 am on Jun 7, 2023 (gmt 0)



As I found different information out in the web, I thought I put this topic up for discussion here. For me personally for stuff like the title-tag, alt-attribute & caption of my pictures I never used punctuation.

How do you guys treat this topic & might there be any information directly from Google about it that may help? :)

phranque

8:25 am on Jun 7, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, LinkedUp!

there are actually several examples of proper alt attribute usage in the HTML Standard:
https://html.spec.whatwg.org/multipage/images.html#alt
they certainly use punctuation where it makes sense.

regarding title-tag, did you mean the title element for the page or the title attribute of the img element?

and what precisely do you mean regarding a "caption"?
is this descriptive text adjacent to an img element?

LinkedUp

9:24 am on Jun 7, 2023 (gmt 0)



Thanks for your quick answer and the source regarding the alt-tags!

I meant the title-attribute for the img element, so the text you get when you hover over the img.

And a caption, for us its called like that, would be a short descriptive/engaging text directly below the img, yes.

lucy24

6:01 pm on Jun 7, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just how long are your alt tags?! As in real life: use punctuation if it is necessary for the information you want to convey. In certain narrow contexts, such as an image of text (in my case, most often when I'm including an image of a book cover), let the title and alt tags use exactly the punctuation that's present in the original: "Winnie the Pooh / by A. A. Milne". In some situations it may be appropriate to let the alt include quotation marks which of course would be proper “curly quotes” (or «guillemets» or whatever is appropriate for the site’s primary language), both for esthetics and to avoid breaking the html.

A caption can be considerably longer than the alt, so why wouldn't you use punctuation if appropriate? Look at captions in print media: if it runs longer than a single line, there's bound to be some punctuation in there somewhere.