code_junkie

Change an image to text via CSS for printing?

Nov 13th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. .nodisplay
  2. {
  3. display: none;
  4. }
  5.  
  6. @media print {
  7. * {
  8. background-color: white !important;
  9. background-image: none !important;
  10. }
  11. .noprint
  12. {
  13. display: none;
  14. }
  15. }
  16.  
  17. <div class="noprint">
  18.  
  19. </div>
  20.  
  21. <img src="logo.png" class="noprint" ...>
  22. <h1 class="nodisplay">Text Logo</h1>
  23.  
  24. h1#logo a, h1#home-logo{
  25. text-indent: 0 !important;
  26. background-image: none !important;
  27. font-size: 1.2em !important;
  28. display: block !important;
  29. height: 1em !important;
  30. width: 100% !important;
  31. text-decoration: none !important;
  32. color: black !important;
  33. }
  34.  
  35. img:after{content: attr(alt);}
Add Comment
Please, Sign In to add comment