简体   繁体   中英

html-pdf text-align: justify not working?

I'm using html-pdf in Node.js to convert html text to a pdf. text-align: left, center, and right work. But text-align: justify does not work. When text-align is justified, it exports the text aligned left.

Here's the HTML code:

<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:

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

How do I make the text-align: justify work?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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