View print CSS in IE7 or IE8

2019-06-18 01:14发布

I'm debugging a site that has problems with element positioning when printing (I have a separate print.css file linked by a link element with the media="print" attribute). This problem only occurs in IE7 and IE8.

What I'm looking for is a way to view the page using the print media type, but while still having IE8's developer tools available to view element details and edit in real-time, etc.

The function I'm looking for would be similar to the "Display CSS by Media Type" feature in Chris Pederick's Web Developer Extension for Firefox. (But this problem doesn't occur in firefox...nor in safari, or even in IE6.)

3条回答
不美不萌又怎样
2楼-- · 2019-06-18 01:32

i've always used print preview, never had a problem with it. just open it up in IE; i'd target it with conditionals, but "hacks" work just as well.

you're seeing differences....what media attributes do your other link elements have? if you have one for all, switch it to type="screen, projection">

查看更多
男人必须洒脱
3楼-- · 2019-06-18 01:47

Why not just assign the screen attribute to the print stylesheet for your debugging session (and remove the screen version or swap the media attributes)?

查看更多
放荡不羁爱自由
4楼-- · 2019-06-18 01:47

What I have always done, is I have disabled (commented out the "screen" style sheet) and converted the media="print" style sheet to be media="screen". Only way I know how with out printing a bunch of test pages.

查看更多
登录 后发表回答