Log in

View Full Version : Help with CSS and jQuery lightbox



jhatter
04-20-2010, 12:05 PM
Hi,

I've created a lightbox slideshow using jQuery and now I'm having problems styling the css on the caption (title="my caption"), please can someone help me?

Here is part of the code that relates to the lightbox

<div class="column4">
<h2><a href="images/web/w1.jpg" rel="lightbox[web]" title="my caption"> DIGITAL MEDIA</a>
<a href="images/web/w2.jpg" rel="lightbox[web]" title="my caption"></a>
</h2>
</div>

Here is the lightbox css:

#lightbox{position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
#lightbox img{ width: auto; height: auto;}
#lightbox a img{ border: none; }

#outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
#imageContainer{ padding: 10px; }

#loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
#hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; }
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url(images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(images/nextlabel.gif) right 15% no-repeat; }

#imageDataContainer{
background-color: #fff;
margin: 0 auto;
line-height: 1.4em;
overflow: auto;
width: 100%;
font-family: "Times New Roman", Times, serif;
font-size: 9px;
color: #00FF00;
}

#imageData{padding:0 10px; color: #666; }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }
#imageData #caption{ font-weight: bold; }
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;}
#imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;}

#overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; }

So two questions:
1) You can see that #imageDataContainer text is set to bright green and 9px - but it is appearing in #cccccc (grey) and more like 14px in size.
Why won't it appear the style in #imageDataContainer?

2) Can someone please explain how all the lightbox css (as above) styles everything, when I can't see any reference to it in the HTML? I assume it refers to it in the jQuery scripts?

Thanks in anticipation.

BLiZZaRD
04-20-2010, 06:29 PM
CSS.. Cascading Style Sheet. Cascading as in a downwards motion.

CSS declarations use what comes LAST as the method to use.



#imageData{padding:0 10px; color: #666; }


is over writing #imageDataContainer.

Change your gray (#666) here
and add font size to the caption data:



#imageData #caption{ font-weight: bold; }