I'm really struggeling to print my Twitter Bootstrap views correctly, and was wondering if anyone could point me in the right direction. I've added a custom "print.css" which overrides some of the original bootstrap styling, as well of styling some of my own components.
This is my print dialog:
Not sure if you can tell so easily from the image, but the well has lost its background as well as not spanning across the entire page width. Also, the 'columns' or 'spans' seem to be all wonky. Page is built up like this: (Only showing first row to keep it clean)
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="row-fluid">
<div style="height: 150px; width: 300px">
<img class="img-rounded" src='data:image/png;base64,@Model.Unit.Image64' />
</div>
</div>
<div class="row-fluid">
...
</div>
</div>
<div class="span4">
...Pie chart control
</div>
<div class="span5">
...Bar chart control
</div>
</div>
</div>
Here's my print.css:
@media print {
body {
margin: 0;
padding: 0;
line-height: 1.4em;
word-spacing: 1px;
letter-spacing: 0.2px;
font: 13px Arial, Helvetica,"Lucida Grande", serif;
color: #000;
}
#print-btn #update-btn #nav-left #nav-bar, #selectUnitContainer, .navbar, .sidebar-nav {
display: none;
}
#print-btn, #update-btn, #units {
display: none;
}
#nav-left {
display: none;
}
#report-container {
visibility: visible;
}
.well .span12{
width: 100%;
visibility: visible;
}
.navbar {
display: none;
}
.sidebar-nav {
display: none;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…