wldrumstcs
12-05-2009, 06:06 PM
I have a CSS dropdown menu, but the thing is slightly shifted to the right. I believe the reason is that even though I have list-style:none, I think the list is still keeping room for the bullet point. I don't want any margin in the left side, but I can't get it to work. I took a screenshot so you might be able to understand what I'm talking about. Notice the selection box around "Food*" doesn't go all the way to the left border of the cell. How do I do this?
Here is the HTML:
<table width="100%" border="0">
<tr>
<th width="5%" scope="col"></th>
<th width="13%" scope="col" align="center"><a href="<?php echo $date_link;?>" title="Sort by date">Date</a></th>
<th width="21%" scope="col" align="center">
<div id="foodMenu">
<ul class="dropDownMenu">
<li><a href="#" onclick="javascript:showlayer('subLayer')" title="Sort by food">Food*</a></li>
<ul class="subDropDownMenu" id="subLayer" onmouseout="javascript:showlayer('subLayer')">
<li><a href="<?php echo $food_name_link;?>" title="Sort by food name">Sort by food name</a></li>
<li><a href="<?php echo $food_rating_link;?>" title="Sort by food rating">Sort by food rating</a></li>
</ul>
</ul>
</div>
</th>
<th width="22%" scope="col" align="center"><a href="<?php echo $restaurant_link;?>" title="Sort by restaurant/brand">Restaurant/Brand*</a></th>
<th width="13%" scope="col" align="center"><a href="<?php echo $sensitive_link;?>" title="Sort by sensitivity">Sensitivity*</a></th>
<th width="21%" scope="col" align="center">Notes</th>
<th width="5%" scope="col" align="center"></th>
</tr>
</table>
And the CSS:
ul, li{list-style:none;}
#foodMenu{
height:0px;
padding-bottom:36px;
/*padding:0px 78px 36px 0px;*/
/*width:150px;*/
}
#foodMenu .dropDownMenu li {
float:none;
/*width:150px;*/
}
#foodMenu .dropDownMenu li a{
display:block;
}
#foodMenu .subDropDownMenu li:hover ul, li.over ul {
display:block;
}
#foodMenu ul .subDropDownMenu {
border:solid 1px #004A66;
background:#FFFFFF;
position:relative;
width:150px;
padding:0px 0px;
clear:both;
z-index:100;
display:none;
}
#foodMenu ul .subDropDownMenu li{
background:none;
display:block;
float:none;
border:0;
height:auto;
line-height:normal;
border-bottom:solid 1px #004A66;
}
#foodMenu .subDropDownMenu li a{
background:none;
display:block;
float:none;
padding:6px 6px;
margin:0;
border:0;
height:auto;
line-height:normal;
}
#foodMenu .subDropDownMenu li a:hover{
background:#5195CE;
color:#FFF;
}
Here is the HTML:
<table width="100%" border="0">
<tr>
<th width="5%" scope="col"></th>
<th width="13%" scope="col" align="center"><a href="<?php echo $date_link;?>" title="Sort by date">Date</a></th>
<th width="21%" scope="col" align="center">
<div id="foodMenu">
<ul class="dropDownMenu">
<li><a href="#" onclick="javascript:showlayer('subLayer')" title="Sort by food">Food*</a></li>
<ul class="subDropDownMenu" id="subLayer" onmouseout="javascript:showlayer('subLayer')">
<li><a href="<?php echo $food_name_link;?>" title="Sort by food name">Sort by food name</a></li>
<li><a href="<?php echo $food_rating_link;?>" title="Sort by food rating">Sort by food rating</a></li>
</ul>
</ul>
</div>
</th>
<th width="22%" scope="col" align="center"><a href="<?php echo $restaurant_link;?>" title="Sort by restaurant/brand">Restaurant/Brand*</a></th>
<th width="13%" scope="col" align="center"><a href="<?php echo $sensitive_link;?>" title="Sort by sensitivity">Sensitivity*</a></th>
<th width="21%" scope="col" align="center">Notes</th>
<th width="5%" scope="col" align="center"></th>
</tr>
</table>
And the CSS:
ul, li{list-style:none;}
#foodMenu{
height:0px;
padding-bottom:36px;
/*padding:0px 78px 36px 0px;*/
/*width:150px;*/
}
#foodMenu .dropDownMenu li {
float:none;
/*width:150px;*/
}
#foodMenu .dropDownMenu li a{
display:block;
}
#foodMenu .subDropDownMenu li:hover ul, li.over ul {
display:block;
}
#foodMenu ul .subDropDownMenu {
border:solid 1px #004A66;
background:#FFFFFF;
position:relative;
width:150px;
padding:0px 0px;
clear:both;
z-index:100;
display:none;
}
#foodMenu ul .subDropDownMenu li{
background:none;
display:block;
float:none;
border:0;
height:auto;
line-height:normal;
border-bottom:solid 1px #004A66;
}
#foodMenu .subDropDownMenu li a{
background:none;
display:block;
float:none;
padding:6px 6px;
margin:0;
border:0;
height:auto;
line-height:normal;
}
#foodMenu .subDropDownMenu li a:hover{
background:#5195CE;
color:#FFF;
}