captions under photos

W

Whitecrest

i'd love to teach you something new about ductape.

Speaking of ductape, I had a friend that use to wrap his hamsters in
ductape..... (scroll to see why)
..

..

..

..

..

..

..

..

..

..

..

..

..

..

..

..

..

So they wouldn't explode when he fucked them.....

sorry...
 
B

brucie

in post: <
Whitecrest said:
Speaking of ductape, I had a friend that use to wrap his hamsters in
ductape..... (scroll to see why)

mommy made me cover my eyes :-(
 
K

Kooner

Barry,

I think I'm still missing something. I copied the div statements from
your post, but the width gets cut off. I tried displaying two photos
(using the div statements), then I displayed the same two photos the
'normal way' at 40% so I can see where they were cut off.
http://home.comcast.net/~jason.kooner/helpfromgoogle.htm

What does 'width: 12em' mean? I really
need a better HTML book. This one I have by Dietel and Dietel (WWW
Internet and World Wide Web How to Program) just doesn't go into
enough detail for me with the CSS,div,class stuff.
On another note, why don't the two rightmost
pictures display on the next line toward the left margin?? Shouldn't
the <p></p> I added around the last two pics give a line return?

Kooner
 
N

Neal

I really
need a better HTML book. This one I have by Dietel and Dietel (WWW
Internet and World Wide Web How to Program) just doesn't go into
enough detail for me

Please don't post on top, trim a bit and put it where it would fall in a
conversation.

If the book is trying to teach you to "program" HTML, use it for toilet
paper.
 
B

Barry Pearson

Kooner said:
Barry,

I think I'm still missing something. I copied the div statements from
your post, but the width gets cut off. I tried displaying two photos
(using the div statements), then I displayed the same two photos the
'normal way' at 40% so I can see where they were cut off.
http://home.comcast.net/~jason.kooner/helpfromgoogle.htm

I think I can see what is happening. Remember that I set up the CSS for
thumbnails, while you want larger photographs. The key is that I used CSS to
make the heights of all the images quite small: { height: 100px; }. Obviously,
that is not what you want! You do need to ensure that all the photographs are
the same heights for floating to work properly, but it is up to you what that
is.

Note that your photographs are far too large for your original intention of 5
by 4. It is not a good idea to cause a user to download a 1280 x 1024
photograph only to see very much smaller images which could have been
downloaded in a tiny fraction of the time. I wouldn't have thought you wanted
photographs much more than 200 or 300 pixels wide / high for that sort of
display. If you start with them all the same height, you don't need to control
their heights further using CSS.
What does 'width: 12em' mean? I really
need a better HTML book. This one I have by Dietel and Dietel (WWW
Internet and World Wide Web How to Program) just doesn't go into
enough detail for me with the CSS,div,class stuff.

"em" is related to the size of the font currently in use at that position. If
one user is using double the font size of another, then that first user will
get a <div> which is twice the width of the other. It is a very useful way,
(indeed, I believe the *intended* way), of building displays that adapt
element sizes naturally to the user's font sizes. I used 12em because I found
by experimentation that it was enough for what I wanted. For example, it
mostly enabled me to have big enough captions for my purpose.

Note - "experimentation". When I was developing the CSS for that gallery
layout, I ran with 5 different browsers pointing at the page. I put in
captions of various sizes, then viewed with each browser at a whole variety of
settings. Including the full range of IE settings, Mozilla settings from too
small to read, to so big that only 2 or 3 words would fit on a screen, and
Opera zoomed from 50% to 200%. I don't have enough confidence to try to decide
the values by any more "scientific" or "mathematical" method. I know enough to
make an initial guess, but no more. Once the galleries get populated, I may
have to fine-tune the CSS, but that is trivial in comparison.

The cut-off is done by { overflow: hidden; }. I experimented with { overflow:
auto; }, but didn't like the scroll-bars I got when there was too much text.
Neither did I like the effect of not controlling the overflow, because I
sometimes got captions running into one-another. In other words, the result is
a compromise - I will sometimes find that I can't get a caption as big as a
really want, and may end up with an abbreviated one. But that is pretty
inevitatble if you want regular alignment of photographs in rows & columns.
On another note, why don't the two rightmost
pictures display on the next line toward the left margin?? Shouldn't
the <p></p> I added around the last two pics give a line return?

No, because you floated the 2 left thumbnails, and that takes them out of the
normal flow. Or, more precisely, you *did* get a line return, and if you put a
border round the paragraph, you will see, in a compliant browser, that the <p>
starts on the left, but it is the (initial) *content* of the <p>, the images
in this case, that are pushed to the right by the floated elements. If you
really wanted the paragraphs to drop below the floated elements, the CSS
property to apply to the paragraph is { clear: left } (or it could be { clear:
both }). This will explain:

http://www.complexspiral.com/publications/containing-floats/
[snip]
 
K

Kooner

Barry Pearson said:
Here is my recent experiment of doing something similar. I didn't want to have
specific CSS rules for different images, which appears to be what brucie does,
but I wanted to have line-wrapped behaviour. I also wanted to cater for all
sorts of user text-sizses, etc. And as many browsers as possible.

I had to break one of your requirements. I had to make the images the same
height. (Not necessarily the same width). If necessary, when I do the proper
version, I will have to add transparent space to them in Photoshop. The reason
is that, when using floats for line-wrapping, the heights of the elements
being floated need to be precisely the same. (If someone knows different,
please tell me!)

http://www.kingsnorton.info/galleries/gallery1.htm

The tricks I had to adopt were: all images have the same height; all captions
have the same number of lines, if necessary with hidden (&nbsp;) lines. The
CSS I used was as follows, but much of it is because they are
thumbnail-anchors, not just images being displayed.

div.thumbnail {
font: normal 75% Arial, Helvetica, sans-serif;
width: 12em;
text-align: center;
float: left;
overflow: hidden;
margin: 5px;
border: 1px solid #E1BC89;
}
div.thumbnail img {
height: 100px;
}
div.thumbnail a {
text-decoration: none;
display: block;
padding: 5px;
white-space: nowrap;
}
div.thumbnail a:hover {
color: #00c;
background: #E1BC89;
}

Typical HTML (for the first one, in fact):

<div class="thumbnail">
<a href="../photographs/generic.htm" title="A title">
<img src="../photographs/thumb0.jpg" alt="" width="125" height="105" title="A
title"><br>
Caption<br>for the first photograph</a>
</div>


Ok, I think I got it now. I also found a good book, "Designing CSS Web
Pages" by C. Schmitt. So far it is a good book for this sort of thing.
Now how did you set up the white background that all the thumbnails
sit on and the nice grayish background that is behind the white
background? Are you using the z-index or another div statement? I'm
still new at this and find it difficult to pick it out from using
"view-->source".

Kooner
 
M

Mark Parnell

still new at this and find it difficult to pick it out from using
"view-->source".

If you use Mozilla, try using the DOM inspector - Ctrl+Shift+I. It gives
you a tree view of all the elements in the page, and you can see exactly
what styles apply to each element.
 
N

Neal

If you use Mozilla, try using the DOM inspector - Ctrl+Shift+I. It gives
you a tree view of all the elements in the page, and you can see exactly
what styles apply to each element.


Which Mozilla does this work in? 1.6, Ctrl-Shift-I does nothing...
 
M

Mark Parnell

Which Mozilla does this work in? 1.6, Ctrl-Shift-I does nothing...

It's optional when you install Mozilla - I always use Custom and select
it. I'd say it probably isn't included in the typical install. Should
have thought of that - sorry. :-S
 
D

Deirdre Saoirse Moen

Mark Parnell said:
If you use Mozilla, try using the DOM inspector - Ctrl+Shift+I. It gives
you a tree view of all the elements in the page, and you can see exactly
what styles apply to each element.

I downloaded Moz just for this. You know, that's wicked cool! Thanks!
 
B

Barry Pearson

Kooner said:
Barry Pearson said:
Kooner said:
Hello,

How do I put a caption centered under a photo? I have 5 rows of
photos and each row contains 4 photos side by side. I was playing
around with the div tag and relative positioning, but I still
can't get it to work. I don't want to use tables either. Also the
photos are not the same size.

Here is my recent experiment of doing something similar. I didn't
want to have specific CSS rules for different images, which appears
to be what brucie does, but I wanted to have line-wrapped behaviour.
I also wanted to cater for all sorts of user text-sizses, etc. And
as many browsers as possible. [snip]
http://www.kingsnorton.info/galleries/gallery1.htm
[snip]
Ok, I think I got it now. I also found a good book, "Designing CSS Web
Pages" by C. Schmitt. So far it is a good book for this sort of thing.
Now how did you set up the white background that all the thumbnails
sit on and the nice grayish background that is behind the white
background? Are you using the z-index or another div statement? I'm
still new at this and find it difficult to pick it out from using
"view-->source".

The backgrounds are specified via CSS. (They don't use z-index). The CSS file
for all the pages, except the photograph pages themselves, is:
http://www.kingsnorton.info/assets/style_main.css

The white background is specified with the following. This is an example of
descendent selectors. Depending on whether I want buttons on the left of the
page, or at the top just under the header, the HTML says either <body
id="leftnavigation"> or <body id="topnavigation">. Then the browser chooses
only rules with a selector that starts #leftnavigation or #topnavigation
respectively. (These are well worth learning about. They can make it far
easier to have various sets of styles for different purposes without
cluttering up your HTML. But ... that makes it harder to understand what is
happening from "view > source"!) The gallery is an example of "topnavigation"
to make more width available. Look in the HTML for id="wrapper" and
id="navigation". (Yes, they are <div>s).

#topnavigation #wrapper {
background: #fff;
}

The greyish background is a GIF. It is specified with different rules at
different places on that page. The overall page background uses the first rule
below. The background to the buttons uses the second rule below:

body {
margin: 0;
padding: 0;
background: #3D3D3D url("page_background.gif");
text-align: center;
}
#topnavigation #navigation {
background: #3D3D3D url("page_background.gif");
width: 100%;
}
 
K

Kooner

Barry Pearson said:
Here is my recent experiment of doing something similar. I didn't want to have
specific CSS rules for different images, which appears to be what brucie does,
but I wanted to have line-wrapped behaviour. I also wanted to cater for all
sorts of user text-sizses, etc. And as many browsers as possible.

I had to break one of your requirements. I had to make the images the same
height. (Not necessarily the same width). If necessary, when I do the proper
version, I will have to add transparent space to them in Photoshop. The reason
is that, when using floats for line-wrapping, the heights of the elements
being floated need to be precisely the same. (If someone knows different,
please tell me!)

http://www.kingsnorton.info/galleries/gallery1.htm

The tricks I had to adopt were: all images have the same height; all captions
have the same number of lines, if necessary with hidden (&nbsp;) lines. The
CSS I used was as follows, but much of it is because they are
thumbnail-anchors, not just images being displayed.

div.thumbnail {
font: normal 75% Arial, Helvetica, sans-serif;
width: 12em;
text-align: center;
float: left;
overflow: hidden;
margin: 5px;
border: 1px solid #E1BC89;
}
div.thumbnail img {
height: 100px;
}
div.thumbnail a {
text-decoration: none;
display: block;
padding: 5px;
white-space: nowrap;
}
div.thumbnail a:hover {
color: #00c;
background: #E1BC89;
}

Typical HTML (for the first one, in fact):

<div class="thumbnail">
<a href="../photographs/generic.htm" title="A title">
<img src="../photographs/thumb0.jpg" alt="" width="125" height="105" title="A
title"><br>
Caption<br>for the first photograph</a>
</div>

If I click on a thumbnail, how do I get the full size picture
displayed centered with a background and boarder?

I tried something like:

..framepicture {align:center; background: black; border:1;}
<a href class="framepicture" "my_picture.jpg"> clickable_thumbnail
</a>


This doesn't work. I belive the class is being applied to the <a> tag
instead of being applied to href="my_picture" which is what I want.

It looks like I would need to create a web page for each picture and
have that web page reference an external style sheet? Or is there a
way to make one template web page that would display/insert any
picture (centered with a boarder) once the corresponding thumbnail is
clicked?


Kooner
 
N

Neal

If I click on a thumbnail, how do I get the full size picture
displayed centered with a background and boarder?

I tried something like:

.framepicture {align:center; background: black; border:1;}

align? See http://www.w3.org/TR/CSS21/propidx.html

And border: 1 what? Em? Pixel? You MUST specify distances in CSS.
<a href class="framepicture" "my_picture.jpg"> clickable_thumbnail
</a>

Huh? This is way messed up. Match your attributes and values.
This doesn't work.
Indeed.

I belive the class is being applied to the <a> tag
instead of being applied to href="my_picture" which is what I want.

Seems to me you are either extremely sloppy in giving examples of what
you've tried (that's why we always ask for a live URL of what you're
trying, not snippets of code) or you need to gain some basic knowledge of
how HTML works. We can't teach you all that here.

CSS is useless unless the HTML is to specs. Please try to learn how to do
simple things correctly first. I think you're trying to tackle something
you aren't ready for...
 
M

Mark Parnell

If I click on a thumbnail, how do I get the full size picture
displayed centered with a background and boarder?

.framepicture {align:center; background: black; border:1;}
<a href class="framepicture" "my_picture.jpg"> clickable_thumbnail
</a>

That code is atrocious. The CSS is invalid - there is no "align"
property, it is "text-align". Any non-zero length requires a unit. IIRC
the shorthand "background" and "border" properties require more than one
value (or use "background-color" and "border-width").

And the HTML is _really_ bad.
This doesn't work.

If you write it correctly it does, though not in the way you want it to.
I belive the class is being applied to the <a> tag
instead of being applied to href="my_picture" which is what I want.

That's how CSS works - that rule applies the style to anything with
class="framepicture" - in this case it is the anchor _element_ (not
tag).
It looks like I would need to create a web page for each picture and
have that web page reference an external style sheet?

Or is there a
way to make one template web page that would display/insert any
picture (centered with a boarder) once the corresponding thumbnail is
clicked?

With server-side scripting, yes.
 
K

Kooner

Neal said:
align? See http://www.w3.org/TR/CSS21/propidx.html

And border: 1 what? Em? Pixel? You MUST specify distances in CSS.


Huh? This is way messed up. Match your attributes and values.


Seems to me you are either extremely sloppy in giving examples of what
you've tried (that's why we always ask for a live URL of what you're
trying, not snippets of code) or you need to gain some basic knowledge of
how HTML works. We can't teach you all that here.

Not sloppy, I know that the above syntax is wrong - I'm just trying to
covey what I am trying to do.
CSS is useless unless the HTML is to specs. Please try to learn how to do
simple things correctly first. I think you're trying to tackle something
you aren't ready for...
I did pick up a good book, "Mastering HTML and XHTML" by Ray, although
I haven't 'mastered' it yet.




Ok, back to class.., here are two urls that are supposed to align a
thumbnail to the
right:

http://home.comcast.net/~jason.kooner/does_not_align.htm
This page does not right align the thumbnail. I believe I used an
embedded style. I checked the page with http://validator.w3.org/ and
there are no errors.
Why won't this page align the thumbnail to the right?



http://home.comcast.net/~jason.kooner/does_align.htm
This page does align the thumbnail. I used an inline style. I know
this not proper XHTML syntax because I used 'align'. But, if I were to
replace align="right" with text-align="right", the thumbnail won't
align to the right?

Kooner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top