473,786 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Content visible only to print stylesheets

Hi,

A website I work on has a print stylesheet to strip navigation and things out
of a page, and changes the fonts and various bits and pieces here and there.
What I'd also like is something small (a footer, perhaps) that says something
along the lines of 'you are viewing a printed version of [TITLE], available
at [url]'. I know I can do this by just adding the content and using display:
none for the screen CSS, but then it becomes visible in text browsers, which
I don't want. It would also have to work in IE, which means I couldn't use
the :before or :after pseudo-elements...

Is there any way to achieve this?

--
"If man were meant to fly in outer space, God would have given him a brain
capable of figuring out the mathematics and physics necessary to do so."
- The Onion
Jul 20 '05 #1
8 3943
la_haine wrote:
A website I work on has a print stylesheet to strip navigation and things out
of a page, and changes the fonts and various bits and pieces here and there.
What I'd also like is something small (a footer, perhaps) that says something
along the lines of 'you are viewing a printed version of [TITLE], available
at [url]'. I know I can do this by just adding the content and using display:
none for the screen CSS, but then it becomes visible in text browsers, which
I don't want. It would also have to work in IE, which means I couldn't use
the :before or :after pseudo-elements...

Is there any way to achieve this?


The only way I can think of is to insert an empty element at the bottom
of each page, and set its background-image to an image of the text you
want in the print stylesheet. Sizing that element is left as an exercise...

--
Mark.
Jul 20 '05 #2
"la_haine" <p.*****@kent.a c.uk> wrote:
A website I work on has a print stylesheet to strip navigation and things out
of a page, and changes the fonts and various bits and pieces here and there.
What I'd also like is something small (a footer, perhaps) that says something
along the lines of 'you are viewing a printed version of [TITLE], available
at [url]'.
Many browsers display the page title and URL in the header and/or
footer of the printed page. So is this really necessary?
I know I can do this by just adding the content and using display:
none for the screen CSS, but then it becomes visible in text browsers, which
I don't want. It would also have to work in IE, which means I couldn't use
the :before or :after pseudo-elements...

Is there any way to achieve this?


Not reliably. You could make an image of the text and include it via
the print CSS as a background image, but many browsers are set not to
print background images.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 20 '05 #3

"la_haine" <p.*****@kent.a c.uk> wrote in message
news:c9******** **@athena.ukc.a c.uk...
Hi,

A website I work on has a print stylesheet to strip navigation and things out of a page, and changes the fonts and various bits and pieces here and there. What I'd also like is something small (a footer, perhaps) that says something along the lines of 'you are viewing a printed version of [TITLE], available at [url]'.


All the browsers I have on my computer (Netscape 4.7 and 7, IE 6, Opera
7.21, Mozilla 1.5, Firefox 0.8) show this information anyway, except for the
part about the printout being a printed version, which is self-evident. So
what's the point?

Jul 20 '05 #4
"Harlan Messinger" <h.*********@co mcast.net> wrote in
news:2i******** ****@uni-berlin.de:
All the browsers I have on my computer (Netscape 4.7 and 7, IE 6, Opera
7.21, Mozilla 1.5, Firefox 0.8) show this information anyway, except for
the part about the printout being a printed version, which is
self-evident. So what's the point?


None really. And apparently it can't be done anyway. So never mind!

--
Time flies like an arrow; fruit flies like a banana.
Jul 20 '05 #5
"la_haine" <p.*****@kent.a c.uk> wrote in message news:<c9******* ***@athena.ukc. ac.uk>...
"Harlan Messinger" <h.*********@co mcast.net> wrote in
news:2i******** ****@uni-berlin.de:
All the browsers I have on my computer (Netscape 4.7 and 7, IE 6, Opera
7.21, Mozilla 1.5, Firefox 0.8) show this information anyway, except for
the part about the printout being a printed version, which is
self-evident. So what's the point?


None really. And apparently it can't be done anyway. So never mind!


Just because you said it can't be done and for laughs, what does your
text browser do with the following?:

<script>
document.write( "<div id='printNote'> <p> Style for print only and it
fits the bill for your 'JS' enabled viewers.</p></div>");
</script>

Or you could go with some server side browser detection and improve on
the percentage.

So there are a few options actually on how to do it. Maybe a
document.write <img src blah blah...> would be better.

No comment on the over kill of all this to label a printed document as
such will be included. Just need to bang my head against the wall when
someone says it can't be done. Why? Because it feels so good when you
stop obviously.

Cheers!
Jul 20 '05 #6
On 4 Jun 2004 20:57:44 -0700, bg***@yahoo.com (Nairb) wrote:

Just because you said it can't be done and for laughs, what does your
text browser do with the following?:

<script>
document.write ("<div id='printNote'> <p> Style for print only and it
fits the bill for your 'JS' enabled viewers.</p></div>");
</script>


While currently no popular text-only browser supports scripting, it's
probably best not to assume one never will. One day a text browser
might be released which supports CSS, too!

-Claire
Jul 20 '05 #7
Claire Tucker <fa**@invalid.c om> wrote in message news:<6t******* *************** **********@4ax. com>...
On 4 Jun 2004 20:57:44 -0700, bg***@yahoo.com (Nairb) wrote:

Just because you said it can't be done and for laughs, what does your
text browser do with the following?:

<script>
document.write ("<div id='printNote'> <p> Style for print only and it
fits the bill for your 'JS' enabled viewers.</p></div>");
</script>


While currently no popular text-only browser supports scripting, it's
probably best not to assume one never will. One day a text browser
might be released which supports CSS, too!

-Claire


I had not considered 100% future compatibility. Your right. I think we
better form a committee and delve into this further. As logic goes,
eventually web browsers be they text based or not, at some point in
the future will no longer even support HTML as we know it. Therefore
you may as well pull all your sites down now and face the inevitable.
Jul 20 '05 #8
Claire Tucker <fa**@invalid.c om> writes:
On 4 Jun 2004 20:57:44 -0700, bg***@yahoo.com (Nairb) wrote:
Just because you said it can't be done and for laughs, what does your
text browser do with the following?:

<script>
document.write ("<div id='printNote'> <p> Style for print only and it
fits the bill for your 'JS' enabled viewers.</p></div>");
</script>

Two (lynx, w3m) ignore it, the other (links 2) displays the HTML content.
While currently no popular text-only browser supports scripting, it's
probably best not to assume one never will. One day a text browser
might be released which supports CSS, too!


Hmm, Links2 (text-only) supports Javascript. I don't think it's
particularly less popular than lynx or w3m, I think it's the default
on some Linuxes.

And doesn't emacs-w3 have some stylesheet support?

--
Chris
Jul 20 '05 #9

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

Similar topics

2
4126
by: Headless | last post by:
I'm pretty sure this isn't possible, but to be sure: in an author print style sheet is it possible to disable printing of a graphic logo and print it's alt content instead? Headless -- Email and usenet filter list: http://www.headless.dna.ie/usenet.htm
2
12040
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references back to 0,0 on the entire page. If I set it to relative, the div layers will not overlap as needed. I prefer to avoid javascripting an 'innerHTML' re-write of a single div and would instead like to build two layers that can reside at the same...
2
1539
by: la_haine | last post by:
Hi, A website I work on has a print stylesheet to strip navigation and things out of a page, and changes the fonts and various bits and pieces here and there. What I'd also like is something small (a footer, perhaps) that says something along the lines of 'you are viewing a printed version of , available at '. I know I can do this by just adding the content and using display: none for the screen CSS, but then it becomes visible in text...
1
2250
by: ptg_abhishek | last post by:
Hullo, I tried the print method provided by javascript to print the frame in current focus. Only the visible content is printed, any hidden content in the current frame does not appear in the printout. If you know some possible work-around, please do let me know. regards. -abhishek.
3
1912
by: jnm | last post by:
How can I avoid the content of <meta name="Microsoft Border" content="b, default"> is printed, when printing by means of <link rel="stylesheet" href="../print.css" type="text/css" media="print" /> I expect it to be possible with som script in the print.css????
8
5912
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
0
1205
by: Germaris | last post by:
My client says it would much more enjoy his Flash Website if there was the capability to print the FULL result of the searches he performs. The result (a Variable returned by the server) is always a text and is displayed in a Dynamic TextField which has a ScrollBar attached. For the time being, only the VISIBLE content of this field is printed. Does the capabilty to print the WHOLE content of this field exist? Many thanks in advance for...
10
2772
by: Ed Jay | last post by:
I do not want to load two style sheets for screen and print media. I'm having difficulty grasping the use of the @print statement, or its syntax. Would someone please provide a simple explanation. For example... If I have a style sheet specifying media="all," is the following correct syntax to center text for printing, but not for screen presentation? ..divClass1 {
8
3626
by: Zhang Weiwu | last post by:
hello. Is it possible to design CSS in the way that content in <inputare not visible in print out (a.k.a. value of <inputnot visible) while the border remain visible? trial: input { border: thin solid black;
0
9491
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
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
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...
0
9959
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
8988
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 projectplanning, coding, testing, and deploymentwithout 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
7510
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...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4063
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
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.