我有一个页面,我正在变成一个pdf与wkhtmltopdf。我有一个3列布局,它在Chrome中运行良好,但是pdf生成不正确。有没有其他的flexbox可以提供相同的视图或使用wkhtmltopdf制作flexbox的方法? Modernizr没有帮助。谢谢。Flexbox wkhtmltopdf渲染问题
HTML:
<div class="header">
<div id="name" class="center">
<h2>
Centered Text
</h2>
</div>
<div id="links" class="left">
<h3>
Left Line 1
<br>
Left Line 2
</h3>
</div>
<div id="contact" class="right">
<h3>
Right Line 1
<br>
Right Line 2
</h3>
</div>
</div>
</div class="clear"></div>
CSS:
.header {
margin-top: 0;
margin-bottom: 2px;
display: flex;
justify-content: space-between;
}
.center {
order: 2;
text-align: center;
}
.left {
order: 1;
float: left;
text-align: left;
}
.right {
order: 3;
float: right;
text-align: right;
}
.clear:before,
.clear:after {
flex-basis: 0;
order: 1;
}
.clear {
clear: both;
}
尝试使用媒体查询打印视图。 –