+ 11
How to Print it? Only Text
I Want Print Only Text or Customized Page, Like a Only Text and Hide Print Button. https://code.sololearn.com/Wx701J6OdVIi/?ref=app
5 Respostas
+ 8
It sounds like you want the print preview and hard copies to show the "Print Only Text" but not have it show in the regular page.
You'd want to use CSS's media selector for print and screen.
Add this to your CSS tab:
h1 {
display: none;
}
@media print {
h1 {
display: block; /* show the "Print Only Text" in print media. */
}
input[type="button"] {
display: none; /* hide the Print button in print media. */
}
}
+ 5
Ayesha wrote, "Why you hide <h1> tage ?"
Response:
I used CSS to hide it because it said "ONLY PRINT THIS TEXT". I interpretted that as make that text exclusive to printing and hidden to all other media. If you wanted it shown whether the page is being printed or not, just remove all my references to h1.
In other words, this would be the only CSS you should use:
@media print {
input[type="button"] {
display: none; /* hide the Print button in print media. */
}
}
+ 3
Why you hide <h1> tage ?