PDA

View Full Version : center text below thumbnail



cway
11-11-2010, 04:12 PM
1) Script Title: CSS Image Gallery

2) Script URL (on DD): http://www.dynamicdrive.com/style/csslibrary/item/css-image-gallery/

3) Describe problem: I can't seem to get the text below each thumbnail, centered. Does anybody have any ideas?

http://dev.shadowboxart.com/page/CTGY/earrings


/* Begin DynamicDrive Gallery
--------------------------------------------------------------------------------- */
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */

.navigation_container
{
/*position: relative;*/
/*Add a height attribute and set to largest image's height to prevent overlaying*/
height: 20px;
margin:0 auto;
text-align:center;
top: 0px;
border:0px solid #0f0;
font-weight:bold;
}
.navigation_container a{width:16px;height:20px;line-height:20px;text-decoration:none;color:#666;}
.navigation_container td{height:20px;line-height:20px;font-size:10px;color:#f00;}
.pageActive{
display:block;
width:16px;
height:20px;
background-image:url('graphics/yellow_dot.gif');
background-repeat:no-repeat;
background-position:center;
}

.product_description
{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
height: 0px;
width: 450px;
left: -10px;
text-align: left;
top: 476px;
font-size: 0.8em;
line-height: 1.5em;
font-family: Arial, Helvetica, sans-serif;
}

.gallerycontainer
{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
/*height: 0px;*/
height:auto;
width: 380px;
left: 470px;
text-align: center;
top: -20px;
border:0px solid #0f0;
}

.gallerycontainer h1
{
text-align: left;
font-size: 9pt;
font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular;
text-decoration: none;
line-height: 0pt;
color: #900;
margin-top: 30px;
font-weight: bold;
margin-left: 0px;
}

.thumbnail img { margin: 0 2px 0px 0; }

.thumbnail:hover{
background-color: transparent;
}

.thumbnail:hover img { }

.thumbnail span
{
/*CSS for enlarged image*/
position: absolute;
padding: 2px;
left: -500px;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 0px;
}

.thumbnail:hover span
{
/*CSS for enlarged image*/
visibility: visible;
top: 144px;
left: -388px;
/*position where enlarged image should offset horizontally */
z-index: 50;
}

dl
{
text-align: center;
font-size: .95em;
margin-top: 25px;
}
dt,dd {
width:4.5em;
float:left;
}
dt
{
width: 110px;
text-align: center;
margin: 0em .5em 1.6em 0em;
}
dd
{
margin: 57px 0 0 -7.5em;
text-align: center;
font-size: 8pt;
font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular;
text-decoration: none;
line-height: 10pt;
white-space: nowrap;
}
img.tn
{
vertical-align: bottom;
padding: 2px;
border: 0em;
text-align: center;
}
em
{
display: block;
font-weight: bold;
margin-bottom: 5px;
}
dl a:hover img,dl a:active img,dl a:focus img
{
}

cway
11-12-2010, 09:14 PM
HTML:

<dd>
<img src=".." />
<a href="" > </a>
</dd>

CSS:

dd a {
text-align: center;
display: block;
}
dd img {
display: block;
margin: 0 auto;
}