October 14, 2019, 02:54:48 am

News:

Go to HostNed.com
Welcome.  This is a place to get user-to-user support, learn more, and share ideas.  If you can't find your answers here, feel free to ask by creating a new topic or visit the support ticket system at https://my.hostned.com :)  Have fun here!


How To Use ALT Tags In BBCode

Started by Dynaweb, April 09, 2015, 02:14:43 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dynaweb

April 09, 2015, 02:14:43 am Last Edit: April 09, 2015, 02:22:32 am by Dynaweb
One criticism of BBCode is that it does not support alt tags for images (yes, properly the alt attribute, I know).  The alt is notoriously kind for SEO purposes and also for impaired visitors.

Well, I was toying around in the forum and discovered a way to make it work.  A bit of a little hack really.

Here is the format:

[img alt=here-is-the-alt]http://upload.wikimedia.org/wikipedia/commons/d/d6/ISO_639_Icon_alt.svg[/img]

And here it is parsed below...

here-is-the-alt

If you inspect the code of the page you will see the alt attribute is present.  Do not add quotes and use dashes or underscores (although you MIGHT be able to get away with spaces in some cases).  I can confirm this works on SMF BBcode, but have not tested elsewhere.