Solved

Why are my links black?

Posted on 2011-03-03
10
230 Views
Last Modified: 2012-06-22
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
Comment
Question by:wordswithfriends
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35032200
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
 
LVL 6

Expert Comment

by:jello024
ID: 35032204
It looks like
#sidebar a
in
style.css
is changing the link color. you can remove that or change the color value.
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35032211
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:wordswithfriends
ID: 35032225
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
 

Author Comment

by:wordswithfriends
ID: 35032353
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
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 35043319
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
 

Author Comment

by:wordswithfriends
ID: 35045781
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
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 35046103
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
 

Author Comment

by:wordswithfriends
ID: 35061402
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
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 250 total points
ID: 35063083
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html5 1 45
CSS Formatting Getting Stripped 1 35
Importing website from Wordpress into updated theme 3 35
carousel control extend past the images 9 28
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question