我正在尝试打印未在页面的 html 中定义的图像,并且作为此解决方案的一部分,无法更改 html。一旦用户选择打印选项,我希望能够将新图像定义为要打印的打印样式表的一部分。请参阅标题部分以尝试显示图像。
试过如下:
@media print {
/* Header */
#printHeader {
display: block;
background url(../html/link/link/linkname;
}
#header {
display: block;
height:75px;
width:75px;
}
#print-header {
display: block;
}
/* applied for body tag */
body {
font-family:"Arial", Times, serif;
overflow: visible;
font-size: 12px;
}
/* Redefinition of TD in general.css */
td {
font-family:"Arial", Times, serif;
font-size:12px;
}
/* Redefinition of value from enquiry.css */
.columnheader {
font-family:"Arial", Times, serif;
font-size:12px;
color:#6A1A41;
}
/*Standard navigation Bars */
.extra-nav {
display:none;
}
.extra-nav ul {
display:none;
}
.extra-nav li {
display:none;
}
.active-tab {
display:none;
}
li.nonactive-tab{
display:none;
}
#commandsViewport {
display:none;
}
nav-menu {
display:none;
}
#nav-menu li {
display:none;
}
/* Direct Debit Header */
aheader{
font-family:"Arial",Sans-serif;
font-size:24px;
color:#6A1A41;
}
/* External Standing Order Header */
bheader{
font-family:"Arial",Sans-serif;
font-size:24px;
color:#6A1A41;
}
/* Internal Standing Order Header */
cheader{
font-family:"Arial",Sans-serif;
font-size:24px;
color:#6A1A41;
}
/* Footer Bar */
#footernav {
visibility:hidden;
}
.footernav {
visibility:hidden;
}
/* The solely fragment that should be printed */
.printableFragment {
display: block;
}
/* fragement that will not be printed */
.notPrintableFragment {
display: block;
}
/* Hides "drill" button */
.enqdrilldowncell {
display: none;
}
/* Hids "next" button in the version */
.belowDealButtonBox {
display: none;
}
/* Applied for images */
img {
display: none;
}
/* used in enquiry selection */
.noPrint {
display: block;
}
}