views:

27

answers:

1

Hey all,

How would I go about adding a comment section under each photo in this gallery? (You can view an image of what I'm hoping to do here: - won't let me post a link because i'm a new member.... zhttp://www.some-things.net/storage/Picture109.p ng )

I know the iframe may not be the best way to be working this - but my friend wanted a sideways scroll area with wordpress integration and I couldn't find any suitable gallery plugins.

The images are displayed in a ul/ li - but because it's display-inline it won't let me put in another div below each image.

http://www.some-things.net/storage/anna/wordpress/?page_id=49

Basically I want to create a section under each picture that contains room for comment if needed - something like the picture above.

Any tips on the code needed would be great!

A: 

Put the image and the content in a div, and float all these divs to the left. use inline-block as display and whitespace: no-wrap.

<html>
<head>
<style type="text/css">
#container {
    white-space: nowrap;
}
.image {
    display: inline-block;
    width: 150px;
}
.comment {
    display: block;
    white-space: normal;
}
</style>
<div id="container"><p>
  <div class="image">
    <div style="height: 200px; width: 150px; background: gold;"></div>
    <div class="comment">Bla bla bla lorum ipsum doler amet amor etc. etc.</div>
  </div>
  <div class="image">
    <div style="height: 200px; width: 150px; background: gold;"></div>
    <div class="comment">Bla bla bla lorum ipsum doler amet amor etc. etc.</div>
  </div>
  ...
  ...
</p></div>
Sjoerd
Hey Sjoerd - I'm just trying it at the moment, but skills aren't up to scratch so some researching is in order. Any tips, encase you see this before I solve it? http://www.some-things.net/storage/anna/wordpress/?page_id=49
michaelbirchall.com
Floating to the left doesn't work, because this simply wraps if it does not fit in the screen. I've edited my question to show a solution. Basically, it uses whitespace: no-wrap to avoid wrapping, and display: inline-block to have multiple blocks on the same line. May not work in IE7.
Sjoerd
Excellent! thanks! Can I ask - How come <div class=image needs the second <div style ? Couldn't this information be put into the .image tag in the style? I tried deleting it but it needs it for some reason?
michaelbirchall.com
I have used this second `div style` instead of an image. You can replace this div by an image.
Sjoerd
Ah sweet, thanks for that!
michaelbirchall.com