开发者

Separate Address for Page Inside a Page

开发者 https://www.devze.com 2022-12-11 01:23 出处:网络
I am somewhat new to web development, so I\'m not sure how \"stupid\" this question is, but I couldn\'t find much when searching, so I wanted to ask.

I am somewhat new to web development, so I'm not sure how "stupid" this question is, but I couldn't find much when searching, so I wanted to ask.

I am creating a page that, when a user presses an Export button, it exports a snapshot of the site as a PDF. The PDF library takes a URL. That works well. However, I want this page inside a larger site. When I print, however, I don't want the larger site to be printed. Is there a way to supply an "internal" HTML address so that my web page ca开发者_StackOverflow社区n still be accessed. What should I look at to do something like this?

Thanks.


The best way to "hide" the rest of the page when the user prints a web page is to create a print stylesheet and include it in the page header like this:

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

Then simply hide the elements of the page that you don't want printing in your print.css file.


I'm wondering if by "larger site" you mean the template surrounding your content. Is that true? If so, a common approach is to provide a parameter that can be added to your request, like print=1, which would suppress the outer template when delivering your content.

0

精彩评论

暂无评论...
验证码 换一张
取 消