normalize all instructions in html5-and-css challenges
This commit is contained in:
@ -84,7 +84,7 @@
|
||||
"description": [
|
||||
"Create a <code>p</code> element below your <code>h2</code> element, and give it the text \"Hello Paragraph\".",
|
||||
"<code>p</code> elements are the preferred element for normal-sized paragraph text on websites. P is short for \"paragraph\".",
|
||||
"You can create a <code>p</code> element like so: <code><p>I'm a p tag!</p></code>"
|
||||
"You can create a <code>p</code> element like so: <code><p>I'm a p tag!</p></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert(($('p').length > 0), 'Create a <code>p</code> element.')",
|
||||
@ -106,7 +106,7 @@
|
||||
"descriptionEs": [
|
||||
"Crea un elemento párrafo debajo de tu elemento h2, y dale el texto \"Hello Paragraph\". Apenas escribas la etiqueta de apertura <code><p></code>, una de nuestras pruebas pasarán (ya que ésta es HTML válido). Asegúrate de cerrar el elemento agregando la etiqueta de cierre <code></p></code>.",
|
||||
"Los elementos párrafo son los principales elementos para los párrafos de texto en tamaño normal en sitios web.",
|
||||
"Tú puedes crear un elemento párrafo como éste: <code><p>I'm a p tag!</p></code>"
|
||||
"Tú puedes crear un elemento párrafo como éste: <code><p>I'm a p tag!</p></code>."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
@ -202,7 +202,8 @@
|
||||
"tests": [
|
||||
"assert(($('h1').length === 0), 'Comment out your <code>h1</code> element so that it is not visible on your page.')",
|
||||
"assert(($('h2').length > 0), 'Leave your <code>h2</code> element uncommented so that is not visible on your page.')",
|
||||
"assert(($('p').length === 0), 'Comment out your <code>p</code> element so that it is not visible on your page.')"
|
||||
"assert(($('p').length === 0), 'Comment out your <code>p</code> element so that it is not visible on your page.')",
|
||||
"assert(editor.match(/-->/g).length > 0, 'Be sure to close each of your comments with <code>--></code>.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<!--",
|
||||
@ -342,7 +343,7 @@
|
||||
"Cambia el estilo del elemento <code>h2</code> de manera que el color de su texto sea rojo.",
|
||||
"Podemos hacer esto por medio de cambiar el <code>estilo</code> del elemento <code>h2</code>.",
|
||||
"El estilo responsable del color de texto de un elemento es el estilo \"color\".",
|
||||
"Así es como podrías volver el color de texto de tu elemento <code>h2</code> en azul: <code><h2 style=\"color: blue\">CatPhotoApp</h2></code>"
|
||||
"Así es como podrías volver el color de texto de tu elemento <code>h2</code> en azul: <code><h2 style=\"color: blue\">CatPhotoApp</h2></code>."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
@ -356,8 +357,8 @@
|
||||
"With CSS, there are hundreds of CSS \"attributes\" that you can use to change the way an element looks on your page.",
|
||||
"When you entered <code><h2 style=\"color: red\">CatPhotoApp</h2></code>, you were giving that individual <code>h2</code> element an \"inline style\".",
|
||||
"That's one way to add style to an element, but a better way is by using Cascading Style Sheets (CSS).",
|
||||
"At the top of your code, create a <code>style</code> element like this: <code><style></style></code>",
|
||||
"Inside that style element, you can create a \"CSS selector\" for all <code>h2</code> elements. For example, if you wanted all <code>h2</code> elements to be red, your style element would look like this: <code><style>h2 {color: red;}</style></code>",
|
||||
"At the top of your code, create a <code>style</code> element like this: <code><style></style></code>.",
|
||||
"Inside that style element, you can create a \"CSS selector\" for all <code>h2</code> elements. For example, if you wanted all <code>h2</code> elements to be red, your style element would look like this: <code><style>h2 {color: red;}</style></code>.",
|
||||
"Note that it's important to have both opening and closing curly braces (<code>{</code> and <code>}</code>) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles."
|
||||
],
|
||||
"tests": [
|
||||
@ -380,10 +381,10 @@
|
||||
"descriptionEs": [
|
||||
"Borra el atributo <code>style</code> de tu elemento <code>h2</code> y escribe el CSS para hacer todos los elementos <code>h2</code> de color azul.",
|
||||
"Con CSS, hay cientos de <code>atributos CSS</code> que puedes usar para cambiar como un elemento se ve en una página web.",
|
||||
"Cuando entraste <code><h2 style=\"color: red\">CatPhotoApp<h2></code>, le estuviste dando a ese elemento h2 en particular un <code>estilo en línea</code>",
|
||||
"Cuando entraste <code><h2 style=\"color: red\">CatPhotoApp<h2></code>, le estuviste dando a ese elemento h2 en particular un <code>estilo en línea</code>.",
|
||||
"Esa es una forma de agregar estilo a un elemento, pero una manera mejor es usando <code>Hojas de Estilo en Cascada (Cascading Style Sheets, CSS)</code>.",
|
||||
"Al principio de tu código, crea una <code>etiqueta style</code> como ésta: <code><style></style></code>",
|
||||
"Dentro de ese elemento style, puedes crear un <code>selector css</code> para todos los elementos <code>h2</code>. Por ejemplo, si querías que todos los elementos <code>h2</code> sean rojos, tu elemento style se vería así: <code><style>h2 {color: red;}</style></code>",
|
||||
"Al principio de tu código, crea una <code>etiqueta style</code> como ésta: <code><style></style></code>.",
|
||||
"Dentro de ese elemento style, puedes crear un <code>selector css</code> para todos los elementos <code>h2</code>. Por ejemplo, si querías que todos los elementos <code>h2</code> sean rojos, tu elemento style se vería así: <code><style>h2 {color: red;}</style></code>.",
|
||||
"Fíjate que es importante tener <code>llaves de apertura y de cierre</code> (<code>{</code> y <code>}</code>) alrededor del estilo para cada elemento. También necesitas asegurarte que el estilo para tu elemento está entre las etiquetas style de apertura y cierre. Finalmente, asegúrate de agregar el punto y coma al final de cada uno de los estilos de tu elemento."
|
||||
],
|
||||
"namePt": "",
|
||||
@ -399,7 +400,7 @@
|
||||
"Here's the anatomy of a CSS class:",
|
||||
"<img class='img-responsive' alt='a diagram of how style tags are composed, which is also described in detail on the following lines.' src='https://www.evernote.com/l/AHSCzZV0l_dDLrqD8r9JsHaBWfEzdN0OpRwB/image.png'/>",
|
||||
"You can see that we've created a CSS class called \"blue-text\" within the <code><style></code> tag.",
|
||||
"You can apply a class to an HTML element like this: <code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
|
||||
"You can apply a class to an HTML element like this: <code><h2 class=\"blue-text\">CatPhotoApp</h2></code>.",
|
||||
"Note that in your CSS <code>style</code> element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.",
|
||||
"Instead of creating a new <code>style</code> element, try removing the <code>h2</code> style declaration from your existing style element, then replace it with the class declaration for \".red-text\"."
|
||||
],
|
||||
@ -480,6 +481,7 @@
|
||||
],
|
||||
"tests": [
|
||||
"assert($('p').length > 1, 'You need 2 <code>p</code> elements with Kitty Ipsum text.')",
|
||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p>/g).length, 'Make sure each of your <code>p</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/p>/g).length > 1, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
||||
"assert($('p').css('font-size') === '16px', 'Give your <code>p</code> elements the font-size of 16px.')"
|
||||
],
|
||||
@ -513,7 +515,7 @@
|
||||
"description": [
|
||||
"Make all of your <code>p</code> elements use the \"Monospace\" font.",
|
||||
"You can set an element's font by using the \"font-family\" attribute.",
|
||||
"For example, if you wanted to set your <code>h2</code> element's font to \"Sans-serif\", you would use the following CSS: <code>h2 { font-family: Sans-serif; }</code>"
|
||||
"For example, if you wanted to set your <code>h2</code> element's font to \"Sans-serif\", you would use the following CSS: <code>h2 { font-family: Sans-serif; }</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('p').css('font-family').match(/monospace/i), 'Your <code>p</code> elements should use the font \"Monospace\".')"
|
||||
@ -554,7 +556,7 @@
|
||||
"Apply the <code>font-family</code> of \"Lobster\" to your <code>h2</code> element.",
|
||||
"First, you'll need to make a \"call\" to Google to grab the \"Lobster\" font and load it into your HTML.",
|
||||
"Copy the following code snippet and paste it into your code editor above your <code>style</code> element:",
|
||||
"<code><link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'></code>",
|
||||
"<code><link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'></code>.",
|
||||
"Now you can set \"Lobster\" as a font-family attribute on your <code>h2</code> element."
|
||||
],
|
||||
"tests": [
|
||||
@ -598,8 +600,8 @@
|
||||
"description": [
|
||||
"Make all your <code>h2</code> elements use \"Lobster\" as their font family, but degrade to the \"Monospace\" font when the \"Lobster\" font isn't available.",
|
||||
"You can leave \"Lobster\" your <code>h2</code> element's font-family, and have it \"degrade\" to a different font when \"Lobster\" isn't available.",
|
||||
"For example, if you wanted an element to use the \"Helvetica\" font, but also degrade to the \"Sans-Serif\" font when \"Helvetica\" wasn't available, you could do use this CSS style: <code>p { font-family: \"Helvetica\", \"Sans-Serif\"; }</code>.",
|
||||
"There are several default fonts that are available in all browsers. These include \"Monospace\", \"Serif\" and \"Sans-Serif\". See if you can set your h2 elements to use \"Lobster\" and degrade to \"Monospace\".",
|
||||
"For example, if you wanted an element to use the \"Helvetica\" font, but also degrade to the \"Sans-Serif\" font when \"Helvetica\" wasn't available, you could do use this CSS style: <code>p { font-family: Helvetica, Sans-Serif; }</code>.",
|
||||
"There are several default fonts that are available in all browsers. These include \"Monospace\", \"Serif\" and \"Sans-Serif\". See if you can set your <code>h2</code> elements to use \"Lobster\" and degrade to \"Monospace\".",
|
||||
"Now try commenting out your call to Google Fonts, so that the \"Lobster\" font isn't available. Notice how it degrades to the \"Monospace\" font."
|
||||
],
|
||||
"tests": [
|
||||
@ -650,9 +652,9 @@
|
||||
"Sometimes HTML elements will receive conflicting information from CSS classes as to how they should be styled.",
|
||||
"If there's a conflict in the CSS, the browser will use whichever style declaration is closest to the bottom of the CSS document (whichever declaration comes last). Note that in-line style declarations are the final authority in how an HTML element will be rendered.",
|
||||
"There's one way to ensure that an element is rendered with a certain style, regardless of where that declaration is located. That one way is to use <code>!important</code>.",
|
||||
"In case you're curious, this is the priority hierarchy for element styles: !important > inline style > css class selector > css selector. That is, !important trumps all other styles, and inline styles trump style tag declarations.",
|
||||
"In case you're curious, this is the priority hierarchy for element styles: <code>!important</code> beats inline styles, which beats CSS class selectors, which beats CSS selector. That is, <code>!important</code> trumps all other styles, and inline styles trump style tag declarations.",
|
||||
"Here's an example of a CSS style that uses <code>!important</code>: <code><style> .urgently-blue { color: blue !important; } </style></code>.",
|
||||
"Now see if you can make sure the h2 element is rendered in the color red without removing the \"blue-text\" class, doing an in-line styling, or changing the sequence of CSS class declarations."
|
||||
"Now see if you can make sure the <code>h2</code> element is rendered in the color red without removing the \"blue-text\" class, doing an in-line styling, and without changing the sequence of CSS class declarations."
|
||||
],
|
||||
"tests": [
|
||||
"assert(new RegExp('.blue-text', 'gi').test(editor), 'Create the CSS class \"blue-text\"')",
|
||||
@ -707,8 +709,8 @@
|
||||
"Try it with this image: <code>http://bit.ly/fcc-kittens</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('img').length > 0, 'Your webpage should have an image element.')",
|
||||
"assert(!!$('img').filter(function(index) { return /kittens/gi.test($('img').attr('src')); }).length > 0, 'Your image should have have a <code>src</code> attribute that points to the kitten image.')"
|
||||
"assert($('img').length > 0, 'Your page should have an image element.')",
|
||||
"assert($('img').filter(function(index) { return /http://bit.ly/fcc-kittens/gi.test($('img').attr('src')); }).length > 0, 'Your image should have have a <code>src</code> attribute that points to the kitten image.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -750,7 +752,7 @@
|
||||
"difficulty": 0.027,
|
||||
"description": [
|
||||
"Create a class called <code>smaller-image</code> and use it to resize the image so that it's only 100 pixels wide.",
|
||||
"CSS has an attribute called <code>width</code> that controls an element's width. Just like with fonts, we'll use pixels(px) to specify the images width.",
|
||||
"CSS has an attribute called <code>width</code> that controls an element's width. Just like with fonts, we'll use pixels(px) to specify the image's width.",
|
||||
"For example, if we wanted to create a CSS class called \"larger-image\" that gave HTML elements a width of 500 pixels, we'd use: <code><style> .larger-image { width: 500px; } </style></code>."
|
||||
],
|
||||
"tests": [
|
||||
@ -853,7 +855,7 @@
|
||||
"name": "Waypoint: Add Rounded Corners with a Border Radius",
|
||||
"difficulty": 0.029,
|
||||
"description": [
|
||||
"Give your cat photo a border radius of 10 pixels.",
|
||||
"Give your cat photo a <code>border-radius</code> of 10 pixels.",
|
||||
"Your cat photo currently has sharp corners. We can round out those corners with a CSS attribute called <code>border-radius</code>.",
|
||||
"You can specify a <code>border-radius</code> with pixels. This will affect how rounded the corners are. Add this attribute to your <code>thick-green-border</code> class and set it to 10 pixels."
|
||||
],
|
||||
@ -970,14 +972,15 @@
|
||||
"name": "Waypoint: Link to External Pages with Anchor Elements",
|
||||
"difficulty": 0.031,
|
||||
"description": [
|
||||
"Create an <code>anchor</code> element that links to http://catphotoapp.com and has \"cat photos\" as its anchor text (link text).",
|
||||
"Here's a diagram of an <code>anchor tag</code>. In this case, it's used in the middle of a paragraph element, which means your link will appear in the middle of your sentence.",
|
||||
"Create an <code>a</code> element that links to http://catphotoapp.com and has \"cat photos\" as its anchor text (link text).",
|
||||
"Here's a diagram of an <code>a</code> element. In this case, it's used in the middle of a paragraph element, which means your link will appear in the middle of your sentence.",
|
||||
"<img class='img-responsive' alt='a diagram of how anchor tags are composed with the same text as on the following line' src='https://www.evernote.com/l/AHSaNaepx_lG9LhhPkVYmagcedpmAeITDsQB/image.png'/>",
|
||||
"Here's an example: <code><p>Here's a <a href='http://freecodecamp.com'> link to Free Code Camp</a> for you to follow.</p></code>"
|
||||
"Here's an example: <code><p>Here's a <a href='http://freecodecamp.com'> link to Free Code Camp</a> for you to follow.</p></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert((/cat photos/gi).test($('a').text()), 'Your <code>anchor</code> element should have the anchor text of \"cat photos\"')",
|
||||
"assert($('a').filter(function(index) { return /com/gi.test($('a').attr('href')); }).length > 0, 'You need an <code>anchor</code> element that links to <code>http://catphotoapp.com<code>.')"
|
||||
"assert((/cat photos/gi).test($('a').text()), 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
||||
"assert($('a').filter(function(index) { return /com/gi.test($('a').attr('href')); }).length > 0, 'You need an <code>a</code> element that links to <code>http://catphotoapp.com<code>.')",
|
||||
"assert(editor.match(/<\\/a>/g) && editor.match(/<\\/a>/g).length === editor.match(/<a>/g).length, 'Make sure your <code>a</code> element has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1031,17 +1034,18 @@
|
||||
"name": "Waypoint: Wrap an Anchor Element within a Paragraph",
|
||||
"difficulty": 0.032,
|
||||
"description": [
|
||||
"Now wrap your anchor element within a <code>p</code> element so that the surrounding paragraph says \"click here for cat photos\", but where only \"cat photos\" is a link - the rest is plain text.",
|
||||
"Now wrap your <code>a</code> element within a <code>p</code> element so that the surrounding paragraph says \"click here for cat photos\", but where only \"cat photos\" is a link - the rest is plain text.",
|
||||
"Again, here's a diagram of an <code>a</code> element for your reference:",
|
||||
"<img class='img-responsive' alt='a diagram of how anchor tags are composed with the same text as on the following line' src='https://www.evernote.com/l/AHSaNaepx_lG9LhhPkVYmagcedpmAeITDsQB/image.png'/>",
|
||||
"Here's an example: <code><p>Here's a <a href='http://freecodecamp.com'> link to Free Code Camp</a> for you to follow.</p></code>"
|
||||
"Here's an example: <code><p>Here's a <a href='http://freecodecamp.com'> link to Free Code Camp</a> for you to follow.</p></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('a').attr('href').match(/catphotoapp.com/gi).length > 0, 'You need an <code>a</code> element that links to \"catphotoapp.com\".')",
|
||||
"assert($('a').text().match(/cat\\sphotos/gi).length > 0, 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
||||
"assert($('a[href=\\'http://www.catphotoapp.com\\']').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')",
|
||||
"assert($('p').text().match(/click\\shere\\sfor/gi), 'Your <code>p</code> element should have the text \"click here for\".')",
|
||||
"assert(editor.match(/<\\/p>/g).length > 2, 'Make sureeach of your <code>p</code> elements has a closing tag.')"
|
||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p>/g).length, 'Make sure your <code>p</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/a>/g) && editor.match(/<\\/a>/g).length === editor.match(/<a>/g).length, 'Make sure your <code>a</code> element has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1097,10 +1101,10 @@
|
||||
"name": "Waypoint: Make Dead Links using the Hash Symbol",
|
||||
"difficulty": 0.033,
|
||||
"description": [
|
||||
"Use the hash symbol(#) to turn your <code>anchor</code> element's link into a dead link.",
|
||||
"Sometimes you want to add <code>anchor</code> elements to your website before you know where they will link.",
|
||||
"Use the hash symbol (#) to turn your <code>a</code> element's link into a dead link.",
|
||||
"Sometimes you want to add <code>a</code> elements to your website before you know where they will link.",
|
||||
"This is also handy when you're changing the behavior of a link using <code>jQuery</code>, which we'll learn about later.",
|
||||
"Replace your <code>anchor</code> element's <code>href</code> attribute with a hash symbol to turn it into a dead link."
|
||||
"Replace your <code>a</code> element's <code>href</code> attribute with a hash symbol to turn it into a dead link."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('a').attr('href') === '#', 'Your <code>anchor</code> element should be a dead link with a <code>href</code> attribute set to \"#\".')"
|
||||
@ -1159,16 +1163,16 @@
|
||||
"name": "Waypoint: Turn an Image into a Link",
|
||||
"difficulty": 0.034,
|
||||
"description": [
|
||||
"Wrap your <code>img</code> element inside an anchor element with a dead link.",
|
||||
"You can make elements into links by wrapping them in an <code>anchor tag</code>.",
|
||||
"Wrap your image in an <code>anchor tag</code>. Here's an example: <code><a href='#'><img src='http://bit.ly/fcc-kittens2'/></a></code>",
|
||||
"Remember to use the hash symbol as your <code>anchor tag</code>'s <code>href</code> property in order to turn it into a dead link.",
|
||||
"Wrap your <code>img</code> element inside an <code>a</code> element with a dead link.",
|
||||
"You can make elements into links by wrapping them within an <code>a</code> element.",
|
||||
"Wrap your image within an <code>a</code> element. Here's an example: <code><a href='#'><img src='http://bit.ly/fcc-kittens2'/></a></code>.",
|
||||
"Remember to use the hash symbol (#) as your <code>a</code> element's <code>href</code> property in order to turn it into a dead link.",
|
||||
"Once you've done this, hover over your image with your cursor. Your cursor's normal pointer should become the link clicking pointer. The photo is now a link."
|
||||
],
|
||||
"tests": [
|
||||
"assert(new RegExp('#').test($('a').children('img').parent().attr('href')), 'Your <code>anchor</code> element should be a dead link with a <code>href</code> attribute set to \"#\".')",
|
||||
"assert($('a').children('img').length > 0, 'Wrap your image element inside an anchor element.')",
|
||||
"assert(editor.match(/<\\/a>/g).length > 1, 'Make sureeach of your <code>a</code> elements has a closing tag.')"
|
||||
"assert(new RegExp('#').test($('a').children('img').parent().attr('href')), 'Your <code>a</code> element should be a dead link with a <code>href</code> attribute set to \"#\".')",
|
||||
"assert($('a').children('img').length > 0, 'Wrap your image element inside an <code>a</code> element.')",
|
||||
"assert(editor.match(/<\\/a>/g) && editor.match(/<\\/a>/g).length === editor.match(/<a>/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1224,11 +1228,11 @@
|
||||
"name": "Waypoint: Add Alt Text to an Image for Accessibility",
|
||||
"difficulty": 0.035,
|
||||
"description": [
|
||||
"Add the <code>alt text</code> \"A cute orange cat lying on its back\" to our cat photo",
|
||||
"<code>alt text</code> is what browsers will display if they fail to load the image. <code>alt text</code> is also important for blind or visually impaired users to understand what an image portrays. Search engines also look at <code>alt text</code>.",
|
||||
"In short, every image should have <code>alt text</code>!",
|
||||
"<code>Alt text</code> is a useful way to tell people (and web crawlers like Google) what is pictured in a photo. It's extremely important for helping blind or visually impaired people understand the content of your website.",
|
||||
"You can add alt text right in the img element like this: <code><img src=\"www.your-image-source.com/your-image.jpg\" alt=\"your alt text\"/></code>."
|
||||
"Add an <code>alt</code> attribute with the text \"A cute orange cat lying on its back\" to our cat photo.",
|
||||
"<code>alt</code> attributes, also known as \"alt text\", are what browsers will display if they fail to load the image. <code>alt</code> attributes are also important for blind or visually impaired users to understand what an image portrays. Search engines also look at <code>alt</code> attributes.",
|
||||
"In short, every image should have an <code>alt</code> attribute!",
|
||||
"<code>alt</code> attributes are a useful way to tell people (and web crawlers like Google) what is pictured in a photo. It's extremely important for helping blind or visually impaired people understand the content of your website.",
|
||||
"You can add an <code>alt</code> attribute right in the img element like this: <code><img src=\"www.your-image-source.com/your-image.jpg\" alt=\"your alt text\"/></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('img').filter(function(){ return /cat/gi.test(this.alt) }).length > 0, 'Your image element should have an <code>alt</code> attribute set to \"A cute orange cat lying on its back\".')"
|
||||
@ -1287,7 +1291,7 @@
|
||||
"name": "Waypoint: Create a Bulleted Unordered List",
|
||||
"difficulty": 0.036,
|
||||
"description": [
|
||||
"Replace the paragraph elements with an unordered list of three things that cats love.",
|
||||
"Replace your <code>p</code> elements with an unordered list of three things that cats love.",
|
||||
"HTML has a special element for creating unordered lists, or bullet point-style lists.",
|
||||
"Unordered lists start with a <code><ul></code> element. Then they contain some number of <code><li></code> elements.",
|
||||
"For example: <code><ul><li>milk</li><li>cheese</li></ul></code> would create a bulleted list of \"milk\" and \"cheese\"."
|
||||
@ -1295,8 +1299,8 @@
|
||||
"tests": [
|
||||
"assert($('ul').length > 0, 'Create a <code>ul</code> element.')",
|
||||
"assert($('li').length > 2, 'Add three <code>li</code> elements to your <code>ul</code> element.')",
|
||||
"assert(editor.match(/<\\/ul>/g), 'Make sureyour <code>ul</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length > 2, 'Make sureeach of your <code>li</code> elements has a closing tag.')"
|
||||
"assert(editor.match(/<\\/ul>/g) && editor.match(/<\\/ul>/g).length === editor.match(/<ul>/g).length, 'Make sure your <code>ul</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length === editor.match(/<li>/g).length, 'Make sure your <code>li</code> element has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1352,19 +1356,19 @@
|
||||
"name": "Waypoint: Create an Ordered List",
|
||||
"difficulty": 0.037,
|
||||
"description": [
|
||||
"Create an <code>ordered list</code> of the top 3 things cats hate the most.",
|
||||
"Create an ordered list of the top 3 things cats hate the most.",
|
||||
"HTML has a special element for creating ordered lists, or numbered-style lists.",
|
||||
"Ordered lists start with a <code><ol></code> element. Then they contain some number of <code><li></code> elements.",
|
||||
"For example: <code><ol><li>hydrogen</li><li>helium</li></ol></code> would create a numbered list of \"hydrogen\" and \"helium\"."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('ul').length > 0, 'You should have an <code>ul</code> element on your webpage.')",
|
||||
"assert($('ol').length > 0, 'You should have an <code>ol</code> element on your webpage.')",
|
||||
"assert($('ul').length > 0, 'You should have an <code>ul</code> element on your page.')",
|
||||
"assert($('ol').length > 0, 'You should have an <code>ol</code> element on your page.')",
|
||||
"assert($('li').length > 5, 'You should have three <code>li</code> elements within your <code>ul</code> element.')",
|
||||
"assert($('li').length > 5, 'You should have three <code>li</code> elements within your <code>ol</code> element.')",
|
||||
"assert(editor.match(/<\\/ol>/g), 'Make sureyour <code>ol</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/ul>/g), 'Make sureyour <code>ul</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/li>/g).length > 5, 'Make sureeach of your <code>li</code> elements has a closing tag.')"
|
||||
"assert(editor.match(/<\\/ul>/g) && editor.match(/<\\/ul>/g).length === editor.match(/<ul>/g).length, 'Make sure your <code>ul</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/ol>/g) && editor.match(/<\\/ol>/g).length === editor.match(/<ol>/g).length, 'Make sure your <code>ol</code> element has a closing tag.')",
|
||||
"assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length === editor.match(/<li>/g).length, 'Make sure your <code>li</code> element has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1424,9 +1428,9 @@
|
||||
"name": "Waypoint: Create a Text Field",
|
||||
"difficulty": 0.038,
|
||||
"description": [
|
||||
"Now we'll create a web form. Create a text field under your lists.",
|
||||
"Now we'll create a web form. Create a text input under your lists.",
|
||||
"Text inputs are a convenient way to get input from your user.",
|
||||
"You can create one like this: <code><input type='text'></code>"
|
||||
"You can create one like this: <code><input type='text'></code>. Note that <code>input</code> elements are self-closing."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('input').length > 0, 'Your app should have an text field input element.')"
|
||||
@ -1495,9 +1499,9 @@
|
||||
"name": "Waypoint: Add Placeholder Text to a Text Field",
|
||||
"difficulty": 0.039,
|
||||
"description": [
|
||||
"Add the placeholder text \"cat photo URL\" to your text field.",
|
||||
"Placeholder text will appear in your text field before your user has inputed anything.",
|
||||
"For example: <code><input type='text' placeholder='this is placeholder text'></code>"
|
||||
"Add the placeholder text \"cat photo URL\" to your text input.",
|
||||
"Your placeholder text is what appears in your text input before your user has inputed anything.",
|
||||
"You can create placeholder text like so: <code><input type='text' placeholder='this is placeholder text'></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('input[placeholder]').length > 0, 'Your text field should have a placeholder attribute.')",
|
||||
@ -1568,14 +1572,14 @@
|
||||
"name": "Waypoint: Create a Form Element",
|
||||
"difficulty": 0.040,
|
||||
"description": [
|
||||
"Wrap your text field in a <code><form></code> element. Add the <code>action=\"/submit-cat-photo\"</code> attribute to this form element.",
|
||||
"Wrap your text field in a <code>form</code> element. Add the <code>action=\"/submit-cat-photo\"</code> attribute to this form element.",
|
||||
"You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your <code>form</code> element.",
|
||||
"For example: <code><form action=\"/url-where-you-want-to-submit-form-data\"></form></code>"
|
||||
"For example: <code><form action=\"/url-where-you-want-to-submit-form-data\"></form></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('form').length > 0, 'Wrap your text input element within a <code>form</code> element.')",
|
||||
"assert($('form').attr('action'), 'Your <code>form</code> element should have an <code>action</code> attribute.')",
|
||||
"assert(editor.match(/<\\/form>/g), 'Make sure your <code>form</code> elements has a closing tag.')",
|
||||
"assert(editor.match(/<\\/form>/g) && editor.match(/<\\/form>/g).length === editor.match(/<form>/g).length, 'Make sure your <code>form</code> element has a closing tag.')",
|
||||
"assert(editor.match(/\\/submit-cat-photo/ig), 'Make sure your <code>form</code> action is set to <code>/submit-cat-photo</code>.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
@ -1645,13 +1649,13 @@
|
||||
"description": [
|
||||
"Add a submit button to your <code>form</code> element with type \"submit\" and \"Submit\" as its text.",
|
||||
"Let's add a submit button to your form. Clicking this button will send the data from your form to the URL you specified with your form's <code>action</code> attribute.",
|
||||
"Here's an example submit button: <code><button type='submit'>this button submits the form</button></code>"
|
||||
"Here's an example submit button: <code><button type='submit'>this button submits the form</button></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('form').children('button').length > 0, 'Your form should have a button inside it.')",
|
||||
"assert($('button').attr('type') === 'submit', 'Your submit button should have be of input type \"submit\".')",
|
||||
"assert($('button').text().match(/submit/gi), 'Your submit button should have the text \"submit\".')",
|
||||
"assert(editor.match(/<\\/button>/g), 'Make sureyour <code>button</code> element has a closing tag.')"
|
||||
"assert(editor.match(/<\\/button>/g) && editor.match(/<\\/button>/g).length === editor.match(/<button>/g).length, 'Make sure your <code>button</code> element has a closing tag.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1721,8 +1725,8 @@
|
||||
"difficulty": 0.042,
|
||||
"description": [
|
||||
"Make it required for your user to input text into your form before being able to submit it.",
|
||||
"You can require your user to complete specific form fields before they will be able to submit your form.",
|
||||
"For example, if you wanted to make a text input field required, you can just add the word \"required\" within your <code>input</code> element use: <code><input type='text' required></code>"
|
||||
"You can require specific form fields so that your user will not be able to submit your form until he or she has filled them out.",
|
||||
"For example, if you wanted to make a text input field required, you can just add the word \"required\" within your <code>input</code> element, you would use: <code><input type='text' required></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('input').prop('required'), 'Your text field should have the property of being required.')"
|
||||
@ -1795,15 +1799,15 @@
|
||||
"name": "Waypoint: Create a Set of Radio Buttons",
|
||||
"difficulty": 0.043,
|
||||
"description": [
|
||||
"Add to your form a pair of <code>radio buttons</code> that are wrapped in <code>label</code> elements and share a <code>name</code> attribute, with the options of \"indoor\" and \"outdoor\".",
|
||||
"You can use <code>radio buttons</code> for questions where you want the user to only give you one answer.",
|
||||
"Add to your form a pair of radio buttons. Each radio button should be wrapped within its own <code>label</code> element. They should share a common <code>name</code> attribute. One should have the option of \"indoor\" and the other should have the option of \"outdoor\".",
|
||||
"You can use radio buttons for questions where you want the user to only give you one answer.",
|
||||
"Radio buttons are a type of <code>input</code>.",
|
||||
"Radio buttons should be wrapped within <code>label</code> elements.",
|
||||
"Each of your radio buttons should be wrapped within its own <code>label</code> elements.",
|
||||
"All related radio buttons should have the same <code>name</code> attribute.",
|
||||
"Here's an example of a radio button: <code><label><input type='radio' name='indoor-outdoor'> Indoor</label></code>"
|
||||
"Here's an example of a radio button: <code><label><input type='radio' name='indoor-outdoor'> Indoor</label></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('input[type=\"radio\"]').length > 1, 'Your webpage should have two radio button elements.')",
|
||||
"assert($('input[type=\"radio\"]').length > 1, 'Your page should have two radio button elements.')",
|
||||
"assert($('input[type=\"radio\"]:nth-child(1)').attr('name') === 'indoor-outdoor', 'Give your radio buttons the <code>name</code> attribute of \"indoor-outdoor\".')",
|
||||
"assert($('label').length > 1, 'Each of your two radio button elements should be wrapped in a label element.')"
|
||||
],
|
||||
@ -1875,13 +1879,13 @@
|
||||
"name": "Waypoint: Create a Set of Checkboxes",
|
||||
"difficulty": 0.044,
|
||||
"description": [
|
||||
"Add to your form a set of three <code>checkbox</code> elements that are wrapped in <code>label</code> elements and share the same <code>name</code> attribute.",
|
||||
"Forms commonly use <code>checkbox</code> elements for questions that may have more than one answer.",
|
||||
"For example: <code><label><input type='checkbox' name='personality'> Loving</label></code>"
|
||||
"Add to your form a set of three checkbox elements. Each checkbox should be wrapped within its own <code>label</code> element. All three should share the same <code>name</code> attribute.",
|
||||
"Forms commonly use checkbox inputs for questions that may have more than one answer.",
|
||||
"For example: <code><label><input type='checkbox' name='personality'> Loving</label></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('input[type=\"checkbox\"]').length > 2, 'Your webpage should have three checkbox elements.')",
|
||||
"assert($('label:has(input[type=\"checkbox\"])').length > 2, 'Each of your three checkbox elements should be wrapped in a label element.')"
|
||||
"assert($('input[type=\"checkbox\"]').length > 2, 'Your page should have three checkbox elements.')",
|
||||
"assert($('label:has(input[type=\"checkbox\"])').length > 2, 'Each of your three checkbox elements should be wrapped in its own <code>label</code> element.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>",
|
||||
@ -1954,7 +1958,7 @@
|
||||
"difficulty": 0.045,
|
||||
"description": [
|
||||
"Clean up your form by adding linebreaks between form elements.",
|
||||
"Remember that you can create a linebreak element by using the code: <code><br></code>"
|
||||
"Remember that you can create a linebreak element by using the code: <code><br></code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('br').length > 1, 'Add at least 2 line breaks to visually separate your form elements.')"
|
||||
@ -2112,14 +2116,14 @@
|
||||
},
|
||||
{
|
||||
"_id": "bad87fee1348bd9aede08835",
|
||||
"name": "Waypoint: Wrap Many Elements within a Div Element",
|
||||
"name": "Waypoint: Wrap Many Elements within a Single Div Element",
|
||||
"difficulty": 0.047,
|
||||
"description": [
|
||||
"Wrap your \"Things cats love\" and \"Things cats hate\" lists all within a single <code>div</code> element.",
|
||||
"The <code>div</code> element, or \"Division\" element, is a general purpose container for other elements.",
|
||||
"The <code>div</code> element is probably the most commonly used HTML element of all. It's useful for assigning classes down to all the elements that it contains.",
|
||||
"The <code>div</code> element is probably the most commonly used HTML element of all. It's useful for passing the CSS of its own class declarations down to all the elements that it contains.",
|
||||
"Just like any other non-self-closing element, you can open a <code>div</code> element with <code><div></code> and close it on another line with <code></div></code>.",
|
||||
"Try putting your opening <code>div</code> tag above your \"Things cats love\" <code>p</code> element and your closing <code>div</code> tag after your closing <code>ol</code> tag so that both of your lists are within one div."
|
||||
"Try putting your opening <code>div</code> tag above your \"Things cats love\" <code>p</code> element and your closing <code>div</code> tag after your closing <code>ol</code> tag so that both of your lists are within one <code>div</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('div').children('ol').length > 0, 'Wrap your <code>ol</code> element inside your <code>div</code> element.')",
|
||||
@ -2205,7 +2209,7 @@
|
||||
"description": [
|
||||
"Create a class called \"gray-background\" with the background color of gray. Assign this class to your <code>div</code> element.",
|
||||
"You can set an element's background color with the \"background-color\" attribute.",
|
||||
"For example, if you wanted an element's background color to be \"green\", you'd use <code>.green-background { background-color: green; }</code>."
|
||||
"For example, if you wanted an element's background color to be \"green\", you'd use <code>.green-background { background-color: green; }</code> within your <code>style</code> element."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('div').hasClass('gray-background'), 'Give your <code>div</code> element the class \"gray-background\".')",
|
||||
@ -2415,8 +2419,8 @@
|
||||
"description": [
|
||||
"Change the <code>margin</code> of the green box to a negative value, so it fills the entire horizontal width of the yellow box around it.",
|
||||
"An element's <code>margin</code> controls the amount of space between an element's <code>border</code> and surrounding elements.",
|
||||
"If you set an element's margin to a negative value, the element will grow larger.",
|
||||
"Try to set the margin to a negative value like the one for the red box."
|
||||
"If you set an element's <code>margin</code> to a negative value, the element will grow larger.",
|
||||
"Try to set the <code>margin</code> to a negative value like the one for the red box."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.green-box').css('margin-top') === '-15px', 'Your <code>green-box</code> class should give elements -15px of margin.')"
|
||||
@ -2475,9 +2479,9 @@
|
||||
"name": "Waypoint: Add Different Padding to Each Side of an Element",
|
||||
"difficulty": 0.067,
|
||||
"description": [
|
||||
"Give the green box a padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Sometimes you will want to customize an element so that it has different padding on each of its sides.",
|
||||
"CSS allows you to control the padding of an element on all four sides with <code>padding-top</code>, <code>padding-right</code>, <code>padding-bottom</code>, and <code>padding-left</code> attributes."
|
||||
"Give the green box a <code>padding</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Sometimes you will want to customize an element so that it has different <code>padding</code> on each of its sides.",
|
||||
"CSS allows you to control the <code>padding</code> of an element on all four sides with <code>padding-top</code>, <code>padding-right</code>, <code>padding-bottom</code>, and <code>padding-left</code> attributes."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.green-box').css('padding-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of padding.')",
|
||||
@ -2540,15 +2544,15 @@
|
||||
"name": "Waypoint: Add Different Margins to Each Side of an Element",
|
||||
"difficulty": 0.068,
|
||||
"description": [
|
||||
"Give the green box a margin of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Sometimes you will want to customize an element so that it has a different margin on each of its sides.",
|
||||
"CSS allows you to control the margin of an element on all four sides with <code>margin-top</code>, <code>margin-right</code>, <code>margin-bottom</code>, and <code>margin-left</code> attributes."
|
||||
"Give the green box a <code>margin</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Sometimes you will want to customize an element so that it has a different <code>margin</code> on each of its sides.",
|
||||
"CSS allows you to control the <code>margin</code> of an element on all four sides with <code>margin-top</code>, <code>margin-right</code>, <code>margin-bottom</code>, and <code>margin-left</code> attributes."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.green-box').css('margin-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of margin.')",
|
||||
"assert($('.green-box').css('margin-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of margin.')",
|
||||
"assert($('.green-box').css('margin-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of margin.')",
|
||||
"assert($('.green-box').css('margin-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of margin.')"
|
||||
"assert($('.green-box').css('margin-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of <code>margin</code>.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<style>",
|
||||
@ -2605,15 +2609,15 @@
|
||||
"name": "Waypoint: Use Clockwise Notation to Specify the Padding of an Element",
|
||||
"difficulty": 0.069,
|
||||
"description": [
|
||||
"Use <code>Clockwise Notation</code> to give the \".green-box\" class a padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Use Clockwise Notation to give the \".green-box\" class a <code>padding</code> of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
|
||||
"Instead of specifying an element's <code>padding-top</code>, <code>padding-right</code>, <code>padding-bottom</code>, and <code>padding-left</code> attributes, you can specify them all in one line, like this: <code>padding: 10px 20px 10px 20px;</code>.",
|
||||
"These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific padding instructions."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.green-box').css('padding-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of padding.')",
|
||||
"assert($('.green-box').css('padding-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of padding.')",
|
||||
"assert($('.green-box').css('padding-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of padding.')",
|
||||
"assert($('.green-box').css('padding-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of padding.')"
|
||||
"assert($('.green-box').css('padding-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of <code>padding</code>.')",
|
||||
"assert($('.green-box').css('padding-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of <code>padding</code>.')",
|
||||
"assert($('.green-box').css('padding-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of <code>padding</code>.')",
|
||||
"assert($('.green-box').css('padding-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of <code>padding</code>.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<style>",
|
||||
@ -2672,10 +2676,10 @@
|
||||
"These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific margin instructions."
|
||||
],
|
||||
"tests": [
|
||||
"assert($('.green-box').css('margin-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of margin.')",
|
||||
"assert($('.green-box').css('margin-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of margin.')",
|
||||
"assert($('.green-box').css('margin-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of margin.')",
|
||||
"assert($('.green-box').css('margin-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of margin.')"
|
||||
"assert($('.green-box').css('margin-top') === '40px', 'Your <code>green-box</code> class should give the top of elements 40px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-right') === '20px', 'Your <code>green-box</code> class should give the right of elements 20px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-bottom') === '20px', 'Your <code>green-box</code> class should give the bottom of elements 20px of <code>margin</code>.')",
|
||||
"assert($('.green-box').css('margin-left') === '40px', 'Your <code>green-box</code> class should give the left of elements 40px of <code>margin</code>.')"
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
|
Reference in New Issue
Block a user