#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    18
    Rep Power
    0

    turning css styles off


    I'm setting up a printer friendly page where all img tags, font tags, and things like that are being stripped.

    I know I could just strip all instances of a class being called too, but is there some way to just turn a css stylesheet 'off'?

    So basically, when this printer friendly page is loaded, it would turn the stylesheet off so that all text is displayed as normal. I only have one stylesheet on the whole site, so i can call it specifically if I have to.

    Thanks for your help
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    <LINK rel="stylesheet" type="text/css" media="print" href="foo.css">

    you can specify an own css file for the print.
    you don't even have to make an own priterfriendly page, just use the css to strip away the stuff you don't want.

    ie. removing all images
    img {
    display:none;
    }

    removing an menu.

    #menu {
    display:none;
    }

    http://www.w3.org/TR/REC-CSS2/media.html
  4. #3
  5. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    You could do this:

    Code:
    <html>
     <head>
      <link rel=stylesheet type="text/css" href="styles.css" id=css>
     </head>
     <body>
    
      <a href=# onClick="document.getElementById('css').href=''">CSS Off</a>
    
     </body>
    </html>

IMN logo majestic logo threadwatch logo seochat tools logo