Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Add description for photo in image gallery
Old 07-31-2008, 09:47 AM Add description for photo in image gallery
Average Talker

Posts: 22
Name: Bob
Trades: 0
Hi,

I want to build an image gallery with the ability to write a description beneath each photo.

Initially I was able to place the gallery in a horizontal position. This is how I begun.

The code (in HTML):
<div id=”gallery”>
<ul>
<li> <a target="_blank" href="forest.html"><img src="forest.jpeg" alt="forest" width="110" height="90" /></a>
<li> <a target="_blank" href="sea.html"><img src="sea.jpeg" alt="sea" width="110" height="90" /></a>
<li> <a target="_blank" href="sky.html"><img src="sky.jpeg" alt="sky" width="110" height="90" /></a>
<li> <a target="_blank" href="flowers.html"><img src="flowers.jpeg" alt="flowers" width="110" height="90" /></a>
</ul>
</div>

In CSS:
#gallery {border: 1px solid green}
#gallery li {display: inline}
#gallery a:hover {border: 3px solid red}

However, although the gallery laid out horizontally with the div border around it, the ‘a:hover’ resulted in an unattractive and partly missing border. Moreover I couldn’t control the image border color (as opposed to the ‘a:hover’ border color); blue seemed to be the image border color default. Eventually I resorted to the net and I found the code set out below.

The HTML code I found on the net:
<div class="img">
<a target="_blank" href="link here"><img src="klematis_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="link here"><img src="klematis2_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="link here"><img src="klematis3_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="link here"><img src="klematis4_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>

The CSS from the net:
div.img {margin: 2px; border: 1px solid black; height: auto; width: auto; float: left; text
align: center}
div.img img {display: inline; margin: 8px; border: 1px solid yellow}
div.img a:hover {border: 1px solid #0000ff;}
div.desc { text-align: center; font-weight: normal; width: 120px; margin: 2px;}

The code works. But:
A) I can’t position the gallery where I want on the page
B) When I write a paragraph (<p> </p>) within another div beneath the gallery code, the paragraph sits to the side of the gallery.

So if someone can help me with either:
A) suggestions on how to position the gallery from the net into my middle column so that:
i) the gallery stays in place
ii) the next division holding other information below it will sit in place without moving to the side of the gallery

or

B) suggestions on how to make the ‘a:hover border’ more attractive and complete in the ul and li code that I started with.

Your suggestions will be most appreciated; I’m not quite sure how to resolve this and you have far greater understanding in this than me.
goodness me is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2008, 10:00 AM Re: Add description for photo in image gallery
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Do you have a live link to the page, so that we may fool around with it using our mysterious hacking tools? (Firebug is such a crutch)
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-31-2008, 10:53 AM Re: Add description for photo in image gallery
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I would make another suggestion - try Lightbox or one of it's variations. It will eliminate the need to open new windows, and you can create captions to your heart's content very easily.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-01-2008, 07:24 AM Re: Add description for photo in image gallery
Average Talker

Posts: 22
Name: Bob
Trades: 0
Thanks for your your responses everyone.

Wayfarer07, my site's not yet on the web; I'm still working on it. I'm convinced you could hack into it though.

Ladynred, I searched around for Lightfoot; I'm still coming to grips with it. I need to do more reading because I'm a little insecure about it.

As I understand it, I need to download some files before doing anything else or writing the source code. Correct me if I'm wrong. Thanks.
goodness me is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Add description for photo in image gallery
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.18517 seconds with 12 queries