remove url and print text from the printed page
The header with the URL (and sometimes the page title, page number etc.) is automatically added by the web browser. Basically the settings can only be changed by the user. This topic is discussed in details in that question
For the button itself, you could hide it using specific print CSS as discussed in that question. And as MMacdonald said, you can use this technique for other elements as well so that you don't need to re-render your page. But then you would lose the preview feature (the user could still use the browser's print preview feature).
Remove URL from printing page using css
a[href]:after { content: none !important; }
update
The CSS :after selector inserts something after the content of each selected element(s).
Use the content property to specify the content to insert. content: none
is for explicitly preventing the after
selector (pseudo-element) from being generated (really only used to override another style that would have generated content).
a[href]:after { content: none !important; }
will mean remove content after each link.
How to remove url text from page printed using javascript's window.print() function
You can do that with media-dependent style sheets like below;
<link rel="stylesheet" type="text/css" media="print,handheld" href="your.css"/>
And in your your.css
;
@media print {
a {
display:none;
}
}
@media screen and projection {
a {
display:inline;
}
}
Removing page title and date when printing web page (with CSS?)
Historically, it's been impossible to make these things disappear as they are user settings and not considered part of the page you have control over.
However, as of 2017, the @page
at-rule has been standardized, which can be used to hide the page title and date in modern browsers:
@page { size: auto; margin: 0mm; }
Print headers/footers and print margins
When printing Web documents, margins are set in the browser's Page Setup (or Print Setup) dialog box. These margin settings, although set within the browser, are controlled at the operating system/printer driver level and are not controllable at the HTML/CSS/DOM level. (For CSS-controlled printed page headers and footers see Printing Headers .)
The settings must be big enough to encompass the printer's physical non-printing areas. Further, they must be big enough to encompass the header and footer that the browser is usually configured to print (typically the page title, page number, URL and date). Note that these headers and footers, although specified by the browser and usually configurable through user preferences, are not part of the Web page itself and therefore are not controllable by CSS. In CSS terms, they fall outside the Page Box CSS2.1 Section 13.2.
... i.e. setting a margin of 0 hides the page title because the title is printed in the margin.
Credit to Vigneswaran S for this tip.
How to remove url from print(in browser)
I did this and both the problems got solved.
@page
{
size: auto; /* auto is the current printer page size */
margin: 0mm; /* this affects the margin in the printer settings */
}
@media print {
#print {
display : none;
}
}
Remove app name and web page address from printing java-script window.print
You can remove them by disabling Header and footers when you run print command in your browser (Screenshot is from Chrome by the way).
Related Topics
Switch Window Between Normal and Full-Screen Mode
How to Make a Web Page Show Up Only Once
How to Override Expansionpanelsummary Deep Elements with Styled-Components
Woocommerce: Disable Date on Edit Orders
Losing Mouseup Event If Releasing Not Over the Same Element
Listing Known CSS Classes Using JavaScript
Link on Certain Position of an Image Background Which Is Responsive
Activate an Element's :Active CSS Pseudo-Class Using JavaScript
Check If Element Is Being Animated CSS3
Make Webelement Visible via Selenium with Python with JavaScript
Detect When a Position: Fixed; Element Crosses Over Another Element
Syncing Column Width of Between Tables in Two Different Frames, etc
Change Width Proportions of Two Blocks with a Slider
Remove Header and Footer in HTML to Print Page
Load Image from Url and Draw to HTML5 Canvas
Is "Localstorage" in Firefox Only Working When the Page Is Online