Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS3 Columns - Widows / Orphans

Tags:

css

I've looking around to see if there have been any decent way of handling widows and orphans in CSS3 multi-columns, but have been disappointed to find none. I've tried the widow and orphan properties themselves, but they didn't do anything.

Does anybody know of a way to use CSS3 multi-columns and handle widows and orphans?

like image 430
Kyle Hotchkiss Avatar asked Jul 13 '11 16:07

Kyle Hotchkiss


People also ask

What are widows and orphans in CSS?

In short, In CSS specifically: widows = minimum number of lines in a paragraph split on the new page. orphans = minimum number of lines in a paragraph split on the old page.

Are orphans CSS properties?

The orphans CSS property sets the minimum number of lines in a block container that must be shown at the bottom of a page, region, or column. In typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page.

How do you avoid a widow in CSS?

Use   for flexibly removing widows I've added a non-breaking space between the words “wraps” and “here” which makes them behave as if they are a single word, rather than two that are separated by a space.

How do you avoid widows and orphans in HTML?

The most simple way to get rid of widows is to manually add a non-breaking space inside your HTML code. A non-breaking space acts as a glue between two words, and force them to be on the same line. A non-breaking space looks like this:   .


1 Answers

An interim solution to this is to add

display: inline-block 

to the block level element you wish to avoid breaking across columns. I recently needed this for <li> and <dl>. Works well for either.

like image 99
PlayGod Avatar answered Oct 12 '22 01:10

PlayGod