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 How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Matt Kelm
Matt Kelm
7,240 Points

The text links here are green - working alongside, mine are gray because the rule written here overruled the 'a' rule. ?

In the video here, the gallery text links are green. I'm working along, and mine are gray, and were over-ruled by the rule we just wrote for #gallery list items. Why are Nick's links green and mine gray?

3 Answers

Matt Kelm
Matt Kelm
7,240 Points

Thank you for the quick response, Robyn - after digging around a little, I found that Nick and I had our gallery nested a little differently--his was #gallery li a p, and mine was set up #gallery a li p. I'm curious to know if it matters if you wrap the list items in anchor tags or vice versa, but that seemed to be causing my issue--I became more suspicious when his css rule in the following movie didn't have an effect on my version.

Hi Matt,

If you have your links wrapping the li's then you should switch it because otherwise you have invalid html.

The only direct children of ul's or ol's that are allowed are li's or script supporting elements.

Robyn Goodwin
PLUS
Robyn Goodwin
Courses Plus Student 10,009 Points

Somewhere in the CSS training they tell you the colors won't match the videos. I'm figuring with software updates, and different times of the videos being done, they don't keep up with changes. Not to worry, you still can does the challenges and get the code down.

Robyn Goodwin
PLUS
Robyn Goodwin
Courses Plus Student 10,009 Points

I'm glad you were able to figure it out. It will matter as you moved forward. Especially in CSS, as it is parent, child centric. If you get my drift. I'm new at this too so my answers aren't as educated as some can answer you, but order is important. When you have a list especially with links, the a should always be wrapped inside the li.