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 trialJosé Manuel Martínez López
18,133 PointsHow can i disable the horizontal scrollbar?
I have an image as background and it has some extra space that i don´t need.
1 Answer
John Hartney
2,893 PointsI use this
html {
background: no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
This is cool if you're using php
$("body").css("overflow", "hidden");
- JH
Chris Shaw
26,676 PointsChris Shaw
26,676 PointsPlease bare in mind that you don't need JavaScript to achieve this, CSS can do this and it's much faster than any piece of JavaScript.
John Hartney
2,893 PointsJohn Hartney
2,893 PointsThanks Chris, I thought that was php, oops!
If it's well supported, css seems to be the best way to go with most things, at least thats what I'm learning since I joined treehouse
It's interesting to note how many ways you can do the same thing, though even more interesting to know what is the most efficient.