Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spaces appearing in table with links using CSS

Status
Not open for further replies.

Modica82

Technical User
Jan 31, 2003
410
GB
HI there,

i have a table that has links in it. When i set the CSS class to the links i seem to get bigger table cells then i had before, it is like there is space above and below the link that wasnt there before. Here is my CSS:

A.navLinks, A.naviLinks:link, A.naviLinks:Visited
{
color: #0755A5;
text-decoration: none;
font-family: Arial;
font-size: 9pt;
font-weight:bold;

}

A.navLinks:hover
{
color: #FF9900;
text-decoration: none;
font-family: Arial;
font-weight: bold;
font-size: 9pt;
}

Also,

My Hover doesnt work??? any ideas!

Rob
 
As for the table, it is hard to tell without seeing the table itself and how it is specified. But actually I don't think there should be a problem.

Regarding the hover, it is working for me. I do not know if it is a typo here but you seem to have a navLinks and naviLinks class and only the first has hover class defined. Also note that default html behaviour for pseudo classes such as hover is inherit everything from :link. So you need not specify items that don't change again. You can shorten your hover into this:

A.navLinks:hover { color: #FF9900; }

If it was a typo and you were planning to have but one class you should delete a.navLinks and keep only :link and :visited.
 
Hi there,

well to show you the table would be difficult as it generated via ASP.Net but i do have a class for it which is:

.headnav
{
width: 125;
text-align: left;
background-color: #BDD0EE;

}

It is when i add the links to have this CSS Class (navLinks) that the extra spaces appear, when i take them out albeit i have no formatting, i dont have these spaces?????

Its very strange.

Rob
 
Is there a URL for this page? If it's somewhere private, you can visit the page and use "View source" to see the HTML that the ASP code generates - then cut & paste the relevant part here.

As to the missing hover, what browser are you using? There was a bug in IE5 that meant that hovers for classes didn't work unless you had an a:hover rule as well. Try adding
[tt]
a:hover { color:blue; }
[/tt]
to your style sheet.

-- Chris Hunt
 
My hover works fine now, was very strange, it started to work for some links and not for others, dodgy, anyway here is my table:

<table width=&quot;760&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=125 height=&quot;5&quot;><table id=&quot;_ctl1_grdCategories&quot; class=&quot;headnav&quot; cellspacing=&quot;0&quot; border=&quot;1&quot; bo style=&quot;border-collapse:collapse;&quot;>
<tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl0_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot; </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl1_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;2/default.aspx?Parent=0&amp;Section=2&quot;> link 2 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl2_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;3/default.aspx?Parent=0&amp;Section=3&quot;>3 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl3_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;4/default.aspx?Parent=0&amp;Section=4&quot;>Link 4 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl4_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;5/default.aspx?Parent=0&amp;Section=5&quot;>Link 5 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl5_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;Link 6/default.aspx?Parent=0&amp;Section=6&quot;>Link 6 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl6_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;7/default.aspx?Parent=0&amp;Section=7&quot;>Link 7 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl7_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;8/default.aspx?Parent=0&amp;Section=8&quot;>Link 8 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl8_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;8/default.aspx?Parent=0&amp;Section=9&quot;>Link 9 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl9_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;10/default.aspx?Parent=0&amp;Section=10&quot;>link 10 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl10_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;11/default.aspx?Parent=0&amp;Section=11&quot;>Link 11 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl11_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;12/default.aspx?Parent=0&amp;Section=12&quot;>Link 12 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl12_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;13/default.aspx?Parent=0&amp;Section=13&quot;>Link 13 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl13_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;14/default.aspx?Parent=0&amp;Section=14&quot;>Link 14 </a>

</td>
</tr><tr>
<td>
&nbsp;<a id=&quot;_ctl1_grdCategories__ctl14_selCategoryID&quot; class=&quot;naviLinks&quot; CommandName=&quot;Select&quot; class=&quot;SubHead&quot; href=&quot;links/default.aspx?Parent=0&amp;Section=15&quot;>Links </a>

</td>
</tr>
</table>

Thanks for taking the time to help me

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top