Gugu8 commited on
Commit
c2a9f18
·
verified ·
1 Parent(s): 48afa97

Add github_code/freeCodeCamp__freeCodeCamp from GitHub (part 6)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21d08acb466c97ccbee8.md +39 -0
  2. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21df8acb466c97ccbee9.md +39 -0
  3. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21eb8acb466c97ccbeea.md +39 -0
  4. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21f88acb466c97ccbeeb.md +39 -0
  5. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e22058acb466c97ccbeec.md +40 -0
  6. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647f87dc07d29547b3bee1bf.md +13 -0
  7. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e22338acb466c97ccbeed.md +39 -0
  8. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e223c8acb466c97ccbeee.md +39 -0
  9. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e224b8acb466c97ccbeef.md +45 -0
  10. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e225e8acb466c97ccbef0.md +40 -0
  11. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e226a8acb466c97ccbef1.md +39 -0
  12. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647f877f07d29547b3bee1be.md +13 -0
  13. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af0.md +84 -0
  14. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af1.md +278 -0
  15. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af2.md +88 -0
  16. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af3.md +241 -0
  17. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af4.md +84 -0
  18. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af5.md +233 -0
  19. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af6.md +98 -0
  20. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af7.md +236 -0
  21. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512af8.md +97 -0
  22. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512af9.md +237 -0
  23. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512afa.md +140 -0
  24. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512afb.md +98 -0
  25. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afc.md +94 -0
  26. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afd.md +106 -0
  27. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afe.md +112 -0
  28. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512aff.md +94 -0
  29. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78af367417b2b2512b00.md +96 -0
  30. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a858944d96184f06fd60d61.md +78 -0
  31. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036d038fddaf9a66b5d32.md +89 -0
  32. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036e138fddaf9a66b5d33.md +81 -0
  33. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d34.md +96 -0
  34. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d35.md +89 -0
  35. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d36.md +83 -0
  36. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d37.md +82 -0
  37. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90372638fddaf9a66b5d38.md +156 -0
  38. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90373638fddaf9a66b5d39.md +141 -0
  39. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90374338fddaf9a66b5d3a.md +92 -0
  40. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90375238fddaf9a66b5d3b.md +83 -0
  41. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90376038fddaf9a66b5d3c.md +84 -0
  42. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fdf869fb03452672e45b.md +84 -0
  43. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe0569fb03452672e45c.md +130 -0
  44. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe1369fb03452672e45d.md +97 -0
  45. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe2669fb03452672e45e.md +100 -0
  46. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe3669fb03452672e45f.md +106 -0
  47. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe4469fb03452672e460.md +90 -0
  48. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe5469fb03452672e461.md +159 -0
  49. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe6269fb03452672e462.md +107 -0
  50. github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe7769fb03452672e463.md +171 -0
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21d08acb466c97ccbee8.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e21d08acb466c97ccbee8
3
+ title: Challenge Project - Develop foreach and if-elseif-else Structures to Process Array Data in C#
4
+ challengeType: 19
5
+ dashedName: challenge-project-develop-foreach-and-if-elseif-else-structures-to-process-array-data-in-c-sharp
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/challenge-project-arrays-iteration-selection/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/challenge-project-arrays-iteration-selection/</a> and complete all the tasks for the "Challenge Project - Develop foreach and if-elseif-else Structures to Process Array Data in C#" module. This is **required** to earn the "Create and Run Simple C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/challenge-project-arrays-iteration-selection/" target="_blank" rel="noreferrer">Develop `foreach` and `if`-`elseif`-`else` Structures to Process Array Data in C#</a> challenge project on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ A developer is working with two other developers to update a collection of applications. The developers will use code comments during the update process. Which of the following describes an appropriate use of code comments?
24
+
25
+ ## --answers--
26
+
27
+ When updates are made, the developers use line and block comments to identify each individual code update.
28
+
29
+ ---
30
+
31
+ When updates are made, the developers leave all existing code comments intact. New comments are added to indicate when old comments no longer apply.
32
+
33
+ ---
34
+
35
+ When updates are made, the developers summarize changes using block comments.
36
+
37
+ ## --video-solution--
38
+
39
+ 3
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21df8acb466c97ccbee9.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e21df8acb466c97ccbee9
3
+ title: Create Readable Code with Conventions, Whitespace, and Comments in C#
4
+ challengeType: 19
5
+ dashedName: create-readable-code-with-conventions-whitespace-and-comments-in-c-sharp
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-readable-code/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-readable-code/</a> and complete all the tasks for the "Create Readable Code with Conventions, Whitespace, and Comments in C#" module. This is **required** to earn the "Create and Run Simple C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/csharp-readable-code/" target="_blank" rel="noreferrer">Create Readable Code with Conventions, Whitespace, and Comments in C#</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Which of the following is a bad reason to use a code comment?
24
+
25
+ ## --answers--
26
+
27
+ To describe the high-level intent of the code.
28
+
29
+ ---
30
+
31
+ To temporarily comment out a line of code while evaluating a feature in a different way.
32
+
33
+ ---
34
+
35
+ To explain how a new C# keyword works.
36
+
37
+ ## --video-solution--
38
+
39
+ 3
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21eb8acb466c97ccbeea.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e21eb8acb466c97ccbeea
3
+ title: Guided Project - Develop foreach and if-elseif-else Structures to Process Array Data in C#
4
+ challengeType: 19
5
+ dashedName: guided-project-develop-foreach-and-if-elseif-else-structures-to-process-array-data-in-c-sharp
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/guided-project-arrays-iteration-selection/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/guided-project-arrays-iteration-selection/</a> and complete all the tasks for the "Guided Project - Develop foreach and if-elseif-else Structures to Process Array Data in C#" module. This is **required** to earn the "Create and Run Simple C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/guided-project-arrays-iteration-selection/" target="_blank" rel="noreferrer">Develop `foreach` and `if`-`elseif`-`else` Structures to Process Array Data in C#</a> guided project on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ A developer writes an application that uses a `foreach` loop to iterate through an array containing 20 elements. After the application is complete, the developer learns that the array must be updated to include 40 elements. The application needs to examine all 40 array elements. Which of the following items describes the required code update?
24
+
25
+ ## --answers--
26
+
27
+ Create a second `foreach` loop that iterates through the additional items.
28
+
29
+ ---
30
+
31
+ No changes are required to the `foreach` loop.
32
+
33
+ ---
34
+
35
+ Place the original `foreach` loop inside the code block of a second `foreach` loop that iterates twice.
36
+
37
+ ## --video-solution--
38
+
39
+ 2
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e21f88acb466c97ccbeeb.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e21f88acb466c97ccbeeb
3
+ title: Install and Configure Visual Studio Code
4
+ challengeType: 19
5
+ dashedName: install-and-configure-visual-studio-code
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/install-configure-visual-studio-code/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/install-configure-visual-studio-code/</a> and complete all the tasks for the "Install and Configure Visual Studio Code" module. This is **required** to earn the "Create and Run Simple C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/install-configure-visual-studio-code/" target="_blank" rel="noreferrer">Install and Configure Visual Studio Code</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Which of the following choices provides the best description of an Integrated Development Environment (IDE)?
24
+
25
+ ## --answers--
26
+
27
+ Visual Studio Code is an Integrated Development Environment.
28
+
29
+ ---
30
+
31
+ An Integrated Development Environment is tool that makes it easier to write code.
32
+
33
+ ---
34
+
35
+ An IDE is a suite of tools that supports the full software development lifecycle.
36
+
37
+ ## --video-solution--
38
+
39
+ 3
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647e22058acb466c97ccbeec.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e22058acb466c97ccbeec
3
+ title: Store and Iterate Through Sequences of Data Using Arrays and the foreach Statement in C#
4
+ challengeType: 19
5
+ dashedName: store-and-iterate-through-sequences-of-data-using-arrays-and-the-foreach-statement-in-c-sharp
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-arrays/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-arrays/</a> and complete all the tasks for the "Store and Iterate Through Sequences of Data Using Arrays and the foreach Statement in C#" module. This is **required** to earn the "Create and Run Simple C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/csharp-arrays/" target="_blank" rel="noreferrer">Store and Iterate Through Sequences of Data Using Arrays and the `foreach` Statement in C#</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Which of the following foreach statements is syntactically correct?
24
+
25
+ ## --answers--
26
+
27
+ `foreach (int value of values)`
28
+
29
+ ---
30
+
31
+ `foreach (int value with values)`
32
+
33
+ ---
34
+
35
+ `foreach (int value in values)`
36
+
37
+
38
+ ## --video-solution--
39
+
40
+ 3
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-and-run-simple-c-sharp-console-applications/647f87dc07d29547b3bee1bf.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647f87dc07d29547b3bee1bf
3
+ title: Trophy - Create and Run Simple C# Console Applications
4
+ challengeType: 18
5
+ dashedName: trophy-create-and-run-simple-c-sharp-console-applications
6
+ msTrophyId: learn.wwl.get-started-c-sharp-part-2.trophy
7
+ ---
8
+
9
+ # --description--
10
+
11
+ Now that you've completed all of the "Create and Run Simple C# Console Applications" challenges, you should have earned the trophy for it on the Microsoft Learn platform. If you don't see this trophy when viewing <a href="https://learn.microsoft.com/users/me/achievements#trophies-section" target="_blank" rel="noreferrer">your achievements page</a>, you have not completed all the tasks and your trophy cannot be verified.
12
+
13
+ Link your Microsoft username to your freeCodeCamp account and click the "Verify Trophy" button below to complete the challenge. This trophy is **required** to qualify for the certification exam.
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e22338acb466c97ccbeed.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e22338acb466c97ccbeed
3
+ title: Challenge Project - Create a Mini-Game
4
+ challengeType: 19
5
+ dashedName: challenge-project-create-a-mini-game
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/challenge-project-create-mini-game/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/challenge-project-create-mini-game/</a> and complete all the tasks for the "Challenge Project - Create a Mini-Game" module. This is **required** to earn the "Create Methods in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/challenge-project-create-mini-game/" target="_blank" rel="noreferrer">Create a Mini-Game</a> challenge project on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ A developer wants to create a method that returns a value in an array. Which of the following options would be a good choice for a method signature?
24
+
25
+ ## --answers--
26
+
27
+ `string GetValueAtIndex(string[] array, int index)`
28
+
29
+ ---
30
+
31
+ `bool GetValueAtIndex(string[] array, int index)`
32
+
33
+ ---
34
+
35
+ `int GetValueAtIndex(int index)`
36
+
37
+ ## --video-solution--
38
+
39
+ 1
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e223c8acb466c97ccbeee.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e223c8acb466c97ccbeee
3
+ title: Create C# Methods that Return Values
4
+ challengeType: 19
5
+ dashedName: create-c-sharp-methods-that-return-values
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/create-c-sharp-methods-return-values/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/create-c-sharp-methods-return-values/</a> and complete all the tasks for the "Create C# Methods that Return Values" module. This is **required** to earn the "Create Methods in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/create-c-sharp-methods-return-values/" target="_blank" rel="noreferrer">Create C# Methods that Return Values</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Which of the following options correctly returns a `string` value?
24
+
25
+ ## --answers--
26
+
27
+ `return "";`
28
+
29
+ ---
30
+
31
+ `return 'a';`
32
+
33
+ ---
34
+
35
+ `return 5;`
36
+
37
+ ## --video-solution--
38
+
39
+ 1
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e224b8acb466c97ccbeef.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e224b8acb466c97ccbeef
3
+ title: Create C# Methods with Parameters
4
+ challengeType: 19
5
+ dashedName: create-c-sharp-methods-with-parameters
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/create-c-sharp-methods-parameters/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/create-c-sharp-methods-parameters/</a> and complete all the tasks for the "Create C# Methods with Parameters" module. This is **required** to earn the "Create Methods in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/create-c-sharp-methods-parameters/" target="_blank" rel="noreferrer">Create C# Methods with Parameters</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Given the method signature,
24
+
25
+ ```csharp
26
+ void Print(string name, string number = "", bool member = false)
27
+ ```
28
+
29
+ Which of the following options correctly uses named and optional arguments?
30
+
31
+ ## --answers--
32
+
33
+ `Print("Tony", member: true);`
34
+
35
+ ---
36
+
37
+ `Print(number: "555", member: false)`
38
+
39
+ ---
40
+
41
+ `Print("Tony", false)`
42
+
43
+ ## --video-solution--
44
+
45
+ 1
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e225e8acb466c97ccbef0.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e225e8acb466c97ccbef0
3
+ title: Guided Project - Plan a Petting Zoo Visit
4
+ challengeType: 19
5
+ dashedName: guided-project-plan-a-petting-zoo-visit
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/guided-project-visit-petting-zoo/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/guided-project-visit-petting-zoo/</a> and complete all the tasks for the "Guided Project - Plan a Petting Zoo Visit" module. This is **required** to earn the "Create Methods in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/guided-project-visit-petting-zoo/" target="_blank" rel="noreferrer">Plan a Petting Zoo Visit</a> guided project on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ What is the purpose of defining an optional parameter in a method?
24
+
25
+ ## --answers--
26
+
27
+ To cause a method to perform a different task.
28
+
29
+ ---
30
+
31
+ To overload a method.
32
+
33
+ ---
34
+
35
+ To simplify the required parameters when a parameter isn't significant to the result.
36
+
37
+ ## --video-solution--
38
+
39
+ 3
40
+
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647e226a8acb466c97ccbef1.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647e226a8acb466c97ccbef1
3
+ title: Write Your First C# Method
4
+ challengeType: 19
5
+ dashedName: write-your-first-c-sharp-method
6
+ ---
7
+
8
+ # --description--
9
+
10
+ This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:
11
+
12
+ 1. Go to <a href="https://learn.microsoft.com/training/modules/write-first-c-sharp-method/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/write-first-c-sharp-method/</a> and complete all the tasks for the "Write Your First C# Method" module. This is **required** to earn the "Create Methods in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
13
+ 1. When you are finished, come back and correctly answer the question below.
14
+
15
+ # --assignment--
16
+
17
+ Complete the <a href="https://learn.microsoft.com/training/modules/write-first-c-sharp-method/" target="_blank" rel="noreferrer">Write Your First C# Method</a> module on Microsoft Learn. Then, answer the question below.
18
+
19
+ # --questions--
20
+
21
+ ## --text--
22
+
23
+ Which of the following correctly declares a method?
24
+
25
+ ## --answers--
26
+
27
+ `DisplayNumbers();`
28
+
29
+ ---
30
+
31
+ `void DisplayNumbers{};`
32
+
33
+ ---
34
+
35
+ `void DisplayNumbers() { }`
36
+
37
+ ## --video-solution--
38
+
39
+ 3
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/create-methods-in-c-sharp-console-applications/647f877f07d29547b3bee1be.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 647f877f07d29547b3bee1be
3
+ title: Trophy - Create Methods in C# Console Applications
4
+ challengeType: 18
5
+ dashedName: trophy-create-methods-in-c-sharp-console-applications
6
+ msTrophyId: learn.wwl.get-started-c-sharp-part-5.trophy
7
+ ---
8
+
9
+ # --description--
10
+
11
+ Now that you've completed all of the "Create Methods in C# Console Applications" challenges, you should have earned the trophy for it on the Microsoft Learn platform. If you don't see this trophy when viewing <a href="https://learn.microsoft.com/users/me/achievements#trophies-section" target="_blank" rel="noreferrer">your achievements page</a>, you have not completed all the tasks and your trophy cannot be verified.
12
+
13
+ Link your Microsoft username to your freeCodeCamp account and click the "Verify Trophy" button below to complete the challenge. This trophy is **required** to qualify for the certification exam.
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af0.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ab367417b2b2512af0
3
+ title: 'Use display: flex to Position Two Boxes'
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cgz3QS7'
6
+ forumTopicId: 301105
7
+ dashedName: use-display-flex-to-position-two-boxes
8
+ ---
9
+
10
+ # --description--
11
+
12
+ This section uses alternating challenge styles to show how to use CSS to position elements in a flexible way. First, a challenge will explain theory, then a practical challenge using a simple tweet component will apply the flexbox concept.
13
+
14
+ Placing the CSS property `display: flex;` on an element allows you to use other flex properties to build a responsive page.
15
+
16
+ # --instructions--
17
+
18
+ Add the CSS property `display` to `#box-container` and set its value to `flex`.
19
+
20
+ # --hints--
21
+
22
+ `#box-container` should have the `display` property set to a value of `flex`.
23
+
24
+ ```js
25
+ const boxContainer = document.querySelector('#box-container');
26
+ const displayStyle = window.getComputedStyle(boxContainer)['display'];
27
+ assert.strictEqual(displayStyle, 'flex');
28
+ ```
29
+
30
+ # --seed--
31
+
32
+ ## --seed-contents--
33
+
34
+ ```html
35
+ <style>
36
+ #box-container {
37
+ height: 500px;
38
+
39
+ }
40
+
41
+ #box-1 {
42
+ background-color: dodgerblue;
43
+ width: 50%;
44
+ height: 50%;
45
+ }
46
+
47
+ #box-2 {
48
+ background-color: orangered;
49
+ width: 50%;
50
+ height: 50%;
51
+ }
52
+ </style>
53
+ <div id="box-container">
54
+ <div id="box-1"></div>
55
+ <div id="box-2"></div>
56
+ </div>
57
+ ```
58
+
59
+ # --solutions--
60
+
61
+ ```html
62
+ <style>
63
+ #box-container {
64
+ height: 500px;
65
+ display: flex;
66
+ }
67
+
68
+ #box-1 {
69
+ background-color: dodgerblue;
70
+ width: 50%;
71
+ height: 50%;
72
+ }
73
+
74
+ #box-2 {
75
+ background-color: orangered;
76
+ width: 50%;
77
+ height: 50%;
78
+ }
79
+ </style>
80
+ <div id="box-container">
81
+ <div id="box-1"></div>
82
+ <div id="box-2"></div>
83
+ </div>
84
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af1.md ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ab367417b2b2512af1
3
+ title: Add Flex Superpowers to the Tweet Embed
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c9W7MhM'
6
+ forumTopicId: 301100
7
+ dashedName: add-flex-superpowers-to-the-tweet-embed
8
+ ---
9
+
10
+ # --description--
11
+
12
+ To the right is the tweet embed that will be used as a practical example. Some of the elements would look better with a different layout. The last challenge demonstrated `display: flex`. Here you'll add it to several components in the tweet embed to start adjusting their positioning.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `display: flex` to all of the following items - note that the selectors are already set up in the CSS:
17
+
18
+ `header`, the header's `.profile-name`, the header's `.follow-btn`, the header's `h3` and `h4`, the `footer`, and the footer's `.stats`.
19
+
20
+ # --hints--
21
+
22
+ Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
23
+
24
+ ```js
25
+ const followButton = document.querySelector('.follow-btn');
26
+ const displayStyle = window.getComputedStyle(followButton)['display'];
27
+ assert.isNotNull(followButton);
28
+ assert.notStrictEqual(displayStyle, 'none');
29
+ ```
30
+
31
+ Your `header` should have a `display` property set to `flex`.
32
+
33
+ ```js
34
+ const header = document.querySelector('header');
35
+ const displayStyle = window.getComputedStyle(header)['display'];
36
+ assert.strictEqual(displayStyle, 'flex');
37
+ ```
38
+
39
+ Your `footer` should have a `display` property set to `flex`.
40
+
41
+ ```js
42
+ const footer = document.querySelector('footer');
43
+ const displayStyle = window.getComputedStyle(footer)['display'];
44
+ assert.strictEqual(displayStyle, 'flex');
45
+ ```
46
+
47
+ Your `h3` should have a `display` property set to `flex`.
48
+
49
+ ```js
50
+ const h3Element = document.querySelector('h3');
51
+ const displayStyle = window.getComputedStyle(h3Element)['display'];
52
+ assert.strictEqual(displayStyle, 'flex');
53
+ ```
54
+
55
+ Your `h4` should have a `display` property set to `flex`.
56
+
57
+ ```js
58
+ const h4Element = document.querySelector('h4');
59
+ const displayStyle = window.getComputedStyle(h4Element)['display'];
60
+ assert.strictEqual(displayStyle, 'flex');
61
+ ```
62
+
63
+ Your `.profile-name` should have a `display` property set to `flex`.
64
+
65
+ ```js
66
+ const profileName = document.querySelector('.profile-name');
67
+ const displayStyle = window.getComputedStyle(profileName)['display'];
68
+ assert.strictEqual(displayStyle, 'flex');
69
+ ```
70
+
71
+ Your `.follow-btn` should have a `display` property set to `flex`.
72
+
73
+ ```js
74
+ const followButton = document.querySelector('.follow-btn');
75
+ const displayStyle = window.getComputedStyle(followButton)['display'];
76
+ assert.strictEqual(displayStyle, 'flex');
77
+ ```
78
+
79
+ Your `.stats` should have a `display` property set to `flex`.
80
+
81
+ ```js
82
+ const stats = document.querySelector('.stats');
83
+ const displayStyle = window.getComputedStyle(stats)['display'];
84
+ assert.strictEqual(displayStyle, 'flex');
85
+ ```
86
+
87
+ # --seed--
88
+
89
+ ## --seed-contents--
90
+
91
+ ```html
92
+ <style>
93
+ body {
94
+ font-family: Arial, sans-serif;
95
+ }
96
+ header {
97
+
98
+ }
99
+ header .profile-thumbnail {
100
+ width: 50px;
101
+ height: 50px;
102
+ border-radius: 4px;
103
+ }
104
+ header .profile-name {
105
+
106
+ margin-left: 10px;
107
+ }
108
+ header .follow-btn {
109
+
110
+ margin: 0 0 0 auto;
111
+ }
112
+ header .follow-btn button {
113
+ border: 0;
114
+ border-radius: 3px;
115
+ padding: 5px;
116
+ }
117
+ header h3, header h4 {
118
+
119
+ margin: 0;
120
+ }
121
+ #inner p {
122
+ margin-bottom: 10px;
123
+ font-size: 20px;
124
+ }
125
+ #inner hr {
126
+ margin: 20px 0;
127
+ border-style: solid;
128
+ opacity: 0.1;
129
+ }
130
+ footer {
131
+
132
+ }
133
+ footer .stats {
134
+
135
+ font-size: 15px;
136
+ }
137
+ footer .stats strong {
138
+ font-size: 18px;
139
+ }
140
+ footer .stats .likes {
141
+ margin-left: 10px;
142
+ }
143
+ footer .cta {
144
+ margin-left: auto;
145
+ }
146
+ footer .cta button {
147
+ border: 0;
148
+ background: transparent;
149
+ }
150
+ </style>
151
+ <header>
152
+ <img src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg" alt="Quincy Larson's profile picture" class="profile-thumbnail">
153
+ <div class="profile-name">
154
+ <h3>Quincy Larson</h3>
155
+ <h4>@ossia</h4>
156
+ </div>
157
+ <div class="follow-btn">
158
+ <button>Follow</button>
159
+ </div>
160
+ </header>
161
+ <div id="inner">
162
+ <p>
163
+ I meet so many people who are in search of that one trick that will help
164
+ them work smart. Even if you work smart, you still have to work hard.
165
+ </p>
166
+ <span class="date">1:32 PM - 12 Jan 2018</span>
167
+ <hr />
168
+ </div>
169
+ <footer>
170
+ <div class="stats">
171
+ <div class="Retweets"><strong>107</strong> Retweets</div>
172
+ <div class="likes"><strong>431</strong> Likes</div>
173
+ </div>
174
+ <div class="cta">
175
+ <button class="share-btn">Share</button>
176
+ <button class="retweet-btn">Retweet</button>
177
+ <button class="like-btn">Like</button>
178
+ </div>
179
+ </footer>
180
+ ```
181
+
182
+ # --solutions--
183
+
184
+ ```html
185
+ <style>
186
+ body {
187
+ font-family: Arial, sans-serif;
188
+ }
189
+ header {
190
+ display: flex;
191
+ }
192
+ header .profile-thumbnail {
193
+ width: 50px;
194
+ height: 50px;
195
+ border-radius: 4px;
196
+ }
197
+ header .profile-name {
198
+ display: flex;
199
+ margin-left: 10px;
200
+ }
201
+ header .follow-btn {
202
+ display: flex;
203
+ margin: 0 0 0 auto;
204
+ }
205
+ header .follow-btn button {
206
+ border: 0;
207
+ border-radius: 3px;
208
+ padding: 5px;
209
+ }
210
+ header h3,
211
+ header h4 {
212
+ display: flex;
213
+ margin: 0;
214
+ }
215
+ #inner p {
216
+ margin-bottom: 10px;
217
+ font-size: 20px;
218
+ }
219
+ #inner hr {
220
+ margin: 20px 0;
221
+ border-style: solid;
222
+ opacity: 0.1;
223
+ }
224
+ footer {
225
+ display: flex;
226
+ }
227
+ footer .stats {
228
+ display: flex;
229
+ font-size: 15px;
230
+ }
231
+ footer .stats strong {
232
+ font-size: 18px;
233
+ }
234
+ footer .stats .likes {
235
+ margin-left: 10px;
236
+ }
237
+ footer .cta {
238
+ margin-left: auto;
239
+ }
240
+ footer .cta button {
241
+ border: 0;
242
+ background: transparent;
243
+ }
244
+ </style>
245
+ <header>
246
+ <img
247
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
248
+ alt="Quincy Larson's profile picture"
249
+ class="profile-thumbnail"
250
+ />
251
+ <div class="profile-name">
252
+ <h3>Quincy Larson</h3>
253
+ <h4>@ossia</h4>
254
+ </div>
255
+ <div class="follow-btn">
256
+ <button>Follow</button>
257
+ </div>
258
+ </header>
259
+ <div id="inner">
260
+ <p>
261
+ I meet so many people who are in search of that one trick that will help
262
+ them work smart. Even if you work smart, you still have to work hard.
263
+ </p>
264
+ <span class="date">1:32 PM - 12 Jan 2018</span>
265
+ <hr />
266
+ </div>
267
+ <footer>
268
+ <div class="stats">
269
+ <div class="Retweets"><strong>107</strong> Retweets</div>
270
+ <div class="likes"><strong>431</strong> Likes</div>
271
+ </div>
272
+ <div class="cta">
273
+ <button class="share-btn">Share</button>
274
+ <button class="retweet-btn">Retweet</button>
275
+ <button class="like-btn">Like</button>
276
+ </div>
277
+ </footer>
278
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af2.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ab367417b2b2512af2
3
+ title: Use the flex-direction Property to Make a Row
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cBEkbfJ'
6
+ forumTopicId: 301110
7
+ dashedName: use-the-flex-direction-property-to-make-a-row
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Adding `display: flex` to an element turns it into a flex container. This makes it possible to align any children of that element into rows or columns. You do this by adding the `flex-direction` property to the parent item and setting it to row or column. Creating a row will align the children horizontally, and creating a column will align the children vertically.
13
+
14
+ Other options for `flex-direction` are `row-reverse` and `column-reverse`.
15
+
16
+ **Note:** The default value for the `flex-direction` property is `row`.
17
+
18
+ # --instructions--
19
+
20
+ Add the CSS property `flex-direction` to the `#box-container` element, and give it a value of `row-reverse`.
21
+
22
+ # --hints--
23
+
24
+ The `#box-container` element should have a `flex-direction` property set to `row-reverse`.
25
+
26
+ ```js
27
+ const boxContainer = document.querySelector('#box-container');
28
+ const flexDirection = window.getComputedStyle(boxContainer)['flex-direction'];
29
+ assert.strictEqual(flexDirection, 'row-reverse');
30
+ ```
31
+
32
+ # --seed--
33
+
34
+ ## --seed-contents--
35
+
36
+ ```html
37
+ <style>
38
+ #box-container {
39
+ display: flex;
40
+ height: 500px;
41
+
42
+ }
43
+ #box-1 {
44
+ background-color: dodgerblue;
45
+ width: 50%;
46
+ height: 50%;
47
+ }
48
+
49
+ #box-2 {
50
+ background-color: orangered;
51
+ width: 50%;
52
+ height: 50%;
53
+ }
54
+ </style>
55
+
56
+ <div id="box-container">
57
+ <div id="box-1"></div>
58
+ <div id="box-2"></div>
59
+ </div>
60
+ ```
61
+
62
+ # --solutions--
63
+
64
+ ```html
65
+ <style>
66
+ #box-container {
67
+ display: flex;
68
+ height: 500px;
69
+ flex-direction: row-reverse;
70
+ }
71
+ #box-1 {
72
+ background-color: dodgerblue;
73
+ width: 50%;
74
+ height: 50%;
75
+ }
76
+
77
+ #box-2 {
78
+ background-color: orangered;
79
+ width: 50%;
80
+ height: 50%;
81
+ }
82
+ </style>
83
+
84
+ <div id="box-container">
85
+ <div id="box-1"></div>
86
+ <div id="box-2"></div>
87
+ </div>
88
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ab367417b2b2512af3.md ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ab367417b2b2512af3
3
+ title: Apply the flex-direction Property to Create Rows in the Tweet Embed
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cJb8yuq'
6
+ forumTopicId: 301104
7
+ dashedName: apply-the-flex-direction-property-to-create-rows-in-the-tweet-embed
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The `header` and `footer` in the tweet embed example have child items that could be arranged as rows using the `flex-direction` property. This tells CSS to align the children horizontally.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `flex-direction` to both the `header` and `footer` and set the value to `row`.
17
+
18
+ # --hints--
19
+
20
+ Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
21
+
22
+ ```js
23
+ const followButton = document.querySelector('.follow-btn');
24
+ const displayStyle = window.getComputedStyle(followButton)['display'];
25
+ assert.isNotNull(followButton);
26
+ assert.notStrictEqual(displayStyle, 'none');
27
+ ```
28
+
29
+ The `header` should have a `flex-direction` property set to `row`.
30
+
31
+ ```js
32
+ assert.match(code, /header\s*?{[^}]*?flex-direction:\s*?row;/g);
33
+ ```
34
+
35
+ The `footer` should have a `flex-direction` property set to `row`.
36
+
37
+ ```js
38
+ assert.match(code, /footer\s*?{[^}]*?flex-direction:\s*?row;/g);
39
+ ```
40
+
41
+ # --seed--
42
+
43
+ ## --seed-contents--
44
+
45
+ ```html
46
+ <style>
47
+ body {
48
+ font-family: Arial, sans-serif;
49
+ }
50
+ header {
51
+ display: flex;
52
+
53
+ }
54
+ header .profile-thumbnail {
55
+ width: 50px;
56
+ height: 50px;
57
+ border-radius: 4px;
58
+ }
59
+ header .profile-name {
60
+ display: flex;
61
+ margin-left: 10px;
62
+ }
63
+ header .follow-btn {
64
+ display: flex;
65
+ margin: 0 0 0 auto;
66
+ }
67
+ header .follow-btn button {
68
+ border: 0;
69
+ border-radius: 3px;
70
+ padding: 5px;
71
+ }
72
+ header h3,
73
+ header h4 {
74
+ display: flex;
75
+ margin: 0;
76
+ }
77
+ #inner p {
78
+ margin-bottom: 10px;
79
+ font-size: 20px;
80
+ }
81
+ #inner hr {
82
+ margin: 20px 0;
83
+ border-style: solid;
84
+ opacity: 0.1;
85
+ }
86
+ footer {
87
+ display: flex;
88
+
89
+ }
90
+ footer .stats {
91
+ display: flex;
92
+ font-size: 15px;
93
+ }
94
+ footer .stats strong {
95
+ font-size: 18px;
96
+ }
97
+ footer .stats .likes {
98
+ margin-left: 10px;
99
+ }
100
+ footer .cta {
101
+ margin-left: auto;
102
+ }
103
+ footer .cta button {
104
+ border: 0;
105
+ background: transparent;
106
+ }
107
+ </style>
108
+ <header>
109
+ <img
110
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
111
+ alt="Quincy Larson's profile picture"
112
+ class="profile-thumbnail"
113
+ />
114
+ <div class="profile-name">
115
+ <h3>Quincy Larson</h3>
116
+ <h4>@ossia</h4>
117
+ </div>
118
+ <div class="follow-btn">
119
+ <button>Follow</button>
120
+ </div>
121
+ </header>
122
+ <div id="inner">
123
+ <p>
124
+ I meet so many people who are in search of that one trick that will help
125
+ them work smart. Even if you work smart, you still have to work hard.
126
+ </p>
127
+ <span class="date">1:32 PM - 12 Jan 2018</span>
128
+ <hr />
129
+ </div>
130
+ <footer>
131
+ <div class="stats">
132
+ <div class="Retweets"><strong>107</strong> Retweets</div>
133
+ <div class="likes"><strong>431</strong> Likes</div>
134
+ </div>
135
+ <div class="cta">
136
+ <button class="share-btn">Share</button>
137
+ <button class="retweet-btn">Retweet</button>
138
+ <button class="like-btn">Like</button>
139
+ </div>
140
+ </footer>
141
+ ```
142
+
143
+ # --solutions--
144
+
145
+ ```html
146
+ <style>
147
+ body {
148
+ font-family: Arial, sans-serif;
149
+ }
150
+ header {
151
+ display: flex;
152
+ flex-direction: row;
153
+ }
154
+ header .profile-thumbnail {
155
+ width: 50px;
156
+ height: 50px;
157
+ border-radius: 4px;
158
+ }
159
+ header .profile-name {
160
+ display: flex;
161
+ margin-left: 10px;
162
+ }
163
+ header .follow-btn {
164
+ display: flex;
165
+ margin: 0 0 0 auto;
166
+ }
167
+ header .follow-btn button {
168
+ border: 0;
169
+ border-radius: 3px;
170
+ padding: 5px;
171
+ }
172
+ header h3,
173
+ header h4 {
174
+ display: flex;
175
+ margin: 0;
176
+ }
177
+ #inner p {
178
+ margin-bottom: 10px;
179
+ font-size: 20px;
180
+ }
181
+ #inner hr {
182
+ margin: 20px 0;
183
+ border-style: solid;
184
+ opacity: 0.1;
185
+ }
186
+ footer {
187
+ display: flex;
188
+ flex-direction: row;
189
+ }
190
+ footer .stats {
191
+ display: flex;
192
+ font-size: 15px;
193
+ }
194
+ footer .stats strong {
195
+ font-size: 18px;
196
+ }
197
+ footer .stats .likes {
198
+ margin-left: 10px;
199
+ }
200
+ footer .cta {
201
+ margin-left: auto;
202
+ }
203
+ footer .cta button {
204
+ border: 0;
205
+ background: transparent;
206
+ }
207
+ </style>
208
+ <header>
209
+ <img
210
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
211
+ alt="Quincy Larson's profile picture"
212
+ class="profile-thumbnail"
213
+ />
214
+ <div class="profile-name">
215
+ <h3>Quincy Larson</h3>
216
+ <h4>@ossia</h4>
217
+ </div>
218
+ <div class="follow-btn">
219
+ <button>Follow</button>
220
+ </div>
221
+ </header>
222
+ <div id="inner">
223
+ <p>
224
+ I meet so many people who are in search of that one trick that will help
225
+ them work smart. Even if you work smart, you still have to work hard.
226
+ </p>
227
+ <span class="date">1:32 PM - 12 Jan 2018</span>
228
+ <hr />
229
+ </div>
230
+ <footer>
231
+ <div class="stats">
232
+ <div class="Retweets"><strong>107</strong> Retweets</div>
233
+ <div class="likes"><strong>431</strong> Likes</div>
234
+ </div>
235
+ <div class="cta">
236
+ <button class="share-btn">Share</button>
237
+ <button class="retweet-btn">Retweet</button>
238
+ <button class="like-btn">Like</button>
239
+ </div>
240
+ </footer>
241
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af4.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ac367417b2b2512af4
3
+ title: Use the flex-direction Property to Make a Column
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cZmWeA4'
6
+ forumTopicId: 301109
7
+ dashedName: use-the-flex-direction-property-to-make-a-column
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The last two challenges used the `flex-direction` property set to `row`. This property can also create a column by vertically stacking the children of a flex container.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `flex-direction` to the `#box-container` element, and give it a value of `column`.
17
+
18
+ # --hints--
19
+
20
+ The `#box-container` element should have a `flex-direction` property set to `column`.
21
+
22
+ ```js
23
+ const boxContainer = document.querySelector('#box-container');
24
+ const flexDirection = window.getComputedStyle(boxContainer)['flex-direction'];
25
+ assert.strictEqual(flexDirection, 'column');
26
+ ```
27
+
28
+ # --seed--
29
+
30
+ ## --seed-contents--
31
+
32
+ ```html
33
+ <style>
34
+ #box-container {
35
+ display: flex;
36
+ height: 500px;
37
+
38
+ }
39
+ #box-1 {
40
+ background-color: dodgerblue;
41
+ width: 50%;
42
+ height: 50%;
43
+ }
44
+
45
+ #box-2 {
46
+ background-color: orangered;
47
+ width: 50%;
48
+ height: 50%;
49
+ }
50
+ </style>
51
+
52
+ <div id="box-container">
53
+ <div id="box-1"></div>
54
+ <div id="box-2"></div>
55
+ </div>
56
+ ```
57
+
58
+ # --solutions--
59
+
60
+ ```html
61
+ <style>
62
+ #box-container {
63
+ display: flex;
64
+ height: 500px;
65
+ flex-direction: column;
66
+ }
67
+ #box-1 {
68
+ background-color: dodgerblue;
69
+ width: 50%;
70
+ height: 50%;
71
+ }
72
+
73
+ #box-2 {
74
+ background-color: orangered;
75
+ width: 50%;
76
+ height: 50%;
77
+ }
78
+ </style>
79
+
80
+ <div id="box-container">
81
+ <div id="box-1"></div>
82
+ <div id="box-2"></div>
83
+ </div>
84
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af5.md ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ac367417b2b2512af5
3
+ title: Apply the flex-direction Property to Create a Column in the Tweet Embed
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cnzdVC9'
6
+ forumTopicId: 301103
7
+ dashedName: apply-the-flex-direction-property-to-create-a-column-in-the-tweet-embed
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The tweet embed `header` and `footer` used the `flex-direction` property earlier with a row value. Similarly, the items inside the `.profile-name` element would work well stacked as a column.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `flex-direction` to the header's `.profile-name` element and set the value to `column`.
17
+
18
+ # --hints--
19
+
20
+ Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
21
+
22
+ ```js
23
+ const followButton = document.querySelector('.follow-btn');
24
+ const displayStyle = window.getComputedStyle(followButton)['display'];
25
+ assert.isNotNull(followButton);
26
+ assert.notStrictEqual(displayStyle, 'none');
27
+ ```
28
+
29
+ The `.profile-name` element should have a `flex-direction` property set to `column`.
30
+
31
+ ```js
32
+ const profileName = document.querySelector('.profile-name');
33
+ const flexDirection = window.getComputedStyle(profileName)['flex-direction'];
34
+ assert.strictEqual(flexDirection, 'column');
35
+ ```
36
+
37
+ # --seed--
38
+
39
+ ## --seed-contents--
40
+
41
+ ```html
42
+ <style>
43
+ body {
44
+ font-family: Arial, sans-serif;
45
+ }
46
+ header,
47
+ footer {
48
+ display: flex;
49
+ flex-direction: row;
50
+ }
51
+ header .profile-thumbnail {
52
+ width: 50px;
53
+ height: 50px;
54
+ border-radius: 4px;
55
+ }
56
+ header .profile-name {
57
+ display: flex;
58
+
59
+ margin-left: 10px;
60
+ }
61
+ header .follow-btn {
62
+ display: flex;
63
+ margin: 0 0 0 auto;
64
+ }
65
+ header .follow-btn button {
66
+ border: 0;
67
+ border-radius: 3px;
68
+ padding: 5px;
69
+ }
70
+ header h3,
71
+ header h4 {
72
+ display: flex;
73
+ margin: 0;
74
+ }
75
+ #inner p {
76
+ margin-bottom: 10px;
77
+ font-size: 20px;
78
+ }
79
+ #inner hr {
80
+ margin: 20px 0;
81
+ border-style: solid;
82
+ opacity: 0.1;
83
+ }
84
+ footer .stats {
85
+ display: flex;
86
+ font-size: 15px;
87
+ }
88
+ footer .stats strong {
89
+ font-size: 18px;
90
+ }
91
+ footer .stats .likes {
92
+ margin-left: 10px;
93
+ }
94
+ footer .cta {
95
+ margin-left: auto;
96
+ }
97
+ footer .cta button {
98
+ border: 0;
99
+ background: transparent;
100
+ }
101
+ </style>
102
+ <header>
103
+ <img
104
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
105
+ alt="Quincy Larson's profile picture"
106
+ class="profile-thumbnail"
107
+ />
108
+ <div class="profile-name">
109
+ <h3>Quincy Larson</h3>
110
+ <h4>@ossia</h4>
111
+ </div>
112
+ <div class="follow-btn">
113
+ <button>Follow</button>
114
+ </div>
115
+ </header>
116
+ <div id="inner">
117
+ <p>
118
+ I meet so many people who are in search of that one trick that will help
119
+ them work smart. Even if you work smart, you still have to work hard.
120
+ </p>
121
+ <span class="date">1:32 PM - 12 Jan 2018</span>
122
+ <hr />
123
+ </div>
124
+ <footer>
125
+ <div class="stats">
126
+ <div class="Retweets"><strong>107</strong> Retweets</div>
127
+ <div class="likes"><strong>431</strong> Likes</div>
128
+ </div>
129
+ <div class="cta">
130
+ <button class="share-btn">Share</button>
131
+ <button class="retweet-btn">Retweet</button>
132
+ <button class="like-btn">Like</button>
133
+ </div>
134
+ </footer>
135
+ ```
136
+
137
+ # --solutions--
138
+
139
+ ```html
140
+ <style>
141
+ body {
142
+ font-family: Arial, sans-serif;
143
+ }
144
+ header,
145
+ footer {
146
+ display: flex;
147
+ flex-direction: row;
148
+ }
149
+ header .profile-thumbnail {
150
+ width: 50px;
151
+ height: 50px;
152
+ border-radius: 4px;
153
+ }
154
+ header .profile-name {
155
+ display: flex;
156
+ flex-direction: column;
157
+ margin-left: 10px;
158
+ }
159
+ header .follow-btn {
160
+ display: flex;
161
+ margin: 0 0 0 auto;
162
+ }
163
+ header .follow-btn button {
164
+ border: 0;
165
+ border-radius: 3px;
166
+ padding: 5px;
167
+ }
168
+ header h3,
169
+ header h4 {
170
+ display: flex;
171
+ margin: 0;
172
+ }
173
+ #inner p {
174
+ margin-bottom: 10px;
175
+ font-size: 20px;
176
+ }
177
+ #inner hr {
178
+ margin: 20px 0;
179
+ border-style: solid;
180
+ opacity: 0.1;
181
+ }
182
+ footer .stats {
183
+ display: flex;
184
+ font-size: 15px;
185
+ }
186
+ footer .stats strong {
187
+ font-size: 18px;
188
+ }
189
+ footer .stats .likes {
190
+ margin-left: 10px;
191
+ }
192
+ footer .cta {
193
+ margin-left: auto;
194
+ }
195
+ footer .cta button {
196
+ border: 0;
197
+ background: transparent;
198
+ }
199
+ </style>
200
+ <header>
201
+ <img
202
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
203
+ alt="Quincy Larson's profile picture"
204
+ class="profile-thumbnail"
205
+ />
206
+ <div class="profile-name">
207
+ <h3>Quincy Larson</h3>
208
+ <h4>@ossia</h4>
209
+ </div>
210
+ <div class="follow-btn">
211
+ <button>Follow</button>
212
+ </div>
213
+ </header>
214
+ <div id="inner">
215
+ <p>
216
+ I meet so many people who are in search of that one trick that will help
217
+ them work smart. Even if you work smart, you still have to work hard.
218
+ </p>
219
+ <span class="date">1:32 PM - 12 Jan 2018</span>
220
+ <hr />
221
+ </div>
222
+ <footer>
223
+ <div class="stats">
224
+ <div class="Retweets"><strong>107</strong> Retweets</div>
225
+ <div class="likes"><strong>431</strong> Likes</div>
226
+ </div>
227
+ <div class="cta">
228
+ <button class="share-btn">Share</button>
229
+ <button class="retweet-btn">Retweet</button>
230
+ <button class="like-btn">Like</button>
231
+ </div>
232
+ </footer>
233
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af6.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ac367417b2b2512af6
3
+ title: Align Elements Using the justify-content Property
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c43gnHm'
6
+ forumTopicId: 301102
7
+ dashedName: align-elements-using-the-justify-content-property
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Sometimes the flex items within a flex container do not fill all the space in the container. It is common to want to tell CSS how to align and space out the flex items a certain way. Fortunately, the `justify-content` property has several options to do this. But first, there is some important terminology to understand before reviewing those options.
13
+
14
+ <a href="https://www.freecodecamp.org/news/flexbox-the-ultimate-css-flex-cheatsheet/" target="_blank" rel="noopener noreferrer nofollow">For more info about flex-box properties read here</a>
15
+
16
+ Recall that setting a flex container as a row places the flex items side-by-side from left-to-right. A flex container set as a column places the flex items in a vertical stack from top-to-bottom. For each, the direction the flex items are arranged is called the **main axis**. For a row, this is a horizontal line that cuts through each item. And for a column, the main axis is a vertical line through the items.
17
+
18
+ There are several options for how to space the flex items along the line that is the main axis. One of the most commonly used is `justify-content: center;`, which aligns all the flex items to the center inside the flex container. Other options include:
19
+
20
+ <ul><li><code>flex-start</code>: aligns items to the start of the flex container. For a row, this pushes the items to the left of the container. For a column, this pushes the items to the top of the container. This is the default alignment if no <code>justify-content</code> is specified.</li><li><code>flex-end</code>: aligns items to the end of the flex container. For a row, this pushes the items to the right of the container. For a column, this pushes the items to the bottom of the container.</li><li><code>space-between</code>: aligns items to the center of the main axis, with extra space placed between the items. The first and last items are pushed to the very edge of the flex container. For example, in a row the first item is against the left side of the container, the last item is against the right side of the container, then the remaining space is distributed evenly among the other items.</li><li><code>space-around</code>: similar to <code>space-between</code> but the first and last items are not locked to the edges of the container, the space is distributed around all the items with a half space on either end of the flex container.</li><li><code>space-evenly</code>: Distributes space evenly between the flex items with a full space at either end of the flex container.</li></ul>
21
+
22
+ # --instructions--
23
+
24
+ An example helps show this property in action. Add the CSS property `justify-content` to the `#box-container` element, and give it a value of `center`.
25
+
26
+ **Bonus**
27
+ Try the other options for the `justify-content` property in the code editor to see their differences. But note that a value of `center` is the only one that will pass this challenge.
28
+
29
+ # --hints--
30
+
31
+ The `#box-container` element should have a `justify-content` property set to a value of `center`.
32
+
33
+ ```js
34
+ const boxContainer = document.querySelector('#box-container');
35
+ const justifyDirection =
36
+ window.getComputedStyle(boxContainer)['justify-content'];
37
+ assert.strictEqual(justifyDirection, 'center');
38
+ ```
39
+
40
+ # --seed--
41
+
42
+ ## --seed-contents--
43
+
44
+ ```html
45
+ <style>
46
+ #box-container {
47
+ background: gray;
48
+ display: flex;
49
+ height: 500px;
50
+
51
+ }
52
+ #box-1 {
53
+ background-color: dodgerblue;
54
+ width: 25%;
55
+ height: 100%;
56
+ }
57
+
58
+ #box-2 {
59
+ background-color: orangered;
60
+ width: 25%;
61
+ height: 100%;
62
+ }
63
+ </style>
64
+
65
+ <div id="box-container">
66
+ <div id="box-1"></div>
67
+ <div id="box-2"></div>
68
+ </div>
69
+ ```
70
+
71
+ # --solutions--
72
+
73
+ ```html
74
+ <style>
75
+ #box-container {
76
+ background: gray;
77
+ display: flex;
78
+ height: 500px;
79
+ justify-content: center;
80
+ }
81
+ #box-1 {
82
+ background-color: dodgerblue;
83
+ width: 25%;
84
+ height: 100%;
85
+ }
86
+
87
+ #box-2 {
88
+ background-color: orangered;
89
+ width: 25%;
90
+ height: 100%;
91
+ }
92
+ </style>
93
+
94
+ <div id="box-container">
95
+ <div id="box-1"></div>
96
+ <div id="box-2"></div>
97
+ </div>
98
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ac367417b2b2512af7.md ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ac367417b2b2512af7
3
+ title: Use the justify-content Property in the Tweet Embed
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c43GgTa'
6
+ forumTopicId: 301115
7
+ dashedName: use-the-justify-content-property-in-the-tweet-embed
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The last challenge showed an example of the `justify-content` property. For the tweet embed, this property can be applied to align the items in the `.profile-name` element.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `justify-content` to the header's `.profile-name` element and set the value to any of the options from the last challenge.
17
+
18
+ # --hints--
19
+
20
+ Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
21
+
22
+ ```js
23
+ const followButton = document.querySelector('.follow-btn');
24
+ const displayStyle = window.getComputedStyle(followButton)['display'];
25
+ assert.isNotNull(followButton);
26
+ assert.notStrictEqual(displayStyle, 'none');
27
+ ```
28
+
29
+ The `.profile-name` element should have the `justify-content` property set to any of these values: `center`, `flex-start`, `flex-end`, `space-between`, `space-around`, or `space-evenly`.
30
+
31
+ ```js
32
+ assert.match(
33
+ code,
34
+ /header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around|space-evenly)\s*;/g
35
+ );
36
+ ```
37
+
38
+ # --seed--
39
+
40
+ ## --seed-contents--
41
+
42
+ ```html
43
+ <style>
44
+ body {
45
+ font-family: Arial, sans-serif;
46
+ }
47
+ header,
48
+ footer {
49
+ display: flex;
50
+ flex-direction: row;
51
+ }
52
+ header .profile-thumbnail {
53
+ width: 50px;
54
+ height: 50px;
55
+ border-radius: 4px;
56
+ }
57
+ header .profile-name {
58
+ display: flex;
59
+ flex-direction: column;
60
+
61
+ margin-left: 10px;
62
+ }
63
+ header .follow-btn {
64
+ display: flex;
65
+ margin: 0 0 0 auto;
66
+ }
67
+ header .follow-btn button {
68
+ border: 0;
69
+ border-radius: 3px;
70
+ padding: 5px;
71
+ }
72
+ header h3,
73
+ header h4 {
74
+ display: flex;
75
+ margin: 0;
76
+ }
77
+ #inner p {
78
+ margin-bottom: 10px;
79
+ font-size: 20px;
80
+ }
81
+ #inner hr {
82
+ margin: 20px 0;
83
+ border-style: solid;
84
+ opacity: 0.1;
85
+ }
86
+ footer .stats {
87
+ display: flex;
88
+ font-size: 15px;
89
+ }
90
+ footer .stats strong {
91
+ font-size: 18px;
92
+ }
93
+ footer .stats .likes {
94
+ margin-left: 10px;
95
+ }
96
+ footer .cta {
97
+ margin-left: auto;
98
+ }
99
+ footer .cta button {
100
+ border: 0;
101
+ background: transparent;
102
+ }
103
+ </style>
104
+ <header>
105
+ <img
106
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
107
+ alt="Quincy Larson's profile picture"
108
+ class="profile-thumbnail"
109
+ />
110
+ <div class="profile-name">
111
+ <h3>Quincy Larson</h3>
112
+ <h4>@ossia</h4>
113
+ </div>
114
+ <div class="follow-btn">
115
+ <button>Follow</button>
116
+ </div>
117
+ </header>
118
+ <div id="inner">
119
+ <p>
120
+ I meet so many people who are in search of that one trick that will help
121
+ them work smart. Even if you work smart, you still have to work hard.
122
+ </p>
123
+ <span class="date">1:32 PM - 12 Jan 2018</span>
124
+ <hr />
125
+ </div>
126
+ <footer>
127
+ <div class="stats">
128
+ <div class="Retweets"><strong>107</strong> Retweets</div>
129
+ <div class="likes"><strong>431</strong> Likes</div>
130
+ </div>
131
+ <div class="cta">
132
+ <button class="share-btn">Share</button>
133
+ <button class="retweet-btn">Retweet</button>
134
+ <button class="like-btn">Like</button>
135
+ </div>
136
+ </footer>
137
+ ```
138
+
139
+ # --solutions--
140
+
141
+ ```html
142
+ <style>
143
+ body {
144
+ font-family: Arial, sans-serif;
145
+ }
146
+ header,
147
+ footer {
148
+ display: flex;
149
+ flex-direction: row;
150
+ }
151
+ header .profile-thumbnail {
152
+ width: 50px;
153
+ height: 50px;
154
+ border-radius: 4px;
155
+ }
156
+ header .profile-name {
157
+ display: flex;
158
+ flex-direction: column;
159
+ justify-content: center;
160
+ margin-left: 10px;
161
+ }
162
+ header .follow-btn {
163
+ display: flex;
164
+ margin: 0 0 0 auto;
165
+ }
166
+ header .follow-btn button {
167
+ border: 0;
168
+ border-radius: 3px;
169
+ padding: 5px;
170
+ }
171
+ header h3,
172
+ header h4 {
173
+ display: flex;
174
+ margin: 0;
175
+ }
176
+ #inner p {
177
+ margin-bottom: 10px;
178
+ font-size: 20px;
179
+ }
180
+ #inner hr {
181
+ margin: 20px 0;
182
+ border-style: solid;
183
+ opacity: 0.1;
184
+ }
185
+ footer .stats {
186
+ display: flex;
187
+ font-size: 15px;
188
+ }
189
+ footer .stats strong {
190
+ font-size: 18px;
191
+ }
192
+ footer .stats .likes {
193
+ margin-left: 10px;
194
+ }
195
+ footer .cta {
196
+ margin-left: auto;
197
+ }
198
+ footer .cta button {
199
+ border: 0;
200
+ background: transparent;
201
+ }
202
+ </style>
203
+ <header>
204
+ <img
205
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
206
+ alt="Quincy Larson's profile picture"
207
+ class="profile-thumbnail"
208
+ />
209
+ <div class="profile-name">
210
+ <h3>Quincy Larson</h3>
211
+ <h4>@ossia</h4>
212
+ </div>
213
+ <div class="follow-btn">
214
+ <button>Follow</button>
215
+ </div>
216
+ </header>
217
+ <div id="inner">
218
+ <p>
219
+ I meet so many people who are in search of that one trick that will help
220
+ them work smart. Even if you work smart, you still have to work hard.
221
+ </p>
222
+ <span class="date">1:32 PM - 12 Jan 2018</span>
223
+ <hr />
224
+ </div>
225
+ <footer>
226
+ <div class="stats">
227
+ <div class="Retweets"><strong>107</strong> Retweets</div>
228
+ <div class="likes"><strong>431</strong> Likes</div>
229
+ </div>
230
+ <div class="cta">
231
+ <button class="share-btn">Share</button>
232
+ <button class="retweet-btn">Retweet</button>
233
+ <button class="like-btn">Like</button>
234
+ </div>
235
+ </footer>
236
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512af8.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ad367417b2b2512af8
3
+ title: Align Elements Using the align-items Property
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c8aggtk'
6
+ forumTopicId: 301101
7
+ dashedName: align-elements-using-the-align-items-property
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The `align-items` property is similar to `justify-content`. Recall that the `justify-content` property aligned flex items along the main axis. For rows, the main axis is a horizontal line and for columns it is a vertical line.
13
+
14
+ Flex containers also have a **cross axis** which is the opposite of the main axis. For rows, the cross axis is vertical and for columns, the cross axis is horizontal.
15
+
16
+ CSS offers the `align-items` property to align flex items along the cross axis. For a row, it tells CSS how to push the items in the entire row up or down within the container. And for a column, how to push all the items left or right within the container.
17
+
18
+ The different values available for `align-items` include:
19
+
20
+ <ul><li><code>flex-start</code>: aligns items to the start of the flex container. For rows, this aligns items to the top of the container. For columns, this aligns items to the left of the container.</li><li><code>flex-end</code>: aligns items to the end of the flex container. For rows, this aligns items to the bottom of the container. For columns, this aligns items to the right of the container.</li><li><code>center</code>: align items to the center. For rows, this vertically aligns items (equal space above and below the items). For columns, this horizontally aligns them (equal space to the left and right of the items).</li><li><code>stretch</code>: stretch the items to fill the flex container. For example, rows items are stretched to fill the flex container top-to-bottom. This is the default value if no <code>align-items</code> value is specified.</li><li><code>baseline</code>: align items to their baselines. Baseline is a text concept, think of it as the line that the letters sit on.</li></ul>
21
+
22
+ # --instructions--
23
+
24
+ An example helps show this property in action. Add the CSS property `align-items` to the `#box-container` element, and give it a value of `center`.
25
+
26
+ **Bonus**
27
+ Try the other options for the `align-items` property in the code editor to see their differences. But note that a value of `center` is the only one that will pass this challenge.
28
+
29
+ # --hints--
30
+
31
+ The `#box-container` element should have an `align-items` property set to a value of `center`.
32
+
33
+ ```js
34
+ const boxContainer = document.querySelector('#box-container');
35
+ const alignment = window.getComputedStyle(boxContainer)['align-items'];
36
+ assert.strictEqual(alignment, 'center');
37
+ ```
38
+
39
+ # --seed--
40
+
41
+ ## --seed-contents--
42
+
43
+ ```html
44
+ <style>
45
+ #box-container {
46
+ background: gray;
47
+ display: flex;
48
+ height: 500px;
49
+
50
+ }
51
+ #box-1 {
52
+ background-color: dodgerblue;
53
+ width: 200px;
54
+ font-size: 24px;
55
+ }
56
+
57
+ #box-2 {
58
+ background-color: orangered;
59
+ width: 200px;
60
+ font-size: 18px;
61
+ }
62
+ </style>
63
+
64
+ <div id="box-container">
65
+ <div id="box-1"><p>Hello</p></div>
66
+ <div id="box-2"><p>Goodbye</p></div>
67
+ </div>
68
+ ```
69
+
70
+ # --solutions--
71
+
72
+ ```html
73
+ <style>
74
+ #box-container {
75
+ background: gray;
76
+ display: flex;
77
+ height: 500px;
78
+ align-items: center;
79
+ }
80
+ #box-1 {
81
+ background-color: dodgerblue;
82
+ width: 200px;
83
+ font-size: 24px;
84
+ }
85
+
86
+ #box-2 {
87
+ background-color: orangered;
88
+ width: 200px;
89
+ font-size: 18px;
90
+ }
91
+ </style>
92
+
93
+ <div id="box-container">
94
+ <div id="box-1"><p>Hello</p></div>
95
+ <div id="box-2"><p>Goodbye</p></div>
96
+ </div>
97
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512af9.md ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ad367417b2b2512af9
3
+ title: Use the align-items Property in the Tweet Embed
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cd3PNfq'
6
+ forumTopicId: 301106
7
+ dashedName: use-the-align-items-property-in-the-tweet-embed
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The last challenge introduced the `align-items` property and gave an example. This property can be applied to a few tweet embed elements to align the flex items inside them.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `align-items` to the header's `.follow-btn` element. Set the value to `center`.
17
+
18
+ # --hints--
19
+
20
+ Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
21
+
22
+ ```js
23
+ const followButton = document.querySelector('.follow-btn');
24
+ const displayStyle = window.getComputedStyle(followButton)['display'];
25
+ assert.isNotNull(followButton);
26
+ assert.notStrictEqual(displayStyle, 'none');
27
+ ```
28
+
29
+ The `.follow-btn` element should have the `align-items` property set to a value of `center`.
30
+
31
+ ```js
32
+ const followButton = document.querySelector('.follow-btn');
33
+ const alignItems = window.getComputedStyle(followButton)['align-items'];
34
+ assert.strictEqual(alignItems, 'center');
35
+ ```
36
+
37
+ # --seed--
38
+
39
+ ## --seed-contents--
40
+
41
+ ```html
42
+ <style>
43
+ body {
44
+ font-family: Arial, sans-serif;
45
+ }
46
+ header,
47
+ footer {
48
+ display: flex;
49
+ flex-direction: row;
50
+ }
51
+ header .profile-thumbnail {
52
+ width: 50px;
53
+ height: 50px;
54
+ border-radius: 4px;
55
+ }
56
+ header .profile-name {
57
+ display: flex;
58
+ flex-direction: column;
59
+ justify-content: center;
60
+ margin-left: 10px;
61
+ }
62
+ header .follow-btn {
63
+ display: flex;
64
+
65
+ margin: 0 0 0 auto;
66
+ }
67
+ header .follow-btn button {
68
+ border: 0;
69
+ border-radius: 3px;
70
+ padding: 5px;
71
+ }
72
+ header h3,
73
+ header h4 {
74
+ display: flex;
75
+ margin: 0;
76
+ }
77
+ #inner p {
78
+ margin-bottom: 10px;
79
+ font-size: 20px;
80
+ }
81
+ #inner hr {
82
+ margin: 20px 0;
83
+ border-style: solid;
84
+ opacity: 0.1;
85
+ }
86
+ footer .stats {
87
+ display: flex;
88
+ font-size: 15px;
89
+ }
90
+ footer .stats strong {
91
+ font-size: 18px;
92
+ }
93
+ footer .stats .likes {
94
+ margin-left: 10px;
95
+ }
96
+ footer .cta {
97
+ margin-left: auto;
98
+ }
99
+ footer .cta button {
100
+ border: 0;
101
+ background: transparent;
102
+ }
103
+ </style>
104
+ <header>
105
+ <img
106
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
107
+ alt="Quincy Larson's profile picture"
108
+ class="profile-thumbnail"
109
+ />
110
+ <div class="profile-name">
111
+ <h3>Quincy Larson</h3>
112
+ <h4>@ossia</h4>
113
+ </div>
114
+ <div class="follow-btn">
115
+ <button>Follow</button>
116
+ </div>
117
+ </header>
118
+ <div id="inner">
119
+ <p>
120
+ I meet so many people who are in search of that one trick that will help
121
+ them work smart. Even if you work smart, you still have to work hard.
122
+ </p>
123
+ <span class="date">1:32 PM - 12 Jan 2018</span>
124
+ <hr />
125
+ </div>
126
+ <footer>
127
+ <div class="stats">
128
+ <div class="Retweets"><strong>107</strong> Retweets</div>
129
+ <div class="likes"><strong>431</strong> Likes</div>
130
+ </div>
131
+ <div class="cta">
132
+ <button class="share-btn">Share</button>
133
+ <button class="retweet-btn">Retweet</button>
134
+ <button class="like-btn">Like</button>
135
+ </div>
136
+ </footer>
137
+ ```
138
+
139
+ # --solutions--
140
+
141
+ ```html
142
+ <style>
143
+ body {
144
+ font-family: Arial, sans-serif;
145
+ }
146
+ header,
147
+ footer {
148
+ display: flex;
149
+ flex-direction: row;
150
+ }
151
+ header .profile-thumbnail {
152
+ width: 50px;
153
+ height: 50px;
154
+ border-radius: 4px;
155
+ }
156
+ header .profile-name {
157
+ display: flex;
158
+ flex-direction: column;
159
+ justify-content: center;
160
+ margin-left: 10px;
161
+ }
162
+ header .follow-btn {
163
+ display: flex;
164
+ align-items: center;
165
+ margin: 0 0 0 auto;
166
+ }
167
+ header .follow-btn button {
168
+ border: 0;
169
+ border-radius: 3px;
170
+ padding: 5px;
171
+ }
172
+ header h3,
173
+ header h4 {
174
+ display: flex;
175
+ margin: 0;
176
+ }
177
+ #inner p {
178
+ margin-bottom: 10px;
179
+ font-size: 20px;
180
+ }
181
+ #inner hr {
182
+ margin: 20px 0;
183
+ border-style: solid;
184
+ opacity: 0.1;
185
+ }
186
+ footer .stats {
187
+ display: flex;
188
+ font-size: 15px;
189
+ }
190
+ footer .stats strong {
191
+ font-size: 18px;
192
+ }
193
+ footer .stats .likes {
194
+ margin-left: 10px;
195
+ }
196
+ footer .cta {
197
+ margin-left: auto;
198
+ }
199
+ footer .cta button {
200
+ border: 0;
201
+ background: transparent;
202
+ }
203
+ </style>
204
+ <header>
205
+ <img
206
+ src="https://cdn.freecodecamp.org/curriculum/legacy-css-flexbox/quincy-twitter-photo.jpg"
207
+ alt="Quincy Larson's profile picture"
208
+ class="profile-thumbnail"
209
+ />
210
+ <div class="profile-name">
211
+ <h3>Quincy Larson</h3>
212
+ <h4>@ossia</h4>
213
+ </div>
214
+ <div class="follow-btn">
215
+ <button>Follow</button>
216
+ </div>
217
+ </header>
218
+ <div id="inner">
219
+ <p>
220
+ I meet so many people who are in search of that one trick that will help
221
+ them work smart. Even if you work smart, you still have to work hard.
222
+ </p>
223
+ <span class="date">1:32 PM - 12 Jan 2018</span>
224
+ <hr />
225
+ </div>
226
+ <footer>
227
+ <div class="stats">
228
+ <div class="Retweets"><strong>107</strong> Retweets</div>
229
+ <div class="likes"><strong>431</strong> Likes</div>
230
+ </div>
231
+ <div class="cta">
232
+ <button class="share-btn">Share</button>
233
+ <button class="retweet-btn">Retweet</button>
234
+ <button class="like-btn">Like</button>
235
+ </div>
236
+ </footer>
237
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512afa.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ad367417b2b2512afa
3
+ title: Use the flex-wrap Property to Wrap a Row or Column
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cQv9ZtG'
6
+ forumTopicId: 301114
7
+ dashedName: use-the-flex-wrap-property-to-wrap-a-row-or-column
8
+ ---
9
+
10
+ # --description--
11
+
12
+ CSS flexbox has a feature to split a flex container into multiple rows (or columns). By default, a flex container will fit all flex items together. For example, a row will all be on one line.
13
+
14
+ However, using the `flex-wrap` property tells CSS to wrap items. This means extra items move into a new row or column. The break point of where the wrapping happens depends on the size of the items and the size of the container.
15
+
16
+ CSS also has options for the direction of the wrap:
17
+
18
+ <ul><li><code>nowrap</code>: this is the default setting, and does not wrap items.</li><li><code>wrap</code>: wraps items onto multiple lines from top-to-bottom if they are in rows and left-to-right if they are in columns.</li><li><code>wrap-reverse</code>: wraps items onto multiple lines from bottom-to-top if they are in rows and right-to-left if they are in columns.</li></ul>
19
+
20
+ # --instructions--
21
+
22
+ The current layout has too many boxes for one row. Add the CSS property `flex-wrap` to the `#box-container` element, and give it a value of `wrap`.
23
+
24
+ # --hints--
25
+
26
+ The `#box-container` element should have the `flex-wrap` property set to a value of `wrap`.
27
+
28
+ ```js
29
+ const boxContainer = document.querySelector('#box-container');
30
+ const flexWrap = window.getComputedStyle(boxContainer)['flex-wrap'];
31
+ assert.strictEqual(flexWrap, 'wrap');
32
+ ```
33
+
34
+ # --seed--
35
+
36
+ ## --seed-contents--
37
+
38
+ ```html
39
+ <style>
40
+ #box-container {
41
+ background: gray;
42
+ display: flex;
43
+ height: 100%;
44
+
45
+ }
46
+ #box-1 {
47
+ background-color: dodgerblue;
48
+ width: 25%;
49
+ height: 50%;
50
+ }
51
+
52
+ #box-2 {
53
+ background-color: orangered;
54
+ width: 25%;
55
+ height: 50%;
56
+ }
57
+ #box-3 {
58
+ background-color: violet;
59
+ width: 25%;
60
+ height: 50%;
61
+ }
62
+ #box-4 {
63
+ background-color: yellow;
64
+ width: 25%;
65
+ height: 50%;
66
+ }
67
+ #box-5 {
68
+ background-color: green;
69
+ width: 25%;
70
+ height: 50%;
71
+ }
72
+ #box-6 {
73
+ background-color: black;
74
+ width: 25%;
75
+ height: 50%;
76
+ }
77
+ </style>
78
+
79
+ <div id="box-container">
80
+ <div id="box-1"></div>
81
+ <div id="box-2"></div>
82
+ <div id="box-3"></div>
83
+ <div id="box-4"></div>
84
+ <div id="box-5"></div>
85
+ <div id="box-6"></div>
86
+ </div>
87
+ ```
88
+
89
+ # --solutions--
90
+
91
+ ```html
92
+ <style>
93
+ #box-container {
94
+ background: gray;
95
+ display: flex;
96
+ height: 100%;
97
+ flex-wrap: wrap;
98
+ }
99
+ #box-1 {
100
+ background-color: dodgerblue;
101
+ width: 25%;
102
+ height: 50%;
103
+ }
104
+
105
+ #box-2 {
106
+ background-color: orangered;
107
+ width: 25%;
108
+ height: 50%;
109
+ }
110
+ #box-3 {
111
+ background-color: violet;
112
+ width: 25%;
113
+ height: 50%;
114
+ }
115
+ #box-4 {
116
+ background-color: yellow;
117
+ width: 25%;
118
+ height: 50%;
119
+ }
120
+ #box-5 {
121
+ background-color: green;
122
+ width: 25%;
123
+ height: 50%;
124
+ }
125
+ #box-6 {
126
+ background-color: black;
127
+ width: 25%;
128
+ height: 50%;
129
+ }
130
+ </style>
131
+
132
+ <div id="box-container">
133
+ <div id="box-1"></div>
134
+ <div id="box-2"></div>
135
+ <div id="box-3"></div>
136
+ <div id="box-4"></div>
137
+ <div id="box-5"></div>
138
+ <div id="box-6"></div>
139
+ </div>
140
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ad367417b2b2512afb.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ad367417b2b2512afb
3
+ title: Use the flex-shrink Property to Shrink Items
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cd3PBfr'
6
+ forumTopicId: 301113
7
+ dashedName: use-the-flex-shrink-property-to-shrink-items
8
+ ---
9
+
10
+ # --description--
11
+
12
+ So far, all the properties in the challenges apply to the flex container (the parent of the flex items). However, there are several useful properties for the flex items.
13
+
14
+ The first is the `flex-shrink` property. When it's used, it allows an item to shrink if the flex container is too small. Items shrink when the width of the parent container is smaller than the combined widths of all the flex items within it.
15
+
16
+ The `flex-shrink` property takes numbers as values. The higher the number, the more it will shrink compared to the other items in the container. For example, if one item has a `flex-shrink` value of `1` and the other has a `flex-shrink` value of `3`, the one with the value of `3` will shrink three times as much as the other.
17
+
18
+ # --instructions--
19
+
20
+ Add the CSS property `flex-shrink` to both `#box-1` and `#box-2`. Give `#box-1` a value of `1` and `#box-2` a value of `2`.
21
+
22
+ # --hints--
23
+
24
+ The `#box-1` element should have the `flex-shrink` property set to a value of `1`.
25
+
26
+ ```js
27
+ const boxOne = document.querySelector('#box-1');
28
+ const flexShrink = window.getComputedStyle(boxOne)['flex-shrink'];
29
+ assert.equal(flexShrink, '1');
30
+ ```
31
+
32
+ The `#box-2` element should have the `flex-shrink` property set to a value of `2`.
33
+
34
+ ```js
35
+ const boxTwo = document.querySelector('#box-2');
36
+ const flexShrink = window.getComputedStyle(boxTwo)['flex-shrink'];
37
+ assert.equal(flexShrink, '2');
38
+ ```
39
+
40
+ # --seed--
41
+
42
+ ## --seed-contents--
43
+
44
+ ```html
45
+ <style>
46
+ #box-container {
47
+ display: flex;
48
+ height: 500px;
49
+ }
50
+ #box-1 {
51
+ background-color: dodgerblue;
52
+ width: 100%;
53
+ height: 200px;
54
+
55
+ }
56
+
57
+ #box-2 {
58
+ background-color: orangered;
59
+ width: 100%;
60
+ height: 200px;
61
+
62
+ }
63
+ </style>
64
+
65
+ <div id="box-container">
66
+ <div id="box-1"></div>
67
+ <div id="box-2"></div>
68
+ </div>
69
+ ```
70
+
71
+ # --solutions--
72
+
73
+ ```html
74
+ <style>
75
+ #box-container {
76
+ display: flex;
77
+ height: 500px;
78
+ }
79
+ #box-1 {
80
+ background-color: dodgerblue;
81
+ width: 100%;
82
+ height: 200px;
83
+ flex-shrink: 1;
84
+ }
85
+
86
+ #box-2 {
87
+ background-color: orangered;
88
+ width: 100%;
89
+ height: 200px;
90
+ flex-shrink: 2;
91
+ }
92
+ </style>
93
+
94
+ <div id="box-container">
95
+ <div id="box-1"></div>
96
+ <div id="box-2"></div>
97
+ </div>
98
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afc.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ae367417b2b2512afc
3
+ title: Use the flex-grow Property to Expand Items
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c2p78cg'
6
+ forumTopicId: 301111
7
+ dashedName: use-the-flex-grow-property-to-expand-items
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The opposite of `flex-shrink` is the `flex-grow` property. Recall that `flex-shrink` controls the size of the items when the container shrinks. The `flex-grow` property controls the size of items when the parent container expands.
13
+
14
+ Using a similar example from the last challenge, if one item has a `flex-grow` value of `1` and the other has a `flex-grow` value of `3`, the one with the value of `3` will grow three times as much as the other.
15
+
16
+ # --instructions--
17
+
18
+ Add the CSS property `flex-grow` to both `#box-1` and `#box-2`. Give `#box-1` a value of `1` and `#box-2` a value of `2`.
19
+
20
+ # --hints--
21
+
22
+ The `#box-1` element should have the `flex-grow` property set to a value of `1`.
23
+
24
+ ```js
25
+ const boxOne = document.querySelector('#box-1');
26
+ const flexGrow = window.getComputedStyle(boxOne)['flex-grow'];
27
+ assert.equal(flexGrow, '1');
28
+ ```
29
+
30
+ The `#box-2` element should have the `flex-grow` property set to a value of `2`.
31
+
32
+ ```js
33
+ const boxTwo = document.querySelector('#box-2');
34
+ const flexGrow = window.getComputedStyle(boxTwo)['flex-grow'];
35
+ assert.equal(flexGrow, '2');
36
+ ```
37
+
38
+ # --seed--
39
+
40
+ ## --seed-contents--
41
+
42
+ ```html
43
+ <style>
44
+ #box-container {
45
+ display: flex;
46
+ height: 500px;
47
+ }
48
+
49
+ #box-1 {
50
+ background-color: dodgerblue;
51
+ height: 200px;
52
+
53
+ }
54
+
55
+ #box-2 {
56
+ background-color: orangered;
57
+ height: 200px;
58
+
59
+ }
60
+ </style>
61
+
62
+ <div id="box-container">
63
+ <div id="box-1"></div>
64
+ <div id="box-2"></div>
65
+ </div>
66
+ ```
67
+
68
+ # --solutions--
69
+
70
+ ```html
71
+ <style>
72
+ #box-container {
73
+ display: flex;
74
+ height: 500px;
75
+ }
76
+
77
+ #box-1 {
78
+ background-color: dodgerblue;
79
+ height: 200px;
80
+ flex-grow: 1;
81
+ }
82
+
83
+ #box-2 {
84
+ background-color: orangered;
85
+ height: 200px;
86
+ flex-grow: 2;
87
+ }
88
+ </style>
89
+
90
+ <div id="box-container">
91
+ <div id="box-1"></div>
92
+ <div id="box-2"></div>
93
+ </div>
94
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afd.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ae367417b2b2512afd
3
+ title: Use the flex-basis Property to Set the Initial Size of an Item
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/c3d9nCa'
6
+ forumTopicId: 301108
7
+ dashedName: use-the-flex-basis-property-to-set-the-initial-size-of-an-item
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The `flex-basis` property specifies the initial size of the item before CSS makes adjustments with `flex-shrink` or `flex-grow`.
13
+
14
+ The units used by the `flex-basis` property are the same as other size properties (`px`, `em`, `%`, etc.). The value `auto` sizes items based on the content.
15
+
16
+ # --instructions--
17
+
18
+ Set the initial size of the boxes using `flex-basis`. Add the CSS property `flex-basis` to both `#box-1` and `#box-2`. Give `#box-1` a value of `10em` and `#box-2` a value of `20em`.
19
+
20
+ # --hints--
21
+
22
+ The `#box-1` element should have the `flex-basis` property.
23
+
24
+ ```js
25
+ const boxOne = document.querySelector('#box-1');
26
+ const flexBasis = window.getComputedStyle(boxOne)['flex-basis'];
27
+ assert.notStrictEqual(flexBasis, 'auto');
28
+ ```
29
+
30
+ The `#box-1` element should have a `flex-basis` value of `10em`.
31
+
32
+ ```js
33
+ assert.match(code, /#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g);
34
+ ```
35
+
36
+ The `#box-2` element should have the `flex-basis` property.
37
+
38
+ ```js
39
+ const boxTwo = document.querySelector('#box-2');
40
+ const flexBasis = window.getComputedStyle(boxTwo)['flex-basis'];
41
+ assert.notStrictEqual(flexBasis, 'auto');
42
+ ```
43
+
44
+ The `#box-2` element should have a `flex-basis` value of `20em`.
45
+
46
+ ```js
47
+ assert.match(code, /#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g);
48
+ ```
49
+
50
+ # --seed--
51
+
52
+ ## --seed-contents--
53
+
54
+ ```html
55
+ <style>
56
+ #box-container {
57
+ display: flex;
58
+ height: 500px;
59
+ }
60
+
61
+ #box-1 {
62
+ background-color: dodgerblue;
63
+ height: 200px;
64
+
65
+ }
66
+
67
+ #box-2 {
68
+ background-color: orangered;
69
+ height: 200px;
70
+
71
+ }
72
+ </style>
73
+
74
+ <div id="box-container">
75
+ <div id="box-1"></div>
76
+ <div id="box-2"></div>
77
+ </div>
78
+ ```
79
+
80
+ # --solutions--
81
+
82
+ ```html
83
+ <style>
84
+ #box-container {
85
+ display: flex;
86
+ height: 500px;
87
+ }
88
+
89
+ #box-1 {
90
+ background-color: dodgerblue;
91
+ height: 200px;
92
+ flex-basis: 10em;
93
+ }
94
+
95
+ #box-2 {
96
+ background-color: orangered;
97
+ height: 200px;
98
+ flex-basis: 20em;
99
+ }
100
+ </style>
101
+
102
+ <div id="box-container">
103
+ <div id="box-1"></div>
104
+ <div id="box-2"></div>
105
+ </div>
106
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512afe.md ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ae367417b2b2512afe
3
+ title: Use the flex Shorthand Property
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cbpW2tE'
6
+ forumTopicId: 301112
7
+ dashedName: use-the-flex-shorthand-property
8
+ ---
9
+
10
+ # --description--
11
+
12
+ There is a shortcut available to set several flex properties at once. The `flex-grow`, `flex-shrink`, and `flex-basis` properties can all be set together by using the `flex` property.
13
+
14
+ For example, `flex: 1 0 10px;` will set the item to `flex-grow: 1;`, `flex-shrink: 0;`, and `flex-basis: 10px;`.
15
+
16
+ The default property settings are `flex: 0 1 auto;`.
17
+
18
+ # --instructions--
19
+
20
+ Add the CSS property `flex` to both `#box-1` and `#box-2`. Give `#box-1` the values so its `flex-grow` is `2`, its `flex-shrink` is `2`, and its `flex-basis` is `150px`. Give `#box-2` the values so its `flex-grow` is `1`, its `flex-shrink` is `1`, and its `flex-basis` is `150px`.
21
+
22
+ These values will cause `#box-1` to grow to fill the extra space at twice the rate of `#box-2` when the container is greater than 300px and shrink at twice the rate of `#box-2` when the container is less than 300px. 300px is the combined size of the `flex-basis` values of the two boxes.
23
+
24
+ # --hints--
25
+
26
+ The `#box-1` element should have the `flex` property set to a value of `2 2 150px`.
27
+
28
+ ```js
29
+ const boxOne = document.querySelector('#box-1');
30
+ const flexGrow = window.getComputedStyle(boxOne)['flex-grow'];
31
+ const flexShrink = window.getComputedStyle(boxOne)['flex-shrink'];
32
+ const flexBasis = window.getComputedStyle(boxOne)['flex-basis'];
33
+
34
+ assert.equal(flexGrow, '2');
35
+ assert.equal(flexShrink, '2');
36
+ assert.equal(flexBasis, '150px');
37
+ ```
38
+
39
+ The `#box-2` element should have the `flex` property set to a value of `1 1 150px`.
40
+
41
+ ```js
42
+ const boxTwo = document.querySelector('#box-2');
43
+ const flexGrow = window.getComputedStyle(boxTwo)['flex-grow'];
44
+ const flexShrink = window.getComputedStyle(boxTwo)['flex-shrink'];
45
+ const flexBasis = window.getComputedStyle(boxTwo)['flex-basis'];
46
+
47
+ assert.equal(flexGrow, '1');
48
+ assert.equal(flexShrink, '1');
49
+ assert.equal(flexBasis, '150px');
50
+ ```
51
+
52
+ Your code should use the `flex` property for `#box-1` and `#box-2`.
53
+
54
+ ```js
55
+ assert.lengthOf(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g), 2);
56
+ ```
57
+
58
+ # --seed--
59
+
60
+ ## --seed-contents--
61
+
62
+ ```html
63
+ <style>
64
+ #box-container {
65
+ display: flex;
66
+ height: 500px;
67
+ }
68
+ #box-1 {
69
+ background-color: dodgerblue;
70
+
71
+ height: 200px;
72
+ }
73
+
74
+ #box-2 {
75
+ background-color: orangered;
76
+
77
+ height: 200px;
78
+ }
79
+ </style>
80
+
81
+ <div id="box-container">
82
+ <div id="box-1"></div>
83
+ <div id="box-2"></div>
84
+ </div>
85
+ ```
86
+
87
+ # --solutions--
88
+
89
+ ```html
90
+ <style>
91
+ #box-container {
92
+ display: flex;
93
+ height: 500px;
94
+ }
95
+ #box-1 {
96
+ background-color: dodgerblue;
97
+ flex: 2 2 150px;
98
+ height: 200px;
99
+ }
100
+
101
+ #box-2 {
102
+ background-color: orangered;
103
+ flex: 1 1 150px;
104
+ height: 200px;
105
+ }
106
+ </style>
107
+
108
+ <div id="box-container">
109
+ <div id="box-1"></div>
110
+ <div id="box-2"></div>
111
+ </div>
112
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78ae367417b2b2512aff.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78ae367417b2b2512aff
3
+ title: Use the order Property to Rearrange Items
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cMbvNAG'
6
+ forumTopicId: 301116
7
+ dashedName: use-the-order-property-to-rearrange-items
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The `order` property is used to tell CSS the order of how flex items appear in the flex container. By default, items will appear in the same order they come in the source HTML. The property takes numbers as values, and negative numbers can be used.
13
+
14
+ # --instructions--
15
+
16
+ Add the CSS property `order` to both `#box-1` and `#box-2`. Give `#box-1` a value of `2` and give `#box-2` a value of `1`.
17
+
18
+ # --hints--
19
+
20
+ The `#box-1` element should have the `order` property set to a value of `2`.
21
+
22
+ ```js
23
+ const boxOne = document.querySelector('#box-1');
24
+ const order = window.getComputedStyle(boxOne)['order'];
25
+ assert.strictEqual(order, '2');
26
+ ```
27
+
28
+ The `#box-2` element should have the `order` property set to a value of `1`.
29
+
30
+ ```js
31
+ const boxTwo = document.querySelector('#box-2');
32
+ const order = window.getComputedStyle(boxTwo)['order'];
33
+ assert.strictEqual(order, '1');
34
+ ```
35
+
36
+ # --seed--
37
+
38
+ ## --seed-contents--
39
+
40
+ ```html
41
+ <style>
42
+ #box-container {
43
+ display: flex;
44
+ height: 500px;
45
+ }
46
+ #box-1 {
47
+ background-color: dodgerblue;
48
+
49
+ height: 200px;
50
+ width: 200px;
51
+ }
52
+
53
+ #box-2 {
54
+ background-color: orangered;
55
+
56
+ height: 200px;
57
+ width: 200px;
58
+ }
59
+ </style>
60
+
61
+ <div id="box-container">
62
+ <div id="box-1"></div>
63
+ <div id="box-2"></div>
64
+ </div>
65
+ ```
66
+
67
+ # --solutions--
68
+
69
+ ```html
70
+ <style>
71
+ #box-container {
72
+ display: flex;
73
+ height: 500px;
74
+ }
75
+ #box-1 {
76
+ background-color: dodgerblue;
77
+ order: 2;
78
+ height: 200px;
79
+ width: 200px;
80
+ }
81
+
82
+ #box-2 {
83
+ background-color: orangered;
84
+ order: 1;
85
+ height: 200px;
86
+ width: 200px;
87
+ }
88
+ </style>
89
+
90
+ <div id="box-container">
91
+ <div id="box-1"></div>
92
+ <div id="box-2"></div>
93
+ </div>
94
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-flexbox/587d78af367417b2b2512b00.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 587d78af367417b2b2512b00
3
+ title: Use the align-self Property
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pVaDAv/cMbvzfv'
6
+ forumTopicId: 301107
7
+ dashedName: use-the-align-self-property
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The final property for flex items is `align-self`. This property allows you to adjust each item's alignment individually, instead of setting them all at once. This is useful since other common adjustment techniques using the CSS properties `float`, `clear`, and `vertical-align` do not work on flex items.
13
+
14
+ `align-self` accepts the same values as `align-items` and will override any value set by the `align-items` property.
15
+
16
+ # --instructions--
17
+
18
+ Add the CSS property `align-self` to both `#box-1` and `#box-2`. Give `#box-1` a value of `center` and give `#box-2` a value of `flex-end`.
19
+
20
+ # --hints--
21
+
22
+ The `#box-1` element should have the `align-self` property set to a value of `center`.
23
+
24
+ ```js
25
+ const boxOne = document.querySelector('#box-1');
26
+ const alignment = window.getComputedStyle(boxOne)['align-self'];
27
+ assert.strictEqual(alignment, 'center');
28
+ ```
29
+
30
+ The `#box-2` element should have the `align-self` property set to a value of `flex-end`.
31
+
32
+ ```js
33
+ const boxTwo = document.querySelector('#box-2');
34
+ const alignment = window.getComputedStyle(boxTwo)['align-self'];
35
+ assert.strictEqual(alignment, 'flex-end');
36
+ ```
37
+
38
+ # --seed--
39
+
40
+ ## --seed-contents--
41
+
42
+ ```html
43
+ <style>
44
+ #box-container {
45
+ display: flex;
46
+ height: 500px;
47
+ }
48
+ #box-1 {
49
+ background-color: dodgerblue;
50
+
51
+ height: 200px;
52
+ width: 200px;
53
+ }
54
+
55
+ #box-2 {
56
+ background-color: orangered;
57
+
58
+ height: 200px;
59
+ width: 200px;
60
+ }
61
+ </style>
62
+
63
+ <div id="box-container">
64
+ <div id="box-1"></div>
65
+ <div id="box-2"></div>
66
+ </div>
67
+ ```
68
+
69
+ # --solutions--
70
+
71
+ ```html
72
+ <style>
73
+ #box-container {
74
+ display: flex;
75
+ height: 500px;
76
+ }
77
+ #box-1 {
78
+ background-color: dodgerblue;
79
+ align-self: center;
80
+ height: 200px;
81
+ width: 200px;
82
+ }
83
+
84
+ #box-2 {
85
+ background-color: orangered;
86
+ align-self: flex-end;
87
+ height: 200px;
88
+ width: 200px;
89
+ }
90
+ </style>
91
+
92
+ <div id="box-container">
93
+ <div id="box-1"></div>
94
+ <div id="box-2"></div>
95
+ </div>
96
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a858944d96184f06fd60d61.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a858944d96184f06fd60d61
3
+ title: Create Your First CSS Grid
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cqwREC4'
6
+ forumTopicId: 301129
7
+ dashedName: create-your-first-css-grid
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Turn any HTML element into a grid container by setting its `display` property to `grid`. This gives you the ability to use all the other properties associated with CSS Grid.
13
+
14
+ **Note:** In CSS Grid, the parent element is referred to as the <dfn>container</dfn> and its children are called <dfn>items</dfn>.
15
+
16
+ # --instructions--
17
+
18
+ Change the display of the div with the `container` class to `grid`.
19
+
20
+ # --hints--
21
+
22
+ `container` class should have a `display` property with a value of `grid`.
23
+
24
+ ```js
25
+ assert.match(code, /.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi);
26
+ ```
27
+
28
+ # --seed--
29
+
30
+ ## --seed-contents--
31
+
32
+ ```html
33
+ <style>
34
+ .d1 {
35
+ background: LightSkyBlue;
36
+ }
37
+ .d2 {
38
+ background: LightSalmon;
39
+ }
40
+ .d3 {
41
+ background: PaleTurquoise;
42
+ }
43
+ .d4 {
44
+ background: LightPink;
45
+ }
46
+ .d5 {
47
+ background: PaleGreen;
48
+ }
49
+
50
+ .container {
51
+ font-size: 40px;
52
+ width: 100%;
53
+ background: LightGray;
54
+ /* Only change code below this line */
55
+
56
+
57
+ /* Only change code above this line */
58
+ }
59
+ </style>
60
+
61
+ <div class="container">
62
+ <div class="d1">1</div>
63
+ <div class="d2">2</div>
64
+ <div class="d3">3</div>
65
+ <div class="d4">4</div>
66
+ <div class="d5">5</div>
67
+ </div>
68
+ ```
69
+
70
+ # --solutions--
71
+
72
+ ```html
73
+ <style>
74
+ .container {
75
+ display: grid;
76
+ }
77
+ </style>
78
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036d038fddaf9a66b5d32.md ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036d038fddaf9a66b5d32
3
+ title: Add Columns with grid-template-columns
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/c7NzDHv'
6
+ forumTopicId: 301117
7
+ dashedName: add-columns-with-grid-template-columns
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Simply creating a grid element doesn't get you very far. You need to define the structure of the grid as well. To add some columns to the grid, use the `grid-template-columns` property on a grid container as demonstrated below:
13
+
14
+ ```css
15
+ .container {
16
+ display: grid;
17
+ grid-template-columns: 50px 50px;
18
+ }
19
+ ```
20
+
21
+ This will give your grid two columns that are each 50px wide. The number of parameters given to the `grid-template-columns` property indicates the number of columns in the grid, and the value of each parameter indicates the width of each column.
22
+
23
+ # --instructions--
24
+
25
+ Give the grid container three columns that are each `100px` wide.
26
+
27
+ # --hints--
28
+
29
+ `container` class should have a `grid-template-columns` property with three units of `100px`.
30
+
31
+ ```js
32
+ const templateColumns = new __helpers.CSSHelp(document).getStyle(
33
+ '.container'
34
+ )?.gridTemplateColumns;
35
+ assert.strictEqual(templateColumns, '100px 100px 100px');
36
+ ```
37
+
38
+ # --seed--
39
+
40
+ ## --seed-contents--
41
+
42
+ ```html
43
+ <style>
44
+ .d1 {
45
+ background: LightSkyBlue;
46
+ }
47
+ .d2 {
48
+ background: LightSalmon;
49
+ }
50
+ .d3 {
51
+ background: PaleTurquoise;
52
+ }
53
+ .d4 {
54
+ background: LightPink;
55
+ }
56
+ .d5 {
57
+ background: PaleGreen;
58
+ }
59
+
60
+ .container {
61
+ font-size: 40px;
62
+ width: 100%;
63
+ background: LightGray;
64
+ display: grid;
65
+ /* Only change code below this line */
66
+
67
+
68
+ /* Only change code above this line */
69
+ }
70
+ </style>
71
+
72
+ <div class="container">
73
+ <div class="d1">1</div>
74
+ <div class="d2">2</div>
75
+ <div class="d3">3</div>
76
+ <div class="d4">4</div>
77
+ <div class="d5">5</div>
78
+ </div>
79
+ ```
80
+
81
+ # --solutions--
82
+
83
+ ```html
84
+ <style>
85
+ .container {
86
+ grid-template-columns: 100px 100px 100px;
87
+ }
88
+ </style>
89
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036e138fddaf9a66b5d33.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036e138fddaf9a66b5d33
3
+ title: Add Rows with grid-template-rows
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cbp9Pua'
6
+ forumTopicId: 301119
7
+ dashedName: add-rows-with-grid-template-rows
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The grid you created in the last challenge will set the number of rows automatically. To adjust the rows manually, use the `grid-template-rows` property in the same way you used `grid-template-columns` in the previous challenge.
13
+
14
+ # --instructions--
15
+
16
+ Add two rows to the grid that are `50px` tall each.
17
+
18
+ # --hints--
19
+
20
+ `container` class should have a `grid-template-rows` property with two units of `50px`.
21
+
22
+ ```js
23
+ assert.match(
24
+ code,
25
+ /.container\s*?{[\s\S]*grid-template-rows\s*?:\s*?50px\s*?50px\s*?;[\s\S]*}/gi
26
+ );
27
+ ```
28
+
29
+ # --seed--
30
+
31
+ ## --seed-contents--
32
+
33
+ ```html
34
+ <style>
35
+ .d1 {
36
+ background: LightSkyBlue;
37
+ }
38
+ .d2 {
39
+ background: LightSalmon;
40
+ }
41
+ .d3 {
42
+ background: PaleTurquoise;
43
+ }
44
+ .d4 {
45
+ background: LightPink;
46
+ }
47
+ .d5 {
48
+ background: PaleGreen;
49
+ }
50
+
51
+ .container {
52
+ font-size: 40px;
53
+ width: 100%;
54
+ background: LightGray;
55
+ display: grid;
56
+ grid-template-columns: 100px 100px 100px;
57
+ /* Only change code below this line */
58
+
59
+
60
+ /* Only change code above this line */
61
+ }
62
+ </style>
63
+
64
+ <div class="container">
65
+ <div class="d1">1</div>
66
+ <div class="d2">2</div>
67
+ <div class="d3">3</div>
68
+ <div class="d4">4</div>
69
+ <div class="d5">5</div>
70
+ </div>
71
+ ```
72
+
73
+ # --solutions--
74
+
75
+ ```html
76
+ <style>
77
+ .container {
78
+ grid-template-rows: 50px 50px;
79
+ }
80
+ </style>
81
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d34.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036ee38fddaf9a66b5d34
3
+ title: Use CSS Grid units to Change the Size of Columns and Rows
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cvE8phd'
6
+ forumTopicId: 301134
7
+ dashedName: use-css-grid-units-to-change-the-size-of-columns-and-rows
8
+ ---
9
+
10
+ # --description--
11
+
12
+ You can use absolute and relative units like `px` and `em` in CSS Grid to define the size of rows and columns. You can use these as well:
13
+
14
+ `fr`: sets the column or row to a fraction of the available space,
15
+
16
+ `auto`: sets the column or row to the width or height of its content automatically,
17
+
18
+ `%`: adjusts the column or row to the percent width of its container.
19
+
20
+ Here's the code that generates the output in the preview:
21
+
22
+ ```css
23
+ grid-template-columns: auto 50px 10% 2fr 1fr;
24
+ ```
25
+
26
+ This snippet creates five columns. The first column is as wide as its content, the second column is 50px, the third column is 10% of its container, and for the last two columns; the remaining space is divided into three sections, two are allocated for the fourth column, and one for the fifth.
27
+
28
+ # --instructions--
29
+
30
+ Make a grid with three columns whose widths are as follows: 1fr, 100px, and 2fr.
31
+
32
+ # --hints--
33
+
34
+ Your `container` class should have a `grid-template-columns` property that has three columns with the following widths: `1fr`, `100px`, and `2fr`.
35
+
36
+ ```js
37
+ assert.match(
38
+ code,
39
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi
40
+ );
41
+ ```
42
+
43
+ # --seed--
44
+
45
+ ## --seed-contents--
46
+
47
+ ```html
48
+ <style>
49
+ .d1 {
50
+ background: LightSkyBlue;
51
+ }
52
+ .d2 {
53
+ background: LightSalmon;
54
+ }
55
+ .d3 {
56
+ background: PaleTurquoise;
57
+ }
58
+ .d4 {
59
+ background: LightPink;
60
+ }
61
+ .d5 {
62
+ background: PaleGreen;
63
+ }
64
+
65
+ .container {
66
+ font-size: 40px;
67
+ width: 100%;
68
+ background: LightGray;
69
+ display: grid;
70
+ /* Only change code below this line */
71
+
72
+ grid-template-columns: auto 50px 10% 2fr 1fr;
73
+
74
+ /* Only change code above this line */
75
+ grid-template-rows: 50px 50px;
76
+ }
77
+ </style>
78
+
79
+ <div class="container">
80
+ <div class="d1">1</div>
81
+ <div class="d2">2</div>
82
+ <div class="d3">3</div>
83
+ <div class="d4">4</div>
84
+ <div class="d5">5</div>
85
+ </div>
86
+ ```
87
+
88
+ # --solutions--
89
+
90
+ ```html
91
+ <style>
92
+ .container {
93
+ grid-template-columns: 1fr 100px 2fr;
94
+ }
95
+ </style>
96
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d35.md ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036ee38fddaf9a66b5d35
3
+ title: Create a Column Gap Using grid-column-gap
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cVZ8vfD'
6
+ forumTopicId: 301124
7
+ dashedName: create-a-column-gap-using-grid-column-gap
8
+ ---
9
+
10
+ # --description--
11
+
12
+ So far in the grids you have created, the columns have all been tight up against each other. Sometimes you want a gap in between the columns. To add a gap between the columns, use the `grid-column-gap` property like this:
13
+
14
+ ```css
15
+ grid-column-gap: 10px;
16
+ ```
17
+
18
+ This creates 10px of empty space between all of our columns.
19
+
20
+ # --instructions--
21
+
22
+ Give the columns in the grid a `20px` gap.
23
+
24
+ # --hints--
25
+
26
+ `container` class should have a `grid-column-gap` property that has the value of `20px`.
27
+
28
+ ```js
29
+ assert.match(
30
+ code,
31
+ /.container\s*?{[\s\S]*grid-column-gap\s*?:\s*?20px\s*?;[\s\S]*}/gi
32
+ );
33
+ ```
34
+
35
+ # --seed--
36
+
37
+ ## --seed-contents--
38
+
39
+ ```html
40
+ <style>
41
+ .d1 {
42
+ background: LightSkyBlue;
43
+ }
44
+ .d2 {
45
+ background: LightSalmon;
46
+ }
47
+ .d3 {
48
+ background: PaleTurquoise;
49
+ }
50
+ .d4 {
51
+ background: LightPink;
52
+ }
53
+ .d5 {
54
+ background: PaleGreen;
55
+ }
56
+
57
+ .container {
58
+ font-size: 40px;
59
+ min-height: 300px;
60
+ width: 100%;
61
+ background: LightGray;
62
+ display: grid;
63
+ grid-template-columns: 1fr 1fr 1fr;
64
+ grid-template-rows: 1fr 1fr 1fr;
65
+ /* Only change code below this line */
66
+
67
+
68
+ /* Only change code above this line */
69
+ }
70
+ </style>
71
+
72
+ <div class="container">
73
+ <div class="d1">1</div>
74
+ <div class="d2">2</div>
75
+ <div class="d3">3</div>
76
+ <div class="d4">4</div>
77
+ <div class="d5">5</div>
78
+ </div>
79
+ ```
80
+
81
+ # --solutions--
82
+
83
+ ```html
84
+ <style>
85
+ .container {
86
+ grid-column-gap: 20px;
87
+ }
88
+ </style>
89
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d36.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036ee38fddaf9a66b5d36
3
+ title: Create a Row Gap using grid-row-gap
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cPbJ2Cv'
6
+ forumTopicId: 301125
7
+ dashedName: create-a-row-gap-using-grid-row-gap
8
+ ---
9
+
10
+ # --description--
11
+
12
+ You can add a gap in between the rows of a grid using `grid-row-gap` in the same way that you added a gap in between columns in the previous challenge.
13
+
14
+ # --instructions--
15
+
16
+ Create a gap for the rows that is `5px` tall.
17
+
18
+ # --hints--
19
+
20
+ `container` class should have a `grid-row-gap` property that has the value of `5px`.
21
+
22
+ ```js
23
+ assert.match(
24
+ code,
25
+ /.container\s*?{[\s\S]*grid-row-gap\s*?:\s*?5px\s*?;[\s\S]*}/gi
26
+ );
27
+ ```
28
+
29
+ # --seed--
30
+
31
+ ## --seed-contents--
32
+
33
+ ```html
34
+ <style>
35
+ .d1 {
36
+ background: LightSkyBlue;
37
+ }
38
+ .d2 {
39
+ background: LightSalmon;
40
+ }
41
+ .d3 {
42
+ background: PaleTurquoise;
43
+ }
44
+ .d4 {
45
+ background: LightPink;
46
+ }
47
+ .d5 {
48
+ background: PaleGreen;
49
+ }
50
+
51
+ .container {
52
+ font-size: 40px;
53
+ min-height: 300px;
54
+ width: 100%;
55
+ background: LightGray;
56
+ display: grid;
57
+ grid-template-columns: 1fr 1fr 1fr;
58
+ grid-template-rows: 1fr 1fr 1fr;
59
+ /* Only change code below this line */
60
+
61
+
62
+ /* Only change code above this line */
63
+ }
64
+ </style>
65
+
66
+ <div class="container">
67
+ <div class="d1">1</div>
68
+ <div class="d2">2</div>
69
+ <div class="d3">3</div>
70
+ <div class="d4">4</div>
71
+ <div class="d5">5</div>
72
+ </div>
73
+ ```
74
+
75
+ # --solutions--
76
+
77
+ ```html
78
+ <style>
79
+ .container {
80
+ grid-row-gap: 5px;
81
+ }
82
+ </style>
83
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a9036ee38fddaf9a66b5d37.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a9036ee38fddaf9a66b5d37
3
+ title: Add Gaps Faster with grid-gap
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/ca2qVtv'
6
+ forumTopicId: 301118
7
+ dashedName: add-gaps-faster-with-grid-gap
8
+ ---
9
+
10
+ # --description--
11
+
12
+ `grid-gap` is a shorthand property for `grid-row-gap` and `grid-column-gap` from the previous two challenges that's more convenient to use. If `grid-gap` has one value, it will create a gap between all rows and columns. However, if there are two values, it will use the first one to set the gap between the rows and the second value for the columns.
13
+
14
+ # --instructions--
15
+
16
+ Use `grid-gap` to introduce a `10px` gap between the rows and `20px` gap between the columns.
17
+
18
+ # --hints--
19
+
20
+ `container` class should have a `grid-gap` property that introduces a `10px` gap between the rows and a `20px` gap between the columns.
21
+
22
+ ```js
23
+ assert.match(
24
+ code,
25
+ /.container\s*?{[\s\S]*grid-gap\s*?:\s*?10px\s+?20px\s*?;[\s\S]*}/gi
26
+ );
27
+ ```
28
+
29
+ # --seed--
30
+
31
+ ## --seed-contents--
32
+
33
+ ```html
34
+ <style>
35
+ .d1 {
36
+ background: LightSkyBlue;
37
+ }
38
+ .d2 {
39
+ background: LightSalmon;
40
+ }
41
+ .d3 {
42
+ background: PaleTurquoise;
43
+ }
44
+ .d4 {
45
+ background: LightPink;
46
+ }
47
+ .d5 {
48
+ background: PaleGreen;
49
+ }
50
+
51
+ .container {
52
+ font-size: 40px;
53
+ min-height: 300px;
54
+ width: 100%;
55
+ background: LightGray;
56
+ display: grid;
57
+ grid-template-columns: 1fr 1fr 1fr;
58
+ grid-template-rows: 1fr 1fr 1fr;
59
+ /* Only change code below this line */
60
+
61
+
62
+ /* Only change code above this line */
63
+ }
64
+ </style>
65
+ <div class="container">
66
+ <div class="d1">1</div>
67
+ <div class="d2">2</div>
68
+ <div class="d3">3</div>
69
+ <div class="d4">4</div>
70
+ <div class="d5">5</div>
71
+ </div>
72
+ ```
73
+
74
+ # --solutions--
75
+
76
+ ```html
77
+ <style>
78
+ .container {
79
+ grid-gap: 10px 20px;
80
+ }
81
+ </style>
82
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90372638fddaf9a66b5d38.md ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a90372638fddaf9a66b5d38
3
+ title: Use grid-column to Control Spacing
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cnzkDSr'
6
+ forumTopicId: 301136
7
+ dashedName: use-grid-column-to-control-spacing
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Up to this point, all the properties that have been discussed are for grid containers. The `grid-column` property is the first one for use on the grid items themselves.
13
+
14
+ The hypothetical horizontal and vertical lines that create the grid are referred to as <dfn>lines</dfn>. These lines are numbered starting with 1 at the top left corner of the grid and move right for columns and down for rows, counting upward.
15
+
16
+ This is what the lines look like for a 3x3 grid:
17
+
18
+ <div style='position:relative;margin:auto;background:Gainsboro;display:block;margin-top:100px;margin-bottom:50px;width:200px;height:200px;'><p style='left:25%;top:-30%;font-size:130%;position:absolute;color:RoyalBlue;'>column lines</p><p style='left:0%;top:-15%;font-size:130%;position:absolute;color:RoyalBlue;'>1</p><p style='left:30%;top:-15%;font-size:130%;position:absolute;color:RoyalBlue;'>2</p><p style='left:63%;top:-15%;font-size:130%;position:absolute;color:RoyalBlue;'>3</p><p style='left:95%;top:-15%;font-size:130%;position:absolute;color:RoyalBlue;'>4</p><p style='left:-40%;top:45%;font-size:130%;transform:rotateZ(-90deg);position:absolute;'>row lines</p><p style='left:-10%;top:-10%;font-size:130%;position:absolute;'>1</p><p style='left:-10%;top:21%;font-size:130%;position:absolute;'>2</p><p style='left:-10%;top:53%;font-size:130%;position:absolute;'>3</p><p style='left:-10%;top:85%;font-size:130%;position:absolute;'>4</p><div style='left:0%;top:0%;width:5%;height:100%;background:RoyalBlue;position:absolute;'></div><div style='left:31%;top:0%;width:5%;height:100%;background:RoyalBlue;position:absolute;'></div><div style='left:63%;top:0%;width:5%;height:100%;background:RoyalBlue;position:absolute;'></div><div style='left:95%;top:0%;width:5%;height:100%;background:RoyalBlue;position:absolute;'></div><div style='left:0%;top:0%;width:100%;height:5%;background:black;position:absolute;'></div><div style='left:0%;top:31%;width:100%;height:5%;background:black;position:absolute;'></div><div style='left:0%;top:63%;width:100%;height:5%;background:black;position:absolute;'></div><div style='left:0%;top:95%;width:100%;height:5%;background:black;position:absolute;'></div></div>
19
+
20
+ To control the number of columns an item will consume, you can use the `grid-column` property in conjunction with the line numbers you want the item to start and stop at.
21
+
22
+ Here's an example:
23
+
24
+ ```css
25
+ grid-column: 1 / 3;
26
+ ```
27
+
28
+ This will make the item start at the first vertical line of the grid on the left and span to the 3rd line of the grid, consuming two columns.
29
+
30
+ # --instructions--
31
+
32
+ Make the item with the class `item5` consume the last two columns of the grid.
33
+
34
+ # --hints--
35
+
36
+ `item5` class should have a `grid-column` property.
37
+
38
+ ```js
39
+ const styleElement = document.querySelector('style:not(.fcc-hide-header)');
40
+ assert.match(
41
+ __helpers.removeWhiteSpace(styleElement.textContent),
42
+ /\.item5{.*grid-column:.*}/g
43
+ );
44
+ ```
45
+
46
+ `item5` class should have a `grid-column` property which results in it consuming the last two columns of the grid.
47
+
48
+ ```js
49
+ const itemFive = document.querySelector('.item5');
50
+ const colStart = getComputedStyle(itemFive).gridColumnStart;
51
+ const colEnd = getComputedStyle(itemFive).gridColumnEnd;
52
+ const result = colStart.toString() + colEnd.toString();
53
+ const correctResults = [
54
+ '24',
55
+ '2-1',
56
+ '2span 2',
57
+ '2span2',
58
+ 'span 2-1',
59
+ '-12',
60
+ 'span 2span 2',
61
+ 'span 2auto',
62
+ 'autospan 2'
63
+ ];
64
+ assert.include(correctResults, result);
65
+ ```
66
+
67
+ # --seed--
68
+
69
+ ## --seed-contents--
70
+
71
+ ```html
72
+ <style>
73
+ .item1 {
74
+ background: LightSkyBlue;
75
+ }
76
+ .item2 {
77
+ background: LightSalmon;
78
+ }
79
+ .item3 {
80
+ background: PaleTurquoise;
81
+ }
82
+ .item4 {
83
+ background: LightPink;
84
+ }
85
+
86
+ .item5 {
87
+ background: PaleGreen;
88
+ /* Only change code below this line */
89
+
90
+
91
+ /* Only change code above this line */
92
+ }
93
+
94
+ .container {
95
+ font-size: 40px;
96
+ min-height: 300px;
97
+ width: 100%;
98
+ background: LightGray;
99
+ display: grid;
100
+ grid-template-columns: 1fr 1fr 1fr;
101
+ grid-template-rows: 1fr 1fr 1fr;
102
+ grid-gap: 10px;
103
+ }
104
+ </style>
105
+
106
+ <div class="container">
107
+ <div class="item1">1</div>
108
+ <div class="item2">2</div>
109
+ <div class="item3">3</div>
110
+ <div class="item4">4</div>
111
+ <div class="item5">5</div>
112
+ </div>
113
+ ```
114
+
115
+ # --solutions--
116
+
117
+ ```html
118
+ <style>
119
+ .item1 {
120
+ background: LightSkyBlue;
121
+ }
122
+ .item2 {
123
+ background: LightSalmon;
124
+ }
125
+ .item3 {
126
+ background: PaleTurquoise;
127
+ }
128
+ .item4 {
129
+ background: LightPink;
130
+ }
131
+
132
+ .item5 {
133
+ background: PaleGreen;
134
+ grid-column: 2 / 4;
135
+ }
136
+
137
+ .container {
138
+ font-size: 40px;
139
+ min-height: 300px;
140
+ width: 100%;
141
+ background: LightGray;
142
+ display: grid;
143
+ grid-template-columns: 1fr 1fr 1fr;
144
+ grid-template-rows: 1fr 1fr 1fr;
145
+ grid-gap: 10px;
146
+ }
147
+ </style>
148
+
149
+ <div class="container">
150
+ <div class="item1">1</div>
151
+ <div class="item2">2</div>
152
+ <div class="item3">3</div>
153
+ <div class="item4">4</div>
154
+ <div class="item5">5</div>
155
+ </div>
156
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90373638fddaf9a66b5d39.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a90373638fddaf9a66b5d39
3
+ title: Use grid-row to Control Spacing
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/c9WBLU4'
6
+ forumTopicId: 301137
7
+ dashedName: use-grid-row-to-control-spacing
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Of course, you can make items consume multiple rows just like you can with columns. You define the horizontal lines you want an item to start and stop at using the `grid-row` property on a grid item.
13
+
14
+ # --instructions--
15
+
16
+ Make the element with the `item5` class consume the last two rows.
17
+
18
+ # --hints--
19
+
20
+ `item5` class should have a `grid-row` property.
21
+
22
+ ```js
23
+ const styleElement = document.querySelector('style:not(.fcc-hide-header)');
24
+ assert.match(
25
+ __helpers.removeWhiteSpace(styleElement.textContent),
26
+ /\.item5{.*grid-row:.*}/g
27
+ );
28
+ ```
29
+
30
+ `item5` class should have a `grid-row` property which results in it consuming the last two rows of the grid.
31
+
32
+ ```js
33
+ const itemFive = document.querySelector('.item5');
34
+ const rowStart = getComputedStyle(itemFive).gridRowStart;
35
+ const rowEnd = getComputedStyle(itemFive).gridRowEnd;
36
+ const result = rowStart.toString() + rowEnd.toString();
37
+ const correctResults = [
38
+ '24',
39
+ '2-1',
40
+ '2span 2',
41
+ '2span2',
42
+ 'span 2-1',
43
+ '-12',
44
+ 'span 2span 2',
45
+ 'span 2auto',
46
+ 'autospan 2'
47
+ ];
48
+ assert.include(correctResults, result);
49
+ ```
50
+
51
+ # --seed--
52
+
53
+ ## --seed-contents--
54
+
55
+ ```html
56
+ <style>
57
+ .item1 {
58
+ background: LightSkyBlue;
59
+ }
60
+ .item2 {
61
+ background: LightSalmon;
62
+ }
63
+ .item3 {
64
+ background: PaleTurquoise;
65
+ }
66
+ .item4 {
67
+ background: LightPink;
68
+ }
69
+
70
+ .item5 {
71
+ background: PaleGreen;
72
+ grid-column: 2 / 4;
73
+ /* Only change code below this line */
74
+
75
+ /* Only change code above this line */
76
+ }
77
+
78
+ .container {
79
+ font-size: 40px;
80
+ min-height: 300px;
81
+ width: 100%;
82
+ background: LightGray;
83
+ display: grid;
84
+ grid-template-columns: 1fr 1fr 1fr;
85
+ grid-template-rows: 1fr 1fr 1fr;
86
+ grid-gap: 10px;
87
+ }
88
+ </style>
89
+
90
+ <div class="container">
91
+ <div class="item1">1</div>
92
+ <div class="item2">2</div>
93
+ <div class="item3">3</div>
94
+ <div class="item4">4</div>
95
+ <div class="item5">5</div>
96
+ </div>
97
+ ```
98
+
99
+ # --solutions--
100
+
101
+ ```html
102
+ <style>
103
+ .item1 {
104
+ background: LightSkyBlue;
105
+ }
106
+ .item2 {
107
+ background: LightSalmon;
108
+ }
109
+ .item3 {
110
+ background: PaleTurquoise;
111
+ }
112
+ .item4 {
113
+ background: LightPink;
114
+ }
115
+
116
+ .item5 {
117
+ background: PaleGreen;
118
+ grid-column: 2 / 4;
119
+ grid-row: 2 / 4;
120
+ }
121
+
122
+ .container {
123
+ font-size: 40px;
124
+ min-height: 300px;
125
+ width: 100%;
126
+ background: LightGray;
127
+ display: grid;
128
+ grid-template-columns: 1fr 1fr 1fr;
129
+ grid-template-rows: 1fr 1fr 1fr;
130
+ grid-gap: 10px;
131
+ }
132
+ </style>
133
+
134
+ <div class="container">
135
+ <div class="item1">1</div>
136
+ <div class="item2">2</div>
137
+ <div class="item3">3</div>
138
+ <div class="item4">4</div>
139
+ <div class="item5">5</div>
140
+ </div>
141
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90374338fddaf9a66b5d3a.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a90374338fddaf9a66b5d3a
3
+ title: Align an Item Horizontally using justify-self
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cJbpKHq'
6
+ forumTopicId: 301122
7
+ dashedName: align-an-item-horizontally-using-justify-self
8
+ ---
9
+
10
+ # --description--
11
+
12
+ In CSS Grid, the content of each item is located in a box which is referred to as a <dfn>cell</dfn>. You can align the content's position within its cell horizontally using the `justify-self` property on a grid item. By default, this property has a value of `stretch`, which will make the content fill the whole width of the cell. This CSS Grid property accepts other values as well:
13
+
14
+ `start`: aligns the content at the left of the cell,
15
+
16
+ `center`: aligns the content in the center of the cell,
17
+
18
+ `end`: aligns the content at the right of the cell.
19
+
20
+ # --instructions--
21
+
22
+ Use the `justify-self` property to center the item with the class `item2`.
23
+
24
+ # --hints--
25
+
26
+ `item2` class should have a `justify-self` property that has the value of `center`.
27
+
28
+ ```js
29
+ assert.match(
30
+ code,
31
+ /.item2\s*?{[\s\S]*justify-self\s*?:\s*?center\s*?;[\s\S]*}/gi
32
+ );
33
+ ```
34
+
35
+ # --seed--
36
+
37
+ ## --seed-contents--
38
+
39
+ ```html
40
+ <style>
41
+ .item1 {
42
+ background: LightSkyBlue;
43
+ }
44
+
45
+ .item2 {
46
+ background: LightSalmon;
47
+ /* Only change code below this line */
48
+
49
+
50
+ /* Only change code above this line */
51
+ }
52
+
53
+ .item3 {
54
+ background: PaleTurquoise;
55
+ }
56
+ .item4 {
57
+ background: LightPink;
58
+ }
59
+ .item5 {
60
+ background: PaleGreen;
61
+ }
62
+
63
+ .container {
64
+ font-size: 40px;
65
+ min-height: 300px;
66
+ width: 100%;
67
+ background: LightGray;
68
+ display: grid;
69
+ grid-template-columns: 1fr 1fr 1fr;
70
+ grid-template-rows: 1fr 1fr 1fr;
71
+ grid-gap: 10px;
72
+ }
73
+ </style>
74
+
75
+ <div class="container">
76
+ <div class="item1">1</div>
77
+ <div class="item2">2</div>
78
+ <div class="item3">3</div>
79
+ <div class="item4">4</div>
80
+ <div class="item5">5</div>
81
+ </div>
82
+ ```
83
+
84
+ # --solutions--
85
+
86
+ ```html
87
+ <style>
88
+ .item2 {
89
+ justify-self: center;
90
+ }
91
+ </style>
92
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90375238fddaf9a66b5d3b.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a90375238fddaf9a66b5d3b
3
+ title: Align an Item Vertically using align-self
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cmzd4fz'
6
+ forumTopicId: 301123
7
+ dashedName: align-an-item-vertically-using-align-self
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Just as you can align an item horizontally, there's a way to align an item vertically as well. To do this, you use the `align-self` property on an item. This property accepts all of the same values as `justify-self` from the last challenge.
13
+
14
+ # --instructions--
15
+
16
+ Align the item with the class `item3` vertically at the `end`.
17
+
18
+ # --hints--
19
+
20
+ `item3` class should have a `align-self` property that has the value of `end`.
21
+
22
+ ```js
23
+ assert.match(code, /.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi);
24
+ ```
25
+
26
+ # --seed--
27
+
28
+ ## --seed-contents--
29
+
30
+ ```html
31
+ <style>
32
+ .item1 {
33
+ background: LightSkyBlue;
34
+ }
35
+ .item2 {
36
+ background: LightSalmon;
37
+ }
38
+
39
+ .item3 {
40
+ background: PaleTurquoise;
41
+ /* Only change code below this line */
42
+
43
+
44
+ /* Only change code above this line */
45
+ }
46
+
47
+ .item4 {
48
+ background: LightPink;
49
+ }
50
+ .item5 {
51
+ background: PaleGreen;
52
+ }
53
+
54
+ .container {
55
+ font-size: 40px;
56
+ min-height: 300px;
57
+ width: 100%;
58
+ background: LightGray;
59
+ display: grid;
60
+ grid-template-columns: 1fr 1fr 1fr;
61
+ grid-template-rows: 1fr 1fr 1fr;
62
+ grid-gap: 10px;
63
+ }
64
+ </style>
65
+
66
+ <div class="container">
67
+ <div class="item1">1</div>
68
+ <div class="item2">2</div>
69
+ <div class="item3">3</div>
70
+ <div class="item4">4</div>
71
+ <div class="item5">5</div>
72
+ </div>
73
+ ```
74
+
75
+ # --solutions--
76
+
77
+ ```html
78
+ <style>
79
+ .item3 {
80
+ align-self: end;
81
+ }
82
+ </style>
83
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a90376038fddaf9a66b5d3c.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a90376038fddaf9a66b5d3c
3
+ title: Align All Items Horizontally using justify-items
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cJbpECn'
6
+ forumTopicId: 301120
7
+ dashedName: align-all-items-horizontally-using-justify-items
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Sometimes you want all the items in your CSS Grid to share the same alignment. You can use the previously learned properties and align them individually, or you can align them all at once horizontally by using `justify-items` on your grid container. This property can accept all the same values you learned about in the previous two challenges, the difference being that it will move **all** the items in our grid to the desired alignment.
13
+
14
+ # --instructions--
15
+
16
+ Use this property to center all our items horizontally.
17
+
18
+ # --hints--
19
+
20
+ `container` class should have a `justify-items` property that has the value of `center`.
21
+
22
+ ```js
23
+ assert.match(
24
+ code,
25
+ /.container\s*?{[\s\S]*justify-items\s*?:\s*?center\s*?;[\s\S]*}/gi
26
+ );
27
+ ```
28
+
29
+ # --seed--
30
+
31
+ ## --seed-contents--
32
+
33
+ ```html
34
+ <style>
35
+ .item1 {
36
+ background: LightSkyBlue;
37
+ }
38
+ .item2 {
39
+ background: LightSalmon;
40
+ }
41
+ .item3 {
42
+ background: PaleTurquoise;
43
+ }
44
+ .item4 {
45
+ background: LightPink;
46
+ }
47
+ .item5 {
48
+ background: PaleGreen;
49
+ }
50
+
51
+ .container {
52
+ font-size: 40px;
53
+ min-height: 300px;
54
+ width: 100%;
55
+ background: LightGray;
56
+ display: grid;
57
+ grid-template-columns: 1fr 1fr 1fr;
58
+ grid-template-rows: 1fr 1fr 1fr;
59
+ grid-gap: 10px;
60
+ /* Only change code below this line */
61
+
62
+
63
+ /* Only change code above this line */
64
+ }
65
+ </style>
66
+
67
+ <div class="container">
68
+ <div class="item1">1</div>
69
+ <div class="item2">2</div>
70
+ <div class="item3">3</div>
71
+ <div class="item4">4</div>
72
+ <div class="item5">5</div>
73
+ </div>
74
+ ```
75
+
76
+ # --solutions--
77
+
78
+ ```html
79
+ <style>
80
+ .container {
81
+ justify-items: center;
82
+ }
83
+ </style>
84
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fdf869fb03452672e45b.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fdf869fb03452672e45b
3
+ title: Align All Items Vertically using align-items
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/ckzPeUv'
6
+ forumTopicId: 301121
7
+ dashedName: align-all-items-vertically-using-align-items
8
+ ---
9
+
10
+ # --description--
11
+
12
+ Using the `align-items` property on a grid container will set the vertical alignment for all the items in our grid.
13
+
14
+ # --instructions--
15
+
16
+ Use it now to move all the items to the end of each cell.
17
+
18
+ # --hints--
19
+
20
+ `container` class should have a `align-items` property that has the value of `end`.
21
+
22
+ ```js
23
+ assert.match(
24
+ code,
25
+ /.container\s*?{[\s\S]*align-items\s*?:\s*?end\s*?;[\s\S]*}/gi
26
+ );
27
+ ```
28
+
29
+ # --seed--
30
+
31
+ ## --seed-contents--
32
+
33
+ ```html
34
+ <style>
35
+ .item1 {
36
+ background: LightSkyBlue;
37
+ }
38
+ .item2 {
39
+ background: LightSalmon;
40
+ }
41
+ .item3 {
42
+ background: PaleTurquoise;
43
+ }
44
+ .item4 {
45
+ background: LightPink;
46
+ }
47
+ .item5 {
48
+ background: PaleGreen;
49
+ }
50
+
51
+ .container {
52
+ font-size: 40px;
53
+ min-height: 300px;
54
+ width: 100%;
55
+ background: LightGray;
56
+ display: grid;
57
+ grid-template-columns: 1fr 1fr 1fr;
58
+ grid-template-rows: 1fr 1fr 1fr;
59
+ grid-gap: 10px;
60
+ /* Only change code below this line */
61
+
62
+
63
+ /* Only change code above this line */
64
+ }
65
+ </style>
66
+
67
+ <div class="container">
68
+ <div class="item1">1</div>
69
+ <div class="item2">2</div>
70
+ <div class="item3">3</div>
71
+ <div class="item4">4</div>
72
+ <div class="item5">5</div>
73
+ </div>
74
+ ```
75
+
76
+ # --solutions--
77
+
78
+ ```html
79
+ <style>
80
+ .container {
81
+ align-items: end;
82
+ }
83
+ </style>
84
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe0569fb03452672e45c.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe0569fb03452672e45c
3
+ title: Divide the Grid Into an Area Template
4
+ challengeType: 0
5
+ forumTopicId: 301130
6
+ dashedName: divide-the-grid-into-an-area-template
7
+ ---
8
+
9
+ # --description--
10
+
11
+ You can group cells of your grid together into an <dfn>area</dfn> and give the area a custom name. Do this by using `grid-template-areas` on the container like this:
12
+
13
+ ```css
14
+ grid-template-areas:
15
+ 'header header header'
16
+ 'advert content content'
17
+ 'advert footer footer';
18
+ ```
19
+
20
+ The code above groups the cells of the grid into four areas: `header`, `advert`, `content`, and `footer`. Every word represents a cell and every pair of quotation marks represent a row.
21
+
22
+ # --instructions--
23
+
24
+ Change the template so the `footer` area spans the entire bottom row. Defining the areas won't have any visual effect right now. Later, you will make an item use an area to see how it works.
25
+
26
+ # --hints--
27
+
28
+ `container` class should have a `grid-template-areas` property similar to the example but with the `footer` area spanning the whole bottom row.
29
+
30
+ ```js
31
+ assert.match(
32
+ __helpers.removeCssComments(code),
33
+ /.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?["|']\s*?header\s*?header\s*?header\s*?["|']\s*?["|']\s*?advert\s*?content\s*?content\s*?["|']\s*?["|']\s*?footer\s*?footer\s*?footer\s*?["|']\s*?;[\s\S]*}/gi
34
+ );
35
+ ```
36
+
37
+ # --seed--
38
+
39
+ ## --seed-contents--
40
+
41
+ ```html
42
+ <style>
43
+ .item1 {
44
+ background: LightSkyBlue;
45
+ }
46
+ .item2 {
47
+ background: LightSalmon;
48
+ }
49
+ .item3 {
50
+ background: PaleTurquoise;
51
+ }
52
+ .item4 {
53
+ background: LightPink;
54
+ }
55
+ .item5 {
56
+ background: PaleGreen;
57
+ }
58
+
59
+ .container {
60
+ font-size: 40px;
61
+ min-height: 300px;
62
+ width: 100%;
63
+ background: LightGray;
64
+ display: grid;
65
+ grid-template-columns: 1fr 1fr 1fr;
66
+ grid-template-rows: 1fr 1fr 1fr;
67
+ grid-gap: 10px;
68
+ grid-template-areas:
69
+ /* Only change code below this line */
70
+ 'header header header'
71
+ 'advert content content'
72
+ 'advert footer footer';
73
+ /* Only change code above this line */
74
+ }
75
+ </style>
76
+
77
+ <div class="container">
78
+ <div class="item1">1</div>
79
+ <div class="item2">2</div>
80
+ <div class="item3">3</div>
81
+ <div class="item4">4</div>
82
+ <div class="item5">5</div>
83
+ </div>
84
+ ```
85
+
86
+ # --solutions--
87
+
88
+ ```html
89
+ <style>
90
+ .item1 {
91
+ background: LightSkyBlue;
92
+ }
93
+ .item2 {
94
+ background: LightSalmon;
95
+ }
96
+ .item3 {
97
+ background: PaleTurquoise;
98
+ }
99
+ .item4 {
100
+ background: LightPink;
101
+ }
102
+ .item5 {
103
+ background: PaleGreen;
104
+ }
105
+
106
+ .container {
107
+ font-size: 40px;
108
+ min-height: 300px;
109
+ width: 100%;
110
+ background: LightGray;
111
+ display: grid;
112
+ grid-template-columns: 1fr 1fr 1fr;
113
+ grid-template-rows: 1fr 1fr 1fr;
114
+ grid-gap: 10px;
115
+
116
+ grid-template-areas:
117
+ 'header header header'
118
+ 'advert content content'
119
+ 'footer footer footer';
120
+ }
121
+ </style>
122
+
123
+ <div class="container">
124
+ <div class="item1">1</div>
125
+ <div class="item2">2</div>
126
+ <div class="item3">3</div>
127
+ <div class="item4">4</div>
128
+ <div class="item5">5</div>
129
+ </div>
130
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe1369fb03452672e45d.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe1369fb03452672e45d
3
+ title: Place Items in Grid Areas Using the grid-area Property
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cRrqmtV'
6
+ forumTopicId: 301132
7
+ dashedName: place-items-in-grid-areas-using-the-grid-area-property
8
+ ---
9
+
10
+ # --description--
11
+
12
+ After creating an area template for your grid container, as shown in the previous challenge, you can place an item in your custom area by referencing the name you gave it. To do this, you use the `grid-area` property on an item like this:
13
+
14
+ ```css
15
+ .item1 {
16
+ grid-area: header;
17
+ }
18
+ ```
19
+
20
+ This lets the grid know that you want the `item1` class to go in the area named `header`. In this case, the item will use the entire top row because that whole row is named as the `header` area.
21
+
22
+ # --instructions--
23
+
24
+ Place an element with the `item5` class in the `footer` area using the `grid-area` property.
25
+
26
+ # --hints--
27
+
28
+ `item5` class should have a `grid-area` property that has the value of `footer`.
29
+
30
+ ```js
31
+ assert.match(
32
+ __helpers.removeCssComments(code),
33
+ /.item5\s*?{[\s\S]*grid-area\s*?:\s*?footer\s*?;[\s\S]*}/gi
34
+ );
35
+ ```
36
+
37
+ # --seed--
38
+
39
+ ## --seed-contents--
40
+
41
+ ```html
42
+ <style>
43
+ .item1 {
44
+ background: LightSkyBlue;
45
+ }
46
+ .item2 {
47
+ background: LightSalmon;
48
+ }
49
+ .item3 {
50
+ background: PaleTurquoise;
51
+ }
52
+ .item4 {
53
+ background: LightPink;
54
+ }
55
+
56
+ .item5 {
57
+ background: PaleGreen;
58
+ /* Only change code below this line */
59
+
60
+
61
+ /* Only change code above this line */
62
+ }
63
+
64
+ .container {
65
+ font-size: 40px;
66
+ min-height: 300px;
67
+ width: 100%;
68
+ background: LightGray;
69
+ display: grid;
70
+ grid-template-columns: 1fr 1fr 1fr;
71
+ grid-template-rows: 1fr 1fr 1fr;
72
+ grid-gap: 10px;
73
+ grid-template-areas:
74
+ 'header header header'
75
+ 'advert content content'
76
+ 'footer footer footer';
77
+ }
78
+ </style>
79
+
80
+ <div class="container">
81
+ <div class="item1">1</div>
82
+ <div class="item2">2</div>
83
+ <div class="item3">3</div>
84
+ <div class="item4">4</div>
85
+ <div class="item5">5</div>
86
+ </div>
87
+ ```
88
+
89
+ # --solutions--
90
+
91
+ ```html
92
+ <style>
93
+ .item5 {
94
+ grid-area: footer;
95
+ }
96
+ </style>
97
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe2669fb03452672e45e.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe2669fb03452672e45e
3
+ title: Use grid-area Without Creating an Areas Template
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/c6N7VhK'
6
+ forumTopicId: 301135
7
+ dashedName: use-grid-area-without-creating-an-areas-template
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The `grid-area` property you learned in the last challenge can be used in another way. If your grid doesn't have an areas template to reference, you can create an area on the fly for an item to be placed like this:
13
+
14
+ ```css
15
+ item1 {
16
+ grid-area: 1/1/2/4;
17
+ }
18
+ ```
19
+
20
+ This is using the line numbers you learned about earlier to define where the area for this item will be. The numbers in the example above represent these values:
21
+
22
+ ```css
23
+ grid-area: horizontal line to start at / vertical line to start at / horizontal
24
+ line to end at / vertical line to end at;
25
+ ```
26
+
27
+ So the item in the example will consume the rows between lines 1 and 2, and the columns between lines 1 and 4.
28
+
29
+ # --instructions--
30
+
31
+ Using the `grid-area` property, place the element with `item5` class between the third and fourth horizontal lines and between the first and fourth vertical lines.
32
+
33
+ # --hints--
34
+
35
+ The `item5` class should have a `grid-area` property to make it fill the whole area between the third and fourth horizontal lines, and first and fourth vertical lines.
36
+
37
+ ```js
38
+ assert.match(
39
+ code,
40
+ /.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi
41
+ );
42
+ ```
43
+
44
+ # --seed--
45
+
46
+ ## --seed-contents--
47
+
48
+ ```html
49
+ <style>
50
+ .item1 {
51
+ background: LightSkyBlue;
52
+ }
53
+ .item2 {
54
+ background: LightSalmon;
55
+ }
56
+ .item3 {
57
+ background: PaleTurquoise;
58
+ }
59
+ .item4 {
60
+ background: LightPink;
61
+ }
62
+
63
+ .item5 {
64
+ background: PaleGreen;
65
+ /* Only change code below this line */
66
+
67
+
68
+ /* Only change code above this line */
69
+ }
70
+
71
+ .container {
72
+ font-size: 40px;
73
+ min-height: 300px;
74
+ width: 100%;
75
+ background: LightGray;
76
+ display: grid;
77
+ grid-template-columns: 1fr 1fr 1fr;
78
+ grid-template-rows: 1fr 1fr 1fr;
79
+ grid-gap: 10px;
80
+ }
81
+ </style>
82
+
83
+ <div class="container">
84
+ <div class="item1">1</div>
85
+ <div class="item2">2</div>
86
+ <div class="item3">3</div>
87
+ <div class="item4">4</div>
88
+ <div class="item5">5</div>
89
+ </div>
90
+ ```
91
+
92
+ # --solutions--
93
+
94
+ ```html
95
+ <style>
96
+ .item5 {
97
+ grid-area: 3/1/4/4;
98
+ }
99
+ </style>
100
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe3669fb03452672e45f.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe3669fb03452672e45f
3
+ title: Reduce Repetition Using the repeat Function
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cQvqyHR'
6
+ forumTopicId: 301133
7
+ dashedName: reduce-repetition-using-the-repeat-function
8
+ ---
9
+
10
+ # --description--
11
+
12
+ When you used `grid-template-columns` and `grid-template-rows` to define the structure of a grid, you entered a value for each row or column you created.
13
+
14
+ Let's say you want a grid with 100 rows of the same height. It isn't very practical to insert 100 values individually. Fortunately, there's a better way - by using the `repeat` function to specify the number of times you want your column or row to be repeated, followed by a comma and the value you want to repeat.
15
+
16
+ Here's an example that would create the 100 row grid, each row at 50px tall.
17
+
18
+ ```css
19
+ grid-template-rows: repeat(100, 50px);
20
+ ```
21
+
22
+ You can also repeat multiple values with the repeat function and insert the function amongst other values when defining a grid structure. Here's what that looks like:
23
+
24
+ ```css
25
+ grid-template-columns: repeat(2, 1fr 50px) 20px;
26
+ ```
27
+
28
+ This translates to:
29
+
30
+ ```css
31
+ grid-template-columns: 1fr 50px 1fr 50px 20px;
32
+ ```
33
+
34
+ **Note:** The `1fr 50px` is repeated twice followed by 20px.
35
+
36
+ # --instructions--
37
+
38
+ Use `repeat` to remove repetition from the `grid-template-columns` property.
39
+
40
+ # --hints--
41
+
42
+ `container` class should have a `grid-template-columns` property that is set to repeat 3 columns with the width of `1fr`.
43
+
44
+ ```js
45
+ assert.match(
46
+ code,
47
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?1fr\s*?\)\s*?;[\s\S]*}/gi
48
+ );
49
+ ```
50
+
51
+ # --seed--
52
+
53
+ ## --seed-contents--
54
+
55
+ ```html
56
+ <style>
57
+ .item1 {
58
+ background: LightSkyBlue;
59
+ }
60
+ .item2 {
61
+ background: LightSalmon;
62
+ }
63
+ .item3 {
64
+ background: PaleTurquoise;
65
+ }
66
+ .item4 {
67
+ background: LightPink;
68
+ }
69
+ .item5 {
70
+ background: PaleGreen;
71
+ }
72
+
73
+ .container {
74
+ font-size: 40px;
75
+ min-height: 300px;
76
+ width: 100%;
77
+ background: LightGray;
78
+ display: grid;
79
+ /* Only change code below this line */
80
+
81
+ grid-template-columns: 1fr 1fr 1fr;
82
+
83
+ /* Only change code above this line */
84
+ grid-template-rows: 1fr 1fr 1fr;
85
+ grid-gap: 10px;
86
+ }
87
+ </style>
88
+
89
+ <div class="container">
90
+ <div class="item1">1</div>
91
+ <div class="item2">2</div>
92
+ <div class="item3">3</div>
93
+ <div class="item4">4</div>
94
+ <div class="item5">5</div>
95
+ </div>
96
+ ```
97
+
98
+ # --solutions--
99
+
100
+ ```html
101
+ <style>
102
+ .container {
103
+ grid-template-columns: repeat(3, 1fr);
104
+ }
105
+ </style>
106
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe4469fb03452672e460.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe4469fb03452672e460
3
+ title: Limit Item Size Using the minmax Function
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cD97RTv'
6
+ forumTopicId: 301131
7
+ dashedName: limit-item-size-using-the-minmax-function
8
+ ---
9
+
10
+ # --description--
11
+
12
+ There's another built-in function to use with `grid-template-columns` and `grid-template-rows` called `minmax`. It's used to limit the size of items when the grid container changes size. To do this you need to specify the acceptable size range for your item. Here is an example:
13
+
14
+ ```css
15
+ grid-template-columns: 100px minmax(50px, 200px);
16
+ ```
17
+
18
+ In the code above, `grid-template-columns` is set to create two columns; the first is 100px wide, and the second has the minimum width of 50px and the maximum width of 200px.
19
+
20
+ # --instructions--
21
+
22
+ Using the `minmax` function, replace the `1fr` in the `repeat` function with a column size that has the minimum width of `90px` and the maximum width of `1fr`, and resize the preview panel to see the effect.
23
+
24
+ # --hints--
25
+
26
+ `container` class should have a `grid-template-columns` property that is set to repeat 3 columns with the minimum width of `90px` and maximum width of `1fr`.
27
+
28
+ ```js
29
+ assert.match(
30
+ code,
31
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?minmax\s*?\(\s*?90px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
32
+ );
33
+ ```
34
+
35
+ # --seed--
36
+
37
+ ## --seed-contents--
38
+
39
+ ```html
40
+ <style>
41
+ .item1 {
42
+ background: LightSkyBlue;
43
+ }
44
+ .item2 {
45
+ background: LightSalmon;
46
+ }
47
+ .item3 {
48
+ background: PaleTurquoise;
49
+ }
50
+ .item4 {
51
+ background: LightPink;
52
+ }
53
+ .item5 {
54
+ background: PaleGreen;
55
+ }
56
+
57
+ .container {
58
+ font-size: 40px;
59
+ min-height: 300px;
60
+ width: 100%;
61
+ background: LightGray;
62
+ display: grid;
63
+ /* Only change code below this line */
64
+
65
+ grid-template-columns: repeat(3, 1fr);
66
+
67
+ /* Only change code above this line */
68
+ grid-template-rows: 1fr 1fr 1fr;
69
+ grid-gap: 10px;
70
+ }
71
+ </style>
72
+
73
+ <div class="container">
74
+ <div class="item1">1</div>
75
+ <div class="item2">2</div>
76
+ <div class="item3">3</div>
77
+ <div class="item4">4</div>
78
+ <div class="item5">5</div>
79
+ </div>
80
+ ```
81
+
82
+ # --solutions--
83
+
84
+ ```html
85
+ <style>
86
+ .container {
87
+ grid-template-columns: repeat(3, minmax(90px, 1fr));
88
+ }
89
+ </style>
90
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe5469fb03452672e461.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe5469fb03452672e461
3
+ title: Create Flexible Layouts Using auto-fill
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cmzdycW'
6
+ forumTopicId: 301126
7
+ dashedName: create-flexible-layouts-using-auto-fill
8
+ ---
9
+
10
+ # --description--
11
+
12
+ The repeat function comes with an option called <dfn>auto-fill</dfn>. This allows you to automatically insert as many rows or columns of your desired size as possible depending on the size of the container. You can create flexible layouts when combining `auto-fill` with `minmax`, like this:
13
+
14
+ ```css
15
+ repeat(auto-fill, minmax(60px, 1fr));
16
+ ```
17
+
18
+ When the container changes size, this setup keeps inserting 60px columns and stretching them until it can insert another one. **Note:** If your container can't fit all your items on one row, it will move them down to a new one.
19
+
20
+ # --instructions--
21
+
22
+ In the first grid, use `auto-fill` with `repeat` to fill the grid with columns that have a minimum width of `60px` and maximum of `1fr`. Then resize the preview to see auto-fill in action.
23
+
24
+ # --hints--
25
+
26
+ `container` class should have a `grid-template-columns` property with `repeat` and `auto-fill` that will fill the grid with columns that have a minimum width of `60px` and maximum of `1fr`.
27
+
28
+ ```js
29
+ assert.match(
30
+ code,
31
+ /.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fill\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
32
+ );
33
+ ```
34
+
35
+ # --seed--
36
+
37
+ ## --seed-contents--
38
+
39
+ ```html
40
+ <style>
41
+ .item1 {
42
+ background: LightSkyBlue;
43
+ }
44
+ .item2 {
45
+ background: LightSalmon;
46
+ }
47
+ .item3 {
48
+ background: PaleTurquoise;
49
+ }
50
+ .item4 {
51
+ background: LightPink;
52
+ }
53
+ .item5 {
54
+ background: PaleGreen;
55
+ }
56
+
57
+ .container {
58
+ font-size: 40px;
59
+ min-height: 100px;
60
+ width: 100%;
61
+ background: LightGray;
62
+ display: grid;
63
+ /* Only change code below this line */
64
+
65
+ grid-template-columns: repeat(3, minmax(60px, 1fr));
66
+
67
+ /* Only change code above this line */
68
+ grid-template-rows: 1fr 1fr 1fr;
69
+ grid-gap: 10px;
70
+ }
71
+
72
+ .container2 {
73
+ font-size: 40px;
74
+ min-height: 100px;
75
+ width: 100%;
76
+ background: Silver;
77
+ display: grid;
78
+ grid-template-columns: repeat(3, minmax(60px, 1fr));
79
+ grid-template-rows: 1fr 1fr 1fr;
80
+ grid-gap: 10px;
81
+ }
82
+ </style>
83
+ <div class="container">
84
+ <div class="item1">1</div>
85
+ <div class="item2">2</div>
86
+ <div class="item3">3</div>
87
+ <div class="item4">4</div>
88
+ <div class="item5">5</div>
89
+ </div>
90
+ <div class="container2">
91
+ <div class="item1">1</div>
92
+ <div class="item2">2</div>
93
+ <div class="item3">3</div>
94
+ <div class="item4">4</div>
95
+ <div class="item5">5</div>
96
+ </div>
97
+ ```
98
+
99
+ # --solutions--
100
+
101
+ ```html
102
+ <style>
103
+ .item1 {
104
+ background: LightSkyBlue;
105
+ }
106
+ .item2 {
107
+ background: LightSalmon;
108
+ }
109
+ .item3 {
110
+ background: PaleTurquoise;
111
+ }
112
+ .item4 {
113
+ background: LightPink;
114
+ }
115
+ .item5 {
116
+ background: PaleGreen;
117
+ }
118
+
119
+ .container {
120
+ font-size: 40px;
121
+ min-height: 100px;
122
+ width: 100%;
123
+ background: LightGray;
124
+ display: grid;
125
+ /* Only change code below this line */
126
+
127
+ grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
128
+
129
+ /* Only change code above this line */
130
+ grid-template-rows: 1fr 1fr 1fr;
131
+ grid-gap: 10px;
132
+ }
133
+
134
+ .container2 {
135
+ font-size: 40px;
136
+ min-height: 100px;
137
+ width: 100%;
138
+ background: Silver;
139
+ display: grid;
140
+ grid-template-columns: repeat(3, minmax(60px, 1fr));
141
+ grid-template-rows: 1fr 1fr 1fr;
142
+ grid-gap: 10px;
143
+ }
144
+ </style>
145
+ <div class="container">
146
+ <div class="item1">1</div>
147
+ <div class="item2">2</div>
148
+ <div class="item3">3</div>
149
+ <div class="item4">4</div>
150
+ <div class="item5">5</div>
151
+ </div>
152
+ <div class="container2">
153
+ <div class="item1">1</div>
154
+ <div class="item2">2</div>
155
+ <div class="item3">3</div>
156
+ <div class="item4">4</div>
157
+ <div class="item5">5</div>
158
+ </div>
159
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe6269fb03452672e462.md ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe6269fb03452672e462
3
+ title: Create Flexible Layouts Using auto-fit
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/c3dPph8'
6
+ forumTopicId: 301127
7
+ dashedName: create-flexible-layouts-using-auto-fit
8
+ ---
9
+
10
+ # --description--
11
+
12
+ `auto-fit` works almost identically to `auto-fill`. The only difference is that when the container's size exceeds the size of all the items combined, `auto-fill` keeps inserting empty rows or columns and pushes your items to the side, while `auto-fit` collapses those empty rows or columns and stretches your items to fit the size of the container.
13
+
14
+ **Note:** If your container can't fit all your items on one row, it will move them down to a new one.
15
+
16
+ # --instructions--
17
+
18
+ In the second grid, use `auto-fit` with `repeat` to fill the grid with columns that have a minimum width of `60px` and maximum of `1fr`. Then resize the preview to see the difference.
19
+
20
+ # --hints--
21
+
22
+ `container2` class should have a `grid-template-columns` property with `repeat` and `auto-fit` that will fill the grid with columns that have a minimum width of `60px` and a maximum of `1fr`.
23
+
24
+ ```js
25
+ assert.match(
26
+ code,
27
+ /.container2\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fit\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi
28
+ );
29
+ ```
30
+
31
+ # --seed--
32
+
33
+ ## --seed-contents--
34
+
35
+ ```html
36
+ <style>
37
+ .item1 {
38
+ background: LightSkyBlue;
39
+ }
40
+ .item2 {
41
+ background: LightSalmon;
42
+ }
43
+ .item3 {
44
+ background: PaleTurquoise;
45
+ }
46
+ .item4 {
47
+ background: LightPink;
48
+ }
49
+ .item5 {
50
+ background: PaleGreen;
51
+ }
52
+
53
+ .container {
54
+ font-size: 40px;
55
+ min-height: 100px;
56
+ width: 100%;
57
+ background: LightGray;
58
+ display: grid;
59
+ grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
60
+ grid-template-rows: 1fr 1fr 1fr;
61
+ grid-gap: 10px;
62
+ }
63
+
64
+ .container2 {
65
+ font-size: 40px;
66
+ min-height: 100px;
67
+ width: 100%;
68
+ background: Silver;
69
+ display: grid;
70
+ /* Only change code below this line */
71
+
72
+ grid-template-columns: repeat(3, minmax(60px, 1fr));
73
+
74
+ /* Only change code above this line */
75
+ grid-template-rows: 1fr 1fr 1fr;
76
+ grid-gap: 10px;
77
+ }
78
+ </style>
79
+
80
+ <div class="container">
81
+ <div class="item1">1</div>
82
+ <div class="item2">2</div>
83
+ <div class="item3">3</div>
84
+ <div class="item4">4</div>
85
+ <div class="item5">5</div>
86
+ </div>
87
+ <div class="container2">
88
+ <div class="item1">1</div>
89
+ <div class="item2">2</div>
90
+ <div class="item3">3</div>
91
+ <div class="item4">4</div>
92
+ <div class="item5">5</div>
93
+ </div>
94
+ ```
95
+
96
+ # --solutions--
97
+
98
+ ```html
99
+ <style>
100
+ .container {
101
+ grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
102
+ }
103
+ .container2 {
104
+ grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
105
+ }
106
+ </style>
107
+ ```
github_code/freeCodeCamp__freeCodeCamp/curriculum/challenges/english/blocks/css-grid/5a94fe7769fb03452672e463.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ id: 5a94fe7769fb03452672e463
3
+ title: Use Media Queries to Create Responsive Layouts
4
+ challengeType: 0
5
+ videoUrl: 'https://scrimba.com/p/pByETK/cMbqeHk'
6
+ forumTopicId: 301138
7
+ dashedName: use-media-queries-to-create-responsive-layouts
8
+ ---
9
+
10
+ # --description--
11
+
12
+ CSS Grid can be an easy way to make your site more responsive by using media queries to rearrange grid areas, change dimensions of a grid, and rearrange the placement of items.
13
+
14
+ In the preview, when the viewport width is 300px or more, the number of columns changes from 1 to 2. The advertisement area then occupies the left column completely.
15
+
16
+ # --instructions--
17
+
18
+ When the viewport width is `400px` or more, make the header area occupy the top row completely and the footer area occupy the bottom row completely.
19
+
20
+ # --hints--
21
+
22
+ When the viewport is `400px` or more, `container` class should have a `grid-template-areas` property in which the header and footer areas occupy the top and bottom rows respectively and advert and content occupy the left and right columns of the middle row.
23
+
24
+ ```js
25
+ assert.match(
26
+ __helpers.removeCssComments(code),
27
+ /@media\s*?\(\s*?min-width\s*?:\s*?400px\s*?\)[\s\S]*.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?["|']\s*?header\s*?header\s*?["|']\s*?["|']\s*?advert\s*?content\s*?["|']\s*?["|']\s*?footer\s*?footer\s*?["|']\s*?;[\s\S]*}/gi
28
+ );
29
+ ```
30
+
31
+ # --seed--
32
+
33
+ ## --seed-contents--
34
+
35
+ ```html
36
+ <style>
37
+ .item1 {
38
+ background: LightSkyBlue;
39
+ grid-area: header;
40
+ }
41
+
42
+ .item2 {
43
+ background: LightSalmon;
44
+ grid-area: advert;
45
+ }
46
+
47
+ .item3 {
48
+ background: PaleTurquoise;
49
+ grid-area: content;
50
+ }
51
+
52
+ .item4 {
53
+ background: lightpink;
54
+ grid-area: footer;
55
+ }
56
+
57
+ .container {
58
+ font-size: 1.5em;
59
+ min-height: 300px;
60
+ width: 100%;
61
+ background: LightGray;
62
+ display: grid;
63
+ grid-template-columns: 1fr;
64
+ grid-template-rows: 50px auto 1fr auto;
65
+ grid-gap: 10px;
66
+ grid-template-areas:
67
+ 'header'
68
+ 'advert'
69
+ 'content'
70
+ 'footer';
71
+ }
72
+
73
+ @media (min-width: 300px) {
74
+ .container {
75
+ grid-template-columns: auto 1fr;
76
+ grid-template-rows: auto 1fr auto;
77
+ grid-template-areas:
78
+ 'advert header'
79
+ 'advert content'
80
+ 'advert footer';
81
+ }
82
+ }
83
+
84
+ @media (min-width: 400px) {
85
+ .container {
86
+ grid-template-areas:
87
+ /* Only change code below this line */
88
+ 'advert header'
89
+ 'advert content'
90
+ 'advert footer';
91
+ /* Only change code above this line */
92
+ }
93
+ }
94
+ </style>
95
+
96
+ <div class="container">
97
+ <div class="item1">header</div>
98
+ <div class="item2">advert</div>
99
+ <div class="item3">content</div>
100
+ <div class="item4">footer</div>
101
+ </div>
102
+ ```
103
+
104
+ # --solutions--
105
+
106
+ ```html
107
+ <style>
108
+ .item1 {
109
+ background: LightSkyBlue;
110
+ grid-area: header;
111
+ }
112
+
113
+ .item2 {
114
+ background: LightSalmon;
115
+ grid-area: advert;
116
+ }
117
+
118
+ .item3 {
119
+ background: PaleTurquoise;
120
+ grid-area: content;
121
+ }
122
+
123
+ .item4 {
124
+ background: lightpink;
125
+ grid-area: footer;
126
+ }
127
+
128
+ .container {
129
+ font-size: 1.5em;
130
+ min-height: 300px;
131
+ width: 100%;
132
+ background: LightGray;
133
+ display: grid;
134
+ grid-template-columns: 1fr;
135
+ grid-template-rows: 50px auto 1fr auto;
136
+ grid-gap: 10px;
137
+ grid-template-areas:
138
+ 'header'
139
+ 'advert'
140
+ 'content'
141
+ 'footer';
142
+ }
143
+
144
+ @media (min-width: 300px) {
145
+ .container {
146
+ grid-template-columns: auto 1fr;
147
+ grid-template-rows: auto 1fr auto;
148
+ grid-template-areas:
149
+ 'advert header'
150
+ 'advert content'
151
+ 'advert footer';
152
+ }
153
+ }
154
+
155
+ @media (min-width: 400px) {
156
+ .container {
157
+ grid-template-areas:
158
+ 'header header'
159
+ 'advert content'
160
+ 'footer footer';
161
+ }
162
+ }
163
+ </style>
164
+
165
+ <div class="container">
166
+ <div class="item1">header</div>
167
+ <div class="item2">advert</div>
168
+ <div class="item3">content</div>
169
+ <div class="item4">footer</div>
170
+ </div>
171
+ ```