gpt4 book ai didi

asp.net - asp.net 打印页面中的页脚

转载 作者:行者123 更新时间:2023-11-28 13:21:44 25 4
gpt4 key购买 nike

我有一个 html 页面需要打印。

<div>content to print</div>

我也有像这样的页脚内容

<div class="divFooter" style="clear: both; text-align: center, font-size: 12px;">
footer content
</div>

页脚的 CSS 是

<style type="text/css">
@media screen
{
div.divFooter
{
display: none;
}
}
@media print
{
div.divFooter
{
position: fixed;
bottom: 0;
}
}
</style>

页脚在 ie 和 firefox 中底部对齐。但在 chrome 浏览器中效果不佳。知道吗?

最佳答案

因为您正在使用 @media print 标签。那么您的页脚将位于 print preview 的底部。如果您想在浏览器底部添加页脚,请添加 @media all

<style type="text/css">
@media screen
{
div.divFooter
{
display: none;
}
}
@media all
{
div.divFooter
{
position: fixed;
bottom: 0;
}
}
</style>

关于asp.net - asp.net 打印页面中的页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14576879/

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