Weasyprint: Support for line-break using {content: }

Created on 31 Oct 2019  路  2Comments  路  Source: Kozea/WeasyPrint

Is there any way to include a line-break between a string while using {content: }?

The following snippet is not working. I'm trying to use the \A

  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <style>
      @media print {
        @page {
            @bottom-center {
                content: "Tous droits r茅serv茅s, 2014 \A https://doi.org/10.7202/1027428ar";
            }
        }
      }
    </style>
  </head>
  <body>
    Content
  </body>
</html>
CSS question

All 2 comments

AFAIK only possible with position: running() and content: element(), e.g.:

<style>    
.footer {
   position: running(footer);
   text-align:center;
}
@page {
  @bottom-center {
    content: element(footer);
  }  
}
</style>

<div class="footer">
  Tous droits r茅serv茅s, 2014 <br>
  https://doi.org/10.7202/1027428ar
</div>

For the record, it also works with \A if you use a white-space value that keeps line breaks (for example white-space: pre-wrap).

Fun fact: that's how <br> tags are handled in WeasyPrint :wink:.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

whitelynx picture whitelynx  路  5Comments

muzzamilkhan picture muzzamilkhan  路  3Comments

Tontyna picture Tontyna  路  4Comments

antuaneacion picture antuaneacion  路  3Comments

ivanprice picture ivanprice  路  3Comments