Is this more or less meaningful TO YOU than only an image element and req'd attributes? <figure> <img src="images/ennishouse.jpg alt="photo of Ennis House by architect Frank Lloyd Wright"> <figcaption>A photo of Ennis House by architect Frank Lloyd Wright</figcaption> </figure>

Apr 27, 2021 路 2:01 AM UTC

5
7
Replying to @mholzschlag
The problem with the structure is that it is too specific. The same underlying architectural form could be used for labeled equations, tables (which have a somewhat similar structure but not able to be adorned by common CSS), Scribd-like document inclusions, and other exhibits.
2
1
The structure is expressed in strict not loose markup. Strict can be thought of as formal language, loose as vernacular. If it were served as xml/xhtml, this markup should not cause a parsing error. I find that helpful to learning personally, but it is so hated by many. :)
Replying to @mholzschlag
I try to make my alt text more descriptive than my captions.
1
4
You caught a nuance, you are good! Gold star. Please explain why you do that. Adjacent alt attribute concern: text we add to social media. LinkedIn for one limits number of characters in alt attribute values.
3
2
Replying to @mholzschlag
iirc alt is a mundane descriptor of the content of the image, a caption can be anything like "look a this guy right here!".
1
1
Caught the nuance there! Why might it be wise to be more descriptive in one description vs. the other?
1
Replying to @mholzschlag
As someone who doesn't know much about semantic html, I prefer the figcaption over alt because it seems more straight forward in declaring it's purpose. I don't love the abbreviation, but I'll survive.
1
1
You just bridged semantic markup to stricter use of HTML syntax! (figure block, img inline). More rigor. One of many points of contention between HTML served as text v XHTML served as application/xhtml+xml. Error forgiveness vs. draconian error handling. (heh, she said draconian)
2
1
Replying to @mholzschlag
If I may, the example is deeply flawed. That's a caption being used as alt instead of a proper visual description for alt with caption being surfaced for everyone. Not advocating figure per say, but separation of caption and alt is critical for proper inclusion IMHO.
1