CSS ไม่แสดงผลในเทมเพลตความเร็ว (JAVA)

Sep 15 2020

ฉันได้เขียน HTML-CSS ในไฟล์มันทำงานได้อย่างสมบูรณ์ในเบราว์เซอร์ แต่เมื่อฉันเปลี่ยนส่วนขยายเป็น vm (สำหรับความเร็ว apache) css บางตัวไม่ทำงาน เหตุใดความเร็วจึงไม่สามารถเข้าใจ 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>

คำตอบ

3 HMT Nov 07 2020 at 00:50

ปัญหาไม่ได้อยู่ที่เทมเพลตความเร็วของฉัน ฉันใช้ Itext5 เพื่อแปลง HTML เป็น PDF และเนื่องจาก Itext5 ไม่รองรับ HTML5 คุณสมบัติบางอย่างจึงไม่ทำงาน ฉันใช้ไลบรารี openHtmlToPdf สำหรับการแปลง HTML เป็น PDF และ css ทำงานได้อย่างสมบูรณ์ในขณะนี้