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 trialBinyamin Friedman
14,615 Pointsdp vs. sp
What is the difference? When do you use one or the other? When I used them they produced the same results.
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi Binyamin,
If you do a Google Search on this, you'll come up with many resource, like this Stack Overflow Thread.
Keep coding!
Timothy Adams
674 PointsTimothy Adams
674 PointsA very general way of thinking about it is: SP -- Scale-Independent Pixels -- is relevant to the SIZE of the screen. DP -- Density-Independent Pixels -- is relevant to the RESOLUTION of the screen.
This doesn't explain everything about SP/DP, but it's a good general guideline.