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

HTML Build a Simple Website Styling Content Writing CSS

Adding the margin property for btn class is not adding the margin for me

I am working on the btn class and I've added the margin property and have given it values of 40px and 0px but I am not seeing any change in the browser. Has anything changed as far as the application of margin property goes since this video was posted? Why can't I see the change. Here's my btn class: .btn { color: #FAF3BC; background: #4FB69F url('img/texture.png') no-repeat right top; padding: 15px 30px; margin: 40px 0px; border-radius: 25px; text-transform: uppercase; }

Thanks!

3 Answers

Alexandru Olteanu
Alexandru Olteanu
17,522 Points

You have to make it a block or inline-block element before margins will work

Paul Franz
Paul Franz
4,461 Points

Try adding this to the btn class:

display: inline-block;

It works, thanks!