At the very bottom of the front page is a 2-column footer widget area (the area has a white background and includes social icons and a mailing list sign up box). There is a vertical border between the two columns, but it only extends to the bottom of the entire area if there is enough content inside.
Is there a way to extend the border to the bottom even if there isn’t enough content?
If the content is not going to change much, you could maybe get away with swapping the border-right on the left box for a border-left on the right one, the right being the taller element.
Some other ways to make both elements fill the full height would be to make the two elements display: table-cell and the parent wrapper display: table. Or just make the parent display: flex.
This assumes that the right flex-footer will always have more content than the left flex-footer. If this is not the case, then you should consider SamA74’s display:table/table-cell or flexbox solution.
As you suggested and; If the “flex-footer-1” keeps its border-right and the “flex-footer-2” overlap it with its border-left by a -1px margin, then either can have more content.
fiex-footer-2 did not have a width assigned before. Why did you add one? Adding the 46% width takes 4% away from inside the right container. It’s noticable. Assign an outline around the right footer box and see for yourself.
.footer-widgets .flex-footer-2 {
border-left: 1px solid #eaeaea;
margin-left: -1px;
outline: 1px solid magenta; /* TEMPORARY outline for testing */
padding-left: 20px;
width: 46%; /* comment out to see width become wider */
}
I did that as part of a test and forgot to remove it. I’ve removed it now, but it seems like the border in the middle isn’t in the exact center of the screen. Do you notice it?
One difference I noticed was that the original margin-left was 2.5###(some-long-decimal)% and the padding-left you replaced it with is 20px. Not sure if that’s it.
ronpat, I set them both to 50% and everything looks great now. I had tried that yesterday and it wasn’t working, so not sure what I was doing wrong. Anyway, I love it. Thank you!
Percentage widths can be tricky. The browser needs to calculate how many pixels it should give the width and that can result in rounding errors where the total 100% actually becomes 100% + one extra pixel. A fix can be to give one of the parts a 1px negative margin to soak up an eventual rounding error.
The code you have now includes that -1px margin, perhaps that is what makes it work today?