SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not working in firefox

    Hi i have this code below that hyperlinks a cell. This works on ie but not in firefox, is there a fix for this?

    <a href='new.php'><td width='87.5' class='btmbtn' align='center'><b>NEW</b></td></a>
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Cause it shouldn't work. What do you want it to do?
    Ryan B | My Blog | Twitter

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    An <a ...> tag can only contain text and inline elements (like <b>, <em>, <span> and so on). It can't contain table or block elements. You need to put the <a ...> inside the <td>.

    If you want to make the clickable area extend to the full width of the cell, then in the CSS you need
    td a {display:block;}

  4. #4
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And, looking from another angle, you can only have <th> or <td> elements inside <tr>:

    <!ELEMENT TR - O (TH|TD)+ -- table row -->


    Your code probably looks something like this:
    Code:
    <tr>
    <td>...</td>
    <a href='new.php'><td width='87.5' class='btmbtn' align='center'><b>NEW</b></td></a>
    </tr>
    when, in fact, like Stevie said, it should look like this:
    Code:
    <tr>
    <td>...</td>
    <td width='87.5' class='btmbtn' align='center'><a href='new.php'><b>NEW</b></a></td>
    </tr>
    Once again, validate your code before posting a problem. It may be that by doing so your problem may solve by it self

  5. #5
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok guys thanks got it working,

    below is my css code how would i make the hyperlink different colours for btmbtn?
    Code:
    body {
    	margin: 0;
    	padding: 0;
    	background-image: url(../images/121bg.jpg);
    	background-attachment: fixed;
    	font-family: arial;
    	font-size: 12px;
    	color: #000000;
    }
    .navbar { 
    color:#0000FF; 
    }
    table { 
      border: 0; 
    } 
    .subheader { 
    background-color: grey;
    	font-family: arial;
    	font-size: 12px;
    } 
    .btmbtn { 
    	background-image: url(images/btmbtn.jpg);
    	font-family: arial;
    	font-size: 12px;
    } 
    p { 
      position:absolute; 
      bottom:2px; 
      cursor: pointer;
    } 
    a:link {
    	text-decoration: none;
    	color: #0154a0;
    }
    
    a:visited {
    	text-decoration: none;
    	color: #0154a0;
    }
    
    a:active {
    	text-decoration: none;
    	color: #0154a0;
    }
    
    a:hover {
    	text-decoration: underline;
    	color: #0154a0;
    }
    Animated Chatrooms - www.121chatrooms.net

  6. #6
    SitePoint Addict Beaumont's Avatar
    Join Date
    Mar 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    .btmbtn a:link {
    
      color: #ABCDEF;
    
    }

  7. #7
    Non-Member
    Join Date
    Aug 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes this <td width='87.5' class='btmbtn' align='center'><a href='new.php'><b>NEW</b></a></td> code will work fine If you want to hyperlink the text inside your cell.
    infact you cant hyperlink the whole td.


Bookmarks

Posting Permissions

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