...

View Full Version : CSS cell Tablink problem



Uzair
08-07-2005, 01:13 PM
I'm having problems controlling my cell links. I want the whole cell as a link. I'm using the following CSS for this purpose but when I define CELL HEIGHT in CSS, the text then vertically align to TOP. And if I dont set CELL HEIGHT, everything is fine. How can I solve this problem.
The Code is here...

<HEAD>
.tablink:visited{color: #993333; text-decoration: none;}
.tablink:active{color: #993333;}
.tablink:link{color: #993333; text-decoration: none;}
.tablink:hover{text-decoration: none; color: #DCA59C; background-color: #FFFFFF;}
.tablink{align: middle; display: block; width: 120;}

<BODY>
<td valign="middle" style="padding-left: 3px;"><a href="#" class="tablink">Welcome</a></td>

coothead
08-07-2005, 01:49 PM
Hi there Uzair,

and a warm welcome to these forums. :)

Try it like this...

<head>
<style type="text/css">
<!--
.tablink {
display: block;
width:120px;
line-height:30px;
background-color:#fee;
color: #933;
text-align:center;
text-decoration: none;
}
.tablink:hover{
color: #dca59c;
background-color: #fff;
}
#cell {
border:1px solid #999;
}
//-->
</style>
</head>

<body>
<table><tr>
<td id="cell"><a href="#" class="tablink">Welcome</a></td>
</tr>
</table>
</body>
Note:- if the visited and active rules are the same as the link rules they do not need to be declared.
If they are different then the must be displayed in this exact order..

link
visited
hover
active


coothead

e-Raser
08-07-2005, 02:56 PM
Don't ever use <!-- --> in CSS, thats HTML.

Uzair
08-07-2005, 06:11 PM
Thank You very much COOTHEAD. You solved my problem & now I'll use your code for my website's cells. :thumbsup:

coothead
08-07-2005, 06:23 PM
No problem, you're welcome. :D

miles74
02-16-2006, 05:48 AM
thanks coothead, that really helps my problem with cell links im working on.:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum