Javascript 为打印窗口旋转css不工作?JS

Javascript 为打印窗口旋转css不工作?JS,javascript,asp.net,html,css,rotatetransform,Javascript,Asp.net,Html,Css,Rotatetransform,我想打印90度的数据,这是支票,但我的transform.rotate css样式在这里不起作用,这是我的html <div id="content"> <div id="dvRef" class="divSquare">1</div> <div id ="dvDate" class="divSquare">2</div> <div style='clear:both'&

我想打印90度的数据,这是支票,但我的transform.rotate css样式在这里不起作用,这是我的html

   <div id="content">
        <div id="dvRef"  class="divSquare">1</div>
        <div  id ="dvDate"  class="divSquare">2</div>
        <div style='clear:both'></div>
        <div id="dvWords" class="divSquare">3</div>
        <div id="dvAmount" class="divSquare">4</div>
  </div>

1.
2.
3.
4.
打印窗口的JS

        var win = window.open('', 'printwindow','height=600,width=800');
        var str = '<html><head><title> alflah</title>';
        str = str + '<style> #content  {     position: relative;   top: 90px;   -webkit-transform: rotate(90deg);  -moz-transform: rotate(90deg);  -o-transform: rotate(90deg);   -ms-transform: rotate(90deg);  transform: rotate(90deg);    }      div#dvAmount { position: relative;  left: 218px; } .divSquare{     width:20%; height:10px; margin:4px;  float: left  } div#dvDate {  left: 218px;   position: relative;   top: -16px;  }  </style>';
        str = str + '   </head>';
        $(win.document.head).html(str);
        $(win.document.body).html('<body>' + $("#content").html() + '</body></html>'); 
        win.document.close();
        win.focus(); // necessary for IE >= 10
        win.print();
        win.close();
var-win=window.open(''printwindow','height=600,width=800');
var str='alflah';
str=str+'#content{position:relative;top:90px;-webkit transform:rotate(90deg);-moz transform:rotate(90deg);-o-transform:rotate(90deg);-ms transform:rotate(90deg);transform:rotate(90deg)}div#dvAmount{position:relative;left:218px;}.divSquare{宽度:20%;高度:10px;边距:4px;浮点:left}div#dvDate{left:218px;position:relative;top:-16px;}';
str=str+'';
$(win.document.head).html(str);
$(win.document.body).html(“”+$(“#content”).html()+“”);
win.document.close();
win.focus();//IE>=10所必需的
win.print();
win.close();
我的css的顶部和对齐工作,但我需要转换。旋转也工作,但它不工作的任何想法。我添加了js小提琴链接


您使用的是哪种浏览器?Chrome。。currentlytry position absolute可将其定位在页面上。旋转始终围绕元素的中间旋转,从而产生窗口外的内容。对于这个最小的示例,将css更改为:position:absolute就足够了;排名:0;旋转这个类似的问题,但如何在我的情况下应用它