Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Eric Nachtsheim
Eric Nachtsheim
1,566 Points

Why is my preview color is off?

As told in the video, I end up with this in my a:focus

background-color: rgba(255, 165, 0, .5);

In the preview page, it shows up as a light shade of orange as expected. But when I hover my mouse over this value in the workspace, it shows a shade of brown. I don't understand why that is.

1 Answer

Steven Parker
Steven Parker
217,531 Points

For "focus" to take effect, you'd need to select the element, not just hover over it.

But the workspace editor doesn't use the CSS, that's what the preview page is for. In the workspace, you're probably seeing some aspect of the syntax highlighting features of the editor.

Eric Nachtsheim
Eric Nachtsheim
1,566 Points

So, because of the way focus works, the workspace won't always preview focus color correctly? I'm most confused because it did preview it correctly before I added the ".5" onto it.

I suppose I am still getting the color I want in the end.

Steven Parker
Steven Parker
217,531 Points

It might help if you make a snapshot of your workspace and post the link to it.