【问题标题】:Css not rendering in velocity template (JAVA)Css 不在速度模板中渲染(JAVA)
【发布时间】:2021-01-01 20:47:24
【问题描述】:

我在一个文件中编写了一些 HTML-CSS,它在浏览器中完美运行,但是当我将扩展更改为 vm(对于 apache 速度)时。一些CSS不起作用。为什么velocity无法理解css。

代码:

   <html>
 <head>
    <title>Letter</title>
    <style>
    .row {
            width: 100%;
            display:flex;
            height:80px;
        }
    .column1 {
            width:33%;
            float: left;
        }
    .column2 {
            width:33%;
            float: center;
        }   
    .column3 {
            width:33%;
            float: right;
        }
        body {
            padding: 20px;
            font-size: 12px;
            font-family: Arial,Arial Unicode MS,Quivira,sans-serif,Wingdings;
        }
        #rcorners2 {
  border-radius: 25px;
  align-items:center;
  border: 1px solid grey;
  padding: 20px;
  width: 1000px;
  height: 50px;
  display:flex;
}
.vl {
  border-left: 1px solid grey;
  height: 50px;
}
.gap{width:200px;background:none;height:200px;display:inline-block;}
    </style>
    </head>
    <body>
    <div class="row">
        <div class="column1">
            <img src="https://www.iconfinder.com/data/icons/pictype-free-vector-icons/16/home-512.png" height="50px" width="250" />
        </div>
        <div class="column2">
        <h1 style="text-align: center;"> Letter Head</h1>
        </div>
        <div class="column3">
            <h2 style="color:#AE275F;text-align: right;">SAMPLE</h2>
        </div>
    </div>
    <div>
    <div id="rcorners2" > </div>
    <div>
    <p>Date </p>
    <p>MAY 28,2020</p>
    </div>
    <div class="gap">
    </div>
    <div class="vl"></div>
    </div>
    </body>
</html>

【问题讨论】:

标签: java html css velocity


【解决方案1】:

问题不在于我的速度模板。我正在使用 Itext5 将 HTML 转换为 PDF,并且由于 Itext5 不支持 HTML5 ,因此某些功能无法正常工作。 我正在使用 openHtmlToPdf 库将 HTML 转换为 PDF,并且 css 现在可以完美运行。

【讨论】:

    猜你喜欢
    • 2017-08-13
    • 2015-09-17
    • 2010-11-26
    • 2012-06-30
    • 1970-01-01
    • 2012-01-09
    • 2017-10-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多