Web Analytics Made Easy -
StatCounter My CSS links are not working with Firefox :( - CodingForum

Announcement

Collapse
No announcement yet.

My CSS links are not working with Firefox :(

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    Do you have a link to a site this code display's on?


    Thanks,
    Nick!

    Comment


    • #3
      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>
      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.

      Comment


      • #4
        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.


        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!

        Comment


        • #5
          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

          Comment


          • #6
            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.

            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.

            Comment

            Working...
            X