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 trialPeter Retvari
2,566 PointsWhat if I want more space between the headline and my content? Like mt-10 or mt-12. It doesn't work for me.
What if I want more space between the headline and my content? Like mt-10 or mt-12. It doesn't work for me. I added CSS class and a new file to set the margin to 300 px, like this:
.magassag{
margin-top: 300px; }
However, I couldn't solve it from HTML and with bootstrap. Is there any other easier solution?
4 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsI'm afraid it takes more knowledge than I have at the moment to override the Bootstrap defaults directly... but it's absolutely okay to take your approach and use your custom CSS. In fact, it's the preferred method.
However, here's some information on overriding Bootstrap in it's own code https://v4-alpha.getbootstrap.com/getting-started/options/
In the past, you were able to use a form on the Bootstrap documentation to select the elements of Bootstrap you needed, but I can't seem to find this now. However, as you've seen it's easy to use custom CSS to override the classes Bootstrap provides.
Jonathan Grieve
Treehouse Moderator 91,253 PointsIt looks like you used an invalid class for Margin top spacing.
Per the documentation, you can only use a sizing class up to 5.
https://v4-alpha.getbootstrap.com/utilities/spacing/You can customize this I believe by going into the Bootstrap documentation and downloading a custom version of Bootstrap
Try using a class of mt-5
and go down until you find a Spacing value that suits you. :)
Alternatively, you can see how you can customize these values in a custom installation.
Peter Retvari
2,566 PointsThanks for your quick answer. Yes, that was my problem. The documentation says that you can only use a sizing class up to 5. What if I want more space? I really have to download BS4 custom version? However, solved it eith CSS. I just wanted to ask is there any other solution
Peter Retvari
2,566 PointsThanks one more time. Helped a lot :) Now, I'm afraid that after my CSS code (which is overwrite the bootstrap coding) my page or that part of my website will be not so flexible like in Bootstrap (e.g.: container, reboot, etc.).