gpt4 book ai didi

html - 使用 css 在可打印页面的底部放置一个表格

转载 作者:太空宇宙 更新时间:2023-11-03 21:43:16 24 4
gpt4 key购买 nike

我有一张 A4 纸用于打印:

.page 
{
width: 21cm;
min-height: 29.7cm;
padding: 1.2cm;
margin: 1cm auto;
border: 1px #D3D3D3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

在此页面中,我试图在底部放置一个表格:

   <table id="t_obs">
<tr>
<td>TEXT</td>
</tr>
</table>

使用CSS:

#t_obs
{
position: absolute;
bottom:0px;
}

但只有 bottom: -100px 才会到底部,为什么?

谢谢。

最佳答案

使用position:relative 到.page

  .page 
{
width: 21cm;
min-height: 29.7cm;
padding: 1.2cm;
margin: 1cm auto;
border: 1px #D3D3D3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position:relative;
}

DEMO

关于html - 使用 css 在可打印页面的底部放置一个表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22147307/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com