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 trialBaran Ureten
5,749 PointsWhy control padding with line-height?
Isn't it easier to just use padding to play around with the space above or below an inline element?
2 Answers
Ivan Franzone
7,328 PointsSimply because "line-height", as its own name indicates, ItΒ΄s more convenient for text elements.
Andreas Anastasiades
2,916 PointsTrue. The line-height makes sure you won't get overlapping text on, let's say, mobile devices...
Susanne Brauer
5,776 PointsPadding does not change the space between individual lines of text rhar are part of the same element, it just relates to the space around the element as such. So lin-height gives you control of the space between the lines WITHIN your paragraph/element.