Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [CSS2] - Drukowanie
Forum PHP.pl > Forum > Po stronie przeglądarki > CSS
kicaj
Spotkal sie ktos z czyms takim? snitch.gif
dragossani
Stylami można nieco wpływać na drukowanie, ale jestem raczej zwolennikiem użycia PDF'ów (o ile oczywiście mamy dostęp do php).
kurtz
Cytat
Spotkal sie ktos z czyms takim? :>
alez oczywiscie.. ale tylko w pieknej teorii :)
wassago
chyba o chodzi wam o to:

Cytat
Hide from Print

Have you ever wished you could hide a portion of HTML from being printed when a visitor prints a web page? Well, believe it or not, it's a simple feat to accomplish, and it will leave observant viewers thoroughly astounded by your greatness.

Hiding objects from print is something we like to do on Spoono on certain pages like this one. We hide undesirable objects like ads and the back button below from printing. (Go to Print Preview to see for yourself). This trick can be accomplished by creating a print-only style that has a hidden visibility and applying it to certain objects. The most efficient way to do this is by linking to an external CSS document like so:

Kod
<link rel="stylesheet" href="/general/hide.css" type="text/css" media="print">


Note that the media attribute is set to the value "print." This tells browsers to only use the classes in this file when printing. If you also have a regular CSS file that loads styles for regular screen display, you can leave the code for that untouched. Now, the following is the code that needs to go into your hide.css file (or whatever you've named it):

Kod
.hide {

display: none;

}


That was certainly simple enough. The last step is to define the hide class for the content that you want to hide. To do this, you can add a class attribute to any of the following tags: <div> <p> <span> <td> plus many others. So here is an example for the code of hidden content:

Kod
<div class="hide">

THIS CONTENT IS HIDDEN

</div>


That's it. Now don't you feel sneaky?


:arrow: www.spoon.com
Alkagar
Hi,
Zadam tutaj to pytanie bo nie chce nowego tematu a ten dotyczy mniej więcej tego co potrzebuje.

Potrzebuje wydrukować w IE Div-a w którym mam ustawione tło (background-color). Normalnie na stronie jest wszystko OK ale jak daje podgląd wydruku a potem drukuje to IE usuwa mi to tło (co dziwne ładnie działa pod operą). Co jeszcze dziwniejsze to to że próbowałem juz tego sposobu z media=print i tak można ustawić wszystko - kolor, rozmiar czcionki ale tła nie :-(. Ma ktoś jakiś pomysł jak to ustawić w css-ie?

Pozdrawiam,
Alk
revyag
Nie da się. To jest kwestia ustawień przeglądarki.
Narzędzia->Opcje internetowe->Zaawansowane->Drukuj->Drukuj kolory i obrazy tła
Alkagar
Ok thx, bede musiał pomyśleć nad innym sposobem rozwiązania tego problemu.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.