@Harald Eilertsen I’ve just finished a test session… with ‘x’ variations. Based on my tests, I’ve found that the ‘alt’ attribute has no effect whatsoever, at least on my hubs. The ‘title’ attribute must be used as the alt text. That way, it works.
I’ve just had a look at the source code of my test posts. AND: Yes, the `alt` attribute does what it’s supposed to do and inserts the `alt` attribute correctly into the HTML. It was simply a misunderstanding.
You mean the actual HTML ‘alt’ attribute, which contains text that is displayed if the actual image cannot be shown. I think you can set it correctly using ‘alt=’ in Hubzilla. So it will work after all.
However, by “alttext” we actually mean this pop-up text, because that’s what’s now commonly used in everyday language for image descriptions. And for that, “alt” doesn’t work – only “title” does.
A communication problem due to differing definitions.
It really would be better not to write or say “alttext” for image descriptions, but to actually use “image description”.
Have a look online: there are now quite a few “alt-text bots” that are actually “image description bots”.
@Der Pepe (Hubzilla) ⁂ Terms can be confusing, but the two attributes have different meaning for a reason.
The alt attribute is the one being used by screen readers to provide image descriptions to blind or visually impaired people.
The title attribute however is a global attribute meant to provide additional info about whatever element it's attached to. This is typically shown as a tooltip when hovering over the element.
Most screen readers will fall back to the title if the alt attribute is not present, but it's not safe to rely on that. The attributes are distinct and has a different purpose for a reason.
I’ve just been looking into this topic in more detail, particularly in relation to Mastodon.
When you attach an image with a caption on Mastodon, both the `alt` and `title` attributes are set to that text. This means that when the image is imported into Hubzilla, the text description is also displayed as a title pop-up.
If you add a description to an image on Hubzilla by placing it between the [zmg][/zmg] tags (the usual method), i.e.
[zmg=<IMAGE_URL>]<IMAGE_DESCRIPTION[/zmg]
Hubzilla behaves in exactly the same way as Mastodon, inserting the description using both the alt attribute AND the title attribute.
When this reaches Mastodon, the image description is also flagged and displayed accordingly.
If, on Hubzilla, you insert the image description within the [zmg=] tag, the image description is added as the alt attribute, but no pop-up appears because the title attribute is not set. On the receiving end, e.g. on Mastodon, the alt text is flagged and displayed.
So, if you want an image description on Hubzilla not only to be present but also to be visible as a pop-up, the “usual method” is the better choice. If it’s really just about the image description and you don’t want a huge pop-up to appear for “epic image descriptions”, then use the option with the alt attribute within the [zmg=] tag.
The example from @𝓒𝓱𝓻𝓲𝓼 above does not set the correct html alt attribute:
Don't confuse the alt attribute with the title which is the one that pops up when you hover over the image.
I’ve just had a look at the source code of my test posts. AND: Yes, the `alt` attribute does what it’s supposed to do and inserts the `alt` attribute correctly into the HTML.
It was simply a misunderstanding.
< img class="zrl" style="width:50px;height:50px;max-width:10%;" alt="Bilde/fotografi" title="Alt Text" src="https://klacker.org/photo/cd747cd9-3f05-42cd-94cc-91c7368c5a18-2.png" / >
Ah, OK... we’re using different terms here.
You mean the actual HTML ‘alt’ attribute, which contains text that is displayed if the actual image cannot be shown. I think you can set it correctly using ‘alt=’ in Hubzilla. So it will work after all.
However, by “alttext” we actually mean this pop-up text, because that’s what’s now commonly used in everyday language for image descriptions. And for that, “alt” doesn’t work – only “title” does.
A communication problem due to differing definitions.
It really would be better not to write or say “alttext” for image descriptions, but to actually use “image description”.
Have a look online: there are now quite a few “alt-text bots” that are actually “image description bots”.
The alt attribute is the one being used by screen readers to provide image descriptions to blind or visually impaired people.
The title attribute however is a global attribute meant to provide additional info about whatever element it's attached to. This is typically shown as a tooltip when hovering over the element.
Most screen readers will fall back to the title if the alt attribute is not present, but it's not safe to rely on that. The attributes are distinct and has a different purpose for a reason.
I’ve just been looking into this topic in more detail, particularly in relation to Mastodon.
When you attach an image with a caption on Mastodon, both the `alt` and `title` attributes are set to that text. This means that when the image is imported into Hubzilla, the text description is also displayed as a title pop-up.
If you add a description to an image on Hubzilla by placing it between the
[zmg][/zmg]tags (the usual method), i.e.[zmg=<IMAGE_URL>]<IMAGE_DESCRIPTION[/zmg]Hubzilla behaves in exactly the same way as Mastodon, inserting the description using both the alt attribute AND the title attribute.
When this reaches Mastodon, the image description is also flagged and displayed accordingly.
If, on Hubzilla, you insert the image description within the
[zmg=]tag, the image description is added as the alt attribute, but no pop-up appears because the title attribute is not set. On the receiving end, e.g. on Mastodon, the alt text is flagged and displayed.So, if you want an image description on Hubzilla not only to be present but also to be visible as a pop-up, the “usual method” is the better choice. If it’s really just about the image description and you don’t want a huge pop-up to appear for “epic image descriptions”, then use the option with the alt attribute within the
[zmg=]tag.[img=https://klacker.org/photo/cd747cd9-3f05-42cd-94cc-91c7368c5a18-2.png]Bilde/fotografi[/img]settings for width and height have no effect :-(
Bilde/fotografi