我尝试将HTML文件的一部分转换为PDF文件,但发现display:inline-block
在转换后无法正常工作。我尝试创建一个包含少量元素的示例html来测试它:
<span>1</span><br><span></span></a></div> <div class="seat"><a data-seat-no="2" class="btn-seat seat-crew" href="#!">
<span>2</span><br><span></span></a></div> <div class="spacing"></div> <div class="seat"><a data-seat-no="3" class="btn-seat seat-crew" href="#!">
<span>3</span><br><span></span></a></div> <div class="seat"><a data-seat-no="4" class="btn-seat seat-crew" href="#!">
<span>4</span><br><span></span></a></div> <br><div class="seat"><a data-seat-no="5" class="btn-seat" href="#!">
<span>5</span><br><span></span></a></div> <div class="seat"><a data-seat-no="6" class="btn-seat" href="#!">
<span>6</span><br><span></span></a></div> <div class="spacing"></div> <div class="seat"><a data-seat-no="7" class="btn-seat" href="#!">
<span>7</span><br><span></span></a></div> <div class="seat"><a data-seat-no="8" class="btn-seat" href="#!">
<span>8</span><br><span></span></a></div> <br><div class="seat"><a data-seat-no="9" class="btn-seat" href="#!">
<span>9</span><br><span></span></a></div> <div class="seat"><a data-seat-no="10" class="btn-seat" href="#!">
<span>10</span><br><span></span></a></div> <div class="spacing"></div>
,CSS代码是:
.seat {
background: #1f89c0 none repeat scroll 0 0;
border: 1px solid #333;
color: #fff;
display: inline-block;
font-size: 10px;
letter-spacing: 1px;
margin: 2px;
padding: 8px 0;
text-align: center;
text-transform: uppercase;
width: 87px;
}
每当我在浏览器中渲染时, display:inline-block
都有效:
但是当我尝试将其转换为PDF文件时,结果是:
ItextSharp不知道如何呈现display:inline-block
吗?我真的必须使用花车吗?