问题描述
我正在尝试使用xhtml2pdf库将HTML文件转换为PDF,以便在Django中进行下载。但是在转换为PDF后,CSS无法正常工作。 这是我的HTML代码段:
<html lang="en">
<head>
<meta charset="utf-8">
<title>Certificate</title>
{% load static %}
<link href="{% static 'koss/css/bootstrap.min.css' %}" rel="stylesheet">
<style>
.test {
position: relative;
bottom: -309px;
left: 331px;
color: #151313;
padding-left: 25px;
padding-right: 20px;
}
#profile_image1{
margin-top: -147px;
margin-left: 171px;
}
#profile_image2{
margin-left: 156px;
}
</style>
</head>
<body>
<div class="test">
<h3>name 1</h3>
</div>
<div class="test">
<h3> name2 </h3>
</div>
<div class="test">
<h3>name3 </h3>
</div>
<img id="profile_image1" alt="image" class="img-fluid m-3" src="{% static 'koss/img/memcirti1.png'%}"
onerror="imgError(this);">
<br>
<img id="profile_image2" alt="image" class="img-fluid m-3" src="{% static 'koss/img/memcirti2.jpg'%}"
onerror="imgError(this);">
</body>
</html>
我该如何解决问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)