Print the web page in two columns

How to print a web page in two columns or one column according to user input / selection.

And when you take the printout, I get the website URL in the upper left of the page. How can we stop printing?

Hi

+3
source share
5 answers

When specifying <link>(for example, in the CSS stylesheet) you can specify an attribute so that CSS is used only for printing or screen. (or braille!) the CSS in this file can then rebuild your site into columns as you see fit.

<link type="text/css" rel="stylesheet" href="print.css" />

CSS , , , JavaScript, - , CSS, , disabled <link>:

var printCSS = document.getElementsByTagName("link")[n];
printCSS.disabled = true;
printCSS.disabled = false;
+2

, 2 1, , html.

, , , , .

+1

mozilla -moz-column-count:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
  <title>Two columns</title>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>

  <div style='-moz-column-count:2'>
     one<p>
     two<p>
     three<p>
     four<p>
     five<p>
     six
  </div>

</body>
</html>

IE, , - IE.

URL-, , . ( ) Firefox File β†’ Page Setup β†’ Margins & Header/Footer: blank.

+1

URL-, , script.

, , HTML , HTML , .

0

- / .

You can provide an alternative stylesheet using the @media rule to provide a different layout that applies only to printed materials ... but I suspect that it is better to leave this in the user printer settings.

And when you take the printout, I get the website URL in the upper left of the page. How can we stop printing?

This is a browser preference. Authors cannot delete it.

0
source

Source: https://habr.com/ru/post/1744830/


All Articles