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!
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
Why does the padding of .card-title only changes the top and bottom but not right and left?
I would like to make the padding; property of the .card-title class less from the right and left sides so that the border is not tooo wide for the h2, whenever i try to put a value to it, it only shrinks or expands from top and bottom only, i tried using padding-left and padding-right, but still not working for me. Please explain, i believe it depends on the parent of that class but i don't know how or why.. i need more explanation on this please.
Jason Stewart14,860 Points
A shot in the dark here, is the .card-title inline instead of block or inline-block?
I don't think padding affects left and right of inline elements.
Try using display: inline-block; if that is the case.
KAMRAN IMRANLI4,107 Points
But display: block does not resolve the problem. The space between the border and the text is still the same.