-
Notifications
You must be signed in to change notification settings - Fork 23.1k
reorder CSS layout test your skills for consistency #42953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b4de64b
ed08090
b3d3936
648e58c
47be243
b564896
f3bdcbe
5ce34dd
b0b301e
d7c1c55
654253b
7e1004c
7042b39
7112e18
8407898
50c72aa
271a24c
b5006f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,15 @@ The aim of this skill test is to help you assess whether you understand [floats | |
| > [!NOTE] | ||
| > To get help, read our [Test your skills](/en-US/docs/Learn_web_development#test_your_skills) usage guide. You can also reach out to us using one of our [communication channels](/en-US/docs/MDN/Community/Communication_channels). | ||
|
|
||
| ## Task 1 | ||
| ## Floats 1 | ||
|
|
||
| To complete this task, float the two elements with a class of `float1` and `float2` left and right, respectively. The text should then appear between the two boxes, as shown in this finished rendering: | ||
| To complete this task, float the two elements with classes of `float1` and `float2` to the left and right, respectively. The text should then appear between the two elements. | ||
|
|
||
| {{EmbedLiveSample("float1-finish", "", "210px")}} | ||
| The starting point of the task looks like this: | ||
|
|
||
| {{EmbedLiveSample("float1-start", "", "440px")}} | ||
|
|
||
| Here's the underlying code for this starting point: | ||
|
|
||
| ```html live-sample___float1-start live-sample___float1-finish | ||
| <div class="box"> | ||
|
|
@@ -59,9 +63,9 @@ body { | |
| } | ||
| ``` | ||
|
|
||
| This is the starting state of the task: | ||
| The layout should look like this once the task is complete: | ||
|
|
||
| {{EmbedLiveSample("float1-start", "", "210px")}} | ||
| {{EmbedLiveSample("float1-finish", "", "210px")}} | ||
|
|
||
| <details> | ||
| <summary>Click here to show the solution</summary> | ||
|
|
@@ -80,16 +84,18 @@ You can use `float` for both boxes: | |
|
|
||
| </details> | ||
|
|
||
| ## Task 2 | ||
| ## Floats 2 | ||
|
|
||
| To complete this task: | ||
|
|
||
| 1. Float the element with a class of `float` to the left. | ||
| 2. Update the code so that the first line of text displays next to that element, but the following line of text (which has a class of `below`) displays underneath it. | ||
|
|
||
| Your final result should look like this finished rendering: | ||
| The starting point of the task looks like this: | ||
|
|
||
| {{EmbedLiveSample("float2-finish", "", "300px")}} | ||
| {{EmbedLiveSample("float2-start", "", "300px")}} | ||
|
|
||
| Here's the underlying code for this starting point: | ||
|
|
||
| ```html live-sample___float2-start live-sample___float2-finish | ||
| <div class="box"> | ||
|
|
@@ -131,9 +137,9 @@ body { | |
| } | ||
| ``` | ||
|
|
||
| This is the starting state of the task: | ||
| The finished layout should look like this: | ||
|
|
||
| {{EmbedLiveSample("float2-start", "", "300px")}} | ||
| {{EmbedLiveSample("float2-finish", "", "300px")}} | ||
|
|
||
| <details> | ||
| <summary>Click here to show the solution</summary> | ||
|
|
@@ -152,13 +158,17 @@ You need to flow the item left, then add `clear: left` to the class for the seco | |
|
|
||
| </details> | ||
|
|
||
| ## Task 3 | ||
| ## Floats 3 | ||
|
|
||
| In this task, we have a floated element. The box wrapping the float and text is displaying behind the float. | ||
| In this task, we have a floated element. The background box that wraps the float and the text does not currently extend underneath the floated element. | ||
|
|
||
| To complete the task, use the most up-to-date method available to cause the box background to extend to below the float, as shown in this finished rendering: | ||
| To complete this task, use the most up-to-date method to ensure the background box contains the floated element and extends underneath it. | ||
|
|
||
| {{EmbedLiveSample("float3-finish", "", "220px")}} | ||
| The starting point of the task looks like this: | ||
|
|
||
| {{EmbedLiveSample("float3-start", "", "220px")}} | ||
|
|
||
| Here's the underlying code for this starting point: | ||
|
|
||
| ```html live-sample___float3-start live-sample___float3-finish | ||
| <div class="box"> | ||
|
|
@@ -205,9 +215,9 @@ body { | |
| } | ||
| ``` | ||
|
|
||
| This is the starting state of the task: | ||
| When you complete the task, the background box and floated element should look like this: | ||
|
|
||
| {{EmbedLiveSample("float3-start", "", "220px")}} | ||
| {{EmbedLiveSample("float3-finish", "", "220px")}} | ||
|
|
||
| <details> | ||
| <summary>Click here to show the solution</summary> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should it be "see the solution"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No; I don't think it is worth changing all of the solution boxes. The benefit of doing so doesn't seem clear.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, it is probably not incorrect semantically, and the difference is subtle. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.