Working with widows and orphans
The orphans and widows properties help control the way HTML pages is printed out. While, widows define the minimum number of lines a paragraph must have at the top of the printed page, the orphan defines the minimum number of lines for the bottom of the page. By the end of the lesson, you will understand how widows and orphans work and know how to use them.
Video Transcript
00:00The next and last lecture in this chapter is about printing elements really and how will they look like when they're printed?
00:08This is not fully supported on every browser yet as of this recording in late 2015, but
00:15You can definitely add it in and it will just ignore it if it's not supported if it is supported even better because then
00:21You'll printouts will look wonderful for those users. So we're gonna look at that. It's called Windows and orphans
00:27We're gonna see what they are and how they work and we're gonna fix a printout to make it more print pretty
00:33Let's jump in and see how that works in your source files
00:37Make sure you moved on to site 3 where what we really did was was just create paragraphs
00:42Just a lot of them and we want to showcase something that's called orphans and windows to do that
00:48Unfortunately, we can't do it in Firefox. So not only do you want to move on to?
00:54The new sample which is in site 3 go ahead and open up the site in Chrome if you can
01:00Once you open it up in Chrome, just go ahead and click on to print the document by typing
01:06Command P or just going through the menu file print
01:11You'll get a preview and in this preview
01:13I deliberately created a page that has a few issues
01:17One of them is we have your something that is called
01:20Orphans and orphans are is when we have a really small amount of lines in a paragraph
01:25Towards the end of a page as it's being printed out in this case. We have your two lines
01:30Apologies for the coughing in behind the scenes if you could hear it
01:34Alright, and the and Windows is when towards the end of a paragraph the a new line is starting a new page
01:41It's just a couple of words or a couple of lines
01:43We want to control that and basically tell the browser when it's printing the document
01:48To make sure that it has at least x amount of lines for the top
01:53Which is right here the window or for the orphan which is in the bottom of it region
01:59To do that. I'm going to go into my source files and in my source files literally
02:03I just created a very simplified version of the last site
02:06We were working on and just go into the paragraph and just add the windows and the windows again is going to make sure that
02:13Windows and it's not widely supported yet. Unfortunately the windows orphans is a little bit more supported
02:21But it doesn't hurt to add both of them in what this is basically going to say is try to make sure
02:25That there are three lines at least for a paragraph if it's in the beginning of a page or at the end of a page
02:33So there we go. So if I go ahead and save this and I go back into my browser into Chrome
02:38Cancel click on refresh
02:41reprint again go ahead to reprint we'll see in our preview that we're not we don't have this
02:46Orphan right now that was there before nor do we have the window issue because now we have their three lines and not one line
02:55So that's it that covers this chapter. We're done talking about configuring paragraphs. We even moved into the print domain
03:02This is not as widely supported, but it definitely is worth putting in especially if you are
03:07You think users are going to print those documents out
03:10This is all you really need to try to control at least a little bit of the
03:14Legibility of the copy when is being printed if you want to make sure that it's not going to break leave only one line
03:20Or one letter in a beginning of a page. So that's it. We are done with this chapter
