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

General Discussion

Is there a “right way” to css properities like these?

Let’s say I’m positioning a button below an image.

I could do something like

.button {
  Margin-top: 568px;
}

Or I could do

.button {
  Position: relative;
  Top: 40px;
}

Or I could get away with flexboxing it all.

Is there such a thing as “bad css”, especially when you’re starting as a junior, will companies guide you on what they’d prefer?

1 Answer

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,696 Points

Ironically, there is "bad CSS", and you've highlighted it in your example. All property names should be in lowercase.