How do I remove the sidebars on my site for my content pages using CSS?

Do you want to remove the sidebars on your site using CSS? Insert the following JaveScript inside the source of the content page where you want them removed. The JavaScript will generate the CSS you need to remove the sidebars.

<script type="text/javascript">
<!--
$(function(){
    $('#content-left').css('display', 'none');
    $('#content-right').css('display', 'none');
    $('#content-middle').css('width', '960px !important');
});
//-->
</script>

In the above code, the line with "#content-left" will remove the sidebars on the left. The line with "#content-right" will remove the sidebars on the right. The line with "#content-middle" will adjust the overall width of your content area to fill in the space where the sidebars were. You may need to adjust that 960px number to get the correct width that matches your design.

 

Search or Browse all topics