Print without ads

Discussion in 'HTML' started by Mike S., May 30, 2007.

  1. Mike S.

    Mike S. Guest

    My website is a free one that places ads on the top of the web page.
    Is there a way to provide a print option so that users can print the
    pages without the ads?
    Mike S., May 30, 2007
    #1
    1. Advertising

  2. Mike S.

    dorayme Guest

    In article
    <>,
    "Mike S." <> wrote:

    > My website is a free one that places ads on the top of the web page.
    > Is there a way to provide a print option so that users can print the
    > pages without the ads?


    Take a look at:

    http://alistapart.com/stories/goingtoprint/

    --
    dorayme
    dorayme, May 30, 2007
    #2
    1. Advertising

  3. On May 30, 6:21 am, "Mike S." <> wrote:
    > My website is a free one that places ads on the top of the web page.
    > Is there a way to provide a print option so that users can print the
    > pages without the ads?


    Since your agreement with your hosting provider almost certainly
    forbids removing the adverts, it is very likely that your only
    reasonable option is to switch to better hosting.

    --
    David Dorward
    http://dorward.me.uk/
    http://blog.dorward.me.uk/
    David Dorward, May 30, 2007
    #3
  4. Mike S.

    dorayme Guest

    In article
    <>,
    David Dorward <> wrote:

    > On May 30, 6:21 am, "Mike S." <> wrote:
    > > My website is a free one that places ads on the top of the web page.
    > > Is there a way to provide a print option so that users can print the
    > > pages without the ads?

    >
    > Since your agreement with your hosting provider almost certainly
    > forbids removing the adverts, it is very likely that your only
    > reasonable option is to switch to better hosting.
    >


    I had thought, in my reply, it was ok to include a print style
    sheet but, of course (!), this is probably unlikely to work on
    such hosting.

    --
    dorayme
    dorayme, May 30, 2007
    #4
  5. Mike S.

    Bergamot Guest

    dorayme wrote:
    > In article
    > <>,
    > David Dorward <> wrote:
    >
    >> On May 30, 6:21 am, "Mike S." <> wrote:
    >> > My website is a free one that places ads on the top of the web page.
    >> > Is there a way to provide a print option so that users can print the
    >> > pages without the ads?

    >>
    >> Since your agreement with your hosting provider almost certainly
    >> forbids removing the adverts, it is very likely that your only
    >> reasonable option is to switch to better hosting.

    >
    > I had thought, in my reply, it was ok to include a print style
    > sheet but, of course (!), this is probably unlikely to work on
    > such hosting.


    Why do you say that? It seems very unlikely that such a server would be
    clever enough to distinguish a print stylesheet from any other
    stylesheet, especially since it's the browser, not the server, that
    decides what rules to apply.


    --
    Berg
    Bergamot, May 30, 2007
    #5
  6. Mike S.

    asdf Guest

    "Mike S." <> wrote in message
    news:...
    > My website is a free one that places ads on the top of the web page.
    > Is there a way to provide a print option so that users can print the
    > pages without the ads?
    >


    Yes.

    Create a CSS stylesheet thus in the <head> section (or put in a separate CSS
    file if you so desire) thus:

    <style type="text/css" media="print">
    <!--
    ..noprint {
    display: none;
    }
    -->
    </style>

    Note 'media="print" attribute of the style tag. This is what allows you to
    reformat your stuff for printing.

    Give the ad (assuming it's an image) a classname like 'noprint' thus:

    <img src='blah' alt='An ad.' class='noprint'>

    You can extend this to remove lots of other stuff from your printout like
    menus etc.... just wrap the stuff you don't want printed with a div of class
    'noprint'.

    Be warned... I haven't tried this on crusty browsers, but it works with
    current releases of IE, FF and Opera.
    asdf, May 30, 2007
    #6
  7. Mike S.

    dorayme Guest

    In article <>,
    Bergamot <> wrote:

    > dorayme wrote:
    > > In article
    > > <>,
    > > David Dorward <> wrote:
    > >
    > >> On May 30, 6:21 am, "Mike S." <> wrote:
    > >> > My website is a free one that places ads on the top of the web page.
    > >> > Is there a way to provide a print option so that users can print the
    > >> > pages without the ads?
    > >>
    > >> Since your agreement with your hosting provider almost certainly
    > >> forbids removing the adverts, it is very likely that your only
    > >> reasonable option is to switch to better hosting.

    > >
    > > I had thought, in my reply, it was ok to include a print style
    > > sheet but, of course (!), this is probably unlikely to work on
    > > such hosting.

    >
    > Why do you say that? It seems very unlikely that such a server would be
    > clever enough to distinguish a print stylesheet from any other
    > stylesheet, especially since it's the browser, not the server, that
    > decides what rules to apply.


    I said it because DD brought further to my attention that it was
    a free web hosting service, and while his point might have been a
    legal one, I then went on to think they would likely make
    technical provisions to stop any different stylesheet from
    operating to avoid their ads. I have a couple of barely used free
    service and they quite often override various things I have
    tried, perhaps there are cleverer ways of doing things that
    escaped me.

    But you make me regret the craven appearance of my retraction. My
    enemies, and there are many, can take advantage of this.

    Anyway, I just had a thought, as crisp in its novelty as it is
    chilly this fine morning in Sydney, the proof is in the pudding,
    OP might consider trying it and seeing what happens when he/she
    prints and then, if all goes well, seeing if any letter from any
    solicitor comes in the post or worse, several large thugs on the
    doorstep.

    --
    dorayme
    dorayme, May 30, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tamer Ibrahim
    Replies:
    3
    Views:
    409
    Alexey Smirnov
    Jan 29, 2007
  2. keto
    Replies:
    0
    Views:
    904
  3. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    337
    David Cournapeau
    Dec 30, 2008
  4. Replies:
    17
    Views:
    711
    David Segall
    Apr 27, 2009
  5. henning
    Replies:
    1
    Views:
    142
    Vince Morgan
    Dec 18, 2006
Loading...

Share This Page