从印刷版中去除阴影 [英] Remove shadow from printed version

查看:106
本文介绍了从印刷版中去除阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 http://www.canadaiplawyer.com/ 上有此代码,希望打印版本的网站将不会有主要(纸)div的影子:

  @media print {
# content,#endpage,#startpage {
-webkit-box-shadow:none;
-moz-box-shadow:none;
box-shadow:none;




$ b $ p
$ b

有没有理由为什么这不起作用,我打印时仍然会得到阴影?

解决方案

我看起来像阴影实际上设置在 #nonfooter ,而不是 #content 。您可能想要使用:

  @media print {
#nonfooter {
-webkit-box- shadow:none;
-moz-box-shadow:none;
box-shadow:none;


$ / code $ / pre

另外,确保 @media 标签在所有正常声明之后,以确保它具有更高的特异性。 (如果它在不同的CSS文件中,请将< link> 标签放在正常的标签之后。)


I have this code at http://www.canadaiplawyer.com/ in the hope that the printed version of the website would not have the shadow around the main (paper) div:

@media print{
  #content, #endpage, #startpage {
    -webkit-box-shadow: none;
    -moz-box-shadow:    none;
    box-shadow:         none; 
  }
}

Is there a reason why this is not working and I still get the shadow when printed?

解决方案

I looks like the shadow is actually set on #nonfooter, not on #content. You probably want to use:

@media print{
  #nonfooter {
    -webkit-box-shadow: none;
    -moz-box-shadow:    none;
    box-shadow:         none; 
  }
}

Also, make sure the @media tag comes after all the normal declarations, to ensure it has a higher specificity. (If it is in a different CSS file, put the <link> tag after the normal one.)

这篇关于从印刷版中去除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆