Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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.