CSSで印刷から除外する
style.css
.inprinter{ display: inline; font-size: 32px; } .outprinter{ display: none; font-size: 12px; }
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel='stylesheet' type='text/css' href='style.css'media="print"/> <title>Insert title here</title> </head> <body> <h1>printer test</h1> <div class="inprinter"> プリンターの印刷対象です。 </div> <div class="outprinter"> プリンターの印刷対象ではありません。 </div> </body> </html>