Results 1 to 8 of 8

Thread: Link not staying the right color

  1. #1
    Join Date
    Sep 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Link not staying the right color

    Good Afternoon

    I really hope that someone can help me please.

    I am trying to make my navigation list so that when a link is click, that link stays a certain color until you go and click another link

    I have tried all the different CCS I know to make that, it is not accepting the color change, I think some other style is taking it over but have tried getting rid of or changing them to no avail. here is the css code in dreamweaver:

    body {
    font-family: Arial;
    color:#ffffff;
    font-size:11px;
    }

    td {
    font-family: Arial;
    color:#ffffff;
    }
    .copy {
    font-family: Arial;
    color:#000066;
    }
    h1 {
    font-family: Arial;
    color:#ffffff;
    font-size:20px;
    font-weight:bold;
    margin-top:10px;
    }
    h2 {
    font-family: Arial;
    color:#000066;
    font-size:18px;
    font-weight:bold;
    margin-top:10px;
    margin-bottom:10px;

    }
    h3 {
    font-family: Arial;
    color:#ffffff;
    font-size:14px;
    font-weight:bold;
    margin-top:0px;
    margin-bottom:0px;
    }

    a.link:link {font-family: Arial;
    color:#ffffff;
    text-decoration:none;
    font-weight:bold; }
    a.link:visited {font-family: Arial;
    color:#ffffff;
    text-decoration:none;
    font-weight:bold; }
    #activelink a:active {
    font-family: Arial;
    color:#FF9900;
    text-decoration:none;
    font-weight:bold;
    }
    input
    {
    color:#ffffff;
    border: 1px solid #FFffff;
    background-color:#000066;
    }
    input.button
    {
    width: 70px;height: 24px;
    color:#ffffff;
    border: 1px solid #FFffff;
    background-color:#000066;
    cursor:hand;
    }
    #popup
    {
    position:absolute;
    left:225px;
    top:80px;
    }
    div.overflow {
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    padding-bottom:0px;
    width: 100%;
    height: 380px;
    overflow-x: hidden;
    overflow: auto;
    scrollbar-arrow-color:#ffffff;
    scrollbar-face-color:#000066;
    scrollbar-highlight-color:#ffffff;
    scrollbar-shadow-color: #FFFFff;
    scrollbar-track-color:#ffffff;
    scrollbar-3dlight-color:#FFFFff;
    scrollbar-darkshadow-Color: #FFFFff;
    }
    .borders
    {
    border-right:1px solid #000000;
    border-bottom:1px solid #000000;
    border-top:1px solid #000000;
    color:#000066;
    }

    Thank you for ur help.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    can you give us the link to the site? so we can look at any other code that may be inhibiting

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Wouldn't this need javascript?

    <a href="" onclick="changeit(this);">

    function changeit(link) {
    link.properties = newstuff;
    global oldlink.properties = regularstuff;
    global oldlink = link;
    }

    Rough concept.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Sep 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boogyman View Post
    can you give us the link to the site? so we can look at any other code that may be inhibiting

    Thank you for your reply.My site if not live...hence i put all my coding with all files linked to it.

  5. #5
    Join Date
    Sep 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried to put this within the <a href="" onclick="document.bgcolor='#FF9900';"

    wanted to whats going to happen...but nothing is happening.

  6. #6
    Join Date
    Sep 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    why this in CSS not working?

    a:active{
    display:block;
    font-family: Arial;
    color:#FF9900;
    text-decoration:none;
    font-weight:bold;
    background-color:#000066;
    }

    a:focus{

    font-family: Arial;
    color:#FF9900;
    text-decoration:none;
    font-weight:bold;
    background-color:#000066;
    }

  7. #7
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    1) are you travelling between pages when you click on a link? eg. does the link take you to a different page?
    in this case you do not even need javascript at all... you just need to add a class that would provide a distinction between the link from the page in use and the rest of the possible choices
    Code:
    <a href="somelink">SOME LINK</a>
    <a href="thelink" class="selectedLnk">CURRENT LINK</a>
    <a href="somelink">SOME LINK</a>
    <a href="somelink">SOME LINK</a>
    <a href="somelink">SOME LINK</a>
    and just change the class on whatever link is the page currently being viewed

    2) if you're using the anchor tag to redirect you to a differnt part of the page (eg [jump to Top of page] ) on here is an example then you could try something like
    Code:
    <a href="#some_reference" onclick="this.style='background-color: #f90'">
    the above could also be used in what I am assuming is your situation were you are incorporating some type of frame system :? where you click on a link and it populates the new page into a frame / iframe located somewhere on the page.

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Trouble/complexity with that is still that the old link would need to be changed to the inactive color.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •