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
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My CSS links are not working with Firefox :(

    I hope this is the right place to ask.... I have a website that I am working on, I am a relative newb to CSS but I am chugging along... I am at a halt with this problem, the following works with IE but not Firefox. Please help!:

    <tr>
    <td><img src="images/antifps_14.jpg" alt="" /></td>
    <td id="menu1" onClick="location.href('./');"></td>
    <td id="menu2" onClick="location.href('../phpBB2/index.php');"></td>
    <td id="menu3" onClick="location.href('./roster.html');"></td>
    <td id="menu4" onClick="location.href('./matches.html');"></td>
    <td id="menu5" onClick="location.href('./history.html');"></td>
    <td id="menu6" onClick="location.href('./media.html');"></td>
    <td id="menu7" onClick="location.href('./enlist.html');"></td>
    <td id="menu8" onClick="location.href('./linkage.html');"></td>
    <td><img src="images/antifps_23.jpg" alt="" /></td>
    </tr>


    Let me know if you need more of the code, thanks! Also, for some reason the mouse over on Firefox shows the secondary image but it doesn't on IE...

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Calgary, AB
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you have a link to a site this code display's on?


    Thanks,
    Nick!

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by arrchangel View Post
    the following works with IE but not Firefox.
    The JavaScript is incorrect. location.href("URI") should be location.href = "URI".

    Also, it looks like the page is XHTML, based upon the closing slash syntax; if that's the case, then onClick is not a valid attribute; all attribute names must be lower-case in XHTML, so use onclick instead. Finally, while it's nice that you're using the required alt attributes, they're pointless when you leave their values blank; assign the alt attributes a value that describes the image (missing information) should the image fail to load. If it would seem inappropriate to assign the images alternate text, then the images are probably merely presentational and should be displayed via CSS instead of HTML.

    Code:
    Revised Code:
    <tr>
      <td><img alt="[Alternate Text]" src="images/antifps_14.jpg"/></td>
      <td id="menu1" onclick="location.href='./';">Menu Option 1</td>
      <td id="menu2" onclick="location.href='../phpBB2/index.php';">Menu Option 2</td>
      <td id="menu3" onclick="location.href='./roster.html';">Menu Option 3</td>
      <td id="menu4" onclick="location.href='./matches.html';">Menu Option 4</td>
      <td id="menu5" onclick="location.href='./history.html';">Menu Option 5</td>
      <td id="menu6" onclick="location.href='./media.html';">Menu Option 6</td>
      <td id="menu7" onclick="location.href='./enlist.html';">Menu Option 7</td>
      <td id="menu8" onclick="location.href='./linkage.html';">Menu Option 8</td>
      <td><img alt="[Alternate Text]" src="images/antifps_23.jpg"/></td>
    </tr>
    Quote Originally Posted by arrchangel View Post
    Also, for some reason the mouse over on Firefox shows the secondary image but it doesn't on IE...
    You need to show the relevant code if you want that problem addressed.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ragol_67 View Post
    Do you have a link to a site this code display's on?


    Thanks,
    Nick!
    Well, it is a work in progress, but the site is http://www.theadultswim.com , it's a website for a guild on the world of warcraft game. For fun.


    Quote Originally Posted by Arbitrator View Post
    The JavaScript is incorrect. location.href("URI") should be location.href = "URI".

    Also, it looks like the page is XHTML, based upon the closing slash syntax; if that's the case, then onClick is not a valid attribute; all attribute names must be lower-case in XHTML, so use onclick instead. Finally, while it's nice that you're using the required alt attributes, they're pointless when you leave their values blank; assign the alt attributes a value that describes the image (missing information) should the image fail to load. If it would seem inappropriate to assign the images alternate text, then the images are probably merely presentational and should be displayed via CSS instead of HTML.

    Code:
    Revised Code:
    <tr>
      <td><img alt="[Alternate Text]" src="images/antifps_14.jpg"/></td>
      <td id="menu1" onclick="location.href='./';">Menu Option 1</td>
      <td id="menu2" onclick="location.href='../phpBB2/index.php';">Menu Option 2</td>
      <td id="menu3" onclick="location.href='./roster.html';">Menu Option 3</td>
      <td id="menu4" onclick="location.href='./matches.html';">Menu Option 4</td>
      <td id="menu5" onclick="location.href='./history.html';">Menu Option 5</td>
      <td id="menu6" onclick="location.href='./media.html';">Menu Option 6</td>
      <td id="menu7" onclick="location.href='./enlist.html';">Menu Option 7</td>
      <td id="menu8" onclick="location.href='./linkage.html';">Menu Option 8</td>
      <td><img alt="[Alternate Text]" src="images/antifps_23.jpg"/></td>
    </tr>
    You need to show the relevant code if you want that problem addressed.
    Thank you! I am going to try this out and see if it works, if not I will let you know

    Thanks again for your replies!

  • #5
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay the revised code helped the buttons actually work! Thanks . I suppose I am doing this wrong because I don't want text in place, just the image of the buttons... so that when you click on the button image you are taken to the href..

    So I took the revised code and removed the text and now it works like I think I wanted it to, but I am pretty sure I am jerry rigging it somehow XD

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by arrchangel View Post
    Well, it is a work in progress, but the site is http://www.theadultswim.com […]
    There doesn't seem to be a website at that address.

    Quote Originally Posted by arrchangel View Post
    I suppose I am doing this wrong because I don't want text in place, just the image of the buttons... so that when you click on the button image you are taken to the href..

    So I took the revised code and removed the text and now it works like I think I wanted it to, but I am pretty sure I am jerry rigging it somehow XD
    I'm guessing that you've assigned each cell a background and are using that background image to indicate the presence of a link? If so, you may want to put actual images (img) in those table cells and surround them with an anchor (a) element instead of using CSS backgrounds and JavaScript. That way you have a fall-back mechanism in case images, CSS, or JavaScript are disabled: if images are disabled, you'll still have the alternate text; if CSS is disabled, you still have the images or alternate text; and if JavaScript is disabled, your links will still be functional.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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