Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在打印样式表上打印图像_Html_Css_Stylesheet - Fatal编程技术网

Html 在打印样式表上打印图像

Html 在打印样式表上打印图像,html,css,stylesheet,Html,Css,Stylesheet,我试图打印一个未在页面的html中定义的图像,并且作为此解决方案的一部分,无法访问html进行更改。我希望能够定义一个新的图像作为打印样式表的一部分,一旦用户选择打印选项,就可以打印。请参阅标题部分以尝试显示图像 他们的努力如下: @media print { /* Header */ #printHeader { display: block; background url(../html/link/link/linkname; } #header { display:

我试图打印一个未在页面的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;
}
    }

您不能打印背景图像,除非您已明确告知您的浏览器这样做,您可以尝试使用:after psuedo类并在打印背景中添加img标记,具体取决于用户打印配置。默认情况下设置为不打印,因此背景色也是如此。不是强制覆盖打印机配置的方法。