Chrome正在将打印样式表应用于屏幕,而IE,FF,Safari正在正常工作 [英] Chrome is applying the print stylesheet to screen, while IE, FF, Safari are working correctly

查看:163
本文介绍了Chrome正在将打印样式表应用于屏幕,而IE,FF,Safari正在正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的银行网站停止在Chrome中使用,因为顶部和侧边菜单和按钮隐藏了CSS规则:

My bank website stops working in Chrome because the top and side menus and buttons are made hidden with the CSS rule:

hr, #date, #logout, #navigation, ul.sectionLink, p.submit, #sideContent, #footer {
display: none;
}

但是,这是在print.css样式表中定义的,到屏幕:

However, that is defined in the print.css stylesheet and not to be applied to screen:

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

什么可能导致Chrome将打印样式表应用于屏幕?

What can cause Chrome to apply a print stylesheet to screen?

Chrome版本29.0.1521.3 dev-m。

Chrome Version 29.0.1521.3 dev-m.

推荐答案

这是Chrome自29版以来的一个已知问题。参见:

This is a known issue with Chrome since version 29. See:

  • Chrome 29 Style/Css issues
  • https://code.google.com/p/chromium/issues/detail?id=244090

暂时修复是 @media 规则中的打印样式表如下:

The temporary fix is to wrap the print stylesheet in a @media rule like this:

@media print {
   /* your CSS here */
}

这篇关于Chrome正在将打印样式表应用于屏幕,而IE,FF,Safari正在正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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