Print a <div></div> only

Is it possible to print just a div?  If you look at this page and click on a person's name, I am wondering if it is possible to print only the individual information box that appears.

Thanks in advance!
Bob SchneiderCo-OwnerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
You have a few possibilities

1. open a new window and document.write the div content to it with an onload=window.print() script
2. hide everything else on print using a style
@media print {
  .bluebox {
    height: 100%;
    width: 100%;
    position: fixed;
    background-color: white;
  }
}

Open in new window

0
Bob SchneiderCo-OwnerAuthor Commented:
I am looking for a way to allow the end user to print the div with their info in it from my website.  Is that an option?
0
HainKurtSr. System AnalystCommented:
add this to css

@media print
{    
    .no-print, .no-print *
    {
        display: none !important;
    }
}

Open in new window


then apply it to elements (class="no-print") that you don't want to print...
0
HainKurtSr. System AnalystCommented:
here is an article that explains how to implement the solution above

http://www.willmaster.com/library/features/a_printer-friendly_web_page_with_non-printing_elements.php
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob SchneiderCo-OwnerAuthor Commented:
Thank you very much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.