Jump to content

unordered list in table


yandoo
Go to solution Solved by yandoo,

Recommended Posts

Hiya I'm really stuck on trying to get an unordered list to appear in my table cell correctly (the unordered list is coded so that when an image is hovered over a larger one appears - this aspect works fine). It doesn't seem to fit, it makes the table wider than it should be, its not centered, it overlaps the edge of the table and theres too much of a gap between each image (see screenshot attachement). I've tried adjusting the padding and margins but it doesn't change anything.  

 

Any ideas on how I can make this work correctly please?

 

 

html/php

<td width="250" height="250" valign="top" style="border:solid; border-color:#D1D0CE; border-width:1px;"><ul class="enlarge"><li><img src="inventory_images/' . $id . '_list.jpg" alt="' . $product_name . '" /><span><img src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" /></span></li></ul><p class="SmallText" align="center"> '.$details.'<center><form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></center></p></td>

css

ul.enlarge{
list-style-type:none; /*remove the bullet point*/
margin-right:0px;
}
ul.enlarge li{
display:inline-block; /*places the images in a line*/
display:inline;
position: relative;
z-index: 0; /*resets the stack order of the list items - later we'll increase this*/
margin:0px 0px 0 0px;
}
ul.enlarge img{
background-color:#eae9d4;
padding: 6px;
-webkit-box-shadow: 0 0 6px rgba(132, 132, 132, .75);
-moz-box-shadow: 0 0 6px rgba(132, 132, 132, .75);
box-shadow: 0 0 6px rgba(132, 132, 132, .75);
-webkit-border-radius: 4px; 
-moz-border-radius: 4px; 
border-radius: 4px; 
}
ul.enlarge span{
position:absolute;
left: -9999px;
background-color:#eae9d4;
padding: 5px;
font-family: 'Droid Sans', sans-serif;
font-size:.9em;
text-align: center; 
color: #495a62; 
-webkit-box-shadow: 0 0 20px rgba(0,0,0, .75));
-moz-box-shadow: 0 0 20px rgba(0,0,0, .75);
box-shadow: 0 0 20px rgba(0,0,0, .75);
-webkit-border-radius: 4px; 
-moz-border-radius: 4px; 
border-radius:4px;
}
ul.enlarge li:hover{
z-index: 50;
cursor:pointer;
}
ul.enlarge span img{
padding:2px;
background:#ccc;
}
ul.enlarge li:hover span{ 
top: -300px; /*the distance from the bottom of the thumbnail to the top of the popup image*/
left: -20px; /*distance from the left of the thumbnail to the left of the popup image*/
}
ul.enlarge li:hover:nth-child(2) span{
left: -100px; 
}
ul.enlarge li:hover:nth-child(3) span{
left: -200px; 
}
/**IE Hacks - see http://css3pie.com/ for more info on how to use CS3Pie and to download the latest version**/
ul.enlarge img, ul.enlarge span{
behavior: url(pie/PIE.htc); 
}

Thank you very much. :)

post-32610-0-73537300-1376940749_thumb.jpg

Edited by yandoo
Link to comment
Share on other sites

  • Solution

I fixed it by: 

 

ul.enlarge{
list-style-type:none; /*remove the bullet point*/
margin-right:-40px;
}

 

This has made it so there is harldy any gap between each photo and I still don't understand why I would need to use -40px in the margin. 

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.