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
Payal Sen
1,173 PointsNeed help for flexible margin layout in responsive designing section
I am new to this area, need some help as to how can i use the example given in the tutorial in my known website.Finding it difficult to adjust the margin in the example "Smells like Bakin" layout.
Payal Sen
1,173 PointsI am sorry the my question was not clear.What i meant to ask is how can i adjust the margin of the "smells like bakin" website as instructed in the responsive web design tutorial video.The example given is clear,but i am not able to use the technique in the code of "smells like bakin" website i mean the percentage calculations of the margins.
Nick Pettit
Treehouse TeacherHi Payal,
Can you provide me with the link to the video that you're having trouble with? There are lots of videos in that course, and lots of instances where margins are used. I want to help, but I'm not sure what part of the code you're talking about. :)
Thomas MacFarlane
2,430 PointsI am having an issue with this also:
My code is at http://codepen.io/anon/pen/ebldH
(Font sizes are funny because I did the extra credit on http://teamtreehouse.com/library/websites/build-a-responsive-website/introduction-to-responsive-web-design)
I don't understand how to change the margin and padding for the .btn class, the copyright div etc etc, all instances of margin and padding. The values I get are all off.
The video I just watched is http://teamtreehouse.com/library/websites/build-a-responsive-website/creating-a-fluid-foundation/creating-flexible-margins
Please help, this has put such a damper on my learning. :(
Thomas MacFarlane
2,430 PointsI now understand everything except why changing:
ul.nav li {
float: left;
margin-right: 40px;
}
to
ul.nav li {
float: left;
margin-right: 10%;
}
Causes the nav elements to wrap even though there is plenty of space!
1 Answer
Darwin Pérez
2,351 PointsHi Payal, how are you?
Maybe this works for you, As you may know there is a magic formula for responsive web design: target / context = result. // Target is the margin you want to convert into percentage and the context is the width of the element´s container.
So.. For margins, the context is the width of the element´s container. For Paddings, the context is the width of the element itself.
... Take it step by step, I am sure you will find the right solution :)
Payal Sen
1,173 Pointshello Darwin,
I am doing good and thanks for the suggestion. I am able to make the changes now.
Thomas MacFarlane
2,430 PointsI don't understand though, please see my post above, I really need help
Nick Pettit
Treehouse TeacherNick Pettit
Treehouse TeacherHi Payal,
I'd love to help you out! Can you be a little bit more specific? What seems to be giving you difficulty?
If you'd like, you can post your code on Code Pen and then share the link here. That will make it much easier to help.