You are either not logged in or not registered with our community. Click here to register.
 
January 23, 2018, 11:37:13 PM

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Click here if you are having problems.
Default Wide Screen Beige Lilac Rainbow Black & Blue October Send us your theme!

Wiki Blogs Dicebot

Author Topic: BB Code img labels?  (Read 231 times)

0 Members and 1 Guest are viewing this topic.

Offline BlastingCapTopic starter

BB Code img labels?
« on: October 03, 2017, 08:30:46 AM »
I looked through the tutorials on BB code, and I'm wondering if there is a way to do either of the following:

1) Add a caption to an image that is embedded with the img code, or
2) make a label appear upon hovering over the embedded image

I figure that 1 is probably unlikely, but I did some digging and found that you can add meta data to an img with the title="text here" code within the img brackets. However, I have been unable to get this to work, so I'm wondering if it's not supported. I can achieve the same result with a table, but I was wondering if there was a more elegant way of doing it.

Anyone a little more familiar with BB code than I am?

Offline Avis habilis

Re: BB Code img labels?
« Reply #1 on: October 03, 2017, 08:36:30 AM »
You can kludge a hover text for an image by wrapping it in an [ acronym ] tag. For instance, this:




is created with this code:

[ acronym="Man sticking his head in a giant mug of coffee" ][ img]https://i.imgur.com/jHBCvQr.jpg[/img ][/acronym ]

Offline BlastingCapTopic starter

Re: BB Code img labels?
« Reply #2 on: October 03, 2017, 08:37:48 AM »
Definitely the option number 2 I was looking for. Thanks Avis!

Now to decide if I want to go with the caption/table idea or the hover.

Offline Avis habilis

Re: BB Code img labels?
« Reply #3 on: October 03, 2017, 09:03:40 AM »
Glad I could help.

Offline NightLux

Re: BB Code img labels?
« Reply #4 on: October 03, 2017, 01:21:26 PM »
Definitely the option number 2 I was looking for. Thanks Avis!

Now to decide if I want to go with the caption/table idea or the hover.

The table would look something like this:

Man sticking his head in a giant mug of coffee


Code: [Select]
[table]
[tr][td][img]https://i.imgur.com/jHBCvQr.jpg[/img][/td][/tr]
[tr][td][center]Man sticking his head in a giant mug of coffee[/center]
[hr][/td][/tr]
[/table]

I added the horizontal row since tables in BBCode are borderless but you could just as easily remove that entirely.  And I just centered the text - it could be formatted however you want.

Offline Kyrsa

Re: BB Code img labels?
« Reply #5 on: October 03, 2017, 02:08:57 PM »
You can also do something like this using BBcode without the table if you are floating the image.

Man sticking his head in a giant mug of coffee

Code: [Select]
[floatleft][img padding=10]https://i.imgur.com/jHBCvQr.jpg[/img] [center]Man sticking his head in a giant mug of coffee[/center] [/floatleft]

Offline BlastingCapTopic starter

Re: BB Code img labels?
« Reply #6 on: October 04, 2017, 06:37:38 AM »
That may work better than my table method, Kyrsa. It does the same thing and it's a lot less BB code to use. Thanks!

Offline Kyrsa

Re: BB Code img labels?
« Reply #7 on: October 04, 2017, 10:52:40 AM »
You're welcome!