diff --git a/files/en-us/web/css/margin-block/index.html b/files/en-us/web/css/margin-block/index.html index 4e76630578160df..288f6d1563358ed 100644 --- a/files/en-us/web/css/margin-block/index.html +++ b/files/en-us/web/css/margin-block/index.html @@ -29,7 +29,7 @@ margin-block: unset; -

These values corresponds to the {{CSSxRef("margin-top")}} and {{CSSxRef("margin-bottom")}}, or {{CSSxRef("margin-right")}}, and {{CSSxRef("margin-left")}} property depending on the values defined for {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, and {{CSSxRef("text-orientation")}}.

+

This property corresponds to the {{CSSxRef("margin-top")}} and {{CSSxRef("margin-bottom")}}, or the {{CSSxRef("margin-right")}} and {{CSSxRef("margin-left")}} properties, depending on the values defined for {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, and {{CSSxRef("text-orientation")}}.

Constituent properties

@@ -58,30 +58,38 @@

Examples

Setting block start and end margins

-

HTML

- -
<div>
-  <p class="exampleText">Example text</p>
-</div>
-
-

CSS

div {
   background-color: yellow;
   width: 120px;
-  height: 120px;
+  height: auto;
+  border: 1px solid green;
 }
 
-.exampleText {
-  writing-mode: vertical-rl;
+p {
+  margin: 0;
   margin-block: 20px 40px;
-  background-color: #c8c800;
+  background-color: tan;
+}
+
+.verticalExample {
+  writing-mode: vertical-rl;
 }
+

HTML

+ +
<div>
+  <p>Example text</p>
+</div>
+<div class="verticalExample">
+  <p>Example text</p>
+</div>
+
+

Result

-

{{EmbedLiveSample("Setting_block_start_and_end_margins", 140, 140)}}

+

{{EmbedLiveSample("Setting_block_start_and_end_margins", 140, 200)}}

Specifications

diff --git a/files/en-us/web/css/margin-inline/index.html b/files/en-us/web/css/margin-inline/index.html index 75812455e387dfc..0ae3a638f4ebbee 100644 --- a/files/en-us/web/css/margin-inline/index.html +++ b/files/en-us/web/css/margin-inline/index.html @@ -29,7 +29,7 @@ margin-inline: unset; -

This property corresponds to the {{CSSxRef("margin-top")}} and {{CSSxRef("margin-bottom")}}, or {{CSSxRef("margin-right")}}, and {{CSSxRef("margin-left")}} properties, depending on the values defined for {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, and {{CSSxRef("text-orientation")}}.

+

This property corresponds to the {{CSSxRef("margin-top")}} and {{CSSxRef("margin-bottom")}}, or the {{CSSxRef("margin-right")}} and {{CSSxRef("margin-left")}} properties, depending on the values defined for {{CSSxRef("writing-mode")}}, {{CSSxRef("direction")}}, and {{CSSxRef("text-orientation")}}.

Constituent properties

@@ -60,30 +60,38 @@

Examples

Setting inline start and end margins

-

HTML

- -
<div>
-  <p class="exampleText">Example text</p>
-</div>
-
-

CSS

div {
   background-color: yellow;
   width: 120px;
-  height: 120px;
+  height: auto;
+  border: 1px solid green;
 }
 
-.exampleText {
-  writing-mode: vertical-rl;
+p {
+  margin: 0;
   margin-inline: 20px 40px;
-  background-color: #c8c800;
+  background-color: tan;
+}
+
+.verticalExample {
+  writing-mode: vertical-rl;
 }
+

HTML

+ +
<div>
+  <p>Example text</p>
+</div>
+<div class="verticalExample">
+  <p>Example text</p>
+</div>
+
+

Result

-

{{EmbedLiveSample("Setting_inline_start_and_end_margins", 140, 140)}}

+

{{EmbedLiveSample("Setting_inline_start_and_end_margins", 140, 240)}}

Specifications