dongyuduan1890 2015-07-01 12:52
浏览 63

如何在没有浏览器生成的页码,URL等的情况下打印PHP页面?

I have a PHP page that I need to print. I managed to remove unwanted elements from printing with a print stylesheet (print.css) below. However it does not remove browser generated header, page numbers, URL and date. I am using bootstrap framework. bootstrap.min.css does not have any '@media print' sort of thing. Need some better CSS ideas to achieve this. Thank you.

    /* 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;
    }
  • 写回答

3条回答 默认 最新

  • dptiq46022 2015-07-01 12:57
    关注

    As far as I am aware you can not change this via css however when you bring up your browsers print dialog it should present you with an option to exclude headers and footers (i.e. page number and url).

    评论

报告相同问题?

悬赏问题

  • ¥15 vscode的问题提问
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM