I have one document white in markdown format, and when it is converted into HTML, it is quite long (>20 pages), I need to print it out to read it . (I am not used to read e-paper before I got iPad).
Then I meet several problems
Width of some pictures is too long
It is so wide (>1024px), after print it out, it make the normal paragraph narrow, it looks urgy.
Surely I can using my favorite gimp to change the size, but it means I need to change a lot of files, I can also set the <img “width=640px”> like to push to this size, but I also have pictures in small size, I don’t want them to grow as well.
Can we handle this in CSS, my CSS expert JiHao say yes, after google, the correct way is using “max-width”, simple but it works.
img { float: none; max-width:640px; display:block;}
Show difference in printer and web
There is a media tag in css, and screen is for browser, projection is for projector and print is for printer, and there are other media, it more depends on browser.
<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print">
How to make page break
In M$ Word, there is page break, and it is similar one (page-break-before in CSS, but when I try it, it seems available for IE only
<style type="text/css" media="print">
p img { float: none; max-width:640px; display:block;}
h1 { page-break-before: always; }
</style>
Then it in printed out document, it is well formatted.
One thing left, how to make sure the image is not acrossed into two pages ?