CSS弹性布局打印问题

huangapple go评论120阅读模式
英文:

CSS Flex Print Issue

问题

我尝试使用Chrome打印,但遇到了一些问题。Google Chrome打印时未读取我的CSS的flex属性,也未读取粗体属性。

有任何解决方案或可使其正常工作的替代代码,或者我可以实现在页面上使用的PDF打印库吗?

英文:

I tried printing with chrome but i got some issue. Google chrome print not reading the flex property of my css also the bold property is not being read.

any solution or alternative code to make this work or any pdf print library that i can implement my page

答案1

得分: 0

我通过将CSS与我的HTML放在同一页来解决了这个问题!

英文:

I fix this by making the css in the same page with my html!

答案2

得分: 0

你可能需要定义一些特殊的打印样式,因为浏览器在打印时会覆盖某些样式。

在CSS文档中,你可以这样做:

@media print {
  /* 所有的打印样式都放在这里 */
}

或者只需链接到一个单独的打印样式表:

<link href="/path/to/print.css" media="print" rel="stylesheet" />

在这里了解更多信息:https://developer.mozilla.org/en-US/docs/Web/Guide/Printing

英文:

You might need to define some special print styles as a browser will override certain styles when printing.

Within a CSS document you can do:

@media print {
  /* All your print styles go here */
}

Or just link to a separate print stylesheet

&lt;link href=&quot;/path/to/print.css&quot; media=&quot;print&quot; rel=&quot;stylesheet&quot; /&gt;

Read more about it here: https://developer.mozilla.org/en-US/docs/Web/Guide/Printing

huangapple
  • 本文由 发表于 2023年6月1日 09:22:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76378136.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定