未在velocity模板中呈现Css(JAVA)
我已经在一个文件中编写了一些HTML-CSS,它在浏览器中工作得非常好,但是当我将扩展名更改为vm(对于apache velocity)时。有些css不起作用。为什么velocity不能理解css 代码:未在velocity模板中呈现Css(JAVA),java,html,css,velocity,Java,Html,Css,Velocity,我已经在一个文件中编写了一些HTML-CSS,它在浏览器中工作得非常好,但是当我将扩展名更改为vm(对于apache velocity)时。有些css不起作用。为什么velocity不能理解css 代码: <html> <head> <title>Letter</title> <style> .row { width: 100%; display:flex;
<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>
书信
.行{
宽度:100%;
显示器:flex;
高度:80px;
}
.专栏1{
宽度:33%;
浮动:左;
}
.专栏2{
宽度:33%;
浮动:中心;
}
.专栏3{
宽度:33%;
浮动:对;
}
身体{
填充:20px;
字体大小:12px;
字体系列:Arial、Arial Unicode MS、Quivira、无衬线、Wingdings;
}
#rcorners2{
边界半径:25px;
对齐项目:居中;
边框:1px纯灰;
填充:20px;
宽度:1000px;
高度:50px;
显示器:flex;
}
.vl{
左边框:1px纯色灰色;
高度:50px;
}
.gap{宽度:200px;背景:无;高度:200px;显示:内联块;}
信头
样品
日期
2020年5月28日
问题不在于我的velocity模板。我使用Itext5将HTML转换为PDF,由于Itext5不支持HTML5,一些功能无法工作。
我正在使用openHtmlToPdf库将HTML转换为PDF,css现在工作得很好。也许这会有帮助:或者问题是一些css工作,而一些不工作。我已经检查了这些答案。谢谢@DeniJuric