Really simple image caption
Tuesday, 7. July 2009, 21:04:03
Caption text
Caption text
Caption textRegular My Opera blog posts don't support captions under the images, even though it would be easy as pie to implement. So I finally got around to making my own codes.
<span class="rightcaption"> [IMG=http://files.myopera.com/drlaunch/thelaunchsite/banner.gif] Caption text </span> <span class="leftcaption"> [IMG=http://files.myopera.com/drlaunch/thelaunchsite/banner.gif] Caption text </span> <span class="centercaption"> [IMG=http://files.myopera.com/drlaunch/thelaunchsite/banner.gif] Caption text </span>
Basically, you add a couple of span tags like those above, around the image and caption to have a caption under the image. This is useful for things like image texts, attribution of authors and image information.
In order to make them work, you'll need to add the following code to your account's custom CSS ( Account --> Design --> Custom style sheet).
.rightcaption {
float: right;
display:block;
}
.leftcaption {
float: left;
display:block;
}
.centercaption {
clear: both;
display: block;
text-align: center;
}
Oh, and the new Neo RC2 needs your feedback.









SouthernCross # 7. July 2009, 21:06
Nerak # 7. July 2009, 22:01
Furie # 8. July 2009, 00:00
I haven't used spans for much apart from dropcaps before. Presumably they support seperate backgrounds, text shadowing, fonts, etc. Everything a div can have yeah?
Class10a1 # 8. July 2009, 02:45
bugscout # 8. July 2009, 06:36
drlaunch # 8. July 2009, 09:45
A div creates a rectangle of elements and is a block element. Borders and backgrounds will follow a rectangle shape around elements in the div.
Any html tag, its class and id can be styled with any CSS. Spans, lists, tables, headings, paragraphs, you name it.
Jurgi # 8. July 2009, 10:17
Jurgi # 8. July 2009, 10:46
1) I suggest addind "text-align: center;" also to left and righ captions, looks much better.
2) Im using html instead of bbcode to put images, to achieve custom alt and totle attributes, like this:
But inserting "img" into your span code does not work correctly:
Any ideas?
3) I've achieved the same effect with no user CSS:
So no additional CSS is needed! It works axactly the same way, as yours! (but I've discovered thos thank to you).
But, again, using html instead of bbcode inside span does not work correctly. The caption tekst is placed next to image instead of under it. I have no idea how to fix it to have both caption text and alt+title atributes.
Furie # 8. July 2009, 13:17
Furie # 8. July 2009, 13:21
SqueakeyCat # 8. July 2009, 13:22
Jurgi # 8. July 2009, 15:15
Originally posted by Furie:
For 99,9% you are right (btw, should it be br or /br?).
From my previous experiences, there is another way: to put caption in bbcode, which makes br at final html code. Align or quote should work.
ellinidata # 8. July 2009, 17:40
PS
great new picture of you too!
Suntana # 9. July 2009, 03:01
So MyOpera doesn't support captions normally? Maybe that would explain why I couldn't get it to work properly when I experimented with some HTML tutorials sometime back.
Up to now, I would
drlaunch # 9. July 2009, 05:48
Furie # 9. July 2009, 11:32
ellinidata # 9. July 2009, 15:44
Thanks Doc !
drlaunch # 9. July 2009, 16:08
If you'd like the text to be centered, just add text-align: center; between the curly brackets in the CSS code you want to change.
53north # 9. July 2009, 23:19
It would be nice if opera got html to work well on the page, but even tabulation doesn't get around the 3 column page default background.
Can anyone get a marquee to run?
Even the simplest forum post page has easier html capability.