Disable @media print in bootstrap?

时光毁灭记忆、已成空白 提交于 2021-02-18 22:20:35

问题


Is it possible to entirely disable any preconfigured @media print css styles from bootstrap without having to recompile it?

The print styles applied by default could be seen here: https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css#L6837

I want my webpage to be printed just as seen, with all css tags applied. Especially colors, like:

b {
  color: #ff0000;
}

In order to disable the print styles from bootstrap, I'd have to explicit override every property again with my custom styles, eg:

b {
  color: #ff0000 !important;
}

But isn't there a global way to disable these default print styles?


回答1:


You can download custom bootstrap without media print. http://getbootstrap.com/customize/

just uncheck

Print media styles



来源:https://stackoverflow.com/questions/35039452/disable-media-print-in-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!