When I have a <section> that goes to two columns and it is relatively short, a paragraph or two, the columns are not balancing as I would expect them to. For instance the first column will be three lines deeper then the second column, which I would expect that at least one of the lines from the first column would be added to the second leaving the columns only one line off. I have even seen examples where the first column is two lines off, which would be equal if one line from the first column was brought over to the second column.
So what I discovered is that if I have the font-size specified at the paragraph level for the <section> then this problem persists, but if I also place the same font size at a block level, say the <body> then the problem goes away and I get balanced columns. I have included the HTML file with the CSS. When the CSS looks like this (border and colors added for clarity):
The columns do not balance as would be expected with the above CSS.
When you add font-size to the <body> like below then the columns balance:
I have also attached two PDF's showing you the results that I am getting. The PDF titled, "column-balance-bug-NO-extra-font-size" has five two column sections. Sections 1 and 4 have balancing issues. And section 3 is the only section that is perfectly balanced.
The PDF titled, "column-balance-bug-plus-extra-font-size" has all the columns balanced correctly, with two of them balanced perfectly. Section 1 is balanced perfectly when in the previous example it was off by three lines. And section 3 is one line off when it was perfectly balanced before.
Overall the second PDF has better line endings as well as better column balancing, the only difference is that even though the <p> tag has its font-size set to 9pt., you have to also put that same font-size on the <body>.
Now of course you will get the same results if just have the font size on the <body> but I needed to insure with the example that nothing about the font-size was changing between examples.
Also it is worth noting that if you set a larger font-size on the <body> and then a smaller on the paragraphs it still does NOT balance the columns correctly. But if you set the <body> to a smaller font-size then the paragraphs it does balance correctly.
We very often set the body to a given font-size and then when we switch to the two column sections or asides we change the font and its size, usually to smaller, and it is at that point that the column balancing begins to get thrown off.
So what I discovered is that if I have the font-size specified at the paragraph level for the <section> then this problem persists, but if I also place the same font size at a block level, say the <body> then the problem goes away and I get balanced columns. I have included the HTML file with the CSS. When the CSS looks like this (border and colors added for clarity):
<style>
body{
}
section{
column-count:2;
column-gap:1.25em;
margin-bottom:1em;
border:1pt solid rgb(225, 211, 157);
padding:.5em .75em .75em .75em;
background-color:rgb(245, 240, 221);
}
section p{
font-size:9pt;
line-height:1.33em;
}
</style>
The columns do not balance as would be expected with the above CSS.
When you add font-size to the <body> like below then the columns balance:
<style>
body{
font-size:9pt;
}
section{
column-count:2;
column-gap:1.25em;
margin-bottom:1em;
border:1pt solid rgb(225, 211, 157);
padding:.5em .75em .75em .75em;
background-color:rgb(245, 240, 221);
}
section p{
font-size:9pt;
line-height:1.33em;
}
</style>
I have also attached two PDF's showing you the results that I am getting. The PDF titled, "column-balance-bug-NO-extra-font-size" has five two column sections. Sections 1 and 4 have balancing issues. And section 3 is the only section that is perfectly balanced.
The PDF titled, "column-balance-bug-plus-extra-font-size" has all the columns balanced correctly, with two of them balanced perfectly. Section 1 is balanced perfectly when in the previous example it was off by three lines. And section 3 is one line off when it was perfectly balanced before.
Overall the second PDF has better line endings as well as better column balancing, the only difference is that even though the <p> tag has its font-size set to 9pt., you have to also put that same font-size on the <body>.
Now of course you will get the same results if just have the font size on the <body> but I needed to insure with the example that nothing about the font-size was changing between examples.
Also it is worth noting that if you set a larger font-size on the <body> and then a smaller on the paragraphs it still does NOT balance the columns correctly. But if you set the <body> to a smaller font-size then the paragraphs it does balance correctly.
We very often set the body to a given font-size and then when we switch to the two column sections or asides we change the font and its size, usually to smaller, and it is at that point that the column balancing begins to get thrown off.