Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-22-2005, 08:32 PM   PM User | #1
docmombo
New to the CF scene

 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
docmombo is an unknown quantity at this point
Making lines invisible on printouts - Resolved

Is there a way to have a sentence appear on your page, but when you print the page out, the sentence does not appear?

Example:

I want the page to have a link that says:
"Return to regular version"

I don't want that to appear on printouts.

Any ideas?

Thanks
Doc

Last edited by docmombo; 12-23-2005 at 02:36 PM.. Reason: Resolved
docmombo is offline   Reply With Quote
Old 12-22-2005, 08:37 PM   PM User | #2
Masterslave
Regular Coder

 
Masterslave's Avatar
 
Join Date: Dec 2005
Posts: 287
Thanks: 2
Thanked 0 Times in 0 Posts
Masterslave is an unknown quantity at this point
You can add this in the head of your HTML docuemnt:

Code:
<link rel="stylesheet" href="css/print.css" type="text/css" media="print" />
Then wrap a span tag around the sentence like this:
Code:
 <span class="noprint">Return to regular version</span>
In the print.css you enter this line
Code:
.noprint
{
display: none;
}
This worked for me.
__________________
Do you Ubuntu?
Mozilla Firefox!
Masterslave is offline   Reply With Quote
Old 12-22-2005, 08:54 PM   PM User | #3
docmombo
New to the CF scene

 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
docmombo is an unknown quantity at this point
Did not work

This made the printing invisible on the screen. I want it invisible when it prints the page, but visible on the screen.

Thanks for your help.

Doc
docmombo is offline   Reply With Quote
Old 12-22-2005, 09:12 PM   PM User | #4
Masterslave
Regular Coder

 
Masterslave's Avatar
 
Join Date: Dec 2005
Posts: 287
Thanks: 2
Thanked 0 Times in 0 Posts
Masterslave is an unknown quantity at this point
This line:
Code:
<link rel="stylesheet" href="css/print.css" type="text/css" media="print" />
media="print" will say that the CSS is working when you are printing.
Did you have add media="print" in the line of your link tag?

So, when you browse to the page you've to see your sentence, when you printing, it's not visible.
__________________
Do you Ubuntu?
Mozilla Firefox!
Masterslave is offline   Reply With Quote
Old 12-23-2005, 02:35 PM   PM User | #5
docmombo
New to the CF scene

 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
docmombo is an unknown quantity at this point
You were right...

It's like you were reading the code on the computerr...I did forget the media=print statement. My fault.

The code did work.

Thank you so much.

Doc
docmombo is offline   Reply With Quote
Old 12-23-2005, 02:48 PM   PM User | #6
Masterslave
Regular Coder

 
Masterslave's Avatar
 
Join Date: Dec 2005
Posts: 287
Thanks: 2
Thanked 0 Times in 0 Posts
Masterslave is an unknown quantity at this point
Hehe, most people don't see the media thing, I thought by myself, o he's forget to add the media.
I'm happy that it's working.
__________________
Do you Ubuntu?
Mozilla Firefox!
Masterslave is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:12 PM.


Advertisement
Log in to turn off these ads.