I am using CSS and JAVASCRIPT for this. Now lets do some CSS for print.
Go to Layout>Edit HTML tab
Search for the closing
</head>
tag.Before
</head>
, add the following lines of code<style media='print' type='text/css'> section, nav, article, aside, hgroup, header, footer, #comments, .comments {display: none;} #main,.main {width: 95% ;} </style>
Explanation:
- The
media='print'
is used to tell the compiler that it’s a print style. - We do not want navigation bar, side bar, comment, footer area to display. so I use a small css code
display: none;
- To hide all this item. Now we want the article area will extent during printing. So I use
width: 95%;
for larger width. We can modify the width for better presentation.
Add a "Print this" link
To print more effectively add a "Print" link in each of your Blogger posts.
To add the print link,
Go to Layout>Edit HTML tab and ticked the "Expand Widget Templates" checkbox.
Now search for this line (Press Ctrl+F for quick search):
<data:post.body/>Immediately after this line, paste one of these three sections of code:
<b:if cond='data:blog.pageType == "item"'> <span style='background: url(http://i818.photobucket.com/albums/zz103/maidul/web%20resource/Print.png) left no-repeat; padding-left: 28px;'> <a href='javascript:window.print()'>Print this post</a></span> </b:if>Explanation:
<b:if cond='data:blog.pageType == "item"'>
is used to check if this currently showing full post.<span style='background: url(http://i818.photobucket.com/albums/zz103/maidul/web%20resource/Print.png) left no-repeat; padding-left: 28px;'>
is for styling the button.<a href='javascript:window.print()'>Print this post</a>
used for printing link.
Very very useful information,
ReplyDeletethanks for the post...
This worked great for me, thanks! Just to mention, I wanted to show on a new line after the last post, so I added
ReplyDeletebefore it and that did the trick! Thanks again!