|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
(For want of a better title.)
I'm trying to get a demo gallery To display captions without causing the line of images to break (when they're big or small). The idea is to have the images in a single row (unless you've got a narrow browser) and not break. The problem is I still want the caption under the image in question. (Click on the images to see what I mean. Only the first one has a caption.) Can anyone help me figure out a solution? (I got the idea and code from Web Monkey) |
|
#2
|
|||||
|
|||||
|
Re: Markup help
I'm not too sure how well this sort of thing would work when stuff's being actively resized; but, for the version of a website I'm working on I did:
Code:
<div id="biophotos"> <span style="float: left;"><center><a href="ort.php?bio=adam"><img src="img/bio/adam.jpg" alt="Coordinator"> <br>Adam <br>(Coordinator)</a></center></span> <span style="float: left;"><center><a href="ort.php?bio=heather"><img src="img/bio/heather.jpg" alt="Communications"> <br>Heather <br>(Communications)</a></center></span> <span style="float: left;"><center><a href="ort.php?bio=mark"><img src="img/bio/mark.jpg" alt="Logistics"> <br>Mark <br>(Logistics)</a></center></span> <span style="float: left;"><center><a href="ort.php?bio=tim"><img src="img/bio/tim.jpg" alt="Information Technology"> <br>Tim <br>(Information Technology)</a></center></span> </div> Last edited by Timothy D. Ginn : 18-05-2006 at 23:05. Reason: Remove unnecessary quote / add disclaimer about IE |
|
#3
|
||||
|
||||
|
Re: Markup help
The reason why your images with descriptions are breaking is because they are block elements. Because your containing DIV and your description DIV on the first image are block elements, they expand the width of the screen and cause the remaining images to move below it.
There are a few ways to fix this, but the easiest would be to turn your A elements surrounding your images into block elements themselves, and floating them left. Therefore, the following code should fix your problems: Code:
.livethumbnail
{
display: block;
float:left;
}
.footer
{
font-size: 11px;
text-align: center;
color: #ccc;
clear: both;
}
Code:
.livethumbnail .caption {
color: white;
display: block;
}
a.livethumbnail:hover .caption {
display: block;
}
a.livethumbnail:visited:hover .caption {
display: block;
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| section 'InterruptVectorLow' type is non-overlay (was: HELP HELP HELP!!!!!) | naor52 | Programming | 14 | 24-02-2007 01:19 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |