I have my HTML page with this structure:
<html>
<head></head>
<body>
<nav>
.... navigation menu
</nav>
<div>
<div></div>
<div class="to-print">
<h2>My div to display in print mode<h2>
<section>
<article>....content....</article>
</section>
</div>
<div></div>
</div>
<div>
.... HTML elements
</div>
</body>
</html>
If a user tries to print the page, I want only the content of the DIV with class to-print
to be printed. How can I achieve that?