RhianaH
Rhiana is a front end developer specialising in making web sites and applications accessible for people with disabilities. Combining her background in educational psychology and a love of computers.
?
header nav, footer, .sidebar, .btn, .fa-sort, .fa-sort-up, .fa-sort-down,
.hr-style, .edit-buttons, .top-banner, .tooltip__info-button {
display: none !important;
}
.no-print {
disply: none;
}
.sidebar, .detail-progress-buttons, .form-search, .print, footer nav, footer .domains {
disply: none;
}
.col-xs-9,
.col-lg-10,
.col-md-12 {
width: 100%;
padding: 0;
}
.table-with-chart .flex-container > table {
width: 100%;
}
<link rel="stylesheet" type="text/css" href="print.css" media="print">
header nav, footer, .sidebar, .btn, .fa-sort, .fa-sort-up, .fa-sort-down,
.hr-style, .edit-buttons, .top-banner, .tooltip__info-button {
display: none !important;
}
.no-print {
disply: none;
}
.sidebar, .detail-progress-buttons, .form-search, .print, footer nav, footer .domains {
disply: none;
}
.col-xs-9,
.col-lg-10,
.col-md-12 {
width: 100%;
padding: 0;
}
.table-with-chart .flex-container > table {
width: 100%;
}
<link rel="stylesheet" type="text/css" href="print.css" media="print">
@media print {
/** Setting margins */
@page { margin: 2cm }
body {
font: 13pt Georgia, "Times New Roman", Times, serif;
line-height: 1.3;
background: #fff !important;
color: #000;
}
/* Defining page breaks */
a {
page-break-inside: avoid;
}
}
.class_name {
background: blue;
color: white;
@media print {
background: transparent !important;
color: black !important;
border: 1px solid black;
}
}
<div class="bg-blue-100 print:bg-white">
<img src="" alt=""
class="block print:hidden"/>
</div>
The properties need to match or it won't work
CSS Styling isn't getting applied?
Tailwind styling isn't getting applied?
Firefox isn't printing all the pages
Firefox isn't printing background
Making the elements background transparent so it can’t overflow
Adding overflow: hidden to the element
Putting the border on the same element as the background-color
Making it a fixed height/width
Borders are going missing
High charts will re-size the chart to the window then print
So test on a few responsive sizes and orientations
There are open issues and tickets to fix this
My Charts are all the wrong size
My Charts are all the wrong size
.highcharts-container {
overflow: visible !important;
position: absolute !important;
}
Temp fix only, may go outside some borders
By RhianaH