分页符不能正常旋转html页面?

时间:2016-03-15 13:34:04

标签: html css

我想要打印A4尺寸纸张两列。所以我拆分页面。在这里我用了

display: block; page-break-before: always;  

它的工作正常。但是在分页内容没有显示之后。

Demo

我需要在分页符内容继续下一个div。 有可能吗?

预期结果如this

1 个答案:

答案 0 :(得分:0)

尝试将第一个div中的最后一个段落放入第二个div中,然后运行。

body {
    margin: 0;
    padding: 0;
    background-color: #FAFAFA;
    font: 14px "Tahoma";
	line-height:28px
}
* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}
.text-center{
	text-align:center;
}
.regno li,   .answer_block div,.answer_block div p{
	display:inline-block;
	
}
.page {
    width: 21cm;
    min-height: 29.7cm;
    padding: 10px;
    margin: 1cm auto;
    border: 1px #D3D3D3 solid;
    border-radius: 5px;
    background: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.subpage {
    padding: 10px;
    border: 1px red solid;
    
	-webkit-transform: rotate(-90deg);
-moz-transform:rotate(-90deg);
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
      margin-left: 160px;
    margin-top: -165px;
    
	width: 180mm;
	    height: 267mm;
}

.subpage.second{
	  margin-left: 160px;
    margin-top: -280px;
		 
}
 	
      

 
@page {
    size: A4;
    margin: 0;
}
@media print {
	html, body {
    width: 210mm;
    height: 297mm;
  }
 
    .page {
        margin: 0;
        border: initial;
        border-radius: initial;
        width: initial;
        min-height: initial;
        box-shadow: initial;
        background: initial;
        page-break-after: always;
    }
p {
   display: block; page-break-before: always;        
}
	   
}
<div class="page">
   <div class="subpage" >
          <p>
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
          </p>
          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
     <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
   </div>
   <div class="subpage second" > 
          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
   </div>
</div>