aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/css/max-inline-size/index.md
blob: 47c4a75ea1ad3ad65ddb72ebedf9c97f33b40bb4 (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
---
title: max-inline-size
slug: Web/CSS/max-inline-size
tags:
  - CSS
  - Experimental
  - Propriété
  - Reference
translation_of: Web/CSS/max-inline-size
---
{{CSSRef}}{{SeeCompatTable}}

La propriété [CSS](/fr/docs/Web/CSS) **`max-inline-size`** définit la taille maximale horizontale ou verticale d'un élément en ligne (_inline_) selon le mode d'écriture utilisé. Elle correspond à la propriété {{cssxref("max-width")}} ou {{cssxref("max-height")}} selon la valeur utilisée pour {{cssxref("writing-mode")}}. Si le mode d'écriture est orienté verticalement, `max-inline-size` fait référence à la hauteur maximale de l'élément, sinon elle fait référence à la largeur maximale de l'élément. La propriété {{cssxref("max-block-size")}} peut être utilisée pour les blocs.

{{EmbedInteractiveExample("pages/css/max-inline-size.html")}}

## Syntaxe

```css
/* Valeurs de longueur */
/* Type <length>       */
max-inline-size: 300px;
max-inline-size: 25em;

/* Valeurs proportionnelles */
/* Type <percentage> */
max-inline-size: 75%;

/* Valeurs avec un mot-clé */
max-inline-size: none;
max-inline-size: max-content;
max-inline-size: min-content;
max-inline-size: fit-content;
max-inline-size: fill-available;

/* Valeurs globales */
max-inline-size: inherit;
max-inline-size: initial;
max-inline-size: unset;
```

### Valeurs

La propriété `max-inline-size` peut prendre les mêmes valeurs que les propriétés {{cssxref("max-width")}} ou {{cssxref("max-height")}}.

### Syntaxe formelle

{{csssyntax}}

## Exemple

### CSS

```css
.exemple {
  writing-mode: vertical-rl;
  background-color: yellow;
  block-size: 100%;
  max-inline-size: 200px;
}
```

### HTML

```html
<p class="exemple">Texte d'exemple</p>
```

### Résultat

{{EmbedLiveSample("Exemple")}}

## Spécifications

| Spécifications                                                                                                   | État                                             | Commentaires        |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------- |
| {{SpecName("CSS Logical Properties", "#propdef-max-inline-size", "max-inline-size")}} | {{Spec2("CSS Logical Properties")}} | Définition initiale |

{{cssinfo}}

## Compatibilité des navigateurs

{{Compat("css.properties.max-inline-size")}}

## Voir aussi

- Les propriétés physiques correspondantes : {{cssxref("max-width")}} et {{cssxref("max-height")}}
- {{cssxref("writing-mode")}}