{ "name": "Bootstrap", "order": 2, "time": "5 hours", "helpRoom": "Help", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" } ], "challenges": [ { "id": "bad87fee1348bd9acdeb9212", "title": "Introduction to the Bootstrap Challenges", "description": [ [ "", "", "Bootstrap is a front-end framework used to design responsive web pages and web applications. It takes a mobile-first approach to web development. Bootstrap includes pre-built CSS styles and classes, plus some JavaScript functionality.", "" ], [ "", "", "Bootstrap uses a responsive 12 column grid layout and has design templates for:


This section introduces some of the ways to use Bootstrap in your web projects.", "" ] ], "releasedOn": "", "challengeSeed": [], "tests": [], "type": "Waypoint", "challengeType": 7, "isRequired": false, "translations": {} }, { "id": "bad87fee1348bd9acde08712", "title": "Use Responsive Design with Bootstrap Fluid Containers", "description": [ "In the HTML5 and CSS section of freeCodeCamp we built a Cat Photo App. Now let's go back to it. 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 by adding the following code to the top of your HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\"/>", "In this case, we've already added it for you to this page behind the scenes. Note that using either > or /> to close the link tag is acceptable.", "To get started, we should nest all of our HTML (except the link tag and the style element) in a div element with the class container-fluid." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", "\"A", "", "

Things cats love:

", "", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
" ], "tests": [ "assert($(\"div\").hasClass(\"container-fluid\"), 'message: Your div element should have the class container-fluid.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div element has a closing tag.');", "assert($(\".container-fluid\").children().length >= 8, 'message: Make sure you have nested all HTML elements after the closing style tag in .container-fluid.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Usa diseño adaptativo con los contenedores fluidos de Bootstrap", "description": [ "Ahora vamos de vuelta a nuestra aplicación de fotos de gatos. Esta vez, vamos a darle estilo utilizando la infraestructura CSS del popular Bootstrap.", "Bootstrap determina qué tan ancha es la pantalla y adapta correspondientemente el tamaño de tus elementos HTML - por eso es que se llama Diseño adaptativo (responsive design).", "Con diseño adaptativo, no hay necesidad de diseñar una versión móvil para tu sitio web. Se verá bien en dispositivos con pantallas de cualquier tamaño.", "Puedes agregar Bootstrap a cualquier aplicación simplemente incluyendo el siguiente código al inicio de tu HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css\"/>", "En este caso, lo hemos agregado a esta página por ti.", "Para iniciar, debemos anidar todo nuestro HTML en un elemento div con la clase container-fluid." ] }, "fr": { "title": "Un design adaptatif (responsive design) utilisant les conteneurs fluides de Bootstrap", "description": [ "Revenons à notre application de photos de chats. Cette fois-ci, nous allons lui donner un style grâce au renommé framework CSS Bootstrap.", "Bootstrap saura reconnaître la largeur de notre écran et s'y adapter en redimensionnant les éléments HTML - d'où le nom Responsive Design (design adaptatif).", "Avec le design responsive, il n'y a pas besoin de créer de version mobile de votre site. Il restera bien sur tous les appareils quelle que soit la taille de leurs écrans.", "Vous pouvez ajouter Bootstrap à n'importe quelle application simplement en incluant le code suivant en haut de votre HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css\"/>", "Ici, nous l'avons déjà ajouté à la page pour vous dans l'arrière-boutique.", "Pour commencer, nous devons envelopper nos éléments HTML dans un élément div possédant la classe container-fluid" ] } } }, { "id": "bad87fee1348bd9acde08812", "title": "Make Images Mobile Responsive", "description": [ "First, add a new image below the existing one. Set its src attribute to https://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." ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " \"A", "", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"img\").length === 2, 'message: You should have a total of two images.');", "assert($(\"img:eq(1)\").hasClass(\"img-responsive\"), 'message: Your new image should be below your old one and have the class img-responsive.');", "assert(!$(\"img:eq(1)\").hasClass(\"smaller-image\"), 'message: Your new image should not have the class smaller-image.');", "assert($(\"img:eq(1)\").attr(\"src\") === \"https://bit.ly/fcc-running-cats\", 'message: Your new image should have a src of https://bit.ly/fcc-running-cats.');", "assert(code.match(//g).length === 2 && code.match(/img element has a closing angle bracket.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Haz que las imágenes sean adaptativas en dispositivos móviles", "description": [ "Primero, agrega una nueva imagen debajo que la que ya existe. Haz que su atributo src sea https://bit.ly/fcc-running-cats.", "Sería genial si esta imagen fuera exactamente del tamaño de la pantalla de nuestro teléfono.", "Afortunadamente, con Bootstrap, todo lo que tenemos que hacer es agregar la clase img-responsive a tu imagen. Hazlo, y verás que la imagen se ajustará perfectamente al ancho de tu página." ] }, "fr": { "title": "Rendre des images adaptatives aux appareils mobiles", "description": [ "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.", "D'abord, ajoutez une nouvelle image en dessous de celle qui eiste dejà. Changez l'attribut src en https://bit.ly/fcc-running-cats.", "Ce serait absolument super si notre image pouvait être exactement de la largeur de l'écran du téléphone.", "Heureusement, avec Bootstrap, il faut seulement ajouter la classe img-responsive à notre image. Faites le, et l'image devrait s'ajuster parfaitement à la largeur de la page." ] } } }, { "id": "bad87fee1348bd8acde08812", "title": "Center Text with Bootstrap", "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>" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " \"A", "", " \"Three", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"h2\").hasClass(\"text-center\"), 'message: Your h2 element should be centered by applying the class text-center');", "assert($(\"h2\").hasClass(\"red-text\"), 'message: Your h2 element should still have the class red-text');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Centra el texto con Bootstrap", "description": [ "Ahora que estamos usando Bootstrap, podemos centrar nuestro elemento de encabezado para hacerlo verse mejor. Todo lo que necesitamos hacer es agregar la clase text-center a nuestro elemento h2.", "Recuerda que puedes agregar varias clases a un mismo elemento separando cada una de ellas con un espacio, de esta forma:", "<h2 class=\"red-text text-center\">your text</h2>" ] }, "fr": { "title": "Centrer du texte avec Bootstrap", "description": [ "Maintenant que wous utilisons Bootstrap, nous pouvons centrer notre entête pour qu'il ait une meilleure apparence. Nous devons seulement ajouter la classe text-center à notre élément h2.", "Souvenez vous que vous pouvez utiliser plusieurs classes pour un même élément en les séparant avec un espace, comme ceci:", "<h2 class=\"red-text text-center\">Votre texte</h2>" ] } } }, { "id": "bad87fee1348cd8acdf08812", "title": "Create a Bootstrap Button", "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\"." ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " \"A", "", " \"Three", "", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert(new RegExp(\"like\",\"gi\").test($(\"button\").text()), 'message: Create a new button element with the text \"Like\".');", "assert($(\"button\").hasClass(\"btn\"), 'message: Your new button should have the class btn.');", "assert(code.match(/<\\/button>/g) && code.match(/
", "By making them block elements with the additional class of btn-block, your button will stretch to fill your page's entire horizontal space and any elements following it will flow onto a \"new line\" below the block.", "<button class=\"btn btn-block\">Submit</button>", "This button would take up 100% of the available width.", "", "Note that these buttons still need the btn class.", "Add Bootstrap's btn-block class to your Bootstrap button." ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " \"A", "", " \"Three", " ", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"button\").hasClass(\"btn\"), 'message: Your button should still have the class btn.');", "assert($(\"button\").hasClass(\"btn-block\"), 'message: Your button should have the class btn-block.');", "assert(code.match(/<\\/button>/g) && code.match(/", "Haciéndolos bloquean elementos con la clase adicional de btn-block, el botón se amplía para llenar toda espacio horizontal de la página y los elementos siguientes fluirá sobre una \"nueva línea\" debajo del bloque .", "<button class=\"btn btn-block\">Enviar</button>", "Este botón llevaría hasta el 100% de la anchura disponible.", "", "Ten en cuenta que estos botones todavía necesitan la clase btn.", "Agrega la clase de Bootstrap btn-block a tu botón Bootstrap." ] }, "fr": { "title": "Créer un bouton bloc Bootstrap", "description": [ "Normalement , vos éléments de button avec une classe de btn ne sont aussi larges que le texte qu'ils contiennent . Par exemple:", "<button class=\"btn\">Soumettre</button>", "Ce bouton ne serait plus large que le mot \"Soumettre\" .", "", "En leur faisant bloquer les éléments avec la classe supplémentaire de btn-block, votre bouton étirer pour remplir tout l'espace horizontal de votre page et tous les éléments suivants, il coulera sur une \"nouvelle ligne\" en dessous du bloc .", "<button class=\"btn btn-block\">Soumettre</button>", "Ce bouton prendrait 100% de la largeur disponible .", "", "Notez que ces boutons ont toujours besoin de la classe btn", "Ajoutez la classe Bootstrap btn-block à votre bouton Bootstrap." ] } } }, { "id": "bad87fee1348cd8acef08811", "title": "Taste the Bootstrap Button Color Rainbow", "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." ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", "

Click here for cat photos.

", "", " \"A", "", " \"Three", " ", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"button\").hasClass(\"btn-primary\"), 'message: Your button should have the class btn-primary.');", "assert($(\"button\").hasClass(\"btn-block\") && $(\"button\").hasClass(\"btn\"), 'message: Your button should still have the btn and btn-block classes.');", "assert(code.match(/<\\/button>/g) && code.match(/", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert(new RegExp(\"info\",\"gi\").test($(\"button\").text()), 'message: Create a new button element with the text \"Info\".');", "assert($(\"button.btn-block.btn\").length > 1, 'message: Both of your Bootstrap buttons should have the btn and btn-block classes.');", "assert($(\"button\").hasClass(\"btn-info\"), 'message: Your new button should have the class btn-info.');", "assert(code.match(/<\\/button>/g) && code.match(/", " ", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert(new RegExp(\"Delete\",\"gi\").test($(\"button\").text()), 'message: Create a new button element with the text \"Delete\".');", "assert($(\"button.btn-block.btn\").length > 2, 'message: All of your Bootstrap buttons should have the btn and btn-block classes.');", "assert($(\"button\").hasClass(\"btn-danger\"), 'message: Your new button should have the class btn-danger.');", "assert(code.match(/<\\/button>/g) && code.match(/", " ", " ", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "tests": [ "assert($(\"div.row:has(button)\").length > 0, 'message: Your buttons should all be nested within the same div element with the class row.');", "assert($(\"div.col-xs-4:has(button)\").length > 2, 'message: Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4.');", "assert(code.match(/<\\/button>/g) && code.match(/
", " ", "
", " ", "
", "
", " ", "
", " ", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "" ], "tests": [ "assert(!$(\"h2\").hasClass(\"red-text\"), 'message: Your h2 element should no longer have the class red-text.');", "assert($(\"h2\").hasClass(\"text-primary\"), 'message: Your h2 element should now have the class text-primary.');", "assert(!$(\"p\").css(\"font-family\").match(/monospace/i), 'message: Your paragraph elements should no longer use the font Monospace.');", "assert(!$(\"img\").hasClass(\"smaller-image\"), 'message: Remove the smaller-image class from your top image.');", "assert($(\".img-responsive\").length > 1, 'message: Add the img-responsive class to your top image.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Reemplaza el CSS personalizado por Bootstrap", "description": [ "Podemos limpiar nuestro código y hacer que nuestra aplicación de fotos de gatos se vea más convencional, usando los estilos pre-construidos de Bootstrap, en lugar de los estilos personalizados que creamos antes.", "No te preocupes, luego habrá más tiempo para personalizar nuestro CSS.", "Elimina las declaraciones CSS .red-text, p, y .smaller-image de tu elemento style, de forma que las únicas declaraciones que queden en tu elemento style sean h2 y thick-green-border.", "Luego elimina el elemento p que contiene un enlace nulo. Después, elimina la clase red-text de tu elemento h2 y reemplázalo con la clase text-primary de Bootstrap.", "Por último, elimina la clase \"smaller-image\" de tu primer elemento img y reemplázalo con la clase img-responsive." ] }, "fr": { "title": "Remplacez le CSS personnalisé par les styles Bootstrap", "description": [ "Nous pouvons nettoyer notre code et rendre le look de notre appli Cat Photos plus conventionnel en utilisant les styles intégrés à Bootstrap à la place des styles personnalisés que nous avons créés auparavant.", "Ne vous inquiétez pas - nous auront beaucoup de temps pour personnaliser notre CSS plus tard.", "Supprimez les déclarations CSS .red-text, p, et .smaller-image de votre élément style pour que les seules déclarations restantes dans l'élément style soient h2 et thick-green-border.", "Ensuite supprimez l'élément p contenant un lien fantôme. Puis enlevez la classe red-text de votre élément h2 et remplacez la par la classe Bootstrap text-primary", "Enfin, enlevez la classe \"smaller-image\" dde votre premier élément img et remplacez le par la classe img-responsive." ] } } }, { "id": "bad87fee1348bd9aedf08845", "title": "Use a span to Target Inline Elements", "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>" ], "challengeSeed": [ "", "", "", "
", "

CatPhotoApp

", "", " \"A", "", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"p span\") && $(\"p span\").length > 0, 'message: Your span element should be inside your p element.');", "assert($(\"p span\") && $(\"p span\").text().match(/love/i) && !$(\"p span\").text().match(/Things cats/i), 'message: Your span element should have just the text love.');", "assert($(\"span\").hasClass(\"text-danger\"), 'message: Your span element should have class text-danger.');", "assert(code.match(/<\\/span>/g) && code.match(//g).length === code.match(/span element has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Usa span para elementos en línea", "description": [ "Puedes utilizar span para crear elementos en línea. ¿Recuerdas cuando usamos la clase btn-block para hacer que el botón llenara toda la línea?", "Esta imagen ilustra la diferencia entre elementos en línea (inline) y elementos a nivel de bloque (block-level):", "\"Un", "Al usar el elemento span, puedes poner varios elementos juntos, e incluso darle diferentes estilos a partes diferentes del mismo elemento.", "Anida la palabra \"love\" en tu elemento \"Things cats love\" dentro de un elemento span. Luego, asigna a ese elemento span la clase text-danger para hacer que el texto sea rojo.", "Así es como lo harías con el elemento \"Top 3 things cats hate\":", "<p>Top 3 things cats <span class=\"text-danger\">hate:</span></p>" ] }, "fr": { "title": "Utiliser Spans pour les éléments \"Inline\"", "description": [ "Vous pouvez utiliser les spans pour créer des éléments inline. Vous rappelez vous quand nous avions utilisé la classe btn-block pour remplir la rangée entière?", "Cette image illustre la différence entre les éléments inline (en ligne) et les éléments block-level (de blocs):", "\"Un", "En utilisant un élément span, vous pouvez mettre ensemble plusieurs éléments, et même donner un style différent à plusieurs parties d'un même élément", "Nichez le mot \"love\" dans votre élément \"Things cats love\" en dessous dans un élément span; Ensuite donnez à ce span la classe text-danger pour rendre le texte rouge.", "Il faudrait que vous fassiez ainsi pour l'élément \"Top 3 things cats hate\":", "<p>Top 3 things cats <span class=\"text-danger\">hate:</span></p>" ] } } }, { "id": "bad87fee1348bd9aede08845", "title": "Create a Custom Heading", "description": [ "We will make a simple heading for our Cat Photo App by putting the title and relaxing cat image 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 element 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?" ], "challengeSeed": [ "", "", "", "", "
", "

CatPhotoApp

", "", " \"A", "", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"div.row:has(h2)\").length > 0 && $(\"div.row:has(img)\").length > 0, 'message: 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 && $(\"div.col-xs-4:has(div)\").length === 0, 'message: Nest your topmost img element within a div with the class col-xs-4.');", "assert($(\"div.col-xs-8:has(h2)\").length > 0 && $(\"div.col-xs-8:has(div)\").length === 0, 'message: Nest your h2 element within a div with the class col-xs-8.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea un encabezado personalizado", "description": [ "Crearemos un encabezado simple para nuestra aplicación de fotos de gatos poniendo el título y la relajante imagen del gato en la misma línea.", "Recuerda, Bootstrap usa un sistema de cuadrícula adaptativo, el cual facilita poner elementos en filas y especificar el ancho relativo de cada elemento. La mayoría de las clases de Bootstrap pueden aplicarse a un elemento div.", "Aquí hay un diagrama del funcionamiento de la cuadrícula de 12 columnas Bootstrap:", "\"una", "En esta ilustración se está utilizando la clase col-md-*. Aquí, md significa mediano, y * es un número que especifica el número de columnas que debe tomar el ancho del elemento. En este caso, se especifica el ancho de columna de un elemento en una pantalla de tamaño mediano, como un computador portátil.", "En la aplicación de fotos de gatos que estamos construyendo, usaremos col-xs-*, donde xs significa extra pequeño (como una pantalla extra-pequeña de un teléfono), y * especifica el número de columnas que debe tomar el ancho del elemento.", "Anida tu primera imagen y tu elemento h2 dentro de un solo elemento <div class=\"row\">. Anida tu texto h2 dentro de un <div class=\"col-xs-8\"> y tu imagen en un <div class=\"col-xs-4\"> de tal forma que estén en la misma línea.", "¿Te diste cuenta de que la imagen es ahora justamente del tamaño apropiado para el texto?" ] }, "fr": { "title": "Créer un entête personalisé", "description": [ "Notice how the image is now just the right size to fit along the text?", "Nous allons réaliser un entête tout simple pour notre appli Cat Photo App en plaçant le titre et l'image de chat relaxante dans la même rangée.", "Rappelez-vous, Bootstrap utilise un système de grille adaptative, qui rend facile le placement des éléments en rangées et la définition de la largeur relative de chaque élément. La plupart des classes de Bootstrap peuvent être appliquées à un élément div.", "Voici un diagramme du fonctionnement de la grille à 12 colonnes de Bootstrap:", "\"Une", "Notez que dans cet exemple, on utilise la classe col-md-*. Ici md signifie medium, et * est un nombre spécifiant le nombre de colonnes en largeur que l'élément devrait avoir.", "Enveloppez votre première image et votre élément h2 dans un seul élément <div class=\"row\">. Mettez l'élément h2 dans un <div class=\"col-xs-8\"> et votre image dans un <div class=\"col-xs-4\"> pour qu'ils soient sur la même ligne.", "Voyez vous comme l'image est maintenant exactement ajustée à la bonne taille pour être à côté du texte?" ] } } }, { "id": "bad87fee1348bd9aedd08845", "title": "Add Font Awesome Icons to our Buttons", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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.", "You can include Font Awesome in any app by adding the following code to the top of your HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\"/>", "In this case, we've already added it for you to this page behind the scenes.", "The i element was originally used to make other elements italic, but is now commonly used for icons. You can add the Font Awesome classes to the i element to turn it into an icon, for example:", "<i class=\"fa fa-info-circle\"></i>", "Note that the span element is also acceptable for use with icons.", "Use Font Awesome to add a thumbs-up icon to your like button by giving it an i element with the classes fa and fa-thumbs-up." ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"i\").is(\".fa.fa-thumbs-up\") || $(\"span\").is(\".fa.fa-thumbs-up\"), 'message: Add an i element with the classes fa and fa-thumbs-up.');", "assert(($(\"i.fa-thumbs-up\").parent().text().match(/Like/gi) && $(\".btn-primary > i\").is(\".fa.fa-thumbs-up\")) || ($(\"span.fa-thumbs-up\").parent().text().match(/Like/gi) && $(\".btn-primary > span\").is(\".fa.fa-thumbs-up\")), 'message: Your fa-thumbs-up icon should be located within the Like button.');", "assert($(\"button\").children(\"i\").length > 0 || $(\"button\").children(\"span\").length > 0, 'message: Nest your i element within your button element.');", "assert(code.match(/<\\/i>|<\\/span>/g), 'message: Make sure your icon element has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Agrega iconos de Font Awesome a los botones", "description": [ "Font Awesome es una librería de iconos muy conveniente. Estos iconos son imágenes vectoriales, almacenadas en formato .svg, y son tratados como si fueran fuentes. Puedes especificar su tamaño usando pixeles, y tomarán el tamaño de fuente de su elemento HTML padre.", "Puedes añadir Font Awesome a cualquier aplicación sólo incluyendo y agregando el siguiente código al comienzo de tu HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\"/>", "En este caso, ya lo hemos agregado por tí a esta página tras bambalinas.", "El elemento i originalmente era usado para hacer textos en itálicas, pero ahora comunmente se usa para iconos. Le agregas clases de Font Awesome al elemento i para convertirlo en un ícono, por ejemplo:", "<i class=\"fa fa-info-circle\"></i>", "Usa Font Awesome para agregar un icono de \"pulgar arriba\" thumbs-up a tu botón de like dándole un elemento i con las clases fa y fa-thumbs-up." ] }, "fr": { "title": "Ajouter des icônes Font Awesome à nos boutons", "description": [ "Font Awesome est une librairie d'icônes très pratique. Ces icones sont des images vectorielles, stockées en format .svg. Ces icônes sont traités exactemeent comme des polices. Vous pouvez choisir leur taille en pixel, et ils prendront la taille de police de leur élémment parent HTML.", "Vous poyvez ajouter Font Awesome à n'importe quell application en ajoutant le code suivant en haut de votre HTML:", "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\"/>", "Ici, nous l'avons déjà ajouté pour vous dans le back-office.", "La balise i eétait utilisé à la base pour mettre les autres éléments en italique, mais maintenant elle est utilisée pour les icones. Vous ajoutez des classes Font Awesome à un élément i pour les les transformer en icones, par exemple:", "<i class=\"fa fa-info-circle\"></i>", "Utilisez Font Awesome pour ajouter un icone thumbs-up à votre bouton de like en lui donnant un élément i ayant les classes fa et fa-thumbs-up." ] } } }, { "id": "bad87fee1348bd9aedc08845", "title": "Add Font Awesome Icons to all of our Buttons", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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 an info-circle icon to your info button and a trash icon to your delete button.", "Note: The span element is an acceptable alternative to the i element for the directions below." ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\".btn-info > i\").is(\".fa.fa-info-circle\") || $(\".btn-info > span\").is(\".fa.fa-info-circle\"), 'message: You should add a <i class=\"fa fa-info-circle\"></i> within your info button element.');", "assert($(\".btn-danger > i\").is(\".fa.fa-trash\") || $(\".btn-danger > span\").is(\".fa.fa-trash\"), 'message: You should add a <i class=\"fa fa-trash\"></i> within your delete button element.');", "assert(code.match(/<\\/i>|<\\/span/g) && code.match(/<\\/i|<\\/span>/g).length > 2 && ($(\".btn-primary > i\").is(\".fa.fa-thumbs-up\") || $(\".btn-primary > span\").is(\".fa.fa-thumbs-up\")), 'message: 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.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Agrega Font Awesome a todos los botones", "description": [ "Font Awesome es una librería de iconos muy conveniente. Estos iconos son imágenes vectoriales, almacenadas en formato .svg, y son tratados como si fueran fuentes. Puedes especificar su tamaño usando pixeles, y tomarán el tamaño de fuente de su elemento HTML padre.", "Utiliza Font Awesome para agregar un icono info-circle a tu botón informativo y un icono trash a tu botón de eliminar." ] }, "fr": { "title": "Ajoutez des icones Font Awesome à tous nos boutons", "description": [ "Font Awesome est une librairie d'icônes très pratique. Ces icones sont des images vectorielles, stockées en format .svg. Ces icônes sont traités exactemeent comme des polices. Vous pouvez choisir leur taille en pixel, et ils prendront la taille de police de leur élémment parent HTML.", "Utilisez Font Awesome pour ajouter un icone info-circle à votre bouton d'info et un icone trash à votre bouton de suppression." ] } } }, { "id": "bad87fee1348bd9aedb08845", "title": "Responsively Style Radio Buttons", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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 both your radio buttons within a <div class=\"row\"> element. Then nest each of them within a <div class=\"col-xs-6\"> element.", "Note: As a reminder, radio buttons are input elements of type radio." ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", " ", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"div.row:has(input[type=\\\"radio\\\"])\").length > 0, 'message: Nest all of your radio buttons inside one div with the class row.');", "assert($(\"div.col-xs-6:has(input[type=\\\"radio\\\"])\").length > 1, 'message: Nest each of your radio buttons inside its own div with the class col-xs-6.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea botones de opción con estilo adaptativo", "description": [ "¡Puedes utilizar las clases col-xs-* de Bootstrap en elementos form también! De esta forma, nuestros botones de opción estarán igualmente distribuidos en la página, sin importar qué tan ancha es la resolución de la pantalla.", "Anida todos los botones de opción dentro de un elemento <div class=\"row\">. Luego, anida cada uno de ellos dentro de un elemento <div class=\"col-xs-6\">." ] }, "fr": { "title": "Donnez un style responsive à vos boutons radio", "description": [ "Vous pouvez utiliser la classe Bootstrap col-xs-* sur des éléments form. Comme ça, nos boutons radio serons disposés régulierement dans la page, quelle que soit la largeur de l'écran.", "Nichez tous vous boutons radio dans un élément <div class=\"row\">. Ensuite, nichezchacun d'entre eux dans un élément <div class=\"col-xs-6\">" ] } } }, { "id": "bad87fee1348bd9aeda08845", "title": "Responsively Style Checkboxes", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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 three of your checkboxes in a <div class=\"row\"> element. Then nest each of them in a <div class=\"col-xs-4\"> element." ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", " ", " ", " ", "
", "
" ], "tests": [ "assert($(\"div.row:has(input[type=\\\"checkbox\\\"])\").length > 0, 'message: Nest all of your checkboxes inside one div with the class row.');", "assert($(\"div.col-xs-4:has(input[type=\\\"checkbox\\\"])\").length > 2, 'message: Nest each of your checkboxes inside its own div with the class col-xs-4.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea casillas de selección con estilo adaptativo", "description": [ "¡Puedes utilizar las clases col-xs-* de Bootstrap en elementos form también! De esta forma, nuestros botones de opción estarán igualmente distribuidos en la página, sin importar qué tan ancha es la resolución de la pantalla.", "Anida todas las casillas de selección en un elemento <div class=\"row\">. Luego, anida cada una de ellas en un elemento <div class=\"col-xs-4\">." ] }, "fr": { "title": "Donnez un style responsive à vos checkbox (cases de séléction)", "description": [ "Vous pouvez aussi utiliser la classe Bootstrap col-xs-* sur des éléments form! Comme ça, nos boutons radio serons disposés régulierement dans la page, quelle que soit la largeur de l'écran.", "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.", "Nichez toustes vos checkbox dans un élément <div class=\"row\">. Ensuite nichez chacun d'entre eux dans un élément <div class=\"col-xs-4\">" ] } } }, { "id": "bad87fee1348bd9aed908845", "title": "Style Text Inputs as Form Controls", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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.", "All textual <input>, <textarea>, and <select> elements with the class .form-control have a width of 100%." ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", "
", "
" ], "tests": [ "assert($(\"button[type=\\\"submit\\\"]\").hasClass(\"btn btn-primary\"), 'message: Give the submit button in your form the classes btn btn-primary.');", "assert($(\"button[type=\\\"submit\\\"]:has(i.fa.fa-paper-plane)\").length > 0, 'message: Add a <i class=\"fa fa-paper-plane\"></i> within your submit button element.');", "assert($(\"input[type=\\\"text\\\"]\").hasClass(\"form-control\"), 'message: Give the text input in your form the class form-control.');", "assert(code.match(/<\\/i>/g) && code.match(/<\\/i/g).length > 3, 'message: Make sure each of your i elements has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Estiliza cajas de texto como controles de formulario", "description": [ "Puedes agregar el icono fa-paper-plane de Font Awesome incluyendo <i class=\"fa fa-paper-plane\"></i> dentro de tu elemento button de envío.", "Dale a la entrada de texto de tu formulario la clase form-control. Dale al botón de envío de tu formulario las clases btn btn-primary. También, incluye en ese botón el icono fa-paper-plane de Font Awesome." ] }, "fr": { "title": "Donnez un style similaire au contrôles de formulaires à des zones de texte", "description": [ "Vous pouvez ajouter l'icone Font Awesome fa-paper-plane en ajoutant <i class=\"fa fa-paper-plane\"></i> à l'intérieur de votre button de soumission du formulaire.", "Donnez aux entrées texte de votre formulaire une classe form-control. Donnez à votre bouton de soumission de formulaire les classes btn btn-primary. Donnez lui aussi un icone Font Awesome fa-paper-plane." ] } } }, { "id": "bad87fee1348bd9aec908845", "title": "Line up Form Elements Responsively with Bootstrap", "required": [ { "link": "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css", "raw": true } ], "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!" ], "challengeSeed": [ "", "", "", "
", "
", "
", "

CatPhotoApp

", "
", "
", " \"A", "
", "
", " \"Three", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", "

Things cats love:

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

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", "
", "
", " ", "
", "
", " ", "
", "
", " ", "
", "
", " ", " ", "
", "
" ], "tests": [ "assert($(\"div.row:has(input[type=\\\"text\\\"])\").length > 0 && $(\"div.row:has(button[type=\\\"submit\\\"])\").length > 0, 'message: 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, 'message: 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, 'message: Nest your form submission button in a div with the class col-xs-5.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Alínea elementos de formulario de forma adaptativa con Bootstrap", "description": [ "Ahora vamos a poner el elemento input y el elemento button que dice submit de tu formulario en la misma línea. Lo haremos de la misma forma que lo hicimos anteriormente: usando un elemento div con la clase row, y otros elementos div dentro de ese, usando la clase col-xs-*.", "Anida ambos, el elemento input y el elemento button que dice submit de tu formulario dentro de un div con la clase row. Anida el elemento input de tu formulario dentro de un div con cla clase col-xs-7. Anida el elemento button que dice submit de tu formulario en un elemento div con la clase col-xs-5.", "¡Este es el último desafío que haremos con nuestra aplicación de fotos de gato por ahora. Esperamos que hayas disfrutado aprender acerca de Font Awesome, Bootstrap y diseño adaptativo!" ] }, "fr": { "title": "Aligner les éléments de formulaire de façon responsive avec Bootstrap", "description": [ "Maintenant mettons sur la même ligne l'élément input et le button de soumission du formulaire. Nous procéderons de la même façon que précedemment: en utilisant un élément div avec la classe row, et un un autre div à l'intérieur qui aura la classe col-xs-*.", "Nichez à la fois l'input texte de votre formulaire et le button de soumission de formulaire à l'intérieur d'un div avec la classe row. Nichez l'input texte du formulaire dans un div ayant la classe col-xs-7. Nichez votre button de soumission de formulaire dans un div ayant la classe col-xs-5.", "C'est le dernier challenge qui concerne notre application de photos de chats. Nous espérons que vous avez aimé apprendre Font Awesome, Bootstrap et du design adaptatif!" ] } } }, { "id": "bad87fee1348bd9aec908846", "title": "Create a Bootstrap Headline", "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." ], "challengeSeed": [ "", "", "" ], "tests": [ "assert($(\"h3\") && $(\"h3\").length > 0, 'message: Add a h3 element to your page.');", "assert(code.match(/<\\/h3>/g) && code.match(/

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

h3 element has a closing tag.');", "assert($(\"h3\").hasClass(\"text-primary\"), 'message: Your h3 element should be colored by applying the class text-primary');", "assert($(\"h3\").hasClass(\"text-center\"), 'message: Your h3 element should be centered by applying the class text-center');", "assert.isTrue((/jquery(\\s)+playground/gi).test($(\"h3\").text()), 'message: Your h3 element should have the text jQuery Playground.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea un encabezado con Bootstrap", "description": [ "Ahora vamos a comenzar un proyecto desde cero para practicar nuestras habilidades con HTML, CSS y Bootstrap.", "Crearemos un área de juego con jQuery, el cual utilizaremos en nuestros desafíos con jQuery.", "Para empezar, crea un elemento h3, con el texto jQuery Playground.", "Ponle color a tu elemento h3 con la clase text-primary de Bootstrap, y céntrala con la clase text-center de Bootstrap." ] }, "fr": { "title": "Créer un entête Bootstrap", "description": [ "Maintenons, créons queqlque chose à partir de zéro pour pratiquer nos connaissances acquises sur HTML, CSS et Bootstrap.", "Nous allons construire un terrain de jeu pour jQuery, que nous allons bientôt utiliser dans les challenges jQuery.", "Pour commencer, créez un élément h3, contenant le texte jQuery Playground.", "Colorez notre élément h3 avec la classe Bootstrap text-primary, et centrez le en utilisant la classe Bootstrap text-center" ] } } }, { "id": "bad87fee1348bd9aec908746", "title": "House our page within a Bootstrap container-fluid div", "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." ], "challengeSeed": [ "

jQuery Playground

", "", "" ], "tests": [ "assert($(\"div\").hasClass(\"container-fluid\"), 'message: Your div element should have the class container-fluid.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.');", "assert($(\"div\").children(\"h3\").length >0, 'message: Nest your h3 element inside a div element.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Aloja la página dentro de un elemento Div contenedor fluido de Bootstrap", "description": [ "Ahora asegurémonos de que todo el contenido en nuestra página pueda adaptarse a dispositivos móviles.", "Anida tu elemento h3 dentro de un elemento div con la clase container-fluid." ] }, "fr": { "title": "Loger notre page dans un conteneur Bootstrap Fluid Div", "description": [ "Maintenant, assurons nous que tout le contenu de la page est mobile-responsive (adaptatif au téléphones mobiles).", "Nichons notre element h3 à l'intérieur d'un élément div ayant la classe container-fluid." ] } } }, { "id": "bad87fee1348bd9bec908846", "title": "Create a Bootstrap Row", "description": [ "Now we'll create a Bootstrap row for our inline elements.", "Create a div element below the h3 tag, with a class of row." ], "challengeSeed": [ "
", "

jQuery Playground

", "", "
", "" ], "tests": [ "assert(($(\"div\").length > 1) && ($(\"div.row h3.text-primary\").length == 0) && ($(\"div.row + h3.text-primary\").length == 0) && ($(\"h3.text-primary + div.row\").length > 0), 'message: Add a div element below your h3 element.');", "assert($(\"div\").hasClass(\"row\"), 'message: Your div element should have the class row');", "assert($(\"div.container-fluid div.row\").length > 0, 'message: Your row div should be nested inside the container-fluid div');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div element has a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea una fila en Bootstrap", "description": [ "Ahora crearemos una fila de Bootstrap con nuestros elementos en línea.", "Crea un elemento div debajo de la etiqueta h3, con la clase row." ] }, "fr": { "title": "Créer une rangée (row) Bootstrap", "description": [ "Maintenant nous allons créer une rangée (row) Bootstrap pour nos éléments inline.", "Créez un élément div en dessous de la balise h3, avec une classe row." ] } } }, { "id": "bad87fee1348bd9aec908847", "title": "Split Your Bootstrap Row", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "", "", "
", "
" ], "tests": [ "assert($(\"div.row > div.col-xs-6\").length > 1, 'message: Nest two div class=\"col-xs-6\" elements within your div class=\"row\" element.');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements have closing tags.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Parte tu fila en Bootstrap", "description": [ "Ahora que tenemos una fila en Bootstrap, vamos a partirla en dos columnas para alojar nuestros elementos.", "Crea dos elementos div dentro de tu fila, ambos con la clase col-xs-6." ] }, "fr": { "title": "Séparer une rangée Bootstrap", "description": [ "Maintenant que nous avons une rangée Bootstrap, séparons la en deux colonnes pour placer nos éléments.", "Créez deux éléments divdans votre rangée, chacun ayant la classe col-xs-6." ] } } }, { "id": "bad87fee1348bd9aec908848", "title": "Create Bootstrap Wells", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "", "
", "
", "", "
", "
", "
" ], "tests": [ "assert($(\"div.col-xs-6\").not(\":has(>div.well)\").length < 1, 'message: 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, 'message: Nest both of your div elements with the class \"col-xs-6\" within your div element with the class \"row\".');", "assert(code.match(/<\\/div>/g) && code.match(/
/g).length === code.match(/
div elements have closing tags.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea pozos en Bootstrap", "description": [ "Bootstrap tiene una clase llamada well que crea una sensación visual de profundidad para tus columnas.", "Anida un elemento div con la clase well dentro de cada uno de tus elementos div que tienen la clase col-xs-6." ] }, "fr": { "title": "Créez un \"puit\" (well) Bootstrap", "description": [ "Bootstrap possède une classe appelée well qui peux créer une certaine profondeur pour vos colonnes.", "Nichez un élément div avec la classe well dans chacun de vos éléments col-xs-6 div." ] } } }, { "id": "bad87fee1348bd9aec908849", "title": "Add Elements within Your Bootstrap Wells", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "
", "", "", "", "
", "
", "
", "
", "", "", "", "
", "
", "
", "
" ], "tests": [ "assert($(\"div.well:eq(0)\").children(\"button\").length === 3 && $(\"div.well:eq(1)\").children(\"button\").length === 3, 'message: Nest three button elements within each of your div elements with class well.');", "assert($(\"button\") && $(\"button\").length > 5, 'message: You should have a total of 6 button elements.');", "assert(code.match(/<\\/button>/g) && code.match(/", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert($(\".btn\").length > 5, 'message: Apply the btn class to each of your button elements.');", "assert($(\".btn-default\").length > 5, 'message: Apply the btn-default class to each of your button elements.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Aplica el estilo de botón predeterminado de Bootstrap", "description": [ "Bootstrap tiene otra clase de botón llamada btn-default.", "Aplica las clases btn y btn-default a cada uno de tus elementos button." ] }, "fr": { "title": "Appliquer le style de bouton par défaut de Bootstrap", "description": [ "Bootstrap possède une autre classe de bouton appelée btn-default.", "Appliquez les deux classes btn et btn-default à chacun de vos éléments button" ] } } }, { "id": "bad87fee1348bd9aec908852", "title": "Create a Class to Target with jQuery Selectors", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert($(\".target\").length > 5, 'message: Apply the target class to each of your button elements.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Crea una clase para usar con selectores de jQuery", "description": [ "No todas las clases necesitan tener un código CSS correspondiente. A veces creamos clases sólo con el propósito de seleccionar esos elementos más fácilmente usando jQuery.", "Dale a cada uno de tus elementos button la clase target." ] }, "fr": { "title": "Créez une classe à cibler avec les sélécteurs jQuery", "description": [ "Toutes les classes ne nécéssitent pas d'avoir un code CSS qui leur correspondent. Parfois ous créons des classes dans le seul but de pouvoir sélectionner ces éléments plus facilement en utilisant jQuery.", "Donnez à chacun de vos éléments button la classe target." ] } } }, { "id": "bad87fee1348bd9aec908853", "title": "Add id Attributes to Bootstrap Elements", "description": [ "Recall that in addition to class attributes, you can give each of your elements an id attribute.", "Each id must be unique to a specific element and used only once per page.", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'message: Give your left well the id of left-well.');", "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'message: Give your right well the id of right-well.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Asígnales atributos de identificación (id) a tus elementos de Bootstrap", "description": [ "Recuerda que, además de los atributos de clase, también puedes darle a cada uno de tus elementos un atributo id.", "Cada id debe ser único para un elemento específico y ser usado solamente una vez por página.", "Vamos a darle un id único a cada uno de nuestros elementos div que tienen la clase well.", "Recuerda que puedes darle a un elemento un id como el siguiente:", "<div class=\"well\" id=\"center-well\">", "Dale al pozo de la izquireda el id left-well. Al pozo de la derecha, dale un id right-well." ] }, "fr": { "title": "Ajouter des attributs ID à vos éléments Bootstrap", "description": [ "Rappelez vous qu'en plus des attributs classes, vous pouvez donnez à chacun de vos éléments un attribut id.", "Chaque id doit être unique pour un élément donné et utilisé une seule fois par page.", "Donnons un id unique à chacun de nos éléments div de classe well.", "Rappelez vous que vous pouvez donner un id à un élément ainsi :", "<div class=\"well\" id=\"center-well\">", "Donnez au puit sur la gauche un id de left-well. Donnez au puit sur la droite un id de right-well." ] } } }, { "id": "bad87fee1348bd9aec908854", "title": "Label Bootstrap Wells", "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." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "", "
", " ", " ", " ", "
", "
", "
", "", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert($(\".col-xs-6\").children(\"h4\") && $(\".col-xs-6\").children(\"h4\").length > 1, 'message: Add an h4 element to each of your <div class=\"col-xs-6\"> elements.');", "assert(new RegExp(\"#left-well\",\"gi\").test($(\"h4\").text()), 'message: One h4 element should have the text #left-well.');", "assert(new RegExp(\"#right-well\",\"gi\").test($(\"h4\").text()), 'message: One h4 element should have the text #right-well.');", "assert(code.match(/<\\/h4>/g) && code.match(/

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

h4 elements have closing tags.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Etiqueta tus pozos de Bootstrap", "description": [ "Para que todo esté más claro, vamos a ponerle a todos nuestros pozos una etiqueta que sea igual a su id.", "Sobre tu pozo de la izquierda, dentro de su elemento div que tiene la clase col-xs-6, agrega un elemento h4 con el texto #left-well.", "Ahora, sobre tu pozo de la derecha, dentro de su elemento div que tiene la clase col-xs-6, agrega un elemento h4 con el texto #right-well." ] }, "fr": { "title": "Donner un nom aux puits Bootstrap", "description": [ "Au nom de la clarté, donnons un nom à nos deux puits en accord avec leur ids", "Au dessus de votre puit de gauche, à l'intérieur de ses éléments col-xs-6 div, ajoutez un élément h4 ayant le texte #left-well.", "Au dessus de votre puit de droite, à l'intérieur de ses éléments col-xs-6 div, ajoutez un élément h4 ayant le texte #right-well." ] } } }, { "id": "bad87fee1348bd9aec908855", "title": "Give Each Element a Unique id", "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, starting with target1 and ending with target6.", "Make sure that target1 to target3 are in #left-well, and target4 to target6 are in #right-well." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

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

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'message: One button element should have the id target1.');", "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'message: One button element should have the id target2.');", "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'message: One button element should have the id target3.');", "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'message: One button element should have the id target4.');", "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'message: One button element should have the id target5.');", "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'message: One button element should have the id target6.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Dale a cada elemento un ID único", "description": [ "También quisiéramos referirnos a cada botón por su id utilizando jQuery.", "Dale a cada uno de tus botones un id único, comenzando con target1 y terminando con target6.", "Asegúrate que target1 a target3 queden en #left-well, mientras que target4 a target6 queden en #right-well." ] }, "fr": { "title": "Donner à chaque élément un ID unique", "description": [ "Nous désirerons aussi pouvoir être capable d'utiliser jQuery pour cibler chaque bouton suivant son id unique.", "Donnez à chaque bouton un id unique, commençant par target1 et finissant par target6.", "Assurez vous que target1 à target3 sont dans le #left-well, et que target4 à target6 sont dans le #right-well." ] } } }, { "id": "bad87fee1348bd9aec908856", "title": "Label Bootstrap Buttons", "description": [ "Just like we labeled our wells, we want to label our buttons.", "Give each of your button elements text that corresponds to its id's selector." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

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

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert(new RegExp(\"#target1\",\"gi\").test($(\"#target1\").text()), 'message: Give your button element with the id target1 the text #target1.');", "assert(new RegExp(\"#target2\",\"gi\").test($(\"#target2\").text()), 'message: Give your button element with the id target2 the text #target2.');", "assert(new RegExp(\"#target3\",\"gi\").test($(\"#target3\").text()), 'message: Give your button element with the id target3 the text #target3.');", "assert(new RegExp(\"#target4\",\"gi\").test($(\"#target4\").text()), 'message: Give your button element with the id target4 the text #target4.');", "assert(new RegExp(\"#target5\",\"gi\").test($(\"#target5\").text()), 'message: Give your button element with the id target5 the text #target5.');", "assert(new RegExp(\"#target6\",\"gi\").test($(\"#target6\").text()), 'message: Give your button element with the id target6 the text #target6.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Etiqueta los botones con Bootstrap", "description": [ "De la misma forma en que etiquetamos nuestros pozos, ahora vamos a etiquetar nuestros botones.", "Dale a cada uno de tus elementos button un texto que corresponda con su id." ] }, "fr": { "title": "Donnez un nom à vos boutons Bootstrap", "description": [ "De la même façon que nous avons donné un nom à nos puits, nous voulons nommer nos boutons.", "Donnez à chaque élément button un texte qui corresponde à son id." ] } } }, { "id": "bad87fee1348bd9aec908857", "title": "Use Comments to Clarify Code", "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 Only change code above this line." ], "challengeSeed": [ "
", "

jQuery Playground

", "
", "
", "

#left-well

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

#right-well

", "
", " ", " ", " ", "
", "
", "
", "
" ], "tests": [ "assert(code.match(/^\\s*.*this line))\\s*.*this line.*\\s*-->/gi), 'message: Your comment should have the text Only change code above this line.');", "assert(code.match(/-->.*\\n+.+/g), 'message: Be sure to close your comment with -->.');", "assert(code.match(//g).length, 'message: You should have the same number of comment openers and closers.');" ], "type": "waypoint", "challengeType": 0, "translations": { "es": { "title": "Usa elementos para explicar tu código", "description": [ "Cuando comencemos a usar jQuery, modificarmemos los elementos HTML sin necesidad de hacer cambios reales en el código HTML.", "Vamos a asegurar que cualquier persona sepa que no debe modificar nada en este código directamente.", "Recuerda que puedes iniciar un comentario usando <!-- y terminarlo usando -->", "Agrega un comentario al inicio de tu código HTML que diga Only change code above this line." ] }, "fr": { "title": "Utiliser des commentaires pour clarifier son code", "description": [ "Quand nous commencerons à utiliser jQuery, nous modifierons les éléments HTML sans avoir besoin de les changer directement dans le fichier HTML.", "Assurons nous que tout le monde sache qu'ils ne devraient pas modifier quoi que ce soit dans le code HTML.", "Rappelez vous que vous pouvez commencer un commentaire avec <!-- et le finir avec -->", "Ajoutez un commentaire en haut de l'HTML qui annonce Only change code above this line. (Changez seulement le code au dessus de cette ligne.)" ] } } } ] }