0

I am trying to print a div in my rails app to a printer. I am following instructions here: Print the contents of a DIV but I can not get the css file to work

mywindow.document.write('<link rel="stylesheet" href="/assets/stylesheets/mystyle.css.scss"     type="text/css" />');

The page is being printed without the CSS. What am I doing wrong?

Community
  • 1
  • 1
Tiamon
  • 237
  • 2
  • 13

2 Answers2

0

href="/assets/stylesheets /mystyle.css.scss"

Please mention full url in above href path and try

Prashant M Bhavsar
  • 1,136
  • 9
  • 13
0

I am not tested this but just try

<link media="print" rel="stylesheet" href="/assets/stylesheets/mystyle.css.scss" type="text/css" />
  • Removed the extra spaces
  • added media="print"
Kiren S
  • 3,037
  • 7
  • 41
  • 69