aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/css/page-break-inside/index.html
blob: 5fa07bd2f523e7f49799f691546def58390c7047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
title: page-break-inside
slug: Web/CSS/page-break-inside
tags:
  - CSS
  - Propriété
  - Reference
translation_of: Web/CSS/page-break-inside
---
<div>{{CSSRef}}</div>

<div class="blockIndicator warning">
<p><strong>Attention !</strong> Cette propriété a été remplacée par la propriété {{cssxref("break-inside")}}.</p>
</div>

<p>La propriété <strong><code>page-break-inside</code></strong> ajuste la façon dont sont appliqués les sauts de page au sein de l'élément courant.</p>

<pre class="brush:css no-line-numbers">/* Valeurs avec un mot-clé */
page-break-inside: auto;
page-break-inside: avoid;

/* Valeurs globales */
page-break-inside: inherit;
page-break-inside: initial;
page-break-inside: unset;
</pre>

<h2 id="Syntaxe">Syntaxe</h2>

<h3 id="Valeurs">Valeurs</h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>Valeur initiale. Les sauts de page sont automatiques (ni forcés, ni interdits).</dd>
 <dt><code>avoid</code></dt>
 <dd>L'agent utilisateur évite d'insérer un saut de page au sein de l'élément.</dd>
</dl>

<h3 id="Syntaxe_formelle">Syntaxe formelle</h3>

{{csssyntax}}

<h2 id="Alias_avec_break-inside">Alias avec <code>break-inside</code></h2>

<p>La propriété <code>page-break-inside</code> a désormais été remplacée par la propriété {{cssxref("break-inside")}}.</p>

<p>Pour des raisons de compatibilité, <code>page-break-inside</code> devrait être considérée par les navigateurs comme synonyme de <code>break-inside</code>. De cette façon, les sites utilisant <code>page-break-inside</code> pourront continuer de fonctionner. Voici un sous-ensemble des valeurs de cette propriété et des correspondances</p>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col"><code>page-break-inside</code></th>
   <th scope="col"><code>break-inside</code></th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>auto</code></td>
   <td><code>auto</code></td>
  </tr>
  <tr>
   <td><code>avoid</code></td>
   <td><code>avoid</code></td>
  </tr>
 </tbody>
</table>

<h2 id="Exemples">Exemples</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;div class="page"&gt;
  &lt;p&gt;Un premier paragraphe.&lt;/p&gt;
  &lt;section class="list"&gt;
    &lt;span&gt;Une liste&lt;/span&gt;
    &lt;ol&gt;
      &lt;li&gt;Un&lt;/li&gt;
&lt;!--       &lt;li&gt;Deux&lt;/li&gt; --&gt;
    &lt;/ol&gt;
  &lt;/section&gt;
  &lt;ul&gt;
    &lt;li&gt;Un&lt;/li&gt;
&lt;!--     &lt;li&gt;Deux&lt;/li&gt; --&gt;
  &lt;/ul&gt;
  &lt;p&gt;Un deuxième paragraphe.&lt;/p&gt;
  &lt;p&gt;Un troisième paragraphe, un peu plus long.&lt;/p&gt;
  &lt;p&gt;Un quatrième paragraphe, un peu plus long voire plus long que le troisième.&lt;/p&gt;
&lt;/div&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">.page {
  background-color: #8cffa0;
  height: 90px;
  width: 200px;
  columns: 1;
  column-width: 100px;
}

.list, ol, ul, p {
  break-inside: avoid;
}

p {
  background-color: #8ca0ff;
}

ol, ul, .list {
  margin: 0.5em 0;
  display: block;
  background-color: orange;
}

p:first-child {
  margin-top: 0;
}</pre>

<h3 id="Résultat">Résultat</h3>

<p>{{EmbedLiveSample("Exemples", 400, 160)}}</p>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">État</th>
   <th scope="col">Commentaires</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Paged Media', '#page-break-inside', 'page-break-inside')}}</td>
   <td>{{Spec2('CSS3 Paged Media')}}</td>
   <td>Permet d'appliquer cette propriété sur plus d'éléments.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'page.html#propdef-page-break-inside', 'page-break-inside')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>Définition initiale.</td>
  </tr>
 </tbody>
</table>

<p>{{cssinfo}}</p>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{Compat("css.properties.page-break-inside")}}</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li>{{cssxref("break-before")}}</li>
 <li>{{cssxref("break-after")}}</li>
 <li>{{cssxref("break-inside")}}</li>
 <li>{{cssxref("page-break-after")}}</li>
 <li>{{cssxref("page-break-before")}}</li>
 <li>{{cssxref("orphans")}}</li>
 <li>{{cssxref("widows")}}</li>
</ul>