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

HTML How to Make a Website Styling Web Pages and Navigation Style the Image Captions

John MacFadyen
John MacFadyen
7,249 Points

Does it matter what order the code is in on the CSS file? I am typing in what he has and am seeing no change.

I did not reorganize the main.css file in the video where he did and i am seeing no change when i edit the gallery and paragraphs.

3 Answers

Yes the order in which properties are defined is very important in css. As the properties down the documents override the ones before them, hence the cascading part of css. Check if that is in fact the problem. If not we can help you solve the problem better if you post the code.

Hope this helps

jason chan
jason chan
31,009 Points

yes it does

<style>
p  {color:red;}
p {color:green;}
</style>
</head>
<p>Green</p>

Actually, I was wondering about this too. I know the order the properties matter, but does the order of the values in a property matter?

'''#gallery li a p { margin: 0; padding: 5%; font-size: 0.75em; color: #bdc3c7; }'''

'''#gallery li a p { color: #bdc3c7; margin: 0; font-size: 0.75em; padding: 5%; }'''

Would both of these rules do the same thing?