简体   繁体   English

html-pdf 文本对齐:证明不起作用?

[英]html-pdf text-align: justify not working?

I'm using html-pdf in Node.js to convert html text to a pdf.我在 Node.js 中使用 html-pdf 将 html 文本转换为 pdf。 text-align: left, center, and right work.文本对齐:左、中、右工作。 But text-align: justify does not work.但是 text-align: justify 不起作用。 When text-align is justified, it exports the text aligned left.当 text-align 对齐时,它导出左对齐的文本。

Here's the HTML code:这是 HTML 代码:

<p class="ql-align-justify"><span style="background-color: rgb(255, 255, 255);">Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. </span></p>

Here's the CSS code:这是CSS代码:

      .ql-align-justify {
          text-align: justify;
      }

How do I make the text-align: justify work?如何使 text-align: justify 工作?

似乎您需要将 WIDTH 设置为您的跨度,这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM