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 How to Make a Website Styling Web Pages and Navigation Build Navigation with Unordered Lists

Question on styling Headers

You are setting the margins and padding with pixels instead of the percent. Will it work correctly in a mobile environment if it is specified in the px.

4 Answers

You are setting the margins and padding with pixels instead of the percent. Will it work correctly in a mobile environment if it is specified in the px.

Stefan Vitasovic
Stefan Vitasovic
13,443 Points

Pixel is not a relative but a fixed unit so it will differ from a device to a device. You might wanna try resizing the browser from the smallest to full-screen to see the differences.

Tommy Gebru
Tommy Gebru
30,164 Points

Yes , using the measurements pixels and percent should work with the margins and padding properties. Also using a percentage as a value is much more fluid than pixels and would give a better user experience. You will get a chance to experiment in a mobile environment when you reach the "Responsive Web Design and Testing" Lesson

(https://teamtreehouse.com/library/how-to-make-a-website/responsive-web-design-and-testing/responsive-web-design/)

Tommy Gebru
Tommy Gebru
30,164 Points

Select Best Answer to close the forum post.