Jump to content


Photo

unordered list in table


Best Answer yandoo, 19 August 2013 - 02:45 PM

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

Go to the full post


  • Please log in to reply
1 reply to this topic

#1 yandoo

yandoo

    Advanced Member

  • Members
  • PipPipPip
  • 469 posts

Posted 19 August 2013 - 02:29 PM

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. :)

Attached Files


Edited by yandoo, 19 August 2013 - 02:33 PM.


#2 yandoo

yandoo

    Advanced Member

  • Members
  • PipPipPip
  • 469 posts

Posted 19 August 2013 - 02:45 PM   Best Answer

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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com