diff --git a/IPython/html/static/notebook/less/cell.less b/IPython/html/static/notebook/less/cell.less
index f24a868..448c570 100644
--- a/IPython/html/static/notebook/less/cell.less
+++ b/IPython/html/static/notebook/less/cell.less
@@ -8,10 +8,18 @@ div.cell {
&.selected {
border-color: @border_color;
+ /* Don't border the cells when printing */
+ @media print {
+ border-color: transparent;
+ }
}
&.edit_mode {
border-color: green;
+ /* Don't border the cells when printing */
+ @media print {
+ border-color: transparent;
+ }
}
width: 100%;
@@ -21,13 +29,6 @@ div.cell {
outline: none;
}
-/* Don't border the cells when printing */
-@media print {
- div.cell {
- border-color: transparent !important;
- }
-}
-
div.prompt {
/* This needs to be wide enough for 3 digit prompt numbers: In[100]: */
min-width: 15ex;
diff --git a/IPython/html/static/notebook/less/codecell.less b/IPython/html/static/notebook/less/codecell.less
index 97a34ba..accead8 100644
--- a/IPython/html/static/notebook/less/codecell.less
+++ b/IPython/html/static/notebook/less/codecell.less
@@ -1,6 +1,6 @@
-/* avoid page breaking on code cells when printing */
-@media print {
- div.code_cell {
+div.code_cell {
+ /* avoid page breaking on code cells when printing */
+ @media print {
page-break-inside: avoid;
}
}
diff --git a/IPython/html/static/notebook/less/notebook.less b/IPython/html/static/notebook/less/notebook.less
index a4727fb..823f6e5 100644
--- a/IPython/html/static/notebook/less/notebook.less
+++ b/IPython/html/static/notebook/less/notebook.less
@@ -90,11 +90,14 @@ p {
.notebook_app #header {
.box-shadow(@notebook-shadow);
+ @media print {
+ display: none;
+ }
}
/* Hide the header when printing */
@media print {
- #header, #header-spacer {
- display: none !important;
+ #header-spacer {
+ display: none;
}
}