CSS A (link-anchor) syntax question

Discussion in 'HTML' started by still just me, May 5, 2008.

  1. I have a question about the syntax of CSS when used on a link (anchor)
    tag.

    I know how to do change the default link characteristics in a CSS file
    and redefine the general link colors:
    a:link{color:#FF0000}
    a:visited{color:#00FF00}

    But how do I define another second style of link? I want to do
    something like this(below), but I don't know the syntax for the link
    portion:

    ..otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
    text-decoration:none;}

    Thanks,
     
    still just me, May 5, 2008
    #1
    1. Advertising

  2. Scripsit still just me:

    > I have a question about the syntax of CSS when used on a link (anchor)
    > tag.


    You should not try to learn the details of syntax before you understand
    the essential basics.

    > I know how to do change the default link characteristics in a CSS file
    > and redefine the general link colors:
    > a:link{color:#FF0000}
    > a:visited{color:#00FF00}


    No, you don't. Even if the colors there are just examples (and they are
    manifestly _bad_ examples of link colors), there's no justification in
    missing the principle "color and background together if at all".

    > But how do I define another second style of link? I want to do
    > something like this(below), but I don't know the syntax for the link
    > portion:
    >
    > .otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
    > text-decoration:none;}


    Why do you try a mess like that? You could just as well write just
    DWIM
    except that if it worked and had the intended meaning (Do What I Mean),
    it would be very helpful!

    Defining "second style of link" is surely an advanced topic - not in
    terms of CSS syntax but in terms of _design_. Don't even try it before
    understanding and practising the basics. See
    http://www.cs.tut.fi/~jkorpela/www/links.html

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, May 5, 2008
    #2
    1. Advertising

  3. still just me

    Rob W. Guest

    still just me schreef:
    > I have a question about the syntax of CSS when used on a link (anchor)
    > tag.
    >
    > I know how to do change the default link characteristics in a CSS file
    > and redefine the general link colors:
    > a:link{color:#FF0000}
    > a:visited{color:#00FF00}
    >
    > But how do I define another second style of link? I want to do
    > something like this(below), but I don't know the syntax for the link
    > portion:
    >
    > .otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
    > text-decoration:none;}
    >
    > Thanks,
    >
    >
    >


    I understand that you want one extra propertie,
    that is the same for both a:link and a:visited
    this would result in the following:

    a:link {color:#FF0000};}
    a:visited {color:#00FF00};}
    a:link, a:visited {text-decoration:none;}

    --
    Rob
     
    Rob W., May 5, 2008
    #3
  4. still just me

    freemont Guest

    On Mon, 05 May 2008 07:08:50 +0000, still just me writ:

    > I have a question about the syntax of CSS when used on a link (anchor)
    > tag.
    >
    > I know how to do change the default link characteristics in a CSS file
    > and redefine the general link colors: a:link{color:#FF0000}
    > a:visited{color:#00FF00}
    >
    > But how do I define another second style of link? I want to do something
    > like this(below), but I don't know the syntax for the link portion:
    >
    > .otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
    > text-decoration:none;}


    <html><head><style>a:link{color:#00f;} a:visited{color:#ff0;}
    a.otherlink{color:#f00;} a.otherlink:visited{color:#0f0;}</style></head>

    <body><p><a href="#">This is normal link</a></p>

    <p><a class="otherlink" href="#">This is other style</a></p></body></html>

    --
    "Because all you of Earth are idiots!"
    ¯`·.¸¸.·´¯`·-> freemont© <-·´¯`·.¸¸.·´¯
     
    freemont, May 5, 2008
    #4
  5. On Mon, 05 May 2008 13:27:45 +0000, freemont
    <> wrote:

    ><html><head><style>a:link{color:#00f;} a:visited{color:#ff0;}
    >a.otherlink{color:#f00;} a.otherlink:visited{color:#0f0;}</style></head>
    >
    ><body><p><a href="#">This is normal link</a></p>
    >
    ><p><a class="otherlink" href="#">This is other style</a></p></body></html>


    Thanks freemont, exactly what I needed to know.
     
    still just me, May 7, 2008
    #5
  6. On Mon, 5 May 2008 11:53:49 +0300, "Jukka K. Korpela"
    <> wrote:

    >Defining "second style of link" is surely an advanced topic - not in
    >terms of CSS syntax but in terms of _design_. Don't even try it before
    >understanding and practising the basics. See
    >http://www.cs.tut.fi/~jkorpela/www/links.html


    Thanks, but I don't need your philosophy or your lecture. I just need
    some syntax help. If you don't want to provide it, that's fine, but
    the condescending lecture is not helpful.

    PS - Your page looks like crap in MSIE. Perhaps it's you who needs to
    do some studying of proper design with a view towards multi-browser
    support.
     
    still just me, May 7, 2008
    #6
  7. On Mon, 05 May 2008 11:00:41 +0200, "Rob W."
    <> wrote:

    >a:link {color:#FF0000};}
    >a:visited {color:#00FF00};}
    >a:link, a:visited {text-decoration:none;}


    Not exactly what I needed (freemont nailed that) but still a helpful
    technique.

    Thanks,
     
    still just me, May 7, 2008
    #7
  8. Scripsit still just me:

    > On Mon, 5 May 2008 11:53:49 +0300, "Jukka K. Korpela"
    > <> wrote:
    >
    >> Defining "second style of link" is surely an advanced topic - not in
    >> terms of CSS syntax but in terms of _design_. Don't even try it
    >> before understanding and practising the basics. See
    >> http://www.cs.tut.fi/~jkorpela/www/links.html

    >
    > Thanks, but I don't need your philosophy or your lecture.


    You do, but your ignorance is not curable if you decide remain clueless.

    > I just need some syntax help.


    If that had been the case, you would have known how to check the syntax
    faster than you sent your question, not to mention any time of other
    people wasted in replying to you.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, May 7, 2008
    #8
  9. On Wed, 7 May 2008 09:18:42 +0300, "Jukka K. Korpela"
    <> wrote:

    >> Thanks, but I don't need your philosophy or your lecture.

    >
    >You do, but your ignorance is not curable if you decide remain clueless.


    Neither the information you posted or your attitude is helpful. Then
    again, it's obvious that you didn't intend either to be positive..

    >> I just need some syntax help.

    >
    >If that had been the case, you would have known how to check the syntax
    >faster than you sent your question, not to mention any time of other
    >people wasted in replying to you.


    Nonsensical and condescending once again. I don't need your help
    concerning style. The colors I choose for the example were just that -
    colors I chose for an example. You, in what appears to be a standard
    method for your responses here, decided to harp on the color selection
    as an excuse to post a canned response demonstrating your "obvious
    superiority".

    In addition, you decided to use that and leverage it into some kind of
    a springboard of assuming that I don't know anything about web design
    when in fact I can run circles around your academian approach to
    building web pages.

    Some people want to help and that's why they post here. Note that they
    didn't mind me "wasting their time". In fact, they felt good about
    helping.

    If you don't want to help, don't post. If you don't have time, don't
    bother reading posts.

    PS - speaking of design: you might want to take some classes in
    graphic design and layout including alignment, font selection and
    sizing, and color selection. After that you can work on developing
    some artistic skills. Let me know when you build your first
    non-academic site for a commercial customer.
     
    still just me, May 8, 2008
    #9
    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. Paul Furman

    alt tag for an anchor link?

    Paul Furman, Feb 12, 2004, in forum: HTML
    Replies:
    13
    Views:
    43,828
    JohnNotion
    Apr 13, 2012
  3. Jeff Thies

    anchor names syntax

    Jeff Thies, Dec 31, 2004, in forum: HTML
    Replies:
    4
    Views:
    624
    Michael Winter
    Dec 31, 2004
  4. Maxime
    Replies:
    7
    Views:
    3,387
    Jukka K. Korpela
    Mar 20, 2007
  5. Jack Jarmush
    Replies:
    3
    Views:
    4,622
    Jack Jarmush
    Aug 3, 2009
Loading...

Share This Page