paulspoon Posted April 12, 2006 Share Posted April 12, 2006 I hope that some one can show me some code on how to remove the following from a page that a user [b]prints[/b] : "The heading", "Page 1 of ?", "the webaddress in the footer" and "the date on th bottom right"I'm currently using css but am quite new in it.All help appreciatedRegards Quote Link to comment https://forums.phpfreaks.com/topic/7198-newbie-needs-help-please/ Share on other sites More sharing options...
obsidian Posted April 12, 2006 Share Posted April 12, 2006 [!--quoteo(post=364005:date=Apr 12 2006, 08:48 AM:name=paulspoon)--][div class=\'quotetop\']QUOTE(paulspoon @ Apr 12 2006, 08:48 AM) [snapback]364005[/snapback][/div][div class=\'quotemain\'][!--quotec--]I hope that some one can show me some code on how to remove the following from a page that a user [b]prints[/b] : "The heading", "Page 1 of ?", "the webaddress in the footer" and "the date on th bottom right"I'm currently using css but am quite new in it.All help appreciatedRegards[/quote]ok, there are two steps to hiding things during printing... first, you need to declare a print and a screen style sheet (so, you'll actually have two for your site). they can be identical, or as different as you'd like, but the key is this: on the print stylesheet, you need to put those elements tha you want hidden as "display: none;"so, for instance, if i wanted to create a class to hide elements form a print layout, i'd do something like this:PRINT CSS:[code].hideForPrint { display: none;}[/code]now, for all intents and purposes, your regular screen CSS could be identical, but you DON'T want the above class in it. that really could be the only difference in them. then, you need to call them both in your page and tell the browser how to use them like this:[code]<link type='text/css' rel='stylesheet' href='screen.css' media='screen' /><link type='text/css' rel='stylesheet' href='print.css' media='print' />[/code]notice the "media" attribute. this is what tells the browser which one to use for screen vs. print.now, all you have to do is apply the class of "hideForPrint" to any elements you want to disappear when you print, and you'll be set to go.hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/7198-newbie-needs-help-please/#findComment-26197 Share on other sites More sharing options...
paulspoon Posted April 12, 2006 Author Share Posted April 12, 2006 Thanx I think that this will work well, I'll try it tonight, but what are the elements names that I can use for these things that I want to hide ? Quote Link to comment https://forums.phpfreaks.com/topic/7198-newbie-needs-help-please/#findComment-26227 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.