Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Overriding browser default colors on page.

I'm only a couple lessons into the Front End Developer track. I can't seem to figure out how to change the browser's default color choices. Resources I found online seem to point towards just writing simple code like:

a:link { color: #6a7b8d; }

But, the code on my workspace page remains the default blue no matter what color I choose. Any suggestions?

4 Answers

Hey Scott,

Chris is correct about the missing bracket. You are also missing a # on line 86 for "#gallery"

CSS doesn't really raise errors like other languages so if you miss a bracket or have some other syntax error it will just end up ignoring the code that follows.

But the color of the code font itself can often give you hints on where an error might be. Notice how prior to the missing bracket when you selected just the elements they are a blue font, but the id's (with the #) are orange. After the syntax error, the colors are different - pretty much reversed in this case.

As you get used to a text editor and get more practice with this stuff you'll get faster at catching syntax errors. Like forgetting to close a tag, quote, or bracket will usually mess up the color scheme enough to tell you that something is wrong.

Thank you so much, Ryan! That worked perfectly. Like you said, I just have to keep working and get used to catching those errors.

Hi Scott,

The code you have will target all unvisited anchor tags and it should work. You could even get rid of the state (:link) if you want, and just apply the color to all anchor tags in general.

a { 
  color: #6a7b8d; 
}

But if it is not working for you then there might be a problem somewhere else.

Some things to check:

  1. Is your stylesheet linked properly in your HTML?
  2. is the syntax of your anchor tags (and surrounding elements) correct?
  3. Are there any other CSS rules above the one in question that possibly have syntax errors?

If you post your code (or provide a snapshot of your workspace) then we can help you debug further.

Hope this helps.

Hi Ryan!

Thank you for your reply. I'm very new to this, but I think this link will take you to what code I have so far. https://w.trhou.se/xife592k48

I've followed the directions closely, so i'm a little lost as to why the links in my browser stay blue no matter what color I change them to.

Any help you can offer is greatly appreciated!

Hi Scott

Line 58 on your main.css, you need to forgot to close the nav tag with "}" and it should work.

Thanks, Chris! I really appreciate your help.