diff --git a/challenges/01-responsive-web-design/css-flexbox.json b/challenges/01-responsive-web-design/css-flexbox.json index 6ec2fe5de6..176d4d048a 100644 --- a/challenges/01-responsive-web-design/css-flexbox.json +++ b/challenges/01-responsive-web-design/css-flexbox.json @@ -41,30 +41,35 @@ "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.", "Placing the CSS property display: flex; on an element allows you to use other flex properties to build a responsive page.", "
", - "Add the CSS property display to both #box-1 and #box-2 and set each to a value of flex." + "Add the CSS property display to #box-container and set its value to flex." ], "challengeSeed": [ "", - "
", - "
" + "
", + "
", + "
", + "
" ], "tests": [ - "assert($('#box-1').css('display') == 'flex', 'message: #box-1 should have the display property set to a value of flex.');", - "assert($('#box-2').css('display') == 'flex', 'message: #box-2 should have the display property set to a value of flex.');" + "assert($('#box-container').css('display') == 'flex', 'message: #box-container should have the display property set to a value of flex.');" ], "solutions": [], "hints": [], @@ -192,9 +197,10 @@ "title": "Using the Flex-direction Property to Make a Row", "description": [ "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.", + "Other options for flex-direction are row-reverse and column-reverse.", "Note
The default value for the flex-direction property is row.", "
", - "Add the CSS property flex-direction to the #box-container element, and give it a value of row." + "Add the CSS property flex-direction to the #box-container element, and give it a value of row-reverse." ], "challengeSeed": [ "", "", @@ -221,7 +227,7 @@ "" ], "tests": [ - "assert($('#box-container').css('flex-direction') == 'row', 'message: The #box-container element should have a flex-direction property set to row.');" + "assert($('#box-container').css('flex-direction') == 'row-reverse', 'message: The #box-container element should have a flex-direction property set to row-reverse.');" ], "solutions": [], "hints": [], @@ -331,8 +337,8 @@ "" ], "tests": [ - "assert($('header').css('flex-direction') == 'row', 'message: The header should have a flex-direction property set to row.');", - "assert($('footer').css('flex-direction') == 'row', 'message: The footer should have a flex-direction property set to row.');" + "assert(code.match(/header\\s*?{\\s*?.*?\\s*?.*?\\s*?flex-direction:\\s*?row;/g), 'message: The header should have a flex-direction property set to row.');", + "assert(code.match(/footer\\s*?{\\s*?.*?\\s*?.*?\\s*?flex-direction:\\s*?row;/g), 'message: The footer should have a flex-direction property set to row.');" ], "solutions": [], "hints": [], @@ -356,14 +362,14 @@ " }", " #box-1 {", " background-color: dodgerblue;", - " width: 500px;", - " height: 500px;", + " width: 50%;", + " height: 50%;", " }", "", " #box-2 {", " background-color: orangered;", - " width: 500px;", - " height: 500px;", + " width: 50%;", + " height: 50%;", " }", "", "", @@ -516,14 +522,14 @@ " }", " #box-1 {", " background-color: dodgerblue;", - " width: 100px;", - " height: 200px;", + " width: 25%;", + " height: 100%;", " }", "", " #box-2 {", " background-color: orangered;", - " width: 100px;", - " height: 200px;", + " width: 25%;", + " height: 100%;", " }", "", "", @@ -641,7 +647,7 @@ "" ], "tests": [ - "assert($('.profile-name').css('justify-content') == 'center' || $('.profile-name').css('justify-content') == 'flex-start' || $('.profile-name').css('justify-content') == 'flex-end' || $('.profile-name').css('justify-content') == 'space-between' || $('.profile-name').css('justify-content') == 'space-around', 'message: The .profile-name element should have the justify-content property set to any of these values: center, flex-start, flex-end, space-between, or space-around.');" + "assert(code.match(/header\\s.profile-name\\s*{\\s*?.*?\\s*?.*?\\s*?\\s*?.*?\\s*?justify-content\\s*:\\s*(center|flex-start|flex-end|space-between|space-around)\\s*;/g), 'message: The .profile-name element should have the justify-content property set to any of these values: center, flex-start, flex-end, space-between, or space-around.');" ], "solutions": [], "hints": [], @@ -835,39 +841,39 @@ " #box-container {", " background: gray;", " display: flex;", - " ", - " height: 500px;", + " height: 100%;", + " ", " }", " #box-1 {", " background-color: dodgerblue;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", "", " #box-2 {", " background-color: orangered;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", " #box-3 {", " background-color: violet;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", " #box-4 {", " background-color: yellow;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", " #box-5 {", " background-color: green;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", " #box-6 {", " background-color: black;", - " width: 200px;", - " height: 200px;", + " width: 25%;", + " height: 50%;", " }", "", "",