Forum How do I...?

Page breaks not working?

chamstar
I have a simple html file which I am feeding in to Prince, however everything appears on one page. I have made sure Acrobat Reader is set to display 'per page' instead of 'continuous'. I would have thought the following HTML should result in 4 pages 30x40cm...

Note also that if I print preview in Firefox I do see 4 pages.

Many thanks in advance, Cham.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
		<style media='print'>
			@page { size: 30cm 40cm }
			div.page { page-break-after: always; 
                                        background-color: blue; 
                                        height: 100%; 
                                        width: 100%; }											
		</style>
		
		<style media='screen'>
			div.page { height: 500px; width: 500px; bottom-margin:40px; border: red solid 4px; }
		</style>
						
		<div class="page">
			<p>PAGE 1</p>
		</div>
		
				
		<div class="page">
			<p>PAGE 2</p>
		</div>
		
		
		<div class="page">
			<p>PAGE 3</p>
		</div>
		
		
		<div class="page">
			<p>PAGE 4</p>
		</div>
				
	</body>
</html>


I would have attached the outputted PDF but "The extension pdf is not allowed.", ironic ;)
chamstar
I may have answered my own question but generating a XHTML 1.0 Strict file and entering the same code works. I guess it may have been a DocType issue.
mikeday
Moving the <style> into the <head> appears to solve the problem.
chamstar
Thanks Mike - I guess browsers are much more forgiving when it comes to standards which is not really a great thing but we are used it.