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

Absolute Centering - Primary col left offset error?

Challenge 5: Set the primary columns left offset to 0, and the secondary column's right offset to 0.

Make sure you're giving "primary the correct left offset value is the error. I can't figure out where the error is.

.primary-col  {
  left: 0;
}

.secondary-col  {
    right: 0;
}

1 Answer

Hi Janise,

Your left and right declarations look good, but you're trying to apply them to non-existent classes. You're targeting primary-col and secondary-col, but these css classes don't exist in the file you're trying to style (index.html).

Looking at index.html, around line 20 you'll see:

<div class="primary col"> ...

Notice the space between primary and col.

When assigning classes to an html element, you can add as many classes as you'd like, by simply listing the desired classes with a space between them. What you see here isn't a div with a single class of primary col (or primary-col as you've written), but rather a div with two classes, primary and col.

The same is true at line 25 with

<div class="secondary col">...

Challenge #4 had you style the col class. Challenge #5 is asking you to style the primary and secondary classes.

Hope this helps!

Shawn THANK YOU!!!!!

I spent over an hour last night trying to figure this out....I get it now. Your explanation was very helpful.

Thank you so much!