473,770 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

captioning images

I'd like to place a "caption" under an image and insert both into the flow
of text.

I'm thinking of something like this:

(Styles shown inline for readability, they would be defined as classes)

<div style="float: left; padding: 10px"><img src="some_image .jpg"><div>my
caption/credit</div></div>
<p> enough content to flow around the image....</p>

Perhaps the image container should have a margin set rather than padding,
but padding doesn't break badly in old broken browsers like NS4.

Seems like there should be a better way to do this. This is such basic
stuff!

What about inserting the image (and caption) into the flow of the paragraph?
Aren't block level elements not allowed in paragraphs?

What's the level of support for <object data="some_imag e_path"
type="image/jpg"> ? (or is that jpeg). My IE5 (win 98) ignores the image and
my Opera 7 and NS7.1 both ignore any text following the object. Haven't
checked Mac. But that doesn't seem right. I used the example here:
<http://www.w3.org/TR/html4/struct/objects.html>

And, no, I don't want to add the "caption" with photoshop!

I wasn't quite sure where to post this, I hope 3 groups isn't overkill!

Jeff
Jul 20 '05 #1
11 1809
Quoth the raven named Jeff Thies:
I'd like to place a "caption" under an image and insert both into the flow
of text.

I'm thinking of something like this:

(Styles shown inline for readability, they would be defined as classes)

<div style="float: left; padding: 10px"><img src="some_image .jpg"><div>my
caption/credit</div></div>
<p> enough content to flow around the image....</p>
Here's what I use.

..imgleft, .imgright {
float: right;
font-size: 90%;
font-style: italic;
padding: 1em;
position: relative;
text-align: center;
}
..imgleft {
float: left;
}
..imgright {
float: right;
}
<p>Blah blah blah blah blah blah blah blah blah blah blah
<span class="imgright ">
<img src="../pathto/image.jpg" alt="Appropriat e text" width="nnn"
height="nnn" /><br>This is Caption
</span>
blah blah blah blah blah blah blah blah blah blah </p>

<snip>
I wasn't quite sure where to post this, I hope 3 groups isn't overkill!


The stylesheet group would have been enough, I suppose.

--
-bts
-This space intentionally left blank.
Jul 20 '05 #2
>
I'd like to place a "caption" under an image and insert both into the flow of text.
<snip>
Here's what I use.

.imgleft, .imgright {
float: right;
font-size: 90%;
font-style: italic;
padding: 1em;
position: relative;
Well that was easy enough! Why the position: relative?

Jeff

text-align: center;
}
.imgleft {
float: left;
}
.imgright {
float: right;
}
<p>Blah blah blah blah blah blah blah blah blah blah blah
<span class="imgright ">
<img src="../pathto/image.jpg" alt="Appropriat e text" width="nnn"
height="nnn" /><br>This is Caption
</span>
blah blah blah blah blah blah blah blah blah blah </p>

<snip>
I wasn't quite sure where to post this, I hope 3 groups isn't overkill!


The stylesheet group would have been enough, I suppose.

--
-bts
-This space intentionally left blank.

Jul 20 '05 #3

"Jeff Thies" <no****@nospam. net> wrote in message
news:XU******** *********@newsr ead1.news.atl.e arthlink.net...
| I'd like to place a "caption" under an image and insert both
into the flow
| of text.
|
| I'm thinking of something like this:
|
| (Styles shown inline for readability, they would be defined as
classes)
|
| <div style="float: left; padding: 10px"><img
src="some_image .jpg"><div>my
| caption/credit</div></div>
| <p> enough content to flow around the image....</p>
|
| Perhaps the image container should have a margin set rather
than padding,
| but padding doesn't break badly in old broken browsers like
NS4.
|
| Seems like there should be a better way to do this. This is
such basic
| stuff!
|
| What about inserting the image (and caption) into the flow of
the paragraph?
| Aren't block level elements not allowed in paragraphs?
|
| What's the level of support for <object data="some_imag e_path"
| type="image/jpg"> ? (or is that jpeg). My IE5 (win 98) ignores
the image and
| my Opera 7 and NS7.1 both ignore any text following the object.
Haven't
| checked Mac. But that doesn't seem right. I used the example
here:
| <http://www.w3.org/TR/html4/struct/objects.html>
|
| And, no, I don't want to add the "caption" with photoshop!
|
| I wasn't quite sure where to post this, I hope 3 groups isn't
overkill!
|
| Jeff
|

Jeff,

Why don't you just place a <br> between the image and caption and
get rid of the caption div? It worked for me on a sample I did.
It also validates strict 4.01 and looks ok in my browsers (IE6,
NN7.1, Moz1.4, & Opera 7.11).

http://webpages.charter.net/rwtest/s...ge_caption.htm

hth
--
Chet
ng******@NOchar terSPAM.net (remove NO.....SPAM)
Jul 20 '05 #4
> | I'd like to place a "caption" under an image and insert both
into the flow
| of text.
|
| I'm thinking of something like this:
|
| (Styles shown inline for readability, they would be defined as
classes)
|
| <div style="float: left; padding: 10px"><img
src="some_image .jpg"><div>my
| caption/credit</div></div>
| <p> enough content to flow around the image....</p>
|
| Perhaps the image container should have a margin set rather
than padding,
| but padding doesn't break badly in old broken browsers like
NS4.
|
| Seems like there should be a better way to do this. This is
such basic
| stuff!
|
| What about inserting the image (and caption) into the flow of
the paragraph?
| Aren't block level elements not allowed in paragraphs?
|
| What's the level of support for <object data="some_imag e_path"
| type="image/jpg"> ? (or is that jpeg). My IE5 (win 98) ignores
the image and
| my Opera 7 and NS7.1 both ignore any text following the object.
Haven't
| checked Mac. But that doesn't seem right. I used the example
here:
| <http://www.w3.org/TR/html4/struct/objects.html>
|
| And, no, I don't want to add the "caption" with photoshop!
|
| I wasn't quite sure where to post this, I hope 3 groups isn't
overkill!
|
| Jeff
|

Jeff,

Why don't you just place a <br> between the image and caption and
get rid of the caption div? It worked for me on a sample I did.
It also validates strict 4.01 and looks ok in my browsers (IE6,
NN7.1, Moz1.4, & Opera 7.11).
Thanks Chet. I think I did that so I could set the margin between the image
the caption. But thinking of that now, I realize I can just set the margin
on the image!

Cheers,
Jeff

http://webpages.charter.net/rwtest/s...ge_caption.htm

hth
--
Chet
ng******@NOchar terSPAM.net (remove NO.....SPAM)

Jul 20 '05 #5
Jeff Thies wrote:
What's the level of support for <object data="some_imag e_path"
type="image/jpg"> ? (or is that jpeg). My IE5 (win 98) ignores the image and
my Opera 7 and NS7.1 both ignore any text following the object. Haven't
checked Mac. But that doesn't seem right. I used the example here:
<http://www.w3.org/TR/html4/struct/objects.html>


You need to end your object element, text inside it is treated something
like the alt attribute of the image element. For instance:
<object data="foo.jpg" type="image/jpeg">Alternate
text</object>Followin g text
Jul 20 '05 #6
Jeff Thies wrote:
I'd like to place a "caption" under an image and insert both into the flow
of text.

<div style="float: left; padding: 10px"><img
src="some_image .jpg"><div>my caption/credit</div></div>
<p> enough content to flow around the image....</p>
That's more or less what I'd do. You probably want to set a width on the
<div> though.
What about inserting the image (and caption) into the flow of the
paragraph? Aren't block level elements not allowed in paragraphs?
You can set 'display:inline-block' on the <div>, but AFAIK that only works
in Opera.
What's the level of support for <object data="some_imag e_path"
type="image/jpg"> ? (or is that jpeg).
Good in most browsers, bad in IE/Win.

And yes, it should be 'image/jpeg'. The list of all registered media types
is here: http://www.iana.org/assignments/media-types/
My IE5 (win 98) ignores the image and
.... see!
my Opera 7 and NS7.1 both ignore any text following the
object.


And so they should. The <object> element works like this:

<object data="blah" type="foo/bar">
<p>This stuff is only displayed if the object can't be loaded.</p>
</object>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Jul 20 '05 #7
In article Chet wrote:
Jeff,

Why don't you just place a <br> between the image and caption and
get rid of the caption div? It worked for me on a sample I did.
It also validates strict 4.01 and looks ok in my browsers (IE6,
NN7.1, Moz1.4, & Opera 7.11).

http://webpages.charter.net/rwtest/s...ge_caption.htm


And if you want to change it later so that image is centered and caption
left-aligned?
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #8

"Lauri Raittila" <la***@raittila .cjb.net> wrote in message
news:MP******** *************** *@news.cis.dfn. de...
|
| And if you want to change it later so that image is centered
and caption
| left-aligned?
|
| --
| Lauri Raittila <http://www.iki.fi/lr>
<http://www.iki.fi/zwak/fonts>
| Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on
yksityinen
| tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.
|

Lauri,

I updated my sample with the captions aligned center, left and
right for you.

http://webpages.charter.net/rwtest/s...ge_caption.htm

hth
--
Chet
ng******@NOchar terSPAM.net (remove NO.....SPAM)
Jul 20 '05 #9
Chet wrote:
Why don't you just place a <br> between the image and caption and
get rid of the caption div?

Lauri:
And if you want to change it later so that image is centered and caption
left-aligned?

Chet:
I updated my sample with the captions aligned center, left and
right for you.

http://webpages.charter.net/rwtest/s...ge_caption.htm


And did you use <br> between image and caption?
</question class="rhetoric al">

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2365
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some patch updating worked fine and showed the pictures. Now the pictures no longer show when looking at the source code the absolute path of the file is correct but will not display the image. I tried it on another 2000 adv svr and the script worked...
11
1786
by: Jeff Thies | last post by:
I'd like to place a "caption" under an image and insert both into the flow of text. I'm thinking of something like this: (Styles shown inline for readability, they would be defined as classes) <div style="float: left; padding: 10px"><img src="some_image.jpg"><div>my caption/credit</div></div> <p> enough content to flow around the image....</p>
3
1588
by: Wraith Daquell | last post by:
Hello all! I'm trying (read: becoming frustrated) to write a DVD viewer in VB.NET. I can embed the DVD picture using DirectX technology, but it seems to be impossible to obtain closed captioning from the DVD and convert it to a string. There were a few tips on getting the captioning in the MSDN, I know, but they were rather cryptic (unusual) and didn't convert the captioning to a string. If there is anyone who can help me, or even just...
3
3829
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a nutshell when testing my ASP.NET (localhost) apps images randomly don't load on the page. Examining the IIS logfile shows the missing images give 401 or 403 errors. Here's an example - 10:15:47 127.0.0.1 GET...
2
1495
by: Clancy | last post by:
Hello to all. I just finished my first web development class so now I have a little knowledge and could be considered dangerous. I have no real clue on how to make this idea work but it sure seems feasible and would immensely appreciate any assistance or direction to make this happen. What I want to happen is to have the user have the ability to turn an IFRAME, ON and OFF at anytime say within a series of 25 continuously linked...
4
2974
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in theory you could get the same image 4 times. I quite often get 2 of the same picture come up. What's the easiest way of saying "once an image is assigned to a variable, take it out of the array"? Here's my code so far.. images = new Array(34);...
0
1321
by: PulkitZery | last post by:
Hi all, I have a question about windows media encoder (WME) closed captioning. Does WME maintains the Line-21 closed captioning? In other words, does windows media encoder pulls closed captioning from line-21 off of the video feed and automatically builds the closed captioning into the Archive file? Thanks very much in advance for your help and time. Best regards, Jerry
3
1991
by: PulkitZery | last post by:
Hi All, I am trying to get the Closed Captioning (if available) from the Windows media player and display it in my little dialog box. Can some one give me an example or point me to any documentation/paper/article that shows how can I get the Close Captioning from windows media player? Thanks in advance for any help. - Pulkit Zery
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.