Internal link help

Discussion in 'HTML' started by Andrew S., Jan 5, 2004.

  1. Andrew S.

    Andrew S. Guest

    I am setting up a Q&A page with the questions listed on top linked to the
    corresponding question below.

    The problem I am having is using the link class it changes the size but
    ignores the color.
    The class works with all other links on the page properly.


    Since the page is not live I have included one of the links and the CSS
    class:

    ----------------------------
    ..linkA
    {
    font-size: 100%;
    color:#003399;
    text-weight: bold;
    text-align: center;
    }

    a { color: #009999; text-decoration: none; font-weight: bold; font-size:
    120%; }
    a:visited { color:#009999; font-weight: bold; text-decoration: none; }
    a:hover { color: #666666; font-weight: bold; text-decoration: none; }

    <a class="linkA" href="#question1/">1. How expensive are water
    treatment systems?</a><br />

    ----------------------------
     
    Andrew S., Jan 5, 2004
    #1
    1. Advertising

  2. Andrew S.

    m Guest

    Andrew S. wrote:

    > .linkA
    > {
    > font-size: 100%;
    > color:#003399;
    > text-weight: bold;
    > text-align: center;
    > }
    >
    > a { color: #009999; text-decoration: none; font-weight: bold; font-size:
    > 120%; }
    > a:visited { color:#009999; font-weight: bold; text-decoration: none; }
    > a:hover { color: #666666; font-weight: bold; text-decoration: none; }
    >
    > <a class="linkA" href="#question1/">1. How expensive are water
    > treatment systems?</a><br />


    Seems to be working fine for me in Konqueror. The class overrides the
    default behavior of <a> as expected. Maybe it's the browser you're
    using?

    (BTW, if you want your code to validate, always set a background color
    when setting a color. If you validate your page, it may help you to find
    the problem.)
    --
    cheers, m at mbstevens.com
     
    m, Jan 5, 2004
    #2
    1. Advertising

  3. Andrew S.

    Richard Guest

    Andrew S. wrote:

    > I am setting up a Q&A page with the questions listed on top linked to the
    > corresponding question below.


    > The problem I am having is using the link class it changes the size but
    > ignores the color.
    > The class works with all other links on the page properly.



    > Since the page is not live I have included one of the links and the CSS
    > class:


    I would refrain from using a keyword as a class or id name all together.
    use something like "jlink" instead.
     
    Richard, Jan 5, 2004
    #3
  4. Andrew S. wrote:

    > .linkA
    > {
    > font-size: 100%;
    > color:#003399;
    > text-weight: bold;
    > text-align: center;
    > }


    Try using

    a.linkA:link { ... }
    a.linkA:visited { ... }
    a.linkA:hover { ... }
    a.linkA:active { ... }
    etc

    and put all this *below* the CSS for regular links.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Jan 5, 2004
    #4
  5. Richard wrote:
    > I would refrain from using a keyword as a class or id name all together.
    > use something like "jlink" instead.


    How is "linkA" a keyword?
     
    Leif K-Brooks, Jan 5, 2004
    #5
  6. Andrew S.

    Richard Guest

    Leif K-Brooks wrote:

    > Richard wrote:
    >> I would refrain from using a keyword as a class or id name all together.
    >> use something like "jlink" instead.


    > How is "linkA" a keyword?


    Through experience, I have learned that when you use keywords as the basis
    of your variable name, it has a tendancy to screw up the works.
    If "name" is a keyword, do not use "names".
    Where some browsers may accept the usage, will they all?

    During the programming of an extensive program in the old BASIC language, I
    realized that one of the problems with variable names is not only the usage
    of keywords in the name, but the length as well.
    Having several that started with "store-compare" and a letter at the end for
    differentiation, I simply put that letter at the beginning and all of a
    sudden things worked better.

    "linka" is a two fold problem. Not only is "link" a keyword, so is "a".
    Depending on how well the program is written, the syntax checking may throw
    back an error simply because the first few letters matched a keyword.

    In my experience of writing programs, I just stay away from using variable
    names that contain keywords.
     
    Richard, Jan 5, 2004
    #6
  7. Richard wrote:
    > "linka" is a two fold problem. Not only is "link" a keyword, so is "a".
    > Depending on how well the program is written, the syntax checking may throw
    > back an error simply because the first few letters matched a keyword.


    Ignoring the fact that neither is a keyword, I've never seen a browser
    which will choke on two keywords being combined (or even a keyword being
    used in a class name by itself).
     
    Leif K-Brooks, Jan 5, 2004
    #7
  8. Andrew S.

    Andrew S. Guest

    Thanks everyone,

    I changed the style sheet to the method below and it is now working fine on
    all those keyword named classes.

    Thanks
    Andrew S.

    "Toby A Inkster" <> wrote in message
    news:p...
    > Andrew S. wrote:
    >
    > > .linkA
    > > {
    > > font-size: 100%;
    > > color:#003399;
    > > text-weight: bold;
    > > text-align: center;
    > > }

    >
    > Try using
    >
    > a.linkA:link { ... }
    > a.linkA:visited { ... }
    > a.linkA:hover { ... }
    > a.linkA:active { ... }
    > etc
    >
    > and put all this *below* the CSS for regular links.
    >
    > --
    > Toby A Inkster BSc (Hons) ARCS
    > Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    >
     
    Andrew S., Jan 5, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    891
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    487
    Eki Y. Baskoro
    Dec 18, 2003
  3. Grant Robertson
    Replies:
    10
    Views:
    573
    Grant Robertson
    Apr 11, 2007
  4. Replies:
    0
    Views:
    130
  5. Iain Adams

    Scrolling to an internal Link

    Iain Adams, Jun 18, 2007, in forum: Javascript
    Replies:
    4
    Views:
    113
    scripts.contact
    Jun 18, 2007
Loading...

Share This Page