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 CSS Basics (2014) The Box Model Padding, Borders, and Margins

Adrian Soto Kraack
Adrian Soto Kraack
2,980 Points

Does the orther matters?

There is a question in the quiz like this:

"Finally, give the .secondary-content element a dotted, lightgrey bottom border that's 2px wide."

What I did is this: (because is what I saw in the videos)

.secondary-content { 2px dotted lightgrey; }

But, could it be also in the order like the question? dotted, then the color and then the size?

Which is the best way to order it.

Thanks!

3 Answers

The order matters, but you also aren't telling the browser what you want.

You have ".secondary-content { 2px dotted lightgrey; }" - but the browser doesn't know what "2px dotted lightgrey" is referencing. Is it a border? Is it a background? Is it something else entirely?

Your code should look something like:

.secondary-content {
    border: 2px dotted lightgrey;
}

Notice how we tell the browser what property (border) we're modifying. As Dale mentioned in his answer, order does matter: width, style, color. Note that a style is not necessarily required (though best practice is to include it).

I still don't understand. i have tried the advice and I am still getting the wrong answer.