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
Unsubscribed User
17,284 PointsEdit Theme
I'm using This theme to create a website for a family member. The problem I am having is the theme defaults to "wide" and I want it to be "boxed". You can see the style switcher to the left (click on cog). I found this in the .JS file. Does anyone know how to make this template stay in the boxed format by looking at this script? Thanks.
//Layout Switcher
$(".layout-style").change(function(){
if( $(this).val() == 1){
$("#container").removeClass("boxed-page"),
$(window).resize();
} else{
$("#container").addClass("boxed-page"),
$(window).resize();
}
});
5 Answers
Colin Bell
29,679 PointsThe only thing that script does is add or remove that the boxed-page class. If you're using their stylesheets, you should be able to just add class = "boxed-page" to the #container div in your html file:
<body>
<!-- Full Body Container -->
<div id="container" class="boxed-page">
<!-- The rest of your stuff -->
...
</div>
</body>
Zoltán Holik
3,401 PointsYour javascript code only add or remove a CSS class on your #container div. You need to write the CSS code for the .boxed-page class.
Unsubscribed User
17,284 PointsAfter looking into it more I'm not sure the style switcher has anything to do with it...the theme defaults to wide and I just want to make it boxed. Help still needed.
Unsubscribed User
17,284 PointsHey Colin, do you mean a Horizontal scroll bar? I get a vertical scroll bar no matter what I do.
Colin Bell
29,679 PointsYeah, haha. Sorry. Kind of hard to avoid vertical scrollbars. I should probably pay closer attention to what I'm writing when giving advice.
Unsubscribed User
17,284 PointsThanks for the help...
Unsubscribed User
17,284 PointsUnsubscribed User
17,284 PointsYou're a genius...thanks.
Colin Bell
29,679 PointsColin Bell
29,679 PointsLooking at it further, you might want to make a slight change to it yourself. The
boxed-pageadds a width of 1220px. The media query is set for 991px. So on screens between 992px and 1219px, you're getting averticalhorizontal scrollbar.VerticalHorizontal scrollbars suck (at least in my opinion, haha). Easiest fix would be to just make it amax-width: 1220px;