Results 1 to 2 of 2

Thread: Link Color

  1. #1
    Join Date
    Jun 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Link Color

    Sounds easier that it is...or is it. I need to be able to set the color of the link to "black" when the link is clicked and the new page loads.
    I am using php and I require the top template file which has all the link in white. Is there any way I can change the color of the current link on the page that it leads to. A little confusing I know...

    Thanx

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Dimi
    I need to be able to set the color of the link to "black" when the link is clicked and the new page loads.
    I am using php and I require the top template file which has all the link in white. Is there any way I can change the color of the current link on the page that it leads to. A little confusing I know...
    Yes, I don't think you phrased that too well. Are you saying that you have on, for example:

      http://www.example.com/foo.html

    a link that points to that same address, so you want to distinguish it from all of the other links?

    If that's the case, then first of all, you shouldn't have links that lead to the same page (unless they're links to anchors within a document). Still, whether you change that or not, you'll still want to change the colour of the text. The simple solution is to give the element that contains the text an id attribute (current-section, for example), then style that element with CSS:

    Code:
    a:link {
      background-color: ...;
      color: white;
    }
    #current-section {
      background-color: ...;
      color: black;
    }
    HTML Code:
    <ul>
    <li><a href="/">Home</a></li>
    <li id="current-section">Cheese</li>
    <li><a href="/biscuits/">Biscuits</li>
    </ul>
    Hopefully you get the idea. If not, please provide a link to the page in question and try to be more careful about describing the problem.

    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •