Skip to content

Commit 9793615

Browse files
Update test your skills values and units images to use live samples (mdn#42667)
1 parent da2d33b commit 9793615

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

files/en-us/learn_web_development/core/styling_basics/test_your_skills/values/index.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ In this task, the first list item has been given a background color using a hex
2121
- The third should use HSL color.
2222
- The fourth should use RGB color but with the alpha channel set to `0.6`.
2323

24-
You [can convert the hex color at convertingcolors.com](https://convertingcolors.com/hex-color-86DEFA.html). You need to figure out how to use the values in CSS. Your final result should look like the image below:
24+
You [can convert the hex color at convertingcolors.com](https://convertingcolors.com/hex-color-86DEFA.html). You need to figure out how to use the values in CSS. Your final result should look like the following rendering:
2525

26-
![Four list items. The first three with the same background color and the last with a lighter background.](mdn-value-color.png)
26+
{{EmbedLiveSample("values1-finish", "", "300px")}}
2727

28-
```html live-sample___color
28+
```html live-sample___values1-start live-sample___values1-finish
2929
<ul>
3030
<li class="hex">hex color</li>
3131
<li class="rgb">RGB color</li>
@@ -34,7 +34,7 @@ You [can convert the hex color at convertingcolors.com](https://convertingcolors
3434
</ul>
3535
```
3636

37-
```css live-sample___color
37+
```css live-sample___values1-start live-sample___values1-finish
3838
body {
3939
font: 1.2em / 1.5 sans-serif;
4040
}
@@ -56,18 +56,16 @@ li {
5656
/* Add styles here */
5757
```
5858

59-
{{EmbedLiveSample("color", "", "300px")}}
59+
This is the starting state of the task:
60+
61+
{{EmbedLiveSample("values1-start", "", "300px")}}
6062

6163
<details>
6264
<summary>Click here to show the solution</summary>
6365

6466
By using [a color conversion tool](https://convertingcolors.com/hex-color-86DEFA.html), you should be equipped to use different [color functions](/en-US/docs/Web/CSS/Reference/Values/color_value#syntax) to define the same color in different ways:
6567

66-
```css
67-
.hex {
68-
background-color: #86defa;
69-
}
70-
68+
```css live-sample___values1-finish
7169
.rgb {
7270
background-color: rgb(134 222 250);
7371
}
@@ -92,11 +90,11 @@ In this task, we want you to set the font size of various items of text:
9290
- All `<p>` elements should be `16px`.
9391
- A `<p>` element that is directly after an `<h1>` should be `120%`.
9492

95-
Your final result should look like the image below:
93+
Your final result should look like the following rendering:
9694

97-
![Some text at varying sizes.](mdn-value-length.png)
95+
{{EmbedLiveSample("values2-finish", "", "420px")}}
9896

99-
```html live-sample___length
97+
```html live-sample___values2-start live-sample___values2-finish
10098
<h1>Level 1 heading</h1>
10199
<p>
102100
Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion
@@ -110,7 +108,7 @@ Your final result should look like the image below:
110108
</p>
111109
```
112110

113-
```css live-sample___length
111+
```css live-sample___values2-start live-sample___values2-finish
114112
body {
115113
font: 1.2em / 1.5 sans-serif;
116114
}
@@ -132,14 +130,16 @@ h1 + p {
132130
}
133131
```
134132

135-
{{EmbedLiveSample("length", "", "420px")}}
133+
This is the starting state of the task:
134+
135+
{{EmbedLiveSample("values2-start", "", "420px")}}
136136

137137
<details>
138138
<summary>Click here to show the solution</summary>
139139

140140
You can use the following length values:
141141

142-
```css
142+
```css live-sample___values2-finish
143143
h1 {
144144
font-size: 50px;
145145
}
@@ -163,15 +163,15 @@ h1 + p {
163163

164164
To complete the task, update the CSS to move the background image so that it is centered horizontally and is `20%` from the top of the box.
165165

166-
Your final result should look like the image below:
166+
Your final result should look like the following rendering:
167167

168-
![A stat centered horizontally in a box and a short distance from the top of the box.](mdn-value-position.png)
168+
{{EmbedLiveSample("values3-finish", "", "400px")}}
169169

170-
```html live-sample___position
170+
```html live-sample___values3-start live-sample___values3-finish
171171
<div class="box"></div>
172172
```
173173

174-
```css live-sample___position
174+
```css live-sample___values3-start live-sample___values3-finish
175175
.box {
176176
border: 5px solid black;
177177
height: 350px;
@@ -183,14 +183,16 @@ Your final result should look like the image below:
183183
}
184184
```
185185

186-
{{EmbedLiveSample("position", "", "400px")}}
186+
This is the starting state of the task:
187+
188+
{{EmbedLiveSample("values3-start", "", "400px")}}
187189

188190
<details>
189191
<summary>Click here to show the solution</summary>
190192

191193
Use `background-position` with the `center` keyword and a percentage:
192194

193-
```css
195+
```css live-sample___values3-finish
194196
.box {
195197
background-image: url("https://mdn.github.io/shared-assets/images/examples/purple-star.png");
196198
background-repeat: no-repeat;
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)