diff --git a/challenges/01-responsive-web-design/applied-accessibility.json b/challenges/01-responsive-web-design/applied-accessibility.json index 87df848bf1..2424a1d4c0 100644 --- a/challenges/01-responsive-web-design/applied-accessibility.json +++ b/challenges/01-responsive-web-design/applied-accessibility.json @@ -1251,7 +1251,9 @@ "assert(code.match(/background-color:\\s*?hsl\\(120,\\s*?25%,\\s*?55%\\)/gi), 'Your code should only change the lightness value for the background-color property to a value of 55%.');" } ], - "solutions": [], + "solutions": [ + "var code = \"body {color: hsl(0, 55%, 15%); background-color: hsl(120, 25%, 55%);}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, diff --git a/challenges/01-responsive-web-design/applied-visual-design.json b/challenges/01-responsive-web-design/applied-visual-design.json index 123724e7e0..51da359bf0 100644 --- a/challenges/01-responsive-web-design/applied-visual-design.json +++ b/challenges/01-responsive-web-design/applied-visual-design.json @@ -98,7 +98,9 @@ "assert(code.match(/.fullCard\\s*{[\\s\\S][^}]*\\n*^\\s*width\\s*:\\s*245px\\s*;/gm), 'Your code should change the width property of the card to 245 pixels by using the fullCard class selector.');" } ], - "solutions": [], + "solutions": [ + "var code = \".fullCard {\\nwidth: 245px; border: 1px solid #ccc; border-radius: 5px; margin: 10px 5px; padding: 4px;}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -809,7 +811,9 @@ "assert(code.match(/box-shadow:\\s*?0\\s+?10px\\s+?20px\\s+?rgba\\(\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0?\\.19\\),\\s*?0\\s+?6px\\s+?6px\\s+?rgba\\(\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0\\s*?,\\s*?0?\\.23\\)/gi), 'You should use the given CSS for the box-shadow value.');" } ], - "solutions": [], + "solutions": [ + "var code = \"#thumbnail {box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -1735,7 +1739,9 @@ "assert(code.match(/margin:\\s*?auto;/g), 'The div should have a margin set to auto.');" } ], - "solutions": [], + "solutions": [ + "var code = \"div {background-color: blue; height: 100px; width: 100px; margin: auto;}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2099,7 +2105,9 @@ "assert(code.match(/nav\\s*?{\\s*?background-color:\\s*?hsl\\(180,\\s*?80%,\\s*?25%\\)/gi), 'The nav element should have a background-color of the adjusted cyan tone using the hsl() property.');" } ], - "solutions": [], + "solutions": [ + "var code = \"nav {background-color: hsl(180, 80%, 25%);}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2178,7 +2186,9 @@ "assert(code.match(/background:\\s*?linear-gradient\\(35deg,\\s*?(#CCFFFF|#CFF),\\s*?(#FFCCCC|#FCC)\\);/gi), 'The div element should have a linear-gradient background with the specified direction and colors.');" } ], - "solutions": [], + "solutions": [ + "var code = \"
\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2257,7 +2267,9 @@ "assert(code.match(/black\\s+?80px/gi), 'The last color stop at 80 pixels should be black.');" } ], - "solutions": [], + "solutions": [ + "var code = \"background: repeating-linear-gradient(45deg, yellow 0px, yellow 40px, black 40px, black 80px);\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2310,7 +2322,9 @@ "assert(code.match(/background:\\s*?url\\(\\s*(\"|'|)https:\\/\\/i\\.imgur\\.com\\/MJAkxbh\\.png\\1\\s*\\)/gi), 'Your body element should have a background property set to a url() with the given link.');" } ], - "solutions": [], + "solutions": [ + "var code = \"body {background: url('https://i.imgur.com/MJAkxbh.png')}\"" + ], "hints": [ "Remember to wrap the address in quotes within the url() function." ], @@ -2346,7 +2360,9 @@ "assert(code.match(/#ball2\\s*?{\\s*?left:\\s*?65%;\\s*?transform:\\s*?scale\\(1\\.5\\);\\s*?}|#ball2\\s*?{\\s*?transform:\\s*?scale\\(1\\.5\\);\\s*?left:\\s*?65%;\\s*?}/gi), 'Set the transform property for #ball2 to scale it 1.5 times its size.');" } ], - "solutions": [], + "solutions": [ + "var code = \"#ball2 {left: 65%; transform: scale(1.5);}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2408,7 +2424,7 @@ "assert(code.match(/div:hover\\s*?{\\s*?transform:\\s*?scale\\(1\\.1\\);/gi), 'The size of the div element should scale 1.1 times when the user hovers over it.');" } ], - "solutions": [], + "solutions": ["var code = \"div:hover {transform: scale(1.1);}\""], "hints": [ "Make sure to apply the CSS rule to the hover state of the div, using div:hover" ], @@ -2463,7 +2479,9 @@ "assert(code.match(/#bottom\\s*?{\\s*?.*?\\s*?transform:\\s*?skewX\\(24deg\\);/g), 'The element with id bottom should be skewed by 24 degrees along its X-axis.');" } ], - "solutions": [], + "solutions": [ + "var code = \"#bottom {background-color: blue; transform: skewX(24deg);}\"" + ], "hints": [ "Notice that there is no space between the number and \"deg\" (-32deg) when declaring the degrees value." ], @@ -2516,7 +2534,9 @@ "assert(code.match(/#top\\s*?{\\s*?.*?\\s*?transform:\\s*?skewY\\(-10deg\\);/g), 'The element with id top should be skewed by -10 degrees along its Y-axis.');" } ], - "solutions": [], + "solutions": [ + "var code = \"#top {background-color: red; transform: skewY(-10deg);}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2582,7 +2602,9 @@ "assert(code.match(/box-shadow:\\s*?25px\\s+?10px\\s+?0(px)?\\s+?0(px)?\\s+?blue\\s*?;/gi), 'The value of the box-shadow property should be set to 25px for offset-x, 10px for offset-y, 0 for blur-radius, 0 for spread-radius, and finally blue for the color.');" } ], - "solutions": [], + "solutions": [ + "var code = \".center {background-color: transparent; border-radius: 50%; box-shadow: 25px 10px 0px 0 blue;}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2657,7 +2679,9 @@ "assert(code.match(/\\.heart::before\\s*?{\\s*?content\\s*?:\\s*?(\"|')\\1\\s*?;/gi), 'The content of the heart::before selector should be an empty string.');" } ], - "solutions": [], + "solutions": [ + "var code = \".heart {transform: rotate(-45deg);} .heart::after {background-color: pink; border-radius: 50%;} .heart::before {content: \\\"\\\"; border-radius: 50%;}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -2873,7 +2897,9 @@ "assert(code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-fill-mode\\s*?:\\s*?forwards\\s*?;[\\s\\S]*}/gi) && code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-name\\s*?:\\s*?background-color\\s*?;[\\s\\S]*}/gi) && code.match(/button\\s*?:\\s*?hover\\s*?{[\\s\\S]*animation-duration\\s*?:\\s*?500ms\\s*?;[\\s\\S]*}/gi), 'button:hover should have a animation-fill-mode property with a value of forwards.');" } ], - "solutions": [], + "solutions": [ + "var code = \"button:hover {animation-name: background-color; animation-duration: 500ms; animation-fill-mode: forwards;}\"" + ], "hints": [], "challengeType": 0, "translations": {}, @@ -2940,7 +2966,9 @@ "assert(code.match(/100%\\s*?{\\s*?background-color:\\s*?yellow;\\s*?top:\\s*?0(px)?;\\s*?left:\\s*?-25px;\\s*?}/gi), 'The @keyframes rule for 100% should use the left offset of -25px.');" } ], - "solutions": [], + "solutions": [ + "var code = \"@keyframes rainbow {0% {background-color: blue; top: 0px; left: 0px;} 50% {background-color: green; top: 50px; left: 25px;} 100% {background-color: yellow; top: 0px; left:-25px;}}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -3010,7 +3038,9 @@ "assert(code.match(/@keyframes fade\\s*?{\\s*?50%\\s*?{\\s*?(?:left:\\s*?60%;\\s*?opacity:\\s*?0?\\.1;|opacity:\\s*?0?\\.1;\\s*?left:\\s*?60%;)/gi), 'The keyframes rule for fade should set the opacity property to 0.1 at 50%.');" } ], - "solutions": [], + "solutions": [ + "var code = \"@keyframes fade {50% { left: 60%; opacity: 0.1;}}\"" + ], "hints": [], "releasedOn": "Feb 17, 2017", "challengeType": 0, @@ -3249,7 +3279,9 @@ "assert(code.match(/twinkle-1\\s*?{\\s*?50%/g), 'The @keyframes rule for the star-1 class should be 50%.');" } ], - "solutions": [], + "solutions": [ + "var code = \"@keyframes twinkle-1 {50% {transform: scale(0.5); opacity: 0.5;}}\"" + ], "hints": [ "Check the animation-name declared in the star-1 class to find the right @keyframes rule to change." ], diff --git a/challenges/01-responsive-web-design/basic-css.json b/challenges/01-responsive-web-design/basic-css.json index 1556443aea..ec0bfec4f0 100644 --- a/challenges/01-responsive-web-design/basic-css.json +++ b/challenges/01-responsive-web-design/basic-css.json @@ -20,14 +20,11 @@ "tests": [ { "text": "Your h2 element should be red.", - "testString": - "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" + "testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" }, { - "text": - "Your style declaration should end with a ; .", - "testString": - "assert(code.match(/\\s*CatPhotoApp\\s*<\\/h2>/),' Your style declaration should end with a ; .');" + "text": "Your style declaration should end with a ; .", + "testString": "assert(code.match(/\\s*CatPhotoApp\\s*<\\/h2>/),' Your style declaration should end with a ; .');" } ], "challengeType": 0, @@ -140,32 +137,24 @@ ], "tests": [ { - "text": - "Remove the style attribute from your h2 element.", - "testString": - "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your h2 element.');" + "text": "Remove the style attribute from your h2 element.", + "testString": "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your h2 element.');" }, { "text": "Create a style element.", - "testString": - "assert($(\"style\") && $(\"style\").length > 1, 'Create a style element.');" + "testString": "assert($(\"style\") && $(\"style\").length > 1, 'Create a style element.');" }, { "text": "Your h2 element should be blue.", - "testString": - "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your h2 element should be blue.');" + "testString": "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your h2 element should be blue.');" }, { - "text": - "Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.", - "testString": - "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.');" + "text": "Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.", + "testString": "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.');" }, { - "text": - "Make sure all your style elements are valid and have a closing tag.", - "testString": - "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(//g) || []).length, 'Make sure all your style elements are valid and have a closing tag.');" + "text": "Make sure all your style elements are valid and have a closing tag.", + "testString": "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(//g) || []).length, 'Make sure all your style elements are valid and have a closing tag.');" } ], "challengeType": 0, @@ -292,26 +281,19 @@ "tests": [ { "text": "Your h2 element should be red.", - "testString": - "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" + "testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" }, { - "text": - "Your h2 element should have the class red-text.", - "testString": - "assert($(\"h2\").hasClass(\"red-text\"), 'Your h2 element should have the class red-text.');" + "text": "Your h2 element should have the class red-text.", + "testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your h2 element should have the class red-text.');" }, { - "text": - "Your stylesheet should declare a red-text class and have its color set to red.", - "testString": - "assert(code.match(/\\.red-text\\s*\\{\\s*color\\s*:\\s*red;\\s*\\}/g), 'Your stylesheet should declare a red-text class and have its color set to red.');" + "text": "Your stylesheet should declare a red-text class and have its color set to red.", + "testString": "assert(code.match(/\\.red-text\\s*\\{\\s*color\\s*:\\s*red;\\s*\\}/g), 'Your stylesheet should declare a red-text class and have its color set to red.');" }, { - "text": - "Do not use inline style declarations like style=\"color: red\" in your h2 element.", - "testString": - "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like style=\"color: red\" in your h2 element.');" + "text": "Do not use inline style declarations like style=\"color: red\" in your h2 element.", + "testString": "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like style=\"color: red\" in your h2 element.');" } ], "challengeType": 0, @@ -438,31 +420,23 @@ "tests": [ { "text": "Your h2 element should be red.", - "testString": - "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" + "testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.');" }, { - "text": - "Your h2 element should have the class red-text.", - "testString": - "assert($(\"h2\").hasClass(\"red-text\"), 'Your h2 element should have the class red-text.');" + "text": "Your h2 element should have the class red-text.", + "testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your h2 element should have the class red-text.');" }, { "text": "Your first p element should be red.", - "testString": - "assert($(\"p:eq(0)\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your first p element should be red.');" + "testString": "assert($(\"p:eq(0)\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your first p element should be red.');" }, { - "text": - "Your second and third p elements should not be red.", - "testString": - "assert(!($(\"p:eq(1)\").css(\"color\") === \"rgb(255, 0, 0)\") && !($(\"p:eq(2)\").css(\"color\") === \"rgb(255, 0, 0)\"), 'Your second and third p elements should not be red.');" + "text": "Your second and third p elements should not be red.", + "testString": "assert(!($(\"p:eq(1)\").css(\"color\") === \"rgb(255, 0, 0)\") && !($(\"p:eq(2)\").css(\"color\") === \"rgb(255, 0, 0)\"), 'Your second and third p elements should not be red.');" }, { - "text": - "Your first p element should have the class red-text.", - "testString": - "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'Your first p element should have the class red-text.');" + "text": "Your first p element should have the class red-text.", + "testString": "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'Your first p element should have the class red-text.');" } ], "challengeType": 0, @@ -577,10 +551,8 @@ ], "tests": [ { - "text": - "Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.", - "testString": - "assert(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.');" + "text": "Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.", + "testString": "assert(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.');" } ], "challengeType": 0, @@ -684,10 +656,8 @@ ], "tests": [ { - "text": - "Your p elements should use the font monospace.", - "testString": - "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your p elements should use the font monospace.');" + "text": "Your p elements should use the font monospace.", + "testString": "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your p elements should use the font monospace.');" } ], "challengeType": 0, @@ -805,25 +775,19 @@ "tests": [ { "text": "Import the Lobster font.", - "testString": - "assert(new RegExp(\"googleapis\", \"gi\").test(code), 'Import the Lobster font.');" + "testString": "assert(new RegExp(\"googleapis\", \"gi\").test(code), 'Import the Lobster font.');" }, { - "text": - "Your h2 element should use the font Lobster.", - "testString": - "assert($(\"h2\").css(\"font-family\").match(/lobster/i), 'Your h2 element should use the font Lobster.');" + "text": "Your h2 element should use the font Lobster.", + "testString": "assert($(\"h2\").css(\"font-family\").match(/lobster/i), 'Your h2 element should use the font Lobster.');" }, { "text": "Use an h2 CSS selector to change the font.", - "testString": - "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?\\s*;\\s*\\}/gi.test(code), 'Use an h2 CSS selector to change the font.');" + "testString": "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?\\s*;\\s*\\}/gi.test(code), 'Use an h2 CSS selector to change the font.');" }, { - "text": - "Your p element should still use the font monospace.", - "testString": - "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'Your p element should still use the font monospace.');" + "text": "Your p element should still use the font monospace.", + "testString": "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'Your p element should still use the font monospace.');" } ], "challengeType": 0, @@ -945,26 +909,19 @@ "tests": [ { "text": "Your h2 element should use the font Lobster.", - "testString": - "assert($(\"h2\").css(\"font-family\").match(/^\"?lobster/i), 'Your h2 element should use the font Lobster.');" + "testString": "assert($(\"h2\").css(\"font-family\").match(/^\"?lobster/i), 'Your h2 element should use the font Lobster.');" }, { - "text": - "Your h2 element should degrade to the font monospace when Lobster is not available.", - "testString": - "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?,\\s*monospace\\s*;\\s*\\}/gi.test(code), 'Your h2 element should degrade to the font monospace when Lobster is not available.');" + "text": "Your h2 element should degrade to the font monospace when Lobster is not available.", + "testString": "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?,\\s*monospace\\s*;\\s*\\}/gi.test(code), 'Your h2 element should degrade to the font monospace when Lobster is not available.');" }, { - "text": - "Comment out your call to Google for the Lobster font by putting <!-- in front of it.", - "testString": - "assert(new RegExp(\"\", \"gi\").test(code), 'Be sure to close your comment by adding -->.');" + "text": "Be sure to close your comment by adding -->.", + "testString": "assert(new RegExp(\"[^fc]-->\", \"gi\").test(code), 'Be sure to close your comment by adding -->.');" } ], "challengeType": 0, @@ -1087,16 +1044,12 @@ ], "tests": [ { - "text": - "Your img element should have the class smaller-image.", - "testString": - "assert($(\"img[src='https://bit.ly/fcc-relaxing-cat']\").attr('class') === \"smaller-image\", 'Your img element should have the class smaller-image.');" + "text": "Your img element should have the class smaller-image.", + "testString": "assert($(\"img[src='https://bit.ly/fcc-relaxing-cat']\").attr('class') === \"smaller-image\", 'Your img element should have the class smaller-image.');" }, { - "text": - "Your image should be 100 pixels wide. Browser zoom should be at 100%.", - "testString": - "assert($(\"img\").width() === 100, 'Your image should be 100 pixels wide. Browser zoom should be at 100%.');" + "text": "Your image should be 100 pixels wide. Browser zoom should be at 100%.", + "testString": "assert($(\"img\").width() === 100, 'Your image should be 100 pixels wide. Browser zoom should be at 100%.');" } ], "challengeType": 0, @@ -1221,32 +1174,24 @@ ], "tests": [ { - "text": - "Your img element should have the class smaller-image.", - "testString": - "assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.');" + "text": "Your img element should have the class smaller-image.", + "testString": "assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.');" }, { - "text": - "Your img element should have the class thick-green-border.", - "testString": - "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img element should have the class thick-green-border.');" + "text": "Your img element should have the class thick-green-border.", + "testString": "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img element should have the class thick-green-border.');" }, { "text": "Give your image a border width of 10px.", - "testString": - "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) >= 8 && parseInt($(\"img\").css(\"border-top-width\"), 10) <= 12, 'Give your image a border width of 10px.');" + "testString": "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) >= 8 && parseInt($(\"img\").css(\"border-top-width\"), 10) <= 12, 'Give your image a border width of 10px.');" }, { "text": "Give your image a border style of solid.", - "testString": - "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.');" + "testString": "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.');" }, { - "text": - "The border around your img element should be green.", - "testString": - "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.');" + "text": "The border around your img element should be green.", + "testString": "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.');" } ], "challengeType": 0, @@ -1305,8 +1250,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-borders-around-your-elements", + "guideUrl": "https://guide.freecodecamp.org/certificates/add-borders-around-your-elements", "files": { "indexhtml": { "key": "indexhtml", @@ -1381,15 +1325,12 @@ ], "tests": [ { - "text": - "Your image element should have the class \"thick-green-border\".", - "testString": - "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your image element should have the class \"thick-green-border\".');" + "text": "Your image element should have the class \"thick-green-border\".", + "testString": "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your image element should have the class \"thick-green-border\".');" }, { "text": "Your image should have a border radius of 10px", - "testString": - "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 8, 'Your image should have a border radius of 10px');" + "testString": "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 8, 'Your image should have a border radius of 10px');" } ], "challengeType": 0, @@ -1431,8 +1372,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-rounded-corners-a-border-radius", + "guideUrl": "https://guide.freecodecamp.org/certificates/add-rounded-corners-a-border-radius", "files": { "indexhtml": { "key": "indexhtml", @@ -1512,15 +1452,12 @@ ], "tests": [ { - "text": - "Your image should have a border radius of 50%, making it perfectly circular.", - "testString": - "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 48, 'Your image should have a border radius of 50%, making it perfectly circular.');" + "text": "Your image should have a border radius of 50%, making it perfectly circular.", + "testString": "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 48, 'Your image should have a border radius of 50%, making it perfectly circular.');" }, { "text": "Be sure to use a percentage value of 50%.", - "testString": - "assert(code.match(/50%/g), 'Be sure to use a percentage value of 50%.');" + "testString": "assert(code.match(/50%/g), 'Be sure to use a percentage value of 50%.');" } ], "challengeType": 0, @@ -1640,16 +1577,12 @@ ], "tests": [ { - "text": - "Give your div element the class silver-background.", - "testString": - "assert($(\"div\").hasClass(\"silver-background\"), 'Give your div element the class silver-background.');" + "text": "Give your div element the class silver-background.", + "testString": "assert($(\"div\").hasClass(\"silver-background\"), 'Give your div element the class silver-background.');" }, { - "text": - "Your div element should have a silver background.", - "testString": - "assert($(\"div\").css(\"background-color\") === \"rgb(192, 192, 192)\", 'Your div element should have a silver background.');" + "text": "Your div element should have a silver background.", + "testString": "assert($(\"div\").css(\"background-color\") === \"rgb(192, 192, 192)\", 'Your div element should have a silver background.');" } ], "challengeType": 0, @@ -1781,10 +1714,8 @@ ], "tests": [ { - "text": - "Give your form element the id of cat-photo-form.", - "testString": - "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.');" + "text": "Give your form element the id of cat-photo-form.", + "testString": "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.');" } ], "challengeType": 0, @@ -1926,28 +1857,20 @@ ], "tests": [ { - "text": - "Give your form element the id of cat-photo-form.", - "testString": - "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.');" + "text": "Give your form element the id of cat-photo-form.", + "testString": "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.');" }, { - "text": - "Your form element should have the background-color of green.", - "testString": - "assert($(\"#cat-photo-form\").css(\"background-color\") === \"rgb(0, 128, 0)\", 'Your form element should have the background-color of green.');" + "text": "Your form element should have the background-color of green.", + "testString": "assert($(\"#cat-photo-form\").css(\"background-color\") === \"rgb(0, 128, 0)\", 'Your form element should have the background-color of green.');" }, { - "text": - "Make sure your form element has an id attribute.", - "testString": - "assert(code.match(//gi) && code.match(//gi).length > 0, 'Make sure your form element has an id attribute.');" + "text": "Make sure your form element has an id attribute.", + "testString": "assert(code.match(//gi) && code.match(//gi).length > 0, 'Make sure your form element has an id attribute.');" }, { - "text": - "Do not give your form any class or style attributes.", - "testString": - "assert(!code.match(//gi) && !code.match(//gi), 'Do not give your form any class or style attributes.');" + "text": "Do not give your form any class or style attributes.", + "testString": "assert(!code.match(//gi) && !code.match(//gi), 'Do not give your form any class or style attributes.');" } ], "challengeType": 0, @@ -2088,10 +2011,8 @@ ], "tests": [ { - "text": - "Your blue-box class should give elements 20px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-top\") === \"20px\", 'Your blue-box class should give elements 20px of padding.');" + "text": "Your blue-box class should give elements 20px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-top\") === \"20px\", 'Your blue-box class should give elements 20px of padding.');" } ], "challengeType": 0, @@ -2148,8 +2069,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/adjust-the-padding-of-an-element", + "guideUrl": "https://guide.freecodecamp.org/certificates/adjust-the-padding-of-an-element", "files": { "indexhtml": { "key": "indexhtml", @@ -2210,10 +2130,8 @@ ], "tests": [ { - "text": - "Your blue-box class should give elements 20px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-top\") === \"20px\", 'Your blue-box class should give elements 20px of margin.');" + "text": "Your blue-box class should give elements 20px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"20px\", 'Your blue-box class should give elements 20px of margin.');" } ], "challengeType": 0, @@ -2259,8 +2177,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/adjust-the-margin-of-an-element", + "guideUrl": "https://guide.freecodecamp.org/certificates/adjust-the-margin-of-an-element", "files": { "indexhtml": { "key": "indexhtml", @@ -2323,10 +2240,8 @@ ], "tests": [ { - "text": - "Your blue-box class should give elements -15px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-top\") === \"-15px\", 'Your blue-box class should give elements -15px of margin.');" + "text": "Your blue-box class should give elements -15px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"-15px\", 'Your blue-box class should give elements -15px of margin.');" } ], "challengeType": 0, @@ -2372,8 +2287,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-a-negative-margin-to-an-element", + "guideUrl": "https://guide.freecodecamp.org/certificates/add-a-negative-margin-to-an-element", "files": { "indexhtml": { "key": "indexhtml", @@ -2434,35 +2348,26 @@ ], "tests": [ { - "text": - "Your blue-box class should give the top of the elements 40px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-top\") === \"40px\", 'Your blue-box class should give the top of the elements 40px of padding.');" + "text": "Your blue-box class should give the top of the elements 40px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-top\") === \"40px\", 'Your blue-box class should give the top of the elements 40px of padding.');" }, { - "text": - "Your blue-box class should give the right of the elements 20px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-right\") === \"20px\", 'Your blue-box class should give the right of the elements 20px of padding.');" + "text": "Your blue-box class should give the right of the elements 20px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-right\") === \"20px\", 'Your blue-box class should give the right of the elements 20px of padding.');" }, { - "text": - "Your blue-box class should give the bottom of the elements 20px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-bottom\") === \"20px\", 'Your blue-box class should give the bottom of the elements 20px of padding.');" + "text": "Your blue-box class should give the bottom of the elements 20px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-bottom\") === \"20px\", 'Your blue-box class should give the bottom of the elements 20px of padding.');" }, { - "text": - "Your blue-box class should give the left of the elements 40px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your blue-box class should give the left of the elements 40px of padding.');" + "text": "Your blue-box class should give the left of the elements 40px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your blue-box class should give the left of the elements 40px of padding.');" } ], "challengeType": 0, "translations": { "de": { - "title": - "Gib jeder Seite eines Elements einen unterschiedlichen Innenabstand", + "title": "Gib jeder Seite eines Elements einen unterschiedlichen Innenabstand", "description": [ "Manchmal wirst du einem Element auf jeder Seite unterschiedliche Innenabstände – also padding – geben wollen.", "CSS erlaubt dir den Innenabstand - padding - eines Elements auf allen Seiten einzeln mit den Eigenschaften padding-top, padding-right, padding-bottom und padding-left zu steuern.", @@ -2480,8 +2385,7 @@ ] }, "pt-br": { - "title": - "Dê Valores Diferentes de Preenchimento a Cada Lado de um Elemento", + "title": "Dê Valores Diferentes de Preenchimento a Cada Lado de um Elemento", "description": [ "As vezes pode ser que você queira personalizar um elemento para que tenha um preenchimento (padding) diferente em cada um de seus lados.", "O CSS permite controlar o preenchimento (padding) de um elemento em todos os quatro lados: superior, direito, inferior e esquerdo, com as propriedades padding-top, padding-right, padding-bottom e padding-left.", @@ -2490,8 +2394,7 @@ ] }, "ru": { - "title": - "Добавьте разный отступ содердимого с каждой стороны элемента", + "title": "Добавьте разный отступ содердимого с каждой стороны элемента", "description": [ "Иногда вам может потребоваться изменить элемент таким образом, чтобы отступ содержимого padding с каждой из сторон был разным.", "CSS позволяет вам контролировать значение свойства padding элемента со всех сторон с помощью свойств: padding-top, padding-right, padding-bottom, padding-left.", @@ -2500,8 +2403,7 @@ ] } }, - "guideUrl": - "https://guide.freecodecamp.org/certificates/add-different-padding-to-each-side-of-an-element", + "guideUrl": "https://guide.freecodecamp.org/certificates/add-different-padding-to-each-side-of-an-element", "files": { "indexhtml": { "key": "indexhtml", @@ -2563,35 +2465,26 @@ ], "tests": [ { - "text": - "Your blue-box class should give the top of elements 40px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of margin.');" + "text": "Your blue-box class should give the top of elements 40px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of margin.');" }, { - "text": - "Your blue-box class should give the right of elements 20px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of margin.');" + "text": "Your blue-box class should give the right of elements 20px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of margin.');" }, { - "text": - "Your blue-box class should give the bottom of elements 20px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of margin.');" + "text": "Your blue-box class should give the bottom of elements 20px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of margin.');" }, { - "text": - "Your blue-box class should give the left of elements 40px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" + "text": "Your blue-box class should give the left of elements 40px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" } ], "challengeType": 0, "translations": { "de": { - "title": - "Füge jeder Seite eines Elements einen unterschiedlichen Außenabstand hinzu", + "title": "Füge jeder Seite eines Elements einen unterschiedlichen Außenabstand hinzu", "description": [ "Manchmal wirst du einem Element auf jeder Seite einen unterschiedlichen Außenabstand - margin - geben wollen.", "CSS erlaubt dir ebenfalls den Außenabstand - margin - eines Elements auf jeder Seite einzeln mit den Eigenschaften margin-top, margin-right, margin-bottom und margin-left zu steuern.", @@ -2689,41 +2582,30 @@ ], "tests": [ { - "text": - "Your blue-box class should give the top of elements 40px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of padding.');" + "text": "Your blue-box class should give the top of elements 40px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of padding.');" }, { - "text": - "Your blue-box class should give the right of elements 20px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of padding.');" + "text": "Your blue-box class should give the right of elements 20px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of padding.');" }, { - "text": - "Your blue-box class should give the bottom of elements 20px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of padding.');" + "text": "Your blue-box class should give the bottom of elements 20px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of padding.');" }, { - "text": - "Your blue-box class should give the left of elements 40px of padding.", - "testString": - "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of padding.');" + "text": "Your blue-box class should give the left of elements 40px of padding.", + "testString": "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of padding.');" }, { - "text": - "You should use the clockwise notation to set the padding of blue-box class.", - "testString": - "assert(!/padding-top|padding-right|padding-bottom|padding-left/.test(code), 'You should use the clockwise notation to set the padding of blue-box class.');" + "text": "You should use the clockwise notation to set the padding of blue-box class.", + "testString": "assert(!/padding-top|padding-right|padding-bottom|padding-left/.test(code), 'You should use the clockwise notation to set the padding of blue-box class.');" } ], "challengeType": 0, "translations": { "de": { - "title": - "Nutze die Notation im Uhrzeigersinn um den Innenabstand eines Elements zu bestimmen", + "title": "Nutze die Notation im Uhrzeigersinn um den Innenabstand eines Elements zu bestimmen", "description": [ "Anstatt die Eigenschaften padding-top, padding-right, padding-bottom und padding-left zu verwenden, kannst du sie alle in einer Zeile schreiben:", "padding: 10px 20px 10px 20px;", @@ -2733,8 +2615,7 @@ ] }, "es": { - "title": - "Utiliza notación en sentido horario para especificar el relleno de un elemento", + "title": "Utiliza notación en sentido horario para especificar el relleno de un elemento", "description": [ "En lugar de especificar las propiedades padding-top, padding-right, padding-bottom y padding-left de un elemento, puedes especificar todas en una sóla línea, así: ", "padding: 10px 20px 10px 20px;", @@ -2744,8 +2625,7 @@ ] }, "pt-br": { - "title": - "Use Notação em Sentido Horário para Especificar o Preenchimento de um Elemento", + "title": "Use Notação em Sentido Horário para Especificar o Preenchimento de um Elemento", "description": [ "Ao invés de especificar as propriedades padding-top, padding-right, padding-bottom e padding-left de um elemento, você pode especificar todas elas em uma só linha, assim:", "padding: 10px 20px 10px 20px;", @@ -2755,8 +2635,7 @@ ] }, "ru": { - "title": - "Используйте систему ссылок по часовой стрелке для установки отступа содержмого элемента", + "title": "Используйте систему ссылок по часовой стрелке для установки отступа содержмого элемента", "description": [ "Вместо указания свойств элемента: padding-top, padding-right, padding-bottom, padding-left, вы можете указать их в строку, например:", "padding: 10px 20px 10px 20px;", @@ -2826,35 +2705,26 @@ ], "tests": [ { - "text": - "Your blue-box class should give the top of elements 40px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of margin.');" + "text": "Your blue-box class should give the top of elements 40px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"40px\", 'Your blue-box class should give the top of elements 40px of margin.');" }, { - "text": - "Your blue-box class should give the right of elements 20px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of margin.');" + "text": "Your blue-box class should give the right of elements 20px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-right\") === \"20px\", 'Your blue-box class should give the right of elements 20px of margin.');" }, { - "text": - "Your blue-box class should give the bottom of elements 20px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of margin.');" + "text": "Your blue-box class should give the bottom of elements 20px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-bottom\") === \"20px\", 'Your blue-box class should give the bottom of elements 20px of margin.');" }, { - "text": - "Your blue-box class should give the left of elements 40px of margin.", - "testString": - "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" + "text": "Your blue-box class should give the left of elements 40px of margin.", + "testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" } ], "challengeType": 0, "translations": { "de": { - "title": - "Nutze die Notation im Uhrzeigersinn um den Außenabstand eines Elements zu bestimmen", + "title": "Nutze die Notation im Uhrzeigersinn um den Außenabstand eines Elements zu bestimmen", "description": [ "Versuchen wir das noch einmal, aber diesmal mit dem Außenabstand – also margin.", "Anstatt die Eigenschaften margin-top, margin-right, margin-bottom und margin-left zu verwenden, kannst du alle in eine Zeile schreiben:", @@ -2865,8 +2735,7 @@ ] }, "es": { - "title": - "Utiliza notación en sentido horario para especificar el margen de un elemento", + "title": "Utiliza notación en sentido horario para especificar el margen de un elemento", "description": [ "Vamos a intentar esto de nuevo, pero esta vez con el margen (margin).", "En lugar de especificar las propiedades margin-top, margin-right, margin-bottom, y margin-left de un elemento, puedes especificarlas en una sóla línea así: ", @@ -2877,8 +2746,7 @@ ] }, "pt-br": { - "title": - "Use Notação em Sentido Horário para Especificar a Margem de um Elemento", + "title": "Use Notação em Sentido Horário para Especificar a Margem de um Elemento", "description": [ "Vamos praticar isso outra vez, mas desta vez será com a margem (margin).", "Ao invés de especificar as propriedades margin-top, margin-right, margin-bottom, e margin-left de um elemento, você pode especificar todas elas em apenas uma linha assim:", @@ -2889,8 +2757,7 @@ ] }, "ru": { - "title": - "Используйте систему ссылок по часовой стрелке для установки отступа элемента", + "title": "Используйте систему ссылок по часовой стрелке для установки отступа элемента", "description": [ "Давайте попробуем то же самое, но со свойством margin на этот раз.", "Вмето указания свойств элемента: margin-top, margin-right, margin-bottom, margin-left, вы можете указать их в строку, например:", @@ -2961,20 +2828,16 @@ ], "tests": [ { - "text": - "The type attribute selector should be used to select the checkboxes.", - "testString": - "assert(code.match(/