更快的方式开发和测试打印样式表(避免每次打印预览)? [英] Faster way to develop and test print stylesheets (avoid print preview every time)?

查看:113
本文介绍了更快的方式开发和测试打印样式表(避免每次打印预览)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的进程:


  1. 将更改保存到print.css

  2. 打开浏览器和刷新页面。

  3. 右键单击并选择打印>打印预览(Firefox,但任何浏览器)

这是第3步,我的错误,我想知道是否可能切掉它的过程与插件或东西。只需选择将页面作为打印媒体查看,然后只需刷新即可查看更改。



如何测试打印样式表?

解决方案

您可以使用



更新28/06 / 2016



Google Developers Google Chrome中的文档DevTools和模拟媒体选项已针对Chrome> 51进行了更新:




This is my process right now:

  1. Save changes to print.css
  2. Open browser and refresh page.
  3. Right-click and choose Print > Print Preview (Firefox, but any browser really)

It's step 3 that bugs me and I'm wondering if it's possible to cut it out of the process with a plugin or something. Just choose to view a page as print media, and then simply refresh to see the changes.

How do you test your print stylesheets? Do you always click print preview after a refresh?

解决方案

You can use the Chrome Media Type Emulation as accepted in the post See print css in the browser.

UPDATE 29/02/2016

The DevTools docs have moved and the above link provides inaccurate information. The updated docs regarding Media type emulation can be found here: Preview styles for more media types.

Open the DevTools emulation drawer by clicking the More overrides ••• more overrides icon in the top right corner of the browser viewport. Then, select Media in the emulation drawer.

UPDATE 12/04/2016

Unfortunately, it seems the docs have not been updated in regards to print emulation. However, the Print Media Emulator has moved (again):

  1. Open Chrome DevTools
  2. Hit esc on your keyboard
  3. Click (vertical ellipsis)
  4. Choose Rendering
  5. Tick Emulate print media

See screenshot below:

UPDATE 28/06/2016

Google Developers Docs around Chrome DevTools and the "Emulate Media" option have been updated for Chrome >51:

https://developers.google.com/web/tools/chrome-devtools/settings?hl=en#emulate-print-media

To view a page in print preview mode, open the DevTools main menu, select More Tools > Rendering Settings, and then enable the emulate media checkbox with the dropdown menu set to print.

这篇关于更快的方式开发和测试打印样式表(避免每次打印预览)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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