I can't get my style sheets to apply to my popup window. I'm probably misses something simple but I can't seem to figure out what. I use the CSS on other pages with the same link and it works fine.
CSS
.Code128 {
font-size: 50px;
}
JQuery
$(document).ready(function () {
$('#Print').on("click", function () {
Popup($('#PrintDiv').html());
});
function Popup(data) {
var mywindow = window.open('', 'Print Label', 'height=400,width=600');
mywindow.document.write('<html><head><title>Print Label</title>');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="~/Content/Fonts.css"/>');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="~/Content/Label.css"/>');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
// mywindow.print();
// mywindow.close();
}
});
HTML
<div id="PrintDiv">
<div class="Code128">BarCode</div>
<div class="Code128">Bar Code</div>
</div>