From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/css/shape-margin/index.html | 118 +++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 files/fr/web/css/shape-margin/index.html (limited to 'files/fr/web/css/shape-margin') diff --git a/files/fr/web/css/shape-margin/index.html b/files/fr/web/css/shape-margin/index.html new file mode 100644 index 0000000000..aeae58a570 --- /dev/null +++ b/files/fr/web/css/shape-margin/index.html @@ -0,0 +1,118 @@ +--- +title: shape-margin +slug: Web/CSS/shape-margin +tags: + - CSS + - Propriété + - Reference +translation_of: Web/CSS/shape-margin +--- +
{{CSSRef}}
+ +

La propriété CSS shape-margin définit la marge autour d'une forme CSS créée avec {{cssxref("shape-outside")}}.

+ +
{{EmbedInteractiveExample("pages/css/shape-margin.html")}}
+ + + +

La marge permet d'ajuster la distance entre le contour de la forme (l'élément flottant) et le contenu autour.

+ +
/* Valeur de longueur */
+/* Type <length> */
+shape-margin: 10px;
+shape-margin: 20mm;
+
+/* Valeur proportionnelle */
+/* Type <percentage> */
+shape-margin: 60%;
+
+/* Valeurs globales */
+shape-margin: inherit;
+shape-margin: initial;
+shape-margin: unset;
+
+ +

Syntaxe

+ +

Valeurs

+ +
+
<length-percentage>
+
Cette valeur définit la marge entre la forme et le texte alentour grâce à une longueur (cf. {{cssxref("<length>")}}) ou à un pourcentage ({{cssxref("<percentage>")}}) proportionnel à la largeur du bloc englobant de l'élément.
+
+ +

Syntaxe formelle

+ +
{{csssyntax}}
+ +

Exemples

+ +

CSS

+ +
section {
+  max-width: 400px;
+}
+
+.shape {
+  float: left;
+  width: 150px;
+  height: 150px;
+  background-color: maroon;
+  clip-path: polygon(0 0, 150px 150px, 0 150px);
+  shape-outside: polygon(0 0, 150px 150px, 0 150px);
+  shape-margin: 20px;
+}
+ +

HTML

+ +
<section>
+  <div class="shape"></div>
+  We are not quite sure of any one thing in biology; our knowledge of geology
+  is relatively very slight, and the economic laws of society are
+  uncertain to every one except some individual who attempts to set them
+  forth; but before the world was fashioned the square on the hypotenuse
+  was equal to the sum of the squares on the other two sides of a right
+  triangle, and it will be so after this world is dead; and the inhabitant
+  of Mars, if he exists, probably knows its truth as we know it.
+</section>
+ +

Résultat

+ +

{{EmbedLiveSample("Exemples", 500, 250)}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('CSS Shapes', '#shape-margin-property', 'shape-margin')}}{{Spec2('CSS Shapes')}}Définition initiale.
+ +

{{cssinfo}}

+ +

Compatibilité des navigateurs

+ + + +

{{Compat("css.properties.shape-margin")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf