diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json index f55cf43ba7..8644217ac7 100644 --- a/challenges/html5-and-css.json +++ b/challenges/html5-and-css.json @@ -2588,8 +2588,8 @@ }, { "id": "bad87dee1348bd9aede07836", - "name": "Waypoint: Use a CSS ID to Style an Element", - "dashedName": "waypoint-use-a-css-id-to-style-an-element", + "name": "Waypoint: Use an ID Attribute to Style an Element", + "dashedName": "waypoint-use-an-id-attribute-to-style-an-element", "difficulty": 0.0392, "description": [ "One cool thing about id attributes is that, like classes, you can style them using CSS.", @@ -3331,21 +3331,23 @@ "descriptionDe": [] }, { - "id": "bad87fee1348bd9aedf06756", - "name": "Waypoint: Override Class Declarations with Inline Styles", - "dashedName": "waypoint-override-class-declarations-with-inline-styles", + "id": "bad87fee1348bd8aedf06756", + "name": "Waypoint: Override Class Declarations by Styling ID Attributes", + "dashedName": "waypoint-override-class-declarations-by-styling-id-attributes", "difficulty": 0.052, "description": [ "We just proved that browsers read CSS from top to bottom. That means that, in the event of a conflict, the browser will use whichever CSS declaration came last.", - "But we're not done yet. There are other ways that you can override CSS. Do you remember inline styles?", - "Use an in-line style to try to make our h1 element white. Remember, in line styles look like this: <h1 style=\"color: green\">", - "Leave the \"blue-text\" and \"pink-text\" classes on your h1 element." + "But we're not done yet. There are other ways that you can override CSS. Do you remember id attributes?", + "Let's override your \"pink-text\" and \"blue-text\" classes, and make your h1 element orange, by giving the h1 element an id and then styling that id.", + "Give your h1 element the id attribute of \"orange-text\". Remember, id styles look like this: <h1 id=\"orange-text\">", + "Leave the \"blue-text\" and \"pink-text\" classes on your h1 element.", + "Create a CSS declaration for your \"orange-text\" id in your style element. Here's and example of what this looks like: #brown-text { color: brown; }" ], "tests": [ "assert($('h1').hasClass('pink-text'), 'Your h1 element should have the class \"pink-text\".')", "assert($('h1').hasClass('blue-text'), 'Your h1 element should have the class \"blue-text\".')", - "assert(!$('h1').hasClass('white-text'), 'Your h1 element should have the inline style of \"color: white\".')", - "assert($('h1').css('color') === 'rgb(255, 255, 255)', 'Your h1 element should be white.')" + "assert($('h1').attr('id') === 'orange-text', 'Give your h1 element the id of \"orange-text\".')", + "assert($('h1').css('color') === 'rgb(255, 165, 0)', 'Your h1 element should be orange.')" ], "challengeSeed": [ "", - "

Hello World!

" + "

Hello World!

" + ], + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [], + "nameDe": "", + "descriptionDe": [] + }, + { + "id": "bad87fee1348bd9aedf07756", + "name": "Waypoint: Override All Other Styles by using Important", + "dashedName": "waypoint-override-all-other-styles-by-using-important", + "difficulty": 0.053, + "description": [ + "Yay! we just proved that in-line styles will override all the CSS declarations in your style element.", + "But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.", + "In many situations, you will use CSS libraries. These may accidentally override your own CSS. So when you absolutely need to be sure that an element has specific CSS, you can use !important.", + "Let's go all the way back to our \"pink-text\" class declaration. Remember that our \"pink-text\" class was overridden by subsequent class declarations, id declarations, and in-line styles.", + "Let's add the keyword !important to your body' element's color declaration to make 100% sure that your h1 element will be pink.", + "An example of how to do this is: color: red !important;" + ], + "tests": [ + "assert($('h1').hasClass('pink-text'), 'Your h1 element should have the class \"pink-text\".')", + "assert($('h1').hasClass('blue-text'), 'Your h1 element should have the class \"blue-text\".')", + "assert($('h1').attr('id') === 'orange-text', 'Your h1 element should have the id of \"orange-text\".')", + "assert(editor.match(/ 0, 'Your h1 element should have the inline style of \"color: white\".')", + "assert(editor.match(/pink.*\\!important/gi) && editor.match(/pink.*\\!important;/gi).length > 0, 'Your \"pink-text\" class should have the !important keyword to override all other declarations.')", + "assert($('h1').css('color') === 'rgb(255, 192, 203)', 'Your h1 element should be pink.')" + ], + "challengeSeed": [ + "", + "

Hello World!

" ], "challengeType": 0, "nameCn": "", @@ -3432,12 +3490,14 @@ "dashedName": "waypoint-use-hex-code-for-specific-colors", "difficulty": 0.054, "description": [ - "", - "Use hex code instead of a color." + "Did you know there other ways to represent colors in CSS? One of these ways is called hexadecimal code, or \"hex code\" for short.", + "\"Decimal\" means the numbers zero through nine - the numbers that people use in everyday life. \"Hexadecimal\" includes these 10 numbers, plus the letters A, B, C, D, E and F. This means that Hexidecimal has a total of 16 possible values, instead of the 10 possible values that our normal base-10 number system gives us.", + "With CSS, we use 6 hexidecimal number to represent colors. For example, #000000 is the lowest possible value, and it represents the color black.", + "Replace the word \"black\" in our body element's background-color with its \"hex code\" representation, #000000. " ], "tests": [ "assert($('body').css('background-color') === 'rgb(0, 0, 0)', 'Give your body element the background-color of black.')", - "assert(editor.match(/#000000/g) && editor.match(/#000000/g).length > 0, 'Use hex code the color black instead of the word \"black\". For example body: { color: #000000; }.')" + "assert(editor.match(/#000000/g) && editor.match(/#000000/g).length > 0, 'Use the hex code for the color black instead of the word \"black\". For example body: { color: #000000; }.')" ], "challengeSeed": [ "" ], @@ -3763,7 +3845,9 @@ "dashedName": "waypoint-use-rgb-to-color-elements-white", "difficulty": 0.064, "description": [ - "Use hex code instead of a color." + "RGB values look like this: rgb(0, 0, 0) for black and rgb(255, 255, 255) for white.", + "Instead of using six hexadecimal digits like you do with hex code, with RGB you specify the brightness of each color with a number between 0 and 255.", + "Change the body element's background color from the RGB value for black to the RGB value for white: rgb(255, 255, 255)" ], "tests": [ "assert($('body').css('background-color') === 'rgb(255, 255, 255)', 'Give your body element the background-color of red.')", @@ -3796,11 +3880,13 @@ "dashedName": "waypoint-use-rgb-to-color-elements-red", "difficulty": 0.065, "description": [ - "Use hex code instead of a color." + "Just like with hex code, you can represent different colors in RGB by using combinations of different values.", + "These values follow the pattern of RGB: the first number represents red, the second number represents green, and the third number represents blue.", + "Change the body element's background color to the RGB value green: rgb(0, 255, 0)" ], "tests": [ - "assert($('body').css('background-color') === 'rgb(255, 0, 0)', 'Give your body element the background-color of red.')", - "assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use RGB code instead of hex for the color red. For example body: { color: rgb(255,0,0); }.')" + "assert($('body').css('background-color') === 'rgb(255, 0, 0)', 'Give your body element the background-color of green.')", + "assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use RGB code instead of hex for the color green. For example body: { color: rgb(255,0,0); }.')" ], "challengeSeed": [ "