简体   繁体   中英

How to make a div that doesn't resize itself

I have 64 students. I want to print a student transcript for each student on one page.I have different number of subjects for different classes. When I resize my div for 12 subjects, it fits perfectly thus printing 64 pages but when the subject reduces, it prints lesser pages as the next student details spills on the previous student. Is there a way to set each div to fully occupy one page by default whether the content is small or big?

Using the page-break-before property on your div , you can force a page break to occur before that element when printing your website, like so:

.student {
    page-break-before: always;
}

This will not work on an empty div , but that does not apply to your case from the sound of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM