473,666 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printer friendly page

I have a web page where I am using a stylesheet and the
attribute and value - media="print" - as below:

<link href="../page_print.css" rel="stylesheet " type="text/css"
media="print">

It works fine except, that the text that I want printed ends up in the
middle of the screen because elements made invisible in the stylesheet
still effect the text's positioning. Stylesheet is like this:

body {visibility:hid den;}

..print {
visibility:visi ble;
position: absolute;
top: 10px;
left: 10px;
}

As shown I have tried using absolute positioning for the printer style
sheet to force the text further up, but the text at the bottom of the page
then gets split over two pages. Is there a solution? I am using IE 6.

I have also tried using this approach:

body { display:none; }
..print { display:table; }

Nothing is displayed at all by doing this. All I am trying to do is wrap a
table containing text in print tags and ensure only that is printed. Can
someone post an example of achieving this?

Thanks.
Jan 5 '06 #1
5 1478
Deciding to do something for the good of humanity, Someone
<no****@nospam. com> spouted in
comp.infosystem s.www.authoring.stylesheets:
All I am trying to do is wrap a
table containing text in print tags and ensure only that is printed. Can
someone post an example of achieving this?


body * {display: none;}
..print {display: block;}

Not tested.

--
Mark Parnell
=============== =============== =============== ========
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 5 '06 #2
On Thu, 5 Jan 2006 11:57:30 +1100, Mark Parnell wrote:
Deciding to do something for the good of humanity, Someone
<no****@nospam. com> spouted in
comp.infosystem s.www.authoring.stylesheets:
All I am trying to do is wrap a
table containing text in print tags and ensure only that is printed. Can
someone post an example of achieving this?


body * {display: none;}
.print {display: block;}

Not tested.


This displays nothing, any chance of a working example?
Jan 5 '06 #3
Deciding to do something for the good of humanity, Someone
<no****@nospam. com> spouted in
comp.infosystem s.www.authoring.stylesheets:
This displays nothing, any chance of a working example?


As I said, not tested - let me have a play with it.

--
Mark Parnell
=============== =============== =============== ========
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 5 '06 #4
Someone <no****@nospam. com> wrote:
It works fine except, that the text that I want printed ends up in the
middle of the screen because elements made invisible in the stylesheet
still effect the text's positioning. Stylesheet is like this:

body {visibility:hid den;}
Yep. That's how the visibility property works. Invisible boxes still affect
layout. See http://www.w3.org/TR/CSS21/visufx.html#visibility
I have also tried using this approach:

body { display:none; }
.print { display:table; }

Nothing is displayed at all by doing this.


Yep. That's how the display property works. Setting "display: none"
prevents the element AND ITS DESCENDANT ELEMENTS from being displayed. See
http://www.w3.org/TR/CSS21/visuren.html#display-prop

What you need to do is use "display: none" on those elements that you don't
want to display. You can't use "display: none" on everything, and then undo
it for the elements you want to display.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"Shin: a device for finding furniture in the dark." - Steven Wright
Jan 5 '06 #5
Deciding to do something for the good of humanity, Someone
<no****@nospam. com> spouted in
comp.infosystem s.www.authoring.stylesheets:
This displays nothing,
This works:

body * {display: none;}
..print {display: block;}
..print * {display: inline;}

It may need some tweaking depending on what you are displaying.
any chance of a working example?


http://clarkecomputers.com.au/usenet/print.html

--
Mark Parnell
=============== =============== =============== ========
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1433
by: ST | last post by:
Hi, I'm implementing a printer friendly feature for all the pages on a web site. I'm separating the header, content, and footer into separate ascx files, which are contained in the main file. In the mail file I have a link button which, supposedly, when clicked on, passes the current content page's url and page title to the printer friendly page, which has a placeholder for the content page. I could do this with session variables, but...
1
1578
by: John Klucker | last post by:
Can anyone tell what easiest way to implement 'Printer Friendly' functionality to my .aspx page. Are there any controls available or is there something in the framework? Thanks in Advance!! John
2
1398
by: Ray | last post by:
ASP.NET Newbie ? I have a populated datagrid on my .aspx page, I want to open a second window without all the extra fluff (nav bar, menus, etc) and display a printer friendly version of my datagrid. I'm looking for ideas on how to pass the data to the second page without making a second request back to the database? Passing the data as a dialog argument in a window.ShowModelDialog is really not an option because of the possible data...
2
1361
by: Ron | last post by:
Hello, I am working on a registration application for my companies intranet. The intranet is ASP classic based as of now. Unfortunately I only know ASP.NET. But that was all okay until I decided I wanted to have a 'printer friendly' class roster. In making it printer friendly, I would want to drop the intranet's standard Navigation and title bars. They allow me to do this by refering to a .asp file as .nfa from the link. However this...
2
1276
by: Sandy | last post by:
Hello - I tried to google this, but got back every page on the whole entire web that has printer friendly versions . . . I have a panel containing text from a repeater that also contains text in a multi-line textbox. How do I create a printer friendly version for this? Any help you can give me will be greatly appreciated -- or if you know exactly where to go on the web to obtain this info, please include the link.
1
1308
by: dinoo | last post by:
Can any one help me out? I am looking out to implement printer friendly version of a web page. I do not want the header and footer show up in the print and I do not want to use frames (it is a client decision). I want to avoid writing the code again to make the printer friendly. Is there any way which would allow me to make the developer friendly page without lot of additional duplicate work. Thanks in advance.
2
1903
by: weetat.yeo | last post by:
Hi all , I have a print button in PHP page which using javascript window.print() to print web page. However , when user click "print" , the print preview display that the page cut-off and alignment is out. Read on regarding the matter , and found that is not the issue of PHP . Some users recommend to me to use CSS and HTML to create printer friendly page.
5
2213
by: weetat.yeo | last post by:
Hi all , I have php page which the data in the page are extracted from MYSQL database. The data are retrieved when user click submit button . In the php page , there is a print button for user to print the php page. Presently, i am using javascript window.print() which not an elegant option.
1
1688
by: tbanov | last post by:
Hi, I'm looking to create my own version of a printer-friendly page. Any resources I can find on this subject are extremely specific about what they consider "printer-friendly", and they don't address my issue. It seems to be browser specific, but I want to get rid of whatever extra is printed in the top and bottom margins. Printed from IE, the top contains the page title and page information, while the bottom contains the URL and date....
15
2148
by: Prisoner at War | last post by:
Okay, I'd like to create a print-friendly website, so I've been reading up on how to create print-friendly pages (without duplicating my site, of course, by having separate versions of each page).... Apparently one can use JavaScript or CSS for this.... Using CSS, it seems that the "trick" is to use * media="print" * in the <linktag.... So if I have a hyperlink to a print-friendly page...um, well, what's
0
8355
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6191
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.