gpt4 book ai didi

php - 如何打印没有浏览器生成的页码、URL 等的 PHP 页面?

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

我有一个需要打印的 PHP 页面。我设法使用下面的打印样式表 (print.css) 从打印中删除不需要的元素。但是它不会删除浏览器生成的页眉、页码、URL 和日期。我正在使用 Bootstrap 框架。 bootstrap.min.css 没有任何“@media print”之类的东西。需要一些更好的 CSS 想法来实现这一点。谢谢。

    /* Remove unwanted elements */
/* Assign class="noprint" in the HTML. Header and navigation (<div id="header"> and <div id="nav">) */

#header, #nav, .noprint
{
display: none;
}

/* Ensure the content spans the full width */
#container, #container2, #content
{
width: 100%; margin: 0; float: none;
}

/* Change text colour to black (useful for light text on a dark background) */
.lighttext
{
color: #000
}

/* Remove links */
a:link, a:visited, .navbar-link
{
display: none;
}

最佳答案

在像 chrome 这样的浏览器中,当您尝试打印页面 (Ctrl+P) 时,它会打开一个对话框。在此框中,您必须选择“更多定义”或类似内容,然后取消选中标题选项。其他浏览器,一定有类似的方法。

关于php - 如何打印没有浏览器生成的页码、URL 等的 PHP 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31161869/

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