I cannot seem to figure out why my middle div(menu-item-middle class) inside the menuitem class won’t stretch accross. I’ve spent quite a bit of time on this now and I thought I better post this one because I cannot figure this out. This is what my code looks like.
.menu-item div
{
display:inline-block
}
.menu-item-left
{
left:0px; float:left; border:1px solid #000000
}
.menu-item-middle
{
padding-top:5px; padding-bottom:6px; padding-right:5px; left:39px; float:left; border:1px solid #000000
}
.menu-item-right
{
width:26px; height:44px; right:0px; clear:right; background-image:url('images/Menu_Item_Arrow.jpg'); background-repeat:no-repeat; border:1px solid #000000
}
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="menu-item">
<div class="menu-item-left">
<div class="item-corner">
</div>
<div class="item-icon">
<img alt="" height="36" src="images/spacer.gif" width="36" />
</div>
</div>
<div class="menu-item-middle">
<table border="0" cellpadding="0" cellspacing="0" style="margin-left:5px">
<tr>
<td>
<a href="#">
<span style="font-family:Verdana; font-size:.95em; font-weight:bold">Technology</span>
</a>
</td>
</tr>
<tr>
<td>
<span style="font-family:Arial; font-size:.7em; color:#0b83bb">Computers &
Office Supplies</span></td>
</tr>
</table>
</div>
<div class="menu-item-right">
<img alt="" height="44" src="images/spacer.gif" width="26" />
</div>
</div>
<div class="menu-item">
<div class="menu-item-left">
<div class="item-corner">
</div>
<div class="item-icon">
<img alt="" height="36" src="images/spacer.gif" width="36" />
</div>
</div>
<div class="menu-item-middle">
<table border="0" cellpadding="0" cellspacing="0" style="margin-left:5px">
<tr>
<td>
<a href="#">
<span style="font-family:Verdana; font-size:.95em; font-weight:bold">Intersts</span>
</a>
</td>
</tr>
<tr>
<td>
<span style="font-family:Arial; font-size:.7em; color:#0b83bb">Movies Books &
Music</span></td>
</tr>
</table>
</div>
<div class="menu-item-right">
<img alt="" height="44" src="images/spacer.gif" width="26" />
</div>
</div>
<div class="menu-item">
<div class="menu-item-left">
<div class="item-corner">
</div>
<div class="item-icon">
<img alt="" height="36" src="images/spacer.gif" width="36" />
</div>
</div>
<div class="menu-item-middle">
<table border="0" cellpadding="0" cellspacing="0" style="margin-left:5px">
<tr>
<td>
<a href="#" style="text-decoration:none; color:#0b83bb">
<span style="font-family:Verdana; font-size:.95em; font-weight:bold">
Entertainment</span> </a>
</td>
</tr>
<tr>
<td>
<span style="font-family:Arial; font-size:.7em; color:#0b83bb">Software &
Digital Games</span></td>
</tr>
</table>
</div>
<div class="menu-item-right">
<img alt="" height="44" src="images/spacer.gif" width="26" />
</div>
</div>
</td>
</tr>
</table>
This is because you have set the
floatproperty. If you want to keep it then try adding awidth: 100%to the class.