From 5f3baf0eb5547256cc3c9ad09bf5ac6fa7a68db6 Mon Sep 17 00:00:00 2001 From: Francis Storr Date: Tue, 9 Jul 2024 14:54:57 -0700 Subject: [PATCH] Update C28 to mention rem units I feel that adding rem unit examples would mean changing the technique name, so I instead added a note saying that rem units would have the same effect. Closes #3903 --- techniques/css/C28.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/techniques/css/C28.html b/techniques/css/C28.html index 46a042490a..0969060eec 100644 --- a/techniques/css/C28.html +++ b/techniques/css/C28.html @@ -17,9 +17,13 @@

When to Use

Description

-

The objective of this technique is to specify the width and/or height of containers, that contain text or that will accept text input, in em units. This will allow user agents that support text resizing to resize the text containers in line with changes in text size settings.

+

The objective of this technique is to specify the width and/or height of containers, that contain text or that will accept text input, in em units. This will allow user agents that support text resizing to resize the text containers in line with changes in text size settings.

The width and/or height of text containers that have been specified using other units risk text cropping because it falls outside the container boundaries when the text size has been increased.

-

The containers generally control the placement of text within the Web page and can include layout elements, structural elements and form controls.

+

The containers generally control the placement of text within the Web page and can include layout elements, structural elements and form controls.

+ +
+

This technique uses em units, but using rem units instead would have the same effect.

+

Examples

@@ -28,7 +32,7 @@

em units for sizes for layout container co

In this example, a div element, with id value of "nav_menu", is used to position the navigation menu along the left-hand side of the main content area of the Web page. The navigation menu consists of a list of text links, with id value of "nav_list". The text size for the navigation links and the width of the container are specified in em units.

-
#nav_menu { width: 20em; height: 100em }
+
#nav_menu { width: 20em; height: 100em; }
 #nav_list { font-size: 100%; }