• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Why are my links black?

I find CSS very confusing.  Can you please tell me what to change to make my links a more traditional blue

http://wordswithfriends.net/?page_id=1779
0
wordswithfriends
Asked:
wordswithfriends
  • 4
  • 3
  • 2
  • +1
1 Solution
 
rawinnlnx9Commented:
Somewhere you have a CSS class that has this definition:

a
{
    color: #000;
}

Open in new window

Replace with:

a
{
    color: #9dd334;
}

Open in new window


Don't forget to set attributes for visited forms and such.
0
 
jello024Commented:
It looks like
#sidebar a
in
style.css
is changing the link color. you can remove that or change the color value.
0
 
rawinnlnx9Commented:
To see what is going on. Navigate to the URL you provided and in IE7 or IE8 press F12. In the new window click on the mouse pointer at the far left. Now ALT+TAB back to your URL and mouse over the link and click it. Then go back to the F12 window and it will show you the class that has defined the attributes of your a tag. When I view it IE tells me that "style.css" is what is setting your a attributes.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
wordswithfriendsAuthor Commented:
rawinnlnx9, it's not just a, I have sidebar a, footer a etc and I don't know which one to choose

jello024, it's not sidebar a which is currently 3c3c3c.

I know it's some type of a but I can't figure out which one
0
 
wordswithfriendsAuthor Commented:
rawinnlnx9, good tip.  I've tried modifying content a but this changes both the heading and the body.  I wish to change only the body
0
 
Chris StanyonCommented:
Line 156 of your style.css file contains the following:

#content a {
      color: #000;
}

If you want to set the links to their default colours, simply remove these lines. If you want to set another colour, change it.


0
 
wordswithfriendsAuthor Commented:
I've tried that but it changes both my heading and content colors.  I just want the content anchor changed but the heading to remain black
0
 
Chris StanyonCommented:
OK, Sorry. Didn't notice that. It's because your heading is also a link (not sure if this is want you want.)

You could either remove the link from the header, or change the rule in your CSS to style only links within H2.

Change line 156 so that it only styles the H2 links
Instead of
     #content a { color:#000000; }

set it to
     #content h2 a { color: #000000; }

Open in new window

0
 
wordswithfriendsAuthor Commented:
That works but there are a few other undesired secondary effects e.g. "Older Posts" turns blue I would like it to stay black.  There must be some piece of code that affects just the links I want because those links are underlined and the others are not.

Would it be possible to find the CSS that is responsible for underlining and then modify that so that only the within post links are affected?  The
0
 
Chris StanyonCommented:
There is no CSS that defines the underline in your styles. Underlined links are the default, so your style sheet removes the underline, but only for links in the sidebar (style.css - line 265).

For CSS to style links differently, it needs to be able to identify them. For example, your style sheet says to colour all links within the content DIV to black (#content a { color:#000; }. If you only want some links to be black, then you will have to identify these separately, maybe adding a class and styling that.

Example
HTML
<a href="whatever.html" class="redlink">This will be black</a>

CSS
a.redlink { color: #f00; }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now