E
Ed Jay
I recall seeing where using CSS one can print a browser page without
printing the links. How is it done?
printing the links. How is it done?
Ed Jay said:I recall seeing where using CSS one can print a browser page without
printing the links. How is it done?
Luigi Donatello Asero said:You create a relative style sheet for print and you put
a <div menu> container</div> on it
which contains the links
and use display:none;
as property.
You use the same class in your menu
in the body or in
<?php include "menu.html"; ?>
where menu is the file name which you may have used to display the list of
links.
I recall seeing where using CSS one can print a browser page without
printing the links. How is it done?
/* normal css for links */
a{background:red;color:blue;}
/* print specific css for links */
@media print{
a{display:none;}
}
Ed said:I recall seeing where using CSS one can print a browser page without
printing the links. How is it done?
Yes, thank you.Jim Higson said:Sounds like a couple of pages on ALA a while back:
http://www.alistapart.com/articles/goingtoprint/
and
http://www.alistapart.com/articles/improvingprint
Thanks much. To answer your concern, my purpose is to print out a resultsJukka K. Korpela said:I'm not sure we know what the question is really about. Dropping all links
sounds strange. Maybe the idea is to print link texts as normal text? That
would be a different issue. Or maybe the OP has a "navigational menu" that
he wants to omit from printed copies. That's quite sensible (assuming you
have such a menu in the first place), but it may involve more that just
omitting links, depending on they menu has been written.
There's nothing normal about that. It's an example, yes - but a bad one.
That would do too much, even assuming that the OP really wants to remove all
links (with their link texts or images). It would also remove any
<a name="...">...</a> element.
Better:
@media print{
:link, :visited {display:none;}
}
There's nothing normal about that.
It's an example, yes - but a bad one.
Ed Jay said:my purpose is to print out a results
report without showing the menu.
Jukka K. Korpela said:Then the simplest approach is to define a class for the element containing
the menu (<div>, <ul>, whatever), say <div class="navi">, and use a class
selector in CSS:
@media print { .navi { display: none; } }
Ed Jay said:Yes, thank you.
Thanks also to Luigi, Jukka and brucie for your valuable inputs.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.