我正在做generate pdf。我想删除最后一个页面使用css方法,我试图获得删除它的:last-child
,但结果是什么。
我的代码:
body {
font-family: 'Roboto', sans-serif;
font-size: 0.85em;
padding-left: 30px;
padding-right: 30px;
line-height: 0.95em;
}
@font-face {
font-family: 'Roboto', sans-serif;
font-style: normal;
font-weight: normal;
}
footer {
position: fixed;
bottom: -30px;
right: 0px;
height: 50px;
width: 270px;
text-align: left;
}
footer .page-number:after {
content: counter(page);
}
footer .page-number .last:last-child {
display: none
}
<body>
<footer>
<div class="right" style="margin-left: -85px;">
<span class="page-number"></span>
</div>
<table width="100%" class="last">
<tr>
<td>
<span style="
border: 1px solid;
box-sizing: border-box;padding-right: 0.88cm;padding-left: 5px;vertical-align: middle;">Roles I </span>
<span style="width: 300px;
border-top: 1px solid;
border-right: 1px solid;
border-bottom: 1px solid;
margin-left: -6px;
box-sizing: border-box;padding-right: 70px;vertical-align: middle;">     </span><br>
<span style="
border-left: 1px solid;
border-right: 1px solid;
border-bottom: 1px solid;
box-sizing: border-box;padding-right: 1.32cm;padding-left: 5px;vertical-align: middle;">Roles II</span>
<span style="width: 300px;
border-right: 1px solid;
border-bottom: 1px solid;
margin-left: -6px;
box-sizing: border-box;padding-right: 70px;vertical-align: middle; ">     </span>
</td>
</tr>
</table>
</footer>
MY content here until N - Page and i want to remove the last footer
</body>
正如你在这张图片的例子中看到的,我有一个3页的数字,在页脚有我标记为红色的数字和方框。我只想删除红色框中的数据,但对于页码部分,我不想删除它。
注意:我使用的是dompdf库
https://stackoverflow.com/questions/56244878
复制相似问题