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) Understanding Values and Units Percentages

pourcentage

hey, well, how can I put this .. the pourcentage of the page, is limited at 100%, then why in some values we can pass 150%, I mean in font-sizes I get it, but in margins and paddings and stuffs, is that possible ? thanks !

2 Answers

Craig Watson
Craig Watson
27,930 Points

Hi,

The percentage value being used over the 100% can come in really handy in some circumstances but yes it is not used in all cases as with anything really its all about picking and choosing your moments.

For background images if you only want to use some of the image on a smaller div with your design increasing the size using percentages this can work really well.

There are limited cases were this use is good practice so using it for margins would be counter productive as well as padding but it is a very useful tool to have in the armory so well worth understanding the limits!

Hope this helps! Craig

thanks for clarifying it to me Craig, I appreciate !