【问题标题】:Maintain text color when copying from html to doc/docx file从 html 复制到 doc/docx 文件时保持文本颜色
【发布时间】:2021-05-04 02:38:09
【问题描述】:

我在页面上生成这个 html 代码:

<p style="font-size: 13.33px">Probability: <a id="low" style="font-size: 13.33px; color: #70ad47"><b>Low</b></a></p>
<p style="font-size: 13.33px">Severity: <a id="medium" style="font-size: 13.33px; color: #ffc000"><b>Medium</b></a></p>
<p style="font-size: 13.33px"><b>Overall Risk:</b> <a id="high" style="font-size: 13.33px; color: #ff0000"><b>High</b></a></p>

但是当我直接从网页复制到docx文件时,它没有颜色:

复印时如何保持颜色格式?

【问题讨论】:

标签: html css formatting docx


【解决方案1】:

实际上,来自浏览器的复制命令主要捕获 HTML 部分,它可能可以与 ctrl + shift + v 一起使用,而不仅仅是 ctrl + v 但我不保证它会起作用,因为复制粘贴不会捕获高级 CSS

【讨论】:

  • 为什么我可以将示例文本从 w3schools 复制到带有颜色的 word 文档而无需任何特殊粘贴?
猜你喜欢
  • 2015-11-30
  • 1970-01-01
  • 1970-01-01
  • 2011-12-18
  • 2011-07-29
  • 1970-01-01
  • 2020-12-30
  • 2021-09-01
相关资源
最近更新 更多