Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    Exclamation CSS cell Tablink problem

    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>

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,746
    Thanks
    0
    Thanked 244 Times in 239 Posts
    Hi there Uzair,

    and a warm welcome to these forums.

    Try it like this...
    Code:
    <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

  • #3
    New Coder
    Join Date
    Jul 2005
    Location
    Perth, Australia. Age: 13
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't ever use <!-- --> in CSS, thats HTML.
    I lost my signature, have you seen it?
    I have the power to erase you...

  • #4
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    Smile CSS cell tablink

    Thank You very much COOTHEAD. You solved my problem & now I'll use your code for my website's cells.

  • #5
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,746
    Thanks
    0
    Thanked 244 Times in 239 Posts
    No problem, you're welcome.

  • #6
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    thanks coothead, that really helps my problem with cell links im working on.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •