Skip to content

Commit a57b06b

Browse files
authored
fix typo container query units (#232)
1 parent be5db1b commit a57b06b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

data/blog/going-beyond-pixels-and-rems-in-css/container-query-length-units.mdx

+10-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Ok, we’ve set our `container-type` and added some basic styling, It’s time t
5151

5252
## cqw
5353

54-
The `cwq` unit stands for **1% of the containing element's width**. It allows you to define element sizes and spacing relative to the width of their container in contrast to the `vw` unit, which defines the spacing relative to the viewport. But just as viewport and font units, it can be used in any property that accepts `<length>` values, such as `font-size`, `width`, `padding`, `margin`, etc. The latter counts for every unit we will tackle in this article.
54+
The `cqw` unit stands for **1% of the containing element's width**. It allows you to define element sizes and spacing relative to the width of their container in contrast to the `vw` unit, which defines the spacing relative to the viewport. But just as viewport and font units, it can be used in any property that accepts `<length>` values, such as `font-size`, `width`, `padding`, `margin`, etc. The latter counts for every unit we will tackle in this article.
5555

5656
Now, a demo says more than a thousand words, so let’s put it to the test. Let’s add a margin to our previous code for the `.item` inside of the container:
5757

@@ -76,8 +76,9 @@ Now the item will have a margin based on its container. This is what you should
7676
allowfullscreen="true"
7777
>
7878
See the Pen <a href="https://codepen.io/utilitybend/pen/jOJjbez">Basic container unit example</a>
79-
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on{' '}
80-
<a href="https://codepen.io">CodePen</a>.
79+
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on <a href="https://codepen.io">
80+
CodePen
81+
</a>.
8182
</iframe>
8283

8384
Now let’s make the effect stick out a bit more by making some other properties rely on the `cqw` unit.
@@ -107,8 +108,9 @@ Now we can see the effect on roids. If you add a few extra containers with diffe
107108
<a href="https://codepen.io/utilitybend/pen/dyrBYMB">
108109
Margins, padding and font-size with container units
109110
</a>
110-
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on{' '}
111-
<a href="https://codepen.io">CodePen</a>.
111+
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on <a href="https://codepen.io">
112+
CodePen
113+
</a>.
112114
</iframe>
113115

114116
**Note: What happens if we don’t define a `container-type` on any of the parents?**
@@ -285,8 +287,9 @@ For the banner, in general, we will take a `1rem` minimum font size and a maximu
285287
<a href="https://codepen.io/utilitybend/pen/xxBoRbr">
286288
Banner with container units and clamp() function for font-sizes
287289
</a>
288-
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on{' '}
289-
<a href="https://codepen.io">CodePen</a>.
290+
&nbsp; by utilitybend (<a href="https://codepen.io/utilitybend">@utilitybend</a>) on <a href="https://codepen.io">
291+
CodePen
292+
</a>.
290293
</iframe>
291294

292295
We could, of course, apply this to margins and paddings as well. Resize the window to see how this behaves.

0 commit comments

Comments
 (0)