Printing a fragment from a web page

Discussion in 'HTML' started by Nicolae Fieraru, Jun 3, 2005.

  1. Hi All,

    I have some pages on a web site and they respect some template, with buttons
    to the top, background image, tables, etc
    I would like to allow a user to print out only a part of the page, but
    without the buttons and the rest of the page. I am not sure it can be done.
    If anybody knows about this, please let me know.

    Regards,
    Nicolae
    Nicolae Fieraru, Jun 3, 2005
    #1
    1. Advertising

  2. "Nicolae Fieraru" <> skrev i meddelandet
    news:...
    > Hi All,
    >
    > I have some pages on a web site and they respect some template, with

    buttons
    > to the top, background image, tables, etc
    > I would like to allow a user to print out only a part of the page, but
    > without the buttons and the rest of the page. I am not sure it can be

    done.
    > If anybody knows about this, please let me know.
    >
    > Regards,
    > Nicolae


    You need 2 different external style sheets: one for the screen and another
    for the print version which you insert in the head of your html code.

    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/
    Luigi Donatello Asero, Jun 3, 2005
    #2
    1. Advertising

  3. "Luigi Donatello Asero" <> skrev i meddelandet
    news:hy0oe.26337$...
    >
    > "Nicolae Fieraru" <> skrev i meddelandet
    > news:...
    > > Hi All,
    > >
    > > I have some pages on a web site and they respect some template, with

    > buttons
    > > to the top, background image, tables, etc
    > > I would like to allow a user to print out only a part of the page, but
    > > without the buttons and the rest of the page. I am not sure it can be

    > done.
    > > If anybody knows about this, please let me know.
    > >
    > > Regards,
    > > Nicolae

    >
    > You need 2 different external style sheets: one for the screen and another
    > for the print version which you insert in the head of your html code.
    >
    > --
    > Luigi ( un italiano che vive in Svezia)
    > https://www.scaiecat-spa-gigi.com/



    You insert in the head the links to respective external relative style
    sheets.
    So, you have to prepare these style sheets first.


    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/
    Luigi Donatello Asero, Jun 3, 2005
    #3
  4. Hi Luigi,

    Ok, so if I have two different CSS files included in the head, what do I do
    next with them?
    How can the styles hide buttons?

    Regards,
    Nicolae



    "Luigi Donatello Asero" <> wrote in message
    news:NA0oe.26338$...
    >
    > "Luigi Donatello Asero" <> skrev i meddelandet
    > news:hy0oe.26337$...
    >>
    >> "Nicolae Fieraru" <> skrev i meddelandet
    >> news:...
    >> > Hi All,
    >> >
    >> > I have some pages on a web site and they respect some template, with

    >> buttons
    >> > to the top, background image, tables, etc
    >> > I would like to allow a user to print out only a part of the page, but
    >> > without the buttons and the rest of the page. I am not sure it can be

    >> done.
    >> > If anybody knows about this, please let me know.
    >> >
    >> > Regards,
    >> > Nicolae

    >>
    >> You need 2 different external style sheets: one for the screen and
    >> another
    >> for the print version which you insert in the head of your html code.
    >>
    >> --
    >> Luigi ( un italiano che vive in Svezia)
    >> https://www.scaiecat-spa-gigi.com/

    >
    >
    > You insert in the head the links to respective external relative style
    > sheets.
    > So, you have to prepare these style sheets first.
    >
    >
    > --
    > Luigi ( un italiano che vive in Svezia)
    > https://www.scaiecat-spa-gigi.com/
    >
    >
    >
    >
    >
    >
    >
    Nicolae Fieraru, Jun 4, 2005
    #4
  5. "Nicolae Fieraru" <> skrev i meddelandet
    news:42a0f619$...
    > Hi Luigi,
    >
    > Ok, so if I have two different CSS files included in the head, what do I

    do
    > next with them?
    > How can the styles hide buttons?
    >
    > Regards,
    > Nicolae



    You want to show the buttons on the screen but not when you print the page,
    donĀ“t you?


    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/sv/italien-valle-daosta/boende-i-bionaz.php
    Luigi Donatello Asero, Jun 4, 2005
    #5
  6. Nicolae Fieraru

    Adrienne Guest

    Gazing into my crystal ball I observed "Nicolae Fieraru"
    <> writing in news::

    > Hi All,
    >
    > I have some pages on a web site and they respect some template, with
    > buttons to the top, background image, tables, etc
    > I would like to allow a user to print out only a part of the page, but
    > without the buttons and the rest of the page. I am not sure it can be
    > done. If anybody knows about this, please let me know.
    >
    > Regards,
    > Nicolae
    >
    >

    In an external stylesheet:

    @media screen {
    /*all your screen CSS info
    ..copyright {font-size:85%;}
    */
    }
    @media print {
    /*all the stuff you do not want printed
    ..copyright {display:none}
    */
    }

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jun 4, 2005
    #6
  7. Nicolae Fieraru

    Stan McCann Guest

    "Nicolae Fieraru" <> wrote in
    news::
    > I have some pages on a web site and they respect some template, with
    > buttons to the top, background image, tables, etc
    > I would like to allow a user to print out only a part of the page,
    > but without the buttons and the rest of the page. I am not sure it
    > can be done. If anybody knows about this, please let me know.


    My first thought was to let the user highlight the part they want to
    print, then print it. Reading over the post again, I figure this might
    be what you want: http://www.w3schools.com/css/css_mediatypes.asp

    --
    Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
    Webmaster/Computer Center Manager, NMSU at Alamogordo
    http://alamo.nmsu.edu/ There are 10 kinds of people.
    Those that understand binary and those that don't.
    Stan McCann, Jun 4, 2005
    #7
  8. "Stan McCann" <> skrev i meddelandet
    news:Xns966AEB41FF131stanmccann@216.234.192.142...
    > "Nicolae Fieraru" <> wrote in
    > news::
    > > I have some pages on a web site and they respect some template, with
    > > buttons to the top, background image, tables, etc
    > > I would like to allow a user to print out only a part of the page,
    > > but without the buttons and the rest of the page. I am not sure it
    > > can be done. If anybody knows about this, please let me know.



    Following my previous answers on this subject, I can add that
    the basic thing is that you design a div container in the style sheet for
    printing in which you use the value: none for the property display, so that
    the content which is within this "div" container will not be displayed in
    the print version.
    But it seems as there are also more refined ways which I am trying to learn.
    http://www.w3.org/TR/REC-CSS1#display
    http://www.w3.org/Style/Examples/007/target.html#tab1

    http://www.w3.org/TR/REC-html40/types.html#h-6.13


    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/sv/italien-valle-daosta/boende-i-bionaz.php
    Luigi Donatello Asero, Jun 4, 2005
    #8
  9. "Luigi Donatello Asero" <> skrev i meddelandet
    news:HFfoe.139414$...
    >
    > "Stan McCann" <> skrev i meddelandet
    > news:Xns966AEB41FF131stanmccann@216.234.192.142...
    > > "Nicolae Fieraru" <> wrote in
    > > news::
    > > > I have some pages on a web site and they respect some template, with
    > > > buttons to the top, background image, tables, etc
    > > > I would like to allow a user to print out only a part of the page,
    > > > but without the buttons and the rest of the page. I am not sure it
    > > > can be done. If anybody knows about this, please let me know.

    >
    >
    > Following my previous answers on this subject, I can add that
    > the basic thing is that you design a div container in the style sheet for
    > printing in which you use the value: none for the property display, so

    that
    > the content which is within this "div" container will not be displayed in
    > the print version.



    Of course, you also have to refer to the same div class in the body of the
    html code of the page which you want to print if you want the property
    display: none; to work.

    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/sv/italien-valle-daosta/boende-i-bionaz.php
    Luigi Donatello Asero, Jun 4, 2005
    #9
    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. quique

    fragment page caching

    quique, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    quique
    Oct 30, 2003
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    786
    Troy Simpson
    Jan 19, 2004
  3. Jon B
    Replies:
    7
    Views:
    7,501
    =?Utf-8?B?SmFzb25DaG9p?=
    Jan 30, 2006
  4. Luigi Donatello Asero

    Re: Printing a fragment from a web page

    Luigi Donatello Asero, Jun 4, 2005, in forum: HTML
    Replies:
    0
    Views:
    389
    Luigi Donatello Asero
    Jun 4, 2005
  5. Erwin Moller
    Replies:
    1
    Views:
    608
    dorayme
    Jul 27, 2012
Loading...

Share This Page