Jump to content
Sign in to follow this  
aarekolit

Printing CSS

Recommended Posts

aarekolit

What is the proper css for removing the sidebar and make the content 100% wide? It does not move to the left with recomended css: /* Print Style Sheet */ @media print { /* Page content */ #page-main { margin:0; } #header {display:none; } #postnav{display:none; } #sidebar-wrap{display:none; } #column-wrap{margin:0; float:none; width:auto;} #comments { } #sidebar {display:none; } #footer {display:none; } .meta-share{display:none;} .pl-sharebar{display:none;} }

Share this post


Link to post
Share on other sites
Danny
Hi, Add the following code to your print.css file, this will hide the sidebar and make the content full width regardless of layout. [code]#sidebar-wrap, #sidebar1, #sidebar2 { display:none;} .one-sidebar-left #pagelines_content #column-wrap, .one-sidebar-right #pagelines_content #column-wrap, .two-sidebar-left #pagelines_content #column-wrap, .two-sidebar-right #pagelines_content #column-wrap, .two-sidebar-center #pagelines_content #column-wrap { float:none; width:auto }[/code] I have also provided you with a link to the Wordpress Codex, regarding the print.css. http://codex.wordpress.org/Styling_for_Print

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
aarekolit
Hi, Thanks for the reply. Your suggestion worked. So the correct css for printing only the content: @media print { #sidebar-wrap, #sidebar1, #sidebar2 { display:none;} .one-sidebar-left #pagelines_content #column-wrap, .one-sidebar-right #pagelines_content #column-wrap, .two-sidebar-left #pagelines_content #column-wrap, .two-sidebar-right #pagelines_content #column-wrap, .two-sidebar-center #pagelines_content #column-wrap { float:none; width:auto } #footer {display:none; } .meta-share{display:none;} .pl-sharebar{display:none;} #header {display:none; } #postnav{display:none; } } Answer Accepted

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×