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.

CSS

nicholas maddren
nicholas maddren
12,793 Points

Margin not working with checkbox element

If you take a look here: http://jsfiddle.net/LvhCh/37/

You will notice that the margin CSS doesn't take any effect to the checkbox's position. Any idea why this is happening?

Thanks

3 Answers

It is working fine for me: http://jsfiddle.net/LvhCh/36/

nicholas maddren
nicholas maddren
12,793 Points

Sorry I attached the wrong fiddle, I have edited my post and added the new one :)

Stephen O'Connor
Stephen O'Connor
22,291 Points

There's a rule for 'input[type=checkbox]' showing a 'margin: 4px 0 0;' if you inspect the element, it's coming from bootstrap (line 5), I'm not sure if this is coming from jsfiddle or your own styles, it has probably got more specificity than your .floa-checkbox class.

robert bryan
robert bryan
7,255 Points

i agree with Stephen O'Connor, on fiddle you can go to the "External Resources" and turn off those bootstrap js files and your styling works.