Having problem with the link color.

Discussion in 'CSS' started by Creative_illusion, Aug 28, 2007.

  1. #1
    Good morning DPers..

    website

    I'm having a problem with the link on my side column. As you can see it is not uniform the color of the link is dark blue which I want to change but when you hover on the link it turn black which I want. Can anyone here with warm heart help me with this problem. All I want is just change the link color on my sitewide link into something more uniform.

    Thank you in advance...

    God bless. More Power DP.
     
    Creative_illusion, Aug 28, 2007 IP
  2. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #2
    I can't see your style sheet but give it the same class name as the a element in your content section, assuming you're doing a.content{color:black;} and not div.content a{color:black;}. Or else either give the links in the side column a class name and use something like a.classname {color:black;} and use <a class="classname" href="whatever"> in your html, Or if your side column is a div with a class name sidecolumn then do div.sidecolumn a{color:black;}
     
    qazu, Aug 28, 2007 IP
  3. NineDesign

    NineDesign Peon

    Messages:
    237
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could style all your anchor tags with the following;

    a { color:#333; }
    a:hover { color:#000; }

    Remember, this would affect all links on your design (unles they've been styled differently via a parent element, ID or class).
     
    NineDesign, Aug 28, 2007 IP
  4. Creative_illusion

    Creative_illusion Well-Known Member

    Messages:
    2,701
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    175
    Digital Goods:
    2
    #4
    Thanks for the response guys.. here is the link to my CSS

    Thanks...
     
    Creative_illusion, Aug 28, 2007 IP
  5. ssanders82

    ssanders82 Peon

    Messages:
    77
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also, use a:visited to style previously clicked links
     
    ssanders82, Aug 28, 2007 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <div class="divspace"></div>
    Code (markup):
    wtf? looks like someone took the infamous "spacer.gif" and made "divspace." A case of div-osis too.

    Anyways,

    #mbgsidemenu 
    
    a:link {
    color:#8d3910;
    }
    a:visited {
    color:#8d3910;
    }
    a:hover {
    color:#000000;
    }
    a:active {
    color:#8d3910;
    }
    Code (markup):
    Normally, you would change the a:link colour to #000 to make it black, although to tell the truth, the fact that they change colour on mouse hover lets me know that "Dirsensei WebDirectory" is one link and not two...

    Here I think is your problem: In your html, you have a div CLASS called "mbgsidemenu" but which it then referred to in the css as #mbgsidemenu... # is used for ids, which are unique and can only occur in the html once. It should be called (in your css) .mbgsidemenu with the dot in front. That denotes a class. The colour that's in your css now isn't blue. It's a sort of rusty brown-red.
    
    .mbgsidemenu a {
        color:#000;
    } 
    
    Code (markup):
    That should make everything black. But it's still not a good idea. It should change colour when someone's hovering over it, and after they've visited it. In which case, you'd have something like this:

    
    .mbgsidemenu a {
        color: #000; /* here's black */
    }
    
    .mbgsidemenu a:visited {
        color:#918b87;  /* this is a dark grey-ish */
    }
    
    .mbgsidemenu a:hover, a:action, a:focus {
        color:#8d3910;  /* this is brownish */
    }
    
    Code (markup):
     
    Stomme poes, Aug 28, 2007 IP
  7. Creative_illusion

    Creative_illusion Well-Known Member

    Messages:
    2,701
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    175
    Digital Goods:
    2
    #7
    Thanks for the response.. Should I use this code and replace some codes? In which part of my css file? TY in advance...
     
    Creative_illusion, Aug 28, 2007 IP
  8. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You have to find what I first posted (I posted my first... well, second code box with exactly your css code) and replace that.

    It's like halfway down the page, you just have to read carefully... scroll down until you find the a's.

    a:link {
    blah blah

    a:blah

    a:blah


    They're sitting under #mbgsidemenu

    Be careful, there are a few other links on the css sheet with other colours... they all have something else in front of them though, so you know it's not the right one.

    If you have trouble finding it, I don't blame you-- both the html and the css have some issues, coming from a template I think. When you find the right area, replace that area with my last code box and see if it works. I'm still not sure that it's the "#" before mbgsidemenu that's making the links blue... see, blue is usually the default a browser (like mine) uses if it can't find code in the CSS to tell it what to do... but obviously my browser is seeing something because my mouse hover IS turning black like it should...
     
    Stomme poes, Aug 28, 2007 IP