如何打印隐藏的iframe的内容?

2 html css php ajax iframe

我想打印一个我放在iframe但不希望内容显示在网页上的页面,但是当我把iframe放到display ='none'时打印按钮不起作用

我做了什么: - 我设置iframe风格='无'

"name ="frame1">
<input type="button" onclick="frames['frame1'].print()" value="print!">
Run Code Online (Sandbox Code Playgroud)

如何打印iframe的内容而不在网页上显示或者保持ifram隐藏

非常感谢任何帮助......

Óla*_*age 7

您执行打印css文件,并在该文件中没有display:none样式.

<link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
Run Code Online (Sandbox Code Playgroud)

感谢Dror,这是媒体类型的链接.