如何在CSS中将文本放置在图像上
<div class="image"> <img src="sample.png"/> <div class="text"> <h2>Some text</h2> </div></div>
<style>.image { position: relative;}h2 { position: absolute; top: 200px; left: 0; width: 100%; margin: 0 auto; width: 300px; height: 50px;}</style>
<style>#image_container{ width: 1000px; height: 700px; background-image:url('switch.png');}</style><a href="prints.php">Print</a><?php ob_start(); ?><div id="image_container"></div><?php $_SESSION['sess'] = ob_get_contents(); ob_flush();?>
<?php require_once('html2pdf/html2pdf.class.php'); ?><?php $html2pdf = new HTML2PDF('L', 'A4', 'en');$html2pdf->writeHTML($_SESSION['sess']);$html2pdf->Output('random.pdf');?>
慕标5832272
尚方宝剑之说