Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print a section of post in blogger template

Status
Not open for further replies.

sweebee

Technical User
Nov 1, 2012
2
0
0
AU
My blogger post is something like this


<div style="text-align: justify;">
<span style="font-family: Georgia, Times New Roman, serif;">[highlight #73D216]don't print this part[/highlight]</span></div>
<[highlight #FCE94F]div class="important[/highlight]" style="border: 2px dotted rgb(158, 158, 158); margin: 25px auto auto; padding: 10px 20px; position: relative; width: 600px;">
[highlight #F57900]this part should be printed[/highlight]
</div>

So now i have to insert a print button above the printable section and when user click on that only the content of div class important should be open in a new tab and then user should be able to print that part. So how can i do this?
Im not a programmer. Have no knowledge about html or javascript. could anyone give me code for this please?
Thanks in advance
 
Hi

sweebee said:
Im not a programmer. Have no knowledge about html or javascript.
No need for programmer, neither for HTML or JavaScript knowledge. CSS is enough :
CSS:
@media print {
  div[teal]:[/teal]not[teal]([[/teal]class[teal]=[/teal]"important"[teal]])[/teal] [teal]{[/teal] [COLOR=coral]display:[/color] [COLOR=darkgoldenrod]none[/color]; [teal]}[/teal]
}
Of course, depending on your document structure this may not be enough.

Feherke.
[link feherke.github.com/][/url]
 
Feherke's solution assumes you only have one printable section on the page. Do you have several different sections that you want to print individually, like a blog index or roll? If so, then you should simply have your print button link to the individual blog entry, where you have employed Feherke's CSS suggestion.

This printing of web pages is an intriguing concept. I recall my boss giving me a paper Rolodex in 1996 so that I could write down and file the URLs of interesting web sites, unaware of browser bookmarks/favorites.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top