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

György Varga
György Varga
19,198 Points

Can you please check my solution?

Hi!

I did a little bit different. Can you please check it?

.primary_col,
  .secondary_col {
    width: 40%;
    display: inline-block;
    margin-right: 50px;
    vertical-align: top;
  }

Thank you very much!

Emily Easton
Emily Easton
13,575 Points

In my opinion, it's absolutely fine. Everyone has their own technique of styling and laying things out in their code (kind of like an artist and the way they paint with a paintbrush), which is great because it suits your own needs and preferences making it easier for you to follow. It is better code to write less so you take up less space and is easier to follow, but if your code works and passes the challenge then you shouldn't worry because you are doing a great job :) . Plus in all fairness you're fairly new to CSS, some people may think theres better ways to do it and you may even learn something else and prefer that technique but as I said in my opinion, theres nothing wrong with what you've written here.

3 Answers

Frans Teja
Frans Teja
8,175 Points

Everyone has their own technique. But when front end developers are collaborating together, all of the developers need to have their own rule of a standard code structure, for future responsiveness and many other aspects which make the code will not be ruined in the future. However, personally when you style an element through external css, you need to order it alphabetically from A to Z. And this is a good habit, so you have less difficulty to read your code or other developers. For example.

Before .primary_col, .secondary_col { width: 40%; display: inline-block; margin-right: 50px; vertical-align: top; }

After, a better readable code .primary_col, .secondary_col { display: inline-block; margin-right: 50px; vertical-align: top; width: 40%; }

If youre using sublime, you can download CSSCOMB.

Regards.

Robert Berek
Robert Berek
3,036 Points

Wow it's amazing how I did the same thing as you mate. It just shows how different people can still think the same even though it was not the same method as shown in the video :)

The only thing I would add to this, is that your method does not center the white space between the two columns with the header and main-nav. It works certainly, but isn't as appealing visually.