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 Margins

Ben Brenton
Ben Brenton
266 Points

Why isn't it good to use negative margins?

In my current project I am using negative margins quite a bit as they are proving handy, but Guil seems to suggest they are not considered a common technique. Should I be relying on them or should I be using normal values where possible?

Konrad Pilch
Konrad Pilch
2,435 Points

I don tthink if this will answer your quesiton but what ill say is that when i use frameworks the margisn are often negative? but ti works pretty fine . Maybe thats something for more advanced people? i don tknow , i never use negative margins really too .

1 Answer

Hi Ben Brenton,

I don't have a definitive answer, but I'll hazard a guess that negative values of any kind would be discouraged because they are more confusing to reason about than positive values.

If you had to debug / maintain someone else's code, would you find it more enjoyable - easier to reason about - if values were positive or negative?

Ben Brenton
Ben Brenton
266 Points

What do you mean by "reason about"?

In this context, I'm using it interchangeably with "understand".