#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    South Yorkshire
    Posts
    442
    Rep Power
    24

    Post using css and the CLASS parameter???


    I have a .css file like so

    A
    {
    TEXT-DECORATION: none;
    }
    A:HOVER
    {
    TEXT-DECORATION: underline;
    }
    A.USER
    {
    TEXT-DECORATION: none;
    }
    A.USER:HOVER
    {
    TEXT-DECORATION: underline;
    COLOR: BLUE;
    }

    Now when I use the following line it doesn't work, am I doing something very silly?????

    <a CLASS="USER" onclick="GoTo('user1')">User1</a>
    <a CLASS="USER" onclick="GoTo('user2')">User2</a>
    etc.
    etc.

    Might it be becuase I have no href parameter in the <a> tag???
    regards,

    pgudge
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Chicago, IL
    Posts
    63
    Rep Power
    14
    try this:

    A:link
    {
    TEXT-DECORATION: none;
    }
    A:HOVER
    {
    TEXT-DECORATION: underline;
    }
    A.USER:link
    {
    TEXT-DECORATION: none;
    }
    A.USER:HOVER
    {
    TEXT-DECORATION: underline;
    COLOR: BLUE;
    }
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    South Yorkshire
    Posts
    442
    Rep Power
    24
    nope

    The

    A.USER
    {
    ......
    }

    Seems to work fine it's the :HOVER that is not working.
    regards,

    pgudge
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Chicago, IL
    Posts
    63
    Rep Power
    14
    the BIG question is: are you using NS4.x??? If so, it won't work as this property isn''t supported in NS4.x
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    South Yorkshire
    Posts
    442
    Rep Power
    24

    RE:


    IE5.5 and IE6
    regards,

    pgudge
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Chicago, IL
    Posts
    63
    Rep Power
    14
    Might it be becuase I have no href parameter in the <a> tag???
    i tested the code and it does seem like that is the problem. I have put your styles and your links into a test page, and... Use1 and User2 didn't even show up as links (ie5 on a mac).
    change
    <a CLASS="USER" onclick="GoTo('user1')">User1</a>
    <a CLASS="USER" onclick="GoTo('user2')">User2</a>
    to
    <a CLASS="USER" href="javascript:GoTo('user1')">User1</a>
    <a CLASS="USER" href="javascript:GoTo('user2')">User2</a>
    this should do it.
  12. #7
  13. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    HREF isn't just a parameter, it's an HTML attribute - and it's required to be specified with the tag, so the browser will know you want a hyperlink instead of a page anchor (<a name="...">).

    http://developer.netscape.com/docs/m...s7.htm#1604913
    Last edited by adios; November 9th, 2001 at 06:56 PM.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2001
    Location
    London, UK
    Posts
    661
    Rep Power
    14
    to use your class u gotta be looking at something like this I'd say

    <a href="....." class="whatever" >

    I kno that would work, cause I have it working on my site
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    Don't know if you got it sorted, but here is working code


    <style>
    A
    {
    TEXT-DECORATION: none;
    }
    A:HOVER
    {
    TEXT-DECORATION: underline;
    }
    A:LINK.USER
    {
    TEXT-DECORATION: none;
    }
    A:HOVER.USER
    {
    TEXT-DECORATION: underline;
    COLOR: BLUE;
    }

    </style>
    </head>

    <body bgcolor="#FFFFFF" text="#000000">

    Now when I use the following line it doesn't work, am I doing something very silly?????
    <p>
    <a href="javascript:" CLASS="USER" onclick="GoTo('user1')">User1</a> <br>
    <a href="javascript:" CLASS="USER" onclick="GoTo('user2')">User2</a> </p>


    Note the A:LINK.USER & A:HOVER.USER

IMN logo majestic logo threadwatch logo seochat tools logo