0

I'm writing a page using HTML, CSS, jQuery and some PHP to run on my localhost. I use a separate stylesheet for printing. In print preview now, the content of the page's title tag

<html><head><title>THIS CONTENT</title>...

shows up on the page - How to get rid of it?

Many thanks in advance.

  • It looks like the header you set in the print settings, depending on your software, OS and/or print driver. – Denys Séguret Mar 31 '13 at 19:19
  • possible duplicate of [Remove the default browser header and footer when printing HTML](http://stackoverflow.com/questions/255534/remove-the-default-browser-header-and-footer-when-printing-html) – Quentin Mar 31 '13 at 19:20
  • It's not the header (nor the footer) created by the browser that bother me. But, before the first content element of my page, I find the page title text. How come ...? – user2229946 Mar 31 '13 at 19:21
  • 1
    With the given data, it seems that the issue is caused by your style sheet. You really need to show your style sheet to get help with the issue. – Jukka K. Korpela Mar 31 '13 at 19:25
  • Well. Now inserted `title { display: none; }` into the print.css - working. Thanks for your time, guys, didn't guess one would CSS-format header elements. – user2229946 Mar 31 '13 at 19:28

2 Answers2

0

Try to send a text/html header from PHP. Add the following to the beginning of your file, before anything else is output to the browser:

<?php header("Content-Type: text/html"); ?>
HellaMad
  • 5,294
  • 6
  • 31
  • 53
  • Done, but to no avail. I'm using PHP only in the body, all header elements are HTML code. – user2229946 Mar 31 '13 at 19:26
  • Thanks, DC_. I got it solved (and will close the question asap, new account) -- inserted `title { display: none; }` into the print.css ... – user2229946 Mar 31 '13 at 19:34
0

I inserted

title { display: none; } 

into the print.css and now it works. Thanks for your time, guys, didn't guess one would CSS-format header elements.

(How do I upvote Jukka's comment? It made me revisit the CSS thought and helped me solve this. @Jukka: Greetings from Helsinki)