Is it possible to have 2 different coloured links on one page?

Discussion in 'HTML & Website Design' started by excaliburwebdesigners, Apr 17, 2007.

  1. #1
    i want links that are shown in the main page header to be white but then in center part of the main page i want the links to be black.

    Is this possible?
     
    excaliburwebdesigners, Apr 17, 2007 IP
  2. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You want the links to be white in both places?

    Assuming that is a typo you can use styles ... in their simplest form (inline), just set the color attribute:

    <a href="#" style="color:white;">Link1</a>
    <a href="#" style="color:red;">Link2</a>

    ...pretty self explanatory :)
     
    bochgoch, Apr 17, 2007 IP
  3. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi, yes it was a typo i wanted a combination of white links at the top and black link to the left column.

    Code works a treat, and yes easy when you know how. :)
     
    excaliburwebdesigners, Apr 17, 2007 IP
  4. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That isn't recommended.
    CSS is made for styling.
     
    bobby9101, Apr 17, 2007 IP
  5. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #5
    :confused: What does that mean -- do you know what css is :confused:
     
    bochgoch, Apr 17, 2007 IP
  6. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #6
    CSS (cascading style sheets)
    Should be defined in the Head or in an external sheet, if and where possible.
    The style attribute is not recommended.

    so it should be:

    Somewhere in the Head:

    <style type="text/css">
    a.link1 {
    color: #FFF;
    }
    a.link2 {
    color: #F00;
    }
    </style>

    Somewhere in the Body:

    <a class="link1" href="link1.htm">Link 1</a>
    <a class="link2" href="link2.htm">Link 2</a>
     
    bobby9101, Apr 17, 2007 IP
  7. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think bobby9101 was talking about external CSS file, which would be the best solution.
     
    Monty, Apr 17, 2007 IP
  8. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yeah either external or inline
    (the style attribute isn't really inline)
     
    bobby9101, Apr 17, 2007 IP
  9. vccseller

    vccseller Active Member

    Messages:
    932
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    95
    #9
    It can also be defined on the header..

    Bobby is right and is easy too , let's imagine a situation in which the person does 100 links , too tough to do the style attribute for all..

    So Bobby's solution is the best
     
    vccseller, Apr 17, 2007 IP
  10. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #10
    What i use

    *external file

    #footer a:link, #footer:visited
    {color:#FFFFFF;}

    etc etc
     
    bacanze, Apr 17, 2007 IP
  11. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #11
    bochgoch, Apr 18, 2007 IP