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 trialNatalie Lewis
3,096 PointsHow do I put space around my div elements (.left and .right) using CSS so that it doesn't look all jammed together?
3 Answers
Rob Potter
9,452 PointsExactly like Christine said...
You could try something like:
.divName { margin-left: 10px; margin-right: 10px; }
or
.divName { margin: 0px 10px 0px 10px; }
or
.divName { margin: 0px 10px; }
As you can see, there are a few different ways you can add space 'around' a div.
Hope that helps! :)
Christine Hendrickson
Front End Web Development Techdegree Student 5,422 PointsIf I'm understanding correctly, perhaps padding or margin would help.
Brandon Brown
4,239 PointsRemember with margins it goes like a clock ie margin: 0 0 0 0; = top margin, right margin, bottom margin, left margin.
Natalie Lewis
3,096 PointsNatalie Lewis
3,096 PointsWhen I added the margin it made one side above the other. how can I make them side by side? https://w.trhou.se/f7tkj7h25o
http://port-80-2mi5c84kkd.treehouse-app.com