From 4fdf7b2b5b8209d89af7254987e85c664c813b28 Mon Sep 17 00:00:00 2001 From: "Eric A. Meyer" Date: Fri, 5 Mar 2021 11:47:45 -0500 Subject: [PATCH] Changes to margin-block and margin-inline (#2859) * Fixed cssxref errors in learn/css/css_layout/grids to prevent double-double parentheses from appearing * Upgraded LiveSample for margin-inline * Upgraded LiveSample for margin-inline * Upgraded LiveSample for margin-block * Tweaked LiveSample for margin-inline * Tweaked LiveSample for margin-block * Minor edit to margin-block * Minor edits to margin-block and margin-inline --- files/en-us/web/css/margin-block/index.html | 34 ++++++++++++-------- files/en-us/web/css/margin-inline/index.html | 34 ++++++++++++-------- 2 files changed, 42 insertions(+), 26 deletions(-) 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