471,582 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 software developers and data experts.

printing div problem

I'm not very good at css but from what I've read it is possible to print the content of a scrolling div. I have tried everything with no luck. From what I've found using a css for the print should work but doesn't seem to. Anyone know what I'm doing wrong?

<style type="text/css">
@media print
div#scroll{height:auto;
font-size:12px;
overflow:visible;
}
</style>
<body>
<div id="scroll" style="border: 1px solid #000000; overflow: hidden; width: 600px; height: 310px">
<div style="padding: 20px 10px; overflow: auto; width: 600px; height: 310px">
large amount of stuff
large amount of stuff
large amount of stuff
</div>
</div>
Sep 1 '07 #1
1 3984
phvfl
173 Expert 100+
I'm not very good at css but from what I've read it is possible to print the content of a scrolling div. I have tried everything with no luck. From what I've found using a css for the print should work but doesn't seem to. Anyone know what I'm doing wrong?

<style type="text/css">
@media print
div#scroll{height:auto;
font-size:12px;
overflow:visible;
}
</style>
<body>
<div id="scroll" style="border: 1px solid #000000; overflow: hidden; width: 600px; height: 310px">
<div style="padding: 20px 10px; overflow: auto; width: 600px; height: 310px">
large amount of stuff
large amount of stuff
large amount of stuff
</div>
</div>
Hi Moonman,

Welcome to TSDN...

Try putting braces around the styles so that the style element reads:
[HTML]
<style type="text/css">
@media print{
div#scroll{
height:auto;
font-size:12px;
overflow:visible;
}
}
</style>
[/HTML]
Sep 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Programatix | last post: by
reply views Thread by Programatix | last post: by
5 posts views Thread by Stefania Scott | last post: by
5 posts views Thread by C-Services Holland b.v. | last post: by
2 posts views Thread by Teemu | last post: by
2 posts views Thread by Sukh | last post: by
18 posts views Thread by Brett | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
1 post views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.