orphans
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Свойство CSS orphans
устанавливает минимальное число строк в блочном контейнере, которое должно быть показано внизу страницы, региона или столбца.
/* <integer> значения */
orphans: 2;
orphans: 3;
/* Глобальные значения */
orphans: inherit;
orphans: initial;
orphans: unset;
Примечание: В типографии, orphan это первая линия абзаца, которая отображается внизу страницы. (Абзац продолжается на следующей странице.)
Начальное значение | 2 |
---|---|
Применяется к | блочные контейнеры |
Наследуется | да |
Обработка значения | как указано |
Animation type | by computed value type |
Синтаксис
Значения
<integer>
-
Минимальное число строк, которое можно оставить внизу фрагмента перед разрывом фрагмента. Значение должно быть положительным.
Формальный синтаксис
orphans =
<integer [1,∞]>
Пример
HTML
<div>
<p>This is the first paragraph containing some text.</p>
<p>
This is the second paragraph containing some more text than the first one.
It is used to demonstrate how widows work.
</p>
<p>
This is the third paragraph. It has a little bit more text than the first
one.
</p>
</div>
CSS
div {
background-color: #8cffa0;
height: 150px;
columns: 3;
orphans: 3;
}
p {
background-color: #8ca0ff;
}
p:first-child {
margin-top: 0;
}
Результат
Спецификации
Specification |
---|
CSS Fragmentation Module Level 3 # widows-orphans |
Совместимость с браузерами
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
orphans |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support