-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_content_change.html
More file actions
34 lines (31 loc) · 945 Bytes
/
print_content_change.html
File metadata and controls
34 lines (31 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" content="width=device-width, height=device-height">
<title>Orange Print Background Removal</title>
</head>
<style>
.box {
height: 100vh;
width: 100vw;
}
@media screen {
.background{
background-color: rgb(0, 0, 255);
color-adjust: exact;
}
}
@media print {
.background{
background-color: rgb(255, 113, 57);
color-adjust: exact;
}
}
</style>
<body>
<div id="content" class="box background">
</div>
</body>
<!-- The window.print should freeze the page before removing the content, so the background should remain present. -->
<button id="print-button" onclick="window.print(); document.getElementById('content').remove()">Print</button>
</html>