2011-11-14 47 views
2

MPDFにoverflow:hiddenでdivを正しく印刷させようとしています。私は文書を上下に読んでいろいろ試しました。運がない。 mpdf単位で、オーバーフローのブロック要素:hiddenはposition:absoluteまたはposition:fixed setを持つ必要があります。 1つのdivだけを印刷すると問題ありません。問題は、divを入れ子にして内側のテキストをクリップする必要があるときに表示されます。ここで私が何を意味するかです:MPDFとオーバーフローに関する問題:ネストされたdivで非表示

これは、あなたが唯一の違いはある見ることができるようにこれは、PHPスクリプトは、単純な

include("mpdf.php"); 
$mpdf=new mPDF(); 
$mpdf->WriteHTML($html); 
$mpdf->Output(); 

ありません

$html = <<< EOM 
<div style='border:1px solid red;position:relative;'> 
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'> 
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. 
</div> 
</div> 
$html = <<< EOM 

ん細かい

$html = <<< EOM 
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'> 
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. 
</div> 
$html = <<< EOM 

を出力しますその1つのdivは別のdivの内側にあります。誰かがこれを行う方法を考え出しましたか?

答えて

0

mpdfでは、ネストされたdivにoverflow: hidden;を使用することはできません。 overflow: hidden;はトップレベルの要素でのみ使用できます。

関連する問題