{ "name": "Responsive Design with Bootstrap", "order": 0.003, "challenges": [ { "id": "bad87fee1348bd9acde08712", "title": "Use Responsive Design with Bootstrap Fluid Containers", "difficulty": 2.01, "description": [ "Now let's go back to our Cat Photo App. This time, we'll style it using the popular Bootstrap responsive CSS framework.", "Bootstrap will figure out how wide your screen is and respond by resizing your HTML elements - hence the name Responsive Design.", "With responsive design, there is no need to design a mobile version of your website. It will look good on devices with screens of any width.", "You can add Bootstrap to any app just by including it with <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css\"/> at the top of your HTML. But we've gone ahead and automatically added it to your Cat Photo App for you.", "To get started, we should nest all of our HTML in a div element with the class container-fluid." ], "tests": [ "assert($(\"div\").hasClass(\"container-fluid\"), 'Your div element should have the class container-fluid')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", "", "", "

Things cats love:

", "", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9acde08812", "title": "Make Images Mobile Responsive", "difficulty": 2.02, "description": [ "First, add a new image below the existing one. Set it's src attribute to http://bit.ly/fcc-running-cats.", "It would be great if this image could be exactly the width of our phone's screen.", "Fortunately, with Bootstrap, all we need to do is add the img-responsive class to your image. Do this, and the image should perfectly fit the width of your page." ], "tests": [ "assert($(\"img\").length > 1, 'You should have a total of two images.')", "assert($(\"img\").hasClass(\"img-responsive\"), 'Your new image should have the class img-responsive.')", "assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Add a second image with the src of http://bit.ly/fcc-running-cats.')" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " ", "", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd8acde08812", "title": "Center Text with Bootstrap", "difficulty": 2.03, "description": [ "Now that we're using Bootstrap, we can center our heading element to make it look better. All we need to do is add the class text-center to our h2 element.", "Remember that you can add several classes to the same element by separating each of them with a space, like this: <h2 class=\"red-text text-center\">your text</h2>." ], "tests": [ "assert($(\"h2\").hasClass(\"text-center\"), 'Your h2 element should be centered by applying the class text-center')" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " ", "", " ", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348cd8acdf08812", "title": "Create a Bootstrap Button", "difficulty": 2.04, "description": [ "Bootstrap has its own styles for button elements, which look much better than the plain HTML ones.", "Create a new button element below your large kitten photo. Give it the class btn and the text of \"Like\"." ], "tests": [ "assert(new RegExp(\"like\",\"gi\").test($(\"button\").text()), 'Create a new button element with the text \"Like\".')", "assert($(\"button\").hasClass(\"btn\"), 'Your new button should have the class btn.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", " ", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348cd8acef08812", "title": "Create a Block Element Bootstrap Button", "difficulty": 2.05, "description": [ "Normally, your button elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.", "This image illustrates the difference between inline elements and block-level elements:", "\"An", "Note that these buttons still need the btn class.", "Add Bootstrap's btn-block class to your Bootstrap button." ], "tests": [ "assert($(\"button\").hasClass(\"btn\"), 'Your button should still have the class btn.')", "assert($(\"button\").hasClass(\"btn-block\"), 'Your button should have the class btn-block.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348cd8acef08811", "title": "Taste the Bootstrap Button Color Rainbow", "difficulty": 2.06, "description": [ "The btn-primary class is the main color you'll use in your app. It is useful for highlighting actions you want your user to take.", "Add Bootstrap's btn-primary class to your button.", "Note that this button will still need the btn and btn-block classes." ], "tests": [ "assert($(\"button\").hasClass(\"btn-primary\"), 'Your button should have the class btn-primary.')", "assert($(\"button\").hasClass(\"btn-block\") && $(\"button\").hasClass(\"btn\"), 'Your button should still have the btn and btn-block classes.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348cd8acef08813", "title": "Call out Optional Actions with Button Info", "difficulty": 2.07, "description": [ "Bootstrap comes with several pre-defined colors for buttons. The btn-info class is used to call attention to optional actions that the user can take.", "Create a new block-level Bootstrap button below your \"Like\" button with the text \"Info\", and add Bootstrap's btn-info and btn-block classes to it.", "Note that these buttons still need the btn and btn-block classes." ], "tests": [ "assert(new RegExp(\"info\",\"gi\").test($(\"button\").text()), 'Create a new button element with the text \"Info\".')", "assert($(\"button.btn-block.btn\").length > 1, 'Both of your Bootstrap buttons should have the btn and btn-block classes.')", "assert($(\"button\").hasClass(\"btn-info\"), 'Your new button should have the class btn-info.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348ce8acef08814", "title": "Warn your Users of a Dangerous Action", "difficulty": 2.08, "description": [ "Bootstrap comes with several pre-defined colors for buttons. The btn-danger class is the button color you'll use to notify users that the button performs a destructive action, such as deleting a cat photo.", "Create a button with the text \"Delete\" and give it the class btn-danger.", "Note that these buttons still need the btn and btn-block classes." ], "tests": [ "assert(new RegExp(\"Delete\",\"gi\").test($(\"button\").text()), 'Create a new button element with the text \"Delete\".')", "assert($(\"button.btn-block.btn\").length > 2, 'All of your Bootstrap buttons should have the btn and btn-block classes.')", "assert($(\"button\").hasClass(\"btn-danger\"), 'Your new button should have the class btn-danger.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", " ", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad88fee1348ce8acef08815", "title": "Use the Bootstrap Grid to Put Elements Side By Side", "difficulty": 2.09, "description": [ "Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div element.", "Here's a diagram of how Bootstrap's 12-column grid layout works:", "\"an", "Note that in this illustration, the col-md-* class is being used. Here, md means medium, and * is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.", "In the Cat Photo App that we're building, we'll use col-xs-*, where xs means extra small (like an extra-small mobile phone screen), and * is the number of columns specifying how many columns wide the element should be.", "Put the Like, Info and Delete buttons side-by-side by nesting all three of them within one <div class=\"row\"> element, then each of them within a <div class=\"col-xs-4\"> element.", "The row class is applied to a div, and the buttons themselves can be nested within it." ], "tests": [ "assert($(\"div.row:has(button)\").length > 0, 'Your buttons should all be nested within the same div element with the class row.')", "assert($(\"div.col-xs-4:has(button)\").length > 2, 'Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", " ", " ", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1347bd9aedf08845", "title": "Ditch Custom CSS for Bootstrap", "difficulty": 2.10, "description": [ "We can clean up our code and make our Cat Photo App look more conventional by using Bootstrap's built-in styles instead of the custom styles we created earlier.", "Don't worry - there will be plenty of time to customize our CSS later.", "Delete the .red-text, p, and .smaller-image CSS declarations from your style element so that the only declarations left in your style element are h2 and thick-green-border.", "Then delete the p element that contains a dead link. Then remove the red-text class from your h2 element and replace it with the text-primary Bootstrap class.", "Finally, remove the \"smaller-image\" class from your first img element and replace it with the img-responsive class." ], "tests": [ "assert(!$(\"h2\").hasClass(\"red-text\"), 'Your h2 element should no longer have the class red-text.')", "assert($(\"h2\").hasClass(\"text-primary\"), 'Your h2 element should now have the class text-primary.')", "assert(!$(\"p\").css(\"font-family\").match(/monospace/i), 'Your paragraph elements should no longer use the font Monospace.')", "assert(!$(\"img\").hasClass(\"smaller-image\"), 'Remove the smaller-image class from your top image.')", "assert($(\".img-responsive\").length > 1, 'Add the img-responsive class to your top image.')" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " ", "", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aedf08845", "title": "Use Spans for Inline Elements", "difficulty": 2.105, "description": [ "You can use spans to create inline elements. Remember when we used the btn-block class to make the button fill the entire row?", "This image illustrates the difference between inline elements and block-level elements:", "\"An", "By using the span element, you can put several elements together, and even style different parts of the same element differently.", "Nest the word \"love\" in your \"Things cats love\" element below within a span element. Then give that span the class text-danger to make the text red.", "Here's how you would do this with the \"Top 3 things cats hate\" element: <p>Top 3 things cats <span class = \"text-danger\">hate</span></p>" ], "tests": [ "assert($(\"p span\") && $(\"p span\").length > 0, 'Your span element should be inside your p element.')", "assert($(\"p span\") && $(\"p span\").text().match(/love/i), 'Your span element should have the text love.')", "assert($(\"span\").hasClass(\"text-danger\"), 'Your span element should have class text-danger.')", "assert(editor.match(/<\\/span>/g) && editor.match(//g).length === editor.match(/span element has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", " ", "", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aede08845", "title": "Create a Custom Heading", "difficulty": 2.11, "description": [ "We will make a simple heading for our Cat Photo App by putting them in the same row.", "Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div element.", "Here's a diagram of how Bootstrap's 12-column grid layout works:", "\"an", "Note that in this illustration, the col-md-* class is being used. Here, md means medium, and * is a number specifying how many columns wide the element should be. In this case, the column width of an element on a medium-sized screen, such as a laptop, is being specified.", "In the Cat Photo App that we're building, we'll use col-xs-*, where xs means extra small (like an extra-small mobile phone screen), and * is the number of columns specifying how many columns wide the element should be.", "Nest your first image and your h2 element within a single <div class=\"row\"> element. Nest your h2 text within a <div class=\"col-xs-8\"> and your image in a <div class=\"col-xs-4\"> so that they are on the same line.", "Notice how the image is now just the right size to fit along the text?" ], "tests": [ "assert($(\"div.row:has(h2)\").length > 0 && $(\"div.row:has(img)\").length > 0, 'Your h2 element and topmost img element should both be nested together within a div element with the class row.')", "assert($(\"div.col-xs-4:has(img)\").length > 0, 'Nest your topmost img element within a div with the class col-xs-4.')", "assert($(\"div.col-xs-8:has(h2)\").length > 0, 'Nest your h2 element within a div with the class col-xs-8.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "", "
", "

CatPhotoApp

", "", " ", "", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aedd08845", "title": "Add Font Awesome Icons to our Buttons", "difficulty": 2.12, "description": [ "Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the .svg file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.", "Use Font Awesome to add a thumbs-up icon to your like button by giving it a i element with the classes fa and fa-thumbs-up." ], "tests": [ "assert($(\"i\").hasClass(\"fa fa-thumbs-up\"), 'Add an i element with the classes fa and fa-thumbs-up.')", "assert($(\"button\").children(\"i\").length > 0, 'Nest your i element within your button element.')", "assert(editor.match(/<\\/i>/g), 'Make sure your i element has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aedc08845", "title": "Add Font Awesome Icons to all of our Buttons", "difficulty": 2.13, "description": [ "Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the .svg file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.", "Use Font Awesome to add a info-circle icon to your info button and a trash icon to your delete button." ], "tests": [ "assert($(\".btn-danger > i\").hasClass(\"fa fa-trash\"), 'You should add a <i class=\"fa fa-trash\"></i> within your delete button element.')", "assert($(\".btn-info > i\").hasClass(\"fa fa-info-circle\"), 'You should add a <i class=\"fa fa-info-circle\"></i> within your info button element.')", "assert(editor.match(/<\\/i>/g) && editor.match(/<\\/i>/g).length > 2 && $(\".btn-primary > i\").hasClass(\"fa fa-thumbs-up\"), 'Make sure each of your i elements has a closing tag and <i class=\"fa fa-thumbs-up\"></i> is in your like button element.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aedb08845", "title": "Responsively Style Radio Buttons", "difficulty": 2.14, "description": [ "You can use Bootstrap's col-xs-* classes on form elements, too! This way, our radio buttons will be evenly spread out across the page, regardless of how wide the screen resolution is.", "Nest all of your radio buttons within a <div class=\"row\"> element. Then nest each of them within a <div class=\"col-xs-6\"> element." ], "tests": [ "assert($(\"div.row:has(input[type=\\\"radio\\\"])\").length > 0, 'Nest all of your radio buttons inside one div with the class row.')", "assert($(\"div.col-xs-6:has(input[type=\\\"radio\\\"])\").length > 1, 'Nest each of your radio buttons inside its own div with the class col-xs-6.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aeda08845", "title": "Responsively Style Checkboxes", "difficulty": 2.15, "description": [ "You can use Bootstrap's col-xs-* classes on form elements, too! This way, our checkboxes will be evenly spread out across the page, regardless of how wide the screen resolution is.", "Nest all your checkboxes in a <div class=\"row\"> element. Then nest each of them in a <div class=\"col-xs-4\"> element." ], "tests": [ "assert($(\"div.row:has(input[type=\\\"checkbox\\\"])\").length > 0, 'Nest all of your checkboxes inside one div with the class row.')", "assert($(\"div.col-xs-4:has(input[type=\\\"checkbox\\\"])\").length > 2, 'Nest each of your checkboxes inside its own div with the class col-xs-4.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", " ", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aed908845", "title": "Style Text Inputs as Form Controls", "difficulty": 2.16, "description": [ "You can add the fa-paper-plane Font Awesome icon by adding <i class=\"fa fa-paper-plane\"></i> within your submit button element.", "Give your form's text input field a class of form-control. Give your form's submit button the classes btn btn-primary. Also give this button the Font Awesome icon of fa-paper-plane." ], "tests": [ "assert($(\"button[type=\\\"submit\\\"]\").hasClass(\"btn btn-primary\"), 'Give the submit button in your form the classes btn btn-primary.')", "assert($(\"button[type=\\\"submit\\\"]:has(i.fa.fa-paper-plane)\").length > 0, 'Add a <i class=\"fa fa-paper-plane\"></i> within your submit button element.')", "assert($(\"input[type=\\\"text\\\"]\").hasClass(\"form-control\"), 'Give the text input in your form the class form-control.')", "assert(editor.match(/<\\/i>/g) && editor.match(/<\\/i/g).length > 3, 'Make sure each of your i elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908845", "title": "Line up Form Elements Responsively with Bootstrap", "difficulty": 2.17, "description": [ "Now let's get your form input and your submission button on the same line. We'll do this the same way we have previously: by using a div element with the class row, and other div elements within it using the col-xs-* class.", "Nest both your form's text input and submit button within a div with the class row. Nest your form's text input within a div with the class of col-xs-7. Nest your form's submit button in a div with the class col-xs-5.", "This is the last challenge we'll do for our Cat Photo App for now. We hope you've enjoyed learning Font Awesome, Bootstrap, and responsive design!" ], "tests": [ "assert($(\"div.row:has(input[type=\\\"text\\\"])\").length > 0 && $(\"div.row:has(button[type=\\\"submit\\\"])\").length > 0, 'Nest your form submission button and text input in a div with class row.')", "assert($(\"div.col-xs-7:has(input[type=\\\"text\\\"])\").length > 0, 'Nest your form text input in a div with the class col-xs-7.')", "assert($(\"div.col-xs-5:has(button[type=\\\"submit\\\"])\").length > 0, 'Nest your form submission button in a div with the class col-xs-5.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", "
    ", "
  • cat nip
  • ", "
  • laser pointers
  • ", "
  • lasagna
  • ", "
", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908846", "title": "Create a Bootstrap Headline", "difficulty": 2.18, "description": [ "Now let's build something from scratch to practice our HTML, CSS and Bootstrap skills.", "We'll build a jQuery playground, which we'll soon put to use in our jQuery challenges.", "To start with, create an h3 element, with the text jQuery Playground.", "Color your h3 element with the text-primary Bootstrap class, and center it with the text-center Bootstrap class." ], "tests": [ "assert($(\"h3\") && $(\"h3\").length > 0, 'Add a h3 element to your page.')", "assert(editor.match(/<\\/h3>/g) && editor.match(/

/g).length === editor.match(/

h3 element has a closing tag.')", "assert($(\"h3\").hasClass(\"text-primary\"), 'Your h3 element should be colored by applying the class text-primary')", "assert($(\"h3\").hasClass(\"text-center\"), 'Your h3 element should be centered by applying the class text-center')", "assert.isTrue((/jquery(\\s)+playground/gi).test($(\"h3\").text()), 'Your h3 element should have the text jQuery Playground.')" ], "challengeSeed": [ "", "", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908746", "title": "House our page within a Bootstrap Container Fluid Div", "difficulty": 2.18, "description": [ "Now let's make sure all the content on your page is mobile-responsive.", "Let's nest your h3 element within a div element with the class container-fluid." ], "tests": [ "assert($(\"div\").hasClass(\"container-fluid\"), 'Your div element should have the class container-fluid.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements has a closing tag.')" ], "challengeSeed": [ "

jQuery Playground

", "", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9bec908846", "title": "Create a Bootstrap Row", "difficulty": 2.19, "description": [ "Now we'll create a Bootstrap row for our inline elements.", "Create a div element with the class row." ], "tests": [ "assert($(\"div\").length > 1, 'Add a div element below your h3 element.')", "assert($(\"div\").hasClass(\"row\"), 'Your div element should have the class row')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div element has a closing tag.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "", "
", "" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908847", "title": "Split your Bootstrap Row", "difficulty": 2.20, "description": [ "Now that we have a Bootstrap Row, let's split it into two columns to house our elements.", "Create two div elements within your row, both with the class col-xs-6." ], "tests": [ "assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest two div class=\"col-xs-6\" elements within your div class=\"row\" element.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements have closing tags.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "", "", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908848", "title": "Create Bootstrap Wells", "difficulty": 2.21, "description": [ "Bootstrap has a class called well that can create a visual sense of depth for your columns.", "Nest one div element with the class well within each of your col-xs-6 div elements." ], "tests": [ "assert($(\"div.col-xs-6\").not(\":has(>div.well)\").length < 1, 'Add a div element with the class well inside each of your div elements with the class \"col-xs-6\"')", "assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest both of your div elements with the class \"col-xs-6\" within your div element with the class \"row\".')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements have closing tags.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "", "
", "
", "", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908849", "title": "Add Elements within your Bootstrap Wells", "difficulty": 2.22, "description": [ "Now we're several div elements deep on each column of our row. This is as deep as we'll need to go. Now we can add our button elements.", "Nest three button elements within each of your well div elements." ], "tests": [ "assert($(\"div.well\").children(\"button\").length > 5, 'Nest three button elements within each of your div elements with class well.')", "assert($(\"button\") && $(\"button\").length > 5, 'You should have a total of 6 button elements.')", "assert(editor.match(/<\\/button>/g) && editor.match(/", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908852", "title": "Create a Class to Target with jQuery Selectors", "difficulty": 2.24, "description": [ "Not every class needs to have corresponding CSS. Sometimes we create classes just for the purpose of selecting these elements more easily using jQuery.", "Give each of your button elements the class target." ], "tests": [ "assert($(\".target\").length > 5, 'Apply the target class to each of your button elements.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908853", "title": "Add ID Attributes to Bootstrap Elements", "difficulty": 2.25, "description": [ "Recall that in addition to class attributes, you can give each of your elements an id attribute.", "Each id should be unique to a specific element.", "Let's give a unique id to each of our div elements of class well.", "Remember that you can give an element an id like this: <div class=\"well\" id=\"center-well\">", "Give the well on the left the id of left-well. Give the well on the right the id of right-well." ], "tests": [ "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908854", "title": "Label Bootstrap Wells", "difficulty": 2.26, "description": [ "For the sake of clarity, let's label both of our wells with their ids.", "Above your left-well, inside its col-xs-6 div element, add a h4 element with the text #left-well.", "Above your right-well, inside its col-xs-6 div element, add a h4 element with the text #right-well." ], "tests": [ "assert($(\".col-xs-6\").children(\"h4\") && $(\".col-xs-6\").children(\"h4\").length > 1, 'Add an h4 element to each of your <div class=\"col-xs-6\"> elements.');", "assert(new RegExp(\"#left-well\",\"gi\").test($(\"h4\").text()), 'One h4 element should have the text #left-well.');", "assert(new RegExp(\"#right-well\",\"gi\").test($(\"h4\").text()), 'One h4 element should have the text #right-well.');", "assert(editor.match(/<\\/h4>/g) && editor.match(/

/g).length === editor.match(/

h4 elements have closing tags.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "", "
", " ", " ", " ", "
", "
", "
", "", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908855", "title": "Give Each Element a Unique ID", "difficulty": 2.27, "description": [ "We will also want to be able to use jQuery to target each button by its unique id.", "Give each of your buttons a unique id like, starting with target1 and ending with target6." ], "tests": [ "assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One button element should have the id target1.')", "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One button element should have the id target2.')", "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One button element should have the id target3.')", "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One button element should have the id target4.')", "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One button element should have the id target5.')", "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One button element should have the id target6.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

", "
", " ", " ", " ", "
", "
", "
", "

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908856", "title": "Label Bootstrap Buttons", "difficulty": 2.28, "description": [ "Just like we labeled our wells, we want to label our buttons.", "Give each of your button elements text that corresponds to their id." ], "tests": [ "assert(new RegExp(\"#target1\",\"gi\").test($(\"#target1\").text()), 'Give your button element with the id target1 the text #target1.')", "assert(new RegExp(\"#target2\",\"gi\").test($(\"#target2\").text()), 'Give your button element with the id target2 the text #target2.')", "assert(new RegExp(\"#target3\",\"gi\").test($(\"#target3\").text()), 'Give your button element with the id target3 the text #target3.')", "assert(new RegExp(\"#target4\",\"gi\").test($(\"#target4\").text()), 'Give your button element with the id target4 the text #target4.')", "assert(new RegExp(\"#target5\",\"gi\").test($(\"#target5\").text()), 'Give your button element with the id target5 the text #target5.')", "assert(new RegExp(\"#target6\",\"gi\").test($(\"#target6\").text()), 'Give your button element with the id target6 the text #target6.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

", "
", " ", " ", " ", "
", "
", "
", "

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] }, { "id": "bad87fee1348bd9aec908857", "title": "Use Comments to Clarify Code", "difficulty": 2.29, "description": [ "When we start using jQuery, we will modify HTML elements without needing to actually change them in HTML.", "Let's make sure that everyone knows they shouldn't actually modify any of this code directly.", "Remember that you can start a comment with <!-- and end a comment with -->", "Add a comment at the top of your HTML that says You shouldn't need to modify code below this line." ], "tests": [ "assert(editor.match(//g) && editor.match(/-->/g).length > 0, 'Be sure to close your comment with -->.')" ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

", "
", " ", " ", " ", "
", "
", "
", "

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "type": "waypoint", "challengeType": 0, "nameCn": "", "descriptionCn": [], "nameFr": "", "descriptionFr": [], "nameRu": "", "descriptionRu": [], "nameEs": "", "descriptionEs": [], "namePt": "", "descriptionPt": [] } ] }