| re: Print entire <div> area
BBB wrote on 03 jun 2004 in comp.lang.javascript:
[color=blue]
> I have a web form with a <div> section ... I have it setup so the
> Update/Cancel buttons are fixed at the bottom of the screen while the
> content of the form is in the <div> and scrolls. Nice to the end user
> ... but when they go to print ... of course they only get a portion of
> the entire web site. I've searched and found references to CSS type
> solutions but have been unable to get them to work.
>
> <div id="main" style="overflow:auto;">
> web form
> </div>
>
> <style type="type/css" media="print">
> div.print { display: block }
> </style>
>
> What I'm looking for is a way to have all of the content in the div
> area to print.
>[/color]
It would ideally be [mind the "text/css"]:
<style type="text/css" media="print">
body {display:none;}
#main {display:block;}
</style>
But no, it does not work, so:
=========================================
<style type="text/css" media="print">
..noprint {display:none;}
</style>
<body>
<div class=noprint>
top
</div>
<div id="main" style="overflow:auto;">
web form
</div>
<div class=noprint>
bottom
</div>
</body>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress) |