{ "name": "Basic CSS", "order": 1, "time": "5 hours", "helpRoom": "Help", "challenges": [ { "id": "597d77903675177232517ab2", "title": "Introduction to Basic CSS", "description": [ [ "", "", "Cascading Style Sheets (CSS) tell the browser how to display the text and other content that you write in HTML.", "" ], [ "", "", "CSS has been adopted by all major browsers and allows you to control:
", "" ], [ "", "", "CSS can be applied both as inline styles\u2014typed directly within HTML style tags\u2014or external style sheets\u2014typed in a separate file that is referenced from your HTML file. Most developers prefer external style sheets because they keep the styles separate from the HTML elements, therefore improving the readability and reusability of your code.", "" ], [ "", "", "The idea behind CSS is that you can use a selector to target an HTML element in the DOM (Document Object Model) and then apply a variety of attributes to that element to change the way it is displayed on the page.

In this section, you'll see how adding CSS styles to the elements of your CatPhotoApp can change it from simple text to something more.", "" ] ], "releasedOn": "", "challengeSeed": [], "tests": [], "type": "Waypoint", "challengeType": 7, "isRequired": false, "titleEs": "", "descriptionEs": [ [] ], "titleFr": "", "descriptionFr": [ [] ], "titleDe": "", "descriptionDe": [ [] ] }, { "id": "bad87fee1348bd9aedf08803", "title": "Change the Color of Text", "description": [ "Now let's change the color of some of our text.", "We can do this by changing the style of your h2 element.", "The style that is responsible for the color of an element's text is the \"color\" style.", "Here's how you would set your h2 element's text color to blue:", "<h2 style=\"color: blue\">CatPhotoApp</h2>", "
", "Change your h2 element's style so that its text color is red." ], "challengeSeed": [ "

CatPhotoApp

", "
", "

Click here to view more cat photos.

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

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", "
", " ", "
", " ", " ", "
", " ", " ", "
", "
" ], "tests": [ "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'message: Your h2 element should be red.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Lass uns jetzt die Farbe von unserem Text ändern.", "Wir können das bewerkstelligen, indem wir den style des h2 Elements ändern.", "Der Style, der zuständig für die Textfarbe eines Elements ist, ist der \"color\" Style.", "So könntest du die Textfarbe des h2 Elements in Blau ändern:", "<h2 style=\"color: blue\">CatPhotoApp</h2>", "
", "Ändere den Style des h2 Elements, damit die Textfarbe rot (\"red\") ist." ] }, "fr": { "title": "Changer la couleur du texte", "description": [ "Changeons maintenant la couleur de quelques-uns de nos textes.", "Nous pouvons le faire en changeant le style de votre élément h2.", "Le style responsable de la couleur de texte d'un élément est \"color\".", "Voici comment changer en bleu la couleur du texte de votre élément h2 :", "<h2 style=\"color: blue\">CatPhotoApp</h2>", "
", "Changez le style de votre élément h2 pour que son texte soit de couleur rouge." ] }, "pt-br": { "title": "Substitua a Cor do Texto", "description": [ "Agora vamos substituir a cor de parte do nosso texto.", "Podemos fazer isso mudando o style do elemento h2.", "A propriedade de estilo responsável pela cor do texto se chama \"color\".", "Você pode mudar a cor do texto de seu elemento h2 para azul assim:", "<h2 style=\"color: blue\">CatPhotoApp</h2>", "
", "Mude o estilo do elemento h2 para que seu texto fique com a cor vermelha." ] }, "ru": { "title": "Измените цвет текста", "description": [ "Теперь давайте изменим цвет части нашего текста.", "Мы можем сделать это изменив style нашего элемента h2.", "Параметр стиля, отвечающий за цвет текста внутри элемента - \"color\".", "Вот как вы могли бы установить цвет текста вашего элемента h2 синим:", "<h2 style=\"color: blue\">CatPhotoApp</h2>", "
", "Измените стиль вашего элемента h2 таким образом, чтобы текст элемента стал красным." ] } } }, { "id": "bad87fee1348bd9aedf08805", "title": "Use CSS Selectors to Style Elements", "description": [ "With CSS, there are hundreds of CSS properties that you can use to change the way an element looks on your page.", "When you entered <h2 style=\"color: red\">CatPhotoApp</h2>, you were giving that individual h2 element an inline style.", "That's one way to add style to an element, but there's a better way to use CSS, which stands for Cascading Style Sheets.", "At the top of your code, create a style element like this:", "
<style>
</style>
", "Inside that style element, you can create a CSS selector for all h2 elements. For example, if you wanted all h2 elements to be red, your style element would look like this:", "
<style>
  h2 {color: red;}
</style>
", "Note that it's important to have both opening and closing curly braces ({ and }) 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.", "
", "Delete your h2 element's style attribute and instead create a CSS style element. Add the necessary CSS to turn all h2 elements blue." ], "challengeSeed": [ "

CatPhotoApp

", "
", "

Click here to view more cat photos.

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

Things cats love:

", " ", "

Top 3 things cats hate:

", "
    ", "
  1. flea treatment
  2. ", "
  3. thunder
  4. ", "
  5. other cats
  6. ", "
", "
", " ", "
", " ", "
", " ", " ", "
", " ", " ", "
", "
" ], "tests": [ "assert(!$(\"h2\").attr(\"style\"), 'message: Remove the style attribute from your h2 element.');", "assert($(\"style\") && $(\"style\").length > 1, 'message: Create a style element.');", "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'message: Your h2 element should be blue.');", "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'message: Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.');", "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(//g) || []).length, 'message: Make sure all your style elements are valid and have a closing tag.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "CSS liefert dir hunderte Attribute oder properties um HTML Elemente auf deiner Seite zu gestalten.", "Mit <h2 style=\"color: red\">CatPhotoApp</h2> hast du dem einzelnen h2 Element einen sogenannten inline style gegeben.", "Das ist ein Weg, um Elemente zu gestalten. Es ist aber besser CSS, was für Cascading Style Sheets steht, zu benutzen.", "Erstelle über deinem Code ein style Element:", "
<style>
</style>
", "Innerhalb des Style Elements kannst du einen CSS selector für alle h2 Elemente erstellen. Wenn du zum Beispiel alle h2 Elemente rot färben willst, schreibst du:", "
<style>
  h2 {color: red;}
</style>
", "Beachte, dass du öffnende und schließende geschwungene Klammern ({ und }) um jeden Style setzen musst. Außerdem musst du sichergehen, dass deine Styles innerhalb dieser Klammern stehen. Zum Schluss benötigst du am Ende jedes Styles ein Semikolon.", "
", "Lösche das Style Attribute deines h2 Elements und erstelle stattdessen ein CSS style Element. Füge das notwendige CSS hinzu, um alle h2 Elemente Blau zu färben." ] }, "fr": { "title": "Utiliser les sélecteurs CSS pour styliser des éléments", "description": [ "Avec CSS, il y a des centaines de propriétés que vous pouvez utliser pour changer l'apparence d'un élément dans votre page.", "Quand vous avez entré <h2 style=\"color: red\">CatPhotoApp</h2>, vous donniez à cet élément h2 uniquement, un style inline.", "C'est une des façons d'ajouter un style à un élément, mais une meilleure approche est d'utiliser CSS, acronyme de Cascading Style Sheets.", "Au sommet de votre code, créez un élément style comme ceci :", "
<style>
</style>
", "À l'intérieur de cet élément style, vous pouvez créer des sélecteurs CSS pour tous les éléments h2. Par exemple, si vous voulez que tous les éléments h2 soient en rouge, votre élément style ressemblerait à ceci :", "
<style>
  h2 {color: red;}
</style>
", "Prenez note qu'il est important d'avoir les accolades ouvrantes et fermantes ({ and }) autour de chaque élément de style. Vous devez aussi vous assurer que vos styles se retrouvent entre une balise style ouvrante et fermante. Finalement, assurez-vous d'ajouter un point-virgule â la fin de chacun des styles d'éléments.", "
", "Supprimez les attributs de styles de votre élément h2 et créez plutôt un élément de style CSS. Ajoutez le CSS nécessaire pour rendre tous vos éléments h2 de couleur bleu." ] }, "pt-br": { "title": "Use Seletores CSS para Estilizar Elementos", "description": [ "Com o CSS, existem centenas de propriedades que você pode utilizar para modificar a forma de como um elemento pode ser visto em uma página da internet.", "Quando você usou o <h2 style=\"color: red\">CatPhotoApp<h2>, você deu ao elemento h2 um estilo inline.", "Essa é uma forma de adicionar estilos a um elemento, mas o jeito recomendado para isso é utilizar Folhas de Estilo em Cascata (Cascading Style Sheets, CSS).", "Acima de seu código, crie um elemento style como esse: <style></style>", "Dentro do elemento style, é possível criar um seletor CSS para todos os elementos h2. Por exemplo, se você quiser que todos os elementos h2 tenham a cor vermelha, seu elemento style será assim:", "<style>", "  h2 {color: red;}", "</style>", "Observe que é importante utilizar as chaves de abertura e de fechamento ({ e }) ao redor do estilo de cada elemento. Também é necessário que o estilo de seu elemento esteja entre as tags de abertura e fechamento. Por fim, não se esqueça de adicionar o ponto-e-vírgula no final de cada um dos estilos de seu elemento.", "
", "Apague o atributo style de seu elemento h2 e então crie um elemento style CSS. Adicione o CSS necessário para fazer com que todos os elementos h2 tenham a cor azul." ] }, "ru": { "title": "Используйте CSS-селекторы для стилизации элементов", "description": [ "В CSS существуют сотни CSS-свойств, которые вы можете использовать для изменения внешнего вида элементов вашей страницы.", "Когда вы вводите <h2 style=\"color: red\">CatPhotoApp</h2>, вы присваиваете определённому h2 элементу встроенный стиль.", "Это один из способов добавления стиля к элементу, но лучший способ - использование CSS, который является сокращением от Cascading Style Sheets (Каскадные таблицы стилей).", "Вверху вашего кода создайте элемент style следующим образом:", "
<style>
</style>
", "Внутри этого элемента style вы можете создать CSS-селектор для всех элементов h2 в документе. Например, если бы вы хотели, чтобы все элементы h2 были красными, ваш элемент style выглядел бы следующим образом:", "
<style>
  h2 {color: red;}
</style>
", "Обратите внимание, что важно наличие открывающих и закрывающих фигурных скобок ({ и }) вокруг стиля каждого элемента. Также вам необходимо убедиться в том, что стиль элемента присвоен внутри элемента style. В завершении, убедитесь, что строка объявления каждого элемента стиля должна заканчиваться точкой с запятой.", "
", "Удалите атрибут стиль вашего элемента h2 и взамен создайте CSS-элемент style. Добавьте необходимый CSS, чтобы все элементы h2 стали синими." ] } } }, { "id": "bad87fee1348bd9aecf08806", "title": "Use a CSS Class to Style an Element", "description": [ "Classes are reusable styles that can be added to HTML elements.", "Here's an example CSS class declaration:", "
<style>
  .blue-text {
    color: blue;
  }
</style>
", "You can see that we've created a CSS class called blue-text within the <style> tag.", "You can apply a class to an HTML element like this:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "Note that in your CSS style element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.", "
", "Inside your style element, change the h2 selector to .red-text and update the color's value from blue to red.", "Give your h2 element the class attribute with a value of 'red-text'." ], "challengeSeed": [ "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'message: Your h2 element should be red.');", "assert($(\"h2\").hasClass(\"red-text\"), 'message: Your h2 element should have the class red-text.');", "assert(code.match(/\\.red-text\\s*\\{\\s*color\\s*:\\s*red;\\s*\\}/g), 'message: Your stylesheet should declare a red-text class and have its color set to red.');", "assert($(\"h2\").attr(\"style\") === undefined, 'message: Do not use inline style declarations like style=\"color: red\" in your h2 element.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Klassen sind wiederverwendbare Styles, die HTML Elementen zugewiesen werden können.", "So sieht eine CSS Klasse aus:", "
<style>
  .blue-text {
    color: blue;
  }
</style>
", "Du siehst, dass wir die CSS Klasse blue-text innerhalb von <style> geschrieben haben.", "Du kannst eine Klasse folgendermaßen einem HTML Element beifügen:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "Beachte, dass Klassen in deinem CSS style Element mit einem Punkt beginnen sollten. In deinen Klassen-Deklarationen von HTML Elementen sollten diese nicht mit einem Punkt beginnen.", "
", "Ändere deinen h2 Selektor innerhalb deines style Elements zu .red-text und ändere den Farbwert von blue zu red.", "Gib deinem h2 Element das class Attribut mit dem Wert 'red-text'." ] }, "fr": { "title": "Utiliser les classes CSS pour styler un élément", "description": [ "Les classes sont des styles réutilisables qui peuvent être ajoutées à des éléments HTML.", "Voici un exemple de déclaration de classe CSS :", "
<style>
  .blue-text {
    color: blue;
  }
</style>
", "Remarquez que nous avons créer une classe CSS nommée blue-text à l'intérieur de notre balise <style>.", "Vous pouvez appliquer une classe à un élément HTML comme ceci :", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "Prenez note que que dans votre élément CSS style, les classes doivent débuter par un point. Dans les déclarations de classes à l'intérieur des éléments HTML, on doit omettre le point du début.", "
", "À l'intérieur de votre élément style, changez le sélecteur du h2 pour .red-text et changez la couleur, passant de blue à red.", "Donnez à votre élément h2 l'attribut de classe la valeur de red-text." ] }, "pt-br": { "title": "Use Classes CSS para Estilizar Elementos", "description": [ "As classes são estilos reutilizáveis que podem ser adicionadas a elementos HTML.", "Aqui está um exemplo de como declarar uma classe com CSS:", "<style>", "  .blue-text {", "    color: blue;", "  }", "</style>", "Veja que criamos uma classe CSS chamada \"blue-text\" no interior da tag <style>.", "Você pode aplicar uma classe a um elemento HTML assim:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "Note que em seu elemento style CSS, as classes devem começar com um ponto. Já nos elementos HTML, as declarações de classes não devem começar com o ponto.", "
", "Ao invés de criar um novo elemento style, tente eliminar a declaração de estilo de h2 dos elementos de estilo existentes, e troque ela pela declaração de classe .red-text.", "Crie uma classe CSS chamada red-text e então a aplique em seu elemento h2." ] }, "ru": { "title": "Используйте CSS-класс для стилизации элемента", "description": [ "Классы являются повторно применяемыми стилями, которые могут быть добавлены к HTML-элементам.", "Вот пример объявления CSS-класса:", "
<style>
  .blue-text {
    color: blue;
  }
</style>
", "Вы можете увидеть, что мы создали CSS-класс названный blue-text внутри элемента <style>.", "Вы можете применить класс к HTML-элементу следующим образом:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "Обратите внимание, что в вашем CSS-элементе style названию классов следует начинаться с точки. При присваивании классов HTML-элементам названия классов не должны начинаться с точки.", "
", "Внутри вашего элемента style, замените селектор h2 на .red-text и измените значение цвета с blue на red.", "Присвойте вашему элементу h2 атрибут class со значением 'red-text'." ] } } }, { "id": "bad87fee1348bd9aefe08806", "title": "Style Multiple Elements with a CSS Class", "description": [ "Classes allow you to use the same CSS styles on multiple HTML elements. You can see this by applying your red-text class to the first p element." ], "challengeSeed": [ "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'message: Your h2 element should be red.');", "assert($(\"h2\").hasClass(\"red-text\"), 'message: Your h2 element should have the class red-text.');", "assert($(\"p:eq(0)\").css(\"color\") === \"rgb(255, 0, 0)\", 'message: Your first p element should be red.');", "assert(!($(\"p:eq(1)\").css(\"color\") === \"rgb(255, 0, 0)\") && !($(\"p:eq(2)\").css(\"color\") === \"rgb(255, 0, 0)\"), 'message: Your second and third p elements should not be red.');", "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'message: Your first p element should have the class red-text.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Du kannst Klassen zu HTML Elementen hinzufügen, indem du zum Beispiel class=\"deine-klasse\" innerhalb des öffnenden Tags schreibst.", "Vergiss nicht dass CSS Klassenselektoren einen Punkt am Anfang brauchen:", "
.blue-text {
  color: blue;
}
", "Aber Klassen-Deklarationen brauchen keinen Punkt:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "
", "Füge die red-text Klasse dem ersten p Element hinzu." ] }, "fr": { "title": "Stylez plusieurs éléments avec une classe CSS", "description": [ "Souvenez-vous que vous pouvez ajouter des classes aux éléments HTML en utilisant class=\"votre-classe-ici\" à l'intérieur de la balise ouvrante correspondante.", "Souvenez-vous que les sélecteurs CSS nécessitent un point au début comme ceci :", "
.blue-text {
  color: blue;
}
", "Rappelez-vous également que les déclarations de classes n'ont pas de point, comme ceci :", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "
", "Appliquez la classe red-text à votre premier élément p." ] }, "pt-br": { "title": "Estilize Múltiplos Elementos com uma Classe CSS", "description": [ "Lembre-se que é possível adicionar classes a elementos HTML ao utilizar class=\"sua-classe-aqui\" dentro da tag de abertura do elemento.", "Relembre também que os seletores de classes CSS exigem um ponto em seu início, assim:", ".blue-text {", "  color: blue;", "}", "Contudo, não se esqueça que as declarações de classes em elementos não utilizam ponto, assim:", "<h2 class=\"blue-text\">CatPhotoApp<h2>", "
", "Adicione a classe red-text ao seu primeiro elemento p." ] }, "ru": { "title": "Стилизуйте множество элементов с помощью CSS-класса", "description": [ "Помните, что вы можете присваивать классы HTML-элементам используя class=\"ваш-класс-тут\" внутри открывающей метки соответствующего элемента.", "Помните, что селекторы CSS-классов должны начинаться с точки, например:", "
.blue-text {
  color: blue;
}
", "Но также не забывайте, что присваивание классов не использует точку, например:", "<h2 class=\"blue-text\">CatPhotoApp</h2>", "
", "Примените класс red-text к вашим элемент первые p." ] } } }, { "id": "bad87fee1348bd9aedf08806", "title": "Change the Font Size of an Element", "description": [ "Font size is controlled by the font-size CSS property, like this:", "
h1 {
  font-size: 30px;
}
", "
", "Inside the same <style> tag that contains your red-text class, create an entry for p elements and set the font-size to 16 pixels (16px)." ], "challengeSeed": [ "", "", "

CatPhotoApp

", "
", "

Click here to view more 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(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'message: Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Schriftgröße wird von dem CSS Attribut font-size kontrolliert:", "
h1 {
  font-size: 30px;
}
", "
", "Erstelle dann innerhalb deines <style> Elements, das auch deine red-text Klasse enthält, einen Eintrag für p Elemente und setzte font-size auf 16 Pixel (16px)." ] }, "fr": { "title": "Changez la taille de police d'un élément", "description": [ "La taille de police est contrôlée par la propriété CSS font-size, comme ceci :", "
h1 {
  font-size: 30px;
}
", "
", "À l'intérieur de la même balise <style> qui contiens votre classe .red-text, créez une nouvelle entrée pour les éléments p et paramétrer le font-size à 16 pixels (16px)." ] }, "pt-br": { "title": "Mude o Tamanho da Fonte de um Elemento", "description": [ "O tamanho da fonte é controlado pela propriedade CSS \"font-size\", como aqui:", "h1 {", "  font-size: 30px;", "}", "
", "Dentro da mesma tag <style> que criamos para sua classe red-text, modifique o font-size dos elementos p para que tenha um tamanho de 16 pixels (16px)." ] }, "ru": { "title": "Измените размер шрифта элемента", "description": [ "Размером шрифта управляют с помощтю CSS-своайства font-size, например:", "
h1 {
  font-size: 30px;
}
", "
", "Внутри того же элемента <style>, который содержит ваш класс red-text, создайте вхождение для элементов p и установите свойство font-size равным 16 пикселей (16px)." ] } } }, { "id": "bad87fee1348bd9aede08807", "title": "Set the Font Family of an Element", "description": [ "You can set an element's font by using the font-family property.", "For example, if you wanted to set your h2 element's font to Sans-Serif, you would use the following CSS:", "
h2 {
  font-family: Sans-Serif;
}
", "
", "Make all of your p elements use the Monospace font." ], "challengeSeed": [ "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'message: Your p elements should use the font Monospace.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Du kannst einem Element mit font-family eine Schriftart zuweisen.", "Wenn du zum Beispiel deinem h2 Element die Schriftart Sans-Serif zuweisen willst, kannst du das mit dem folgenden CSS tun:", "
h2 {
  font-family: Sans-Serif;
}
", "
", "Definiere für alle p Elemente die Schriftart Monospace." ] }, "fr": { "title": "Paramétrer la famille de police d'un élément", "description": [ "Vous pouvez paramétrer la police d'un élément en utilisant la propriété font-family.", "Par exemple, si vous voulez paramétrer la police de votre élément h2 à Sans-Serif, vous devez utiliser le CSS suivant :", "
h2 {
  font-family: Sans-Serif;
}
", "
", "Faites en sorte que tous vos éléments p aient la police Monospace." ] }, "pt-br": { "title": "Defina a Fonte para um Elemento", "description": [ "Você pode estabelecer o estilo de fonte para um elemento ao utilizar a propriedade font-family.", "Por exemplo, se você quiser estabelecer o estilo de fonte de seu elemento h2 como Sans-Serif, você poderá utilizar o seguinte código em CSS:", "h2 {", "  font-family: Sans-Serif;", "}", "
", "Faça com que todos os elementos p utilizem o estilo de fonte Monospace." ] }, "ru": { "title": "Установите семейство шрифтов для элемента", "description": [ "Вы можете установить семейство шрифтов для элемента используя свойство font-family.", "Например, если бы вы хотели установить семейство шрифтов Sans-Serif для вашего элемента h2, вы бы использовали следующий CSS:", "
h2 {
  font-family: Sans-Serif;
}
", "
", "Присвойте шрифт Monospace всем вашим элементам p." ] } } }, { "id": "bad87fee1348bd9aedf08807", "title": "Import a Google Font", "description": [ "Now, let's import and apply a Google font (note that if Google is blocked in your country, you will need to skip this challenge).", "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 the top of your code editor:", "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Remember, before you can apply styles, like a new font, to an element, you'll need to create a CSS rule.", "
h2 {
font-family: Sans-Serif;
}
", "
", "Create a CSS rule for the font-family of Lobster and apply this new font to your h2 element." ], "challengeSeed": [ "", "", "

CatPhotoApp

", "
", "

Click here to view more 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(new RegExp(\"googleapis\", \"gi\").test(code), 'message: Import the Lobster font.');", "assert($(\"h2\").css(\"font-family\").match(/lobster/i), 'message: Your h2 element should use the font Lobster.');", "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?\\s*;\\s*\\}/gi.test(code), 'message: Use an h2 CSS selector to change the font.');", "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'message: Your p element should still use the font Monospace.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Lass uns jetzt eine Google Font importieren und verwenden. (Beachte dass du diese Challenge überspringen musst, falls Google in deinem Land blockiert wird)", "Zuerst musst du einen call (Anfrage) an Google machen um um auf Lobster zugreifen und in dein HMTL einbinden zu können.", "Kopiere den folgenden Code und füge diesen in deinen Editor oben ein:", "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Jetzt kannst du \"Lobster\" als font-family Attribut zu deinem h2 Element hinzufügen.", "
", "Füge dem h2 Element die Schriftart oder font-family Lobster hinzu." ] }, "fr": { "title": "Importer une police de Google", "description": [ "Maintenant, importons et appliquons une police de Google (prenez note que si Google est interdit d'accès dans votre pays, vous devrez omettre ce défi).", "Premièrement, vous devrez faire un appel vers Google pour prendre la police Lobster et la charger dans votre HTML.", "Copier l'extrait de code suivant et coller le dans le haut de votre éditeur de code :", "Maintenant vous pouvez paramétrer Lobster comme valeur de police de votre élément h2.", "
", "Appliquer la valeur Lobster à la font-family de votre élément h2." ] }, "pt-br": { "title": "Importe uma Fonte a Partir do Google Fonts", "description": [ "Agora, vamos importar e aplicar um estilo de fonte por meio do Google Fonts.", "Primeiro, faça um chamado ao Google Fonts para poder utilizar a fonte chamada Lobster e carregá-la em seu HTML.", "Para fazer isso, copie o código abaixo e insira-o na parte superior de seu editor de texto:", "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "
", "Agora, estableça Lobster como o valor para font-family em seu elemento h2." ] }, "ru": { "title": "Импортируйте шрифт Google", "description": [ "Теперь давайте импортируем и применим шрифт Google (обратите внимание, что если Google заблокирован в ваней стране, вам нужно будет пропустить это испытание).", "Сначала вам понадобится сделать запрос к Google для получения шрифта Lobster и загрузить его в ваш HTML.", "Скопируйте следующй кусок кода и вставьте его в самый верх вашего редактора кода:", "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Теперь вы можете установить шрифт Lobster в качестве значения семейства шрифтов для вашего h2.", "
", "Примените свойство font-family со значением Lobster к вашему элементу h2." ] } } }, { "id": "bad87fee1348bd9aedf08808", "title": "Specify How Fonts Should Degrade", "description": [ "There are several default fonts that are available in all browsers. These include Monospace, Serif and Sans-Serif", "When one font isn't available, you can tell the browser to \"degrade\" to another font.", "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 use this CSS style:", "
p {
  font-family: Helvetica, Sans-Serif;
}
", "
", "Now comment out your call to Google Fonts, so that the Lobster font isn't available. Notice how it degrades to the Monospace font.", "Note
If you have the Lobster font installed on your computer, you wont see the degradation because your browser is able to find the font." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"h2\").css(\"font-family\").match(/^\"?lobster/i), 'message: Your h2 element should use the font Lobster.');", "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?,\\s*Monospace\\s*;\\s*\\}/gi.test(code), 'message: Your h2 element should degrade to the font Monospace when Lobster is not available.');", "assert(new RegExp(\"\", \"gi\").test(code), 'message: Be sure to close your comment by adding -->.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Es gibt verschiedene Schriftarten, die jedem Browser standardmäßig zur Verfügung stehen. Das sind unter anderem Monospace, Serif und Sans-Serif.", "Falls eine Font nicht verfügbar ist kannst du dem Browser sagen was er stattdessen verwenden soll.", "Wenn du zum Beispiel einem Element die Schriftart Helvetica geben möchtest, aber gleichzeitig als Alertnative die Schrift Sans-Serif laden willst, falls Helvetica nicht verfügbar ist, kannst du diesen CSS Style verwenden:", "
p {
  font-family: Helvetica, Sans-Serif;
}
", "
", "Kommentiere jetzt den Aufruf an Google Fonts aus, sodass Lobster nicht zur Verfügung steht. Beachte, wie nun alternativ die Schriftart Monospace geladen wird." ] }, "fr": { "title": "Spécifier comment vos polices devraient dégrader", "description": [ "Il y a plusieurs polices par défaut qui sont disponible dans tous les navigateurs Web. Ceci comprend Monospace, Serif et Sans-Serif.", "Quand une police n'est pas disponible, vous pouvez demander au navigateur de \"dégrader\" vers une autre police.", "Par exemple, si vous voulez qu'un élément utilise la police Helvetica, mais également dégrader vers Sans-Serif lorsque la police Helvetica n'est pas disponible, vous pouvez utiliser le style CSS suivant :", "
p {
  font-family: Helvetica, Sans-Serif;
}
", "
", "Maintenant, commenter votre appel vers les polices de Google, pour que la police Lobster ne soit pas disponible. Regardez comment la police se dégrade vers Monospace." ] }, "pt-br": { "title": "Especifique como as Fontes Devem se Degradar", "description": [ "Existem diversas fontes que estão disponíveis por padrão nos navegadores de internet, incluindo Monospace, Serif e Sans-Serif.", "No entanto, quando uma fonte não está disponível, podemos dizer ao navegador que \"degrade\" a outro tipo de fonte.", "Por exemplo, se você deseja que um elemento use a fonte Helvetica, e que degrade para a fonte Sans-Serif quando a Helvetica não estiver disponível, você pode utilizar o seguinte CSS:", "p {", "  font-family: Helvetica, Sans-Serif;", "}", "
", "Agora, comente o seu chamado para a fonte do Google, para que a fonte Lobster não esteja disponível. Note como a fonte degrada para Monospace." ] }, "ru": { "title": "Укажите порядок деградации шрифтов", "description": [ "Существует несколько стандартных шрифтов, которые доступны во всех браузерах. Среди них Monospace, Serif и Sans-Serif", "Когда один шрифт недоступен, вы можете сообщить браузеру \"деградировать\" до другого шрифта.", "Например, если бы вы хотели, чтобы элемент использовал шрифт Helvetica, но также деградировал до шрифта Sans-Serif, когда Helvetica недоступен, вы могли бы использовать этот CSS-стиль:", "
p {
  font-family: Helvetica, Sans-Serif;
}
", "
", "Теперь закомментируйте ваш запрос к Google Fonts, таким образом шрифт Lobster становится недоступен. Обратите внимание как происходит деградация до шрифта Monospace." ] } } }, { "id": "bad87fee1348bd9acdf08812", "title": "Size your Images", "description": [ "CSS has a property called width that controls an element's width. Just like with fonts, we'll use px (pixels) 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:", "
<style>
  .larger-image {
    width: 500px;
  }
</style>
", "
", "Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.", "Note
Due to browser implementation differences, you may need to be at 100% zoom to pass the tests on this challenge." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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[src='https://bit.ly/fcc-relaxing-cat']\").attr('class') === \"smaller-image\", 'message: Your img element should have the class smaller-image.');", "assert($(\"img\").width() === 100, 'message: Your image should be 100 pixels wide. Browser zoom should be at 100%.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "Die Breite eines Elements wird mit dem CSS Attribut width kontrolliert. Wie bei Schriftarten verwenden wir Pixel px um die Größe zu definieren.", "Wenn wir also die CSS Klasse larger-image erstellen wollen, um HTML Elementen eine Breite von 500 Pixeln zu verleihen, verwenden wir:", "
<style>
  .larger-image {
    width: 500px;
  }
</style>
", "
", "Erstelle eine Klasse mit dem Namen smaller-image und verwende sie, um dein Bild auf 100 Pixel zu skalieren.", "Notiz
Aufgrund verschiedener Brower Implementierungen, könnte es sein dass du auf 100% Zoom sein musst um die Tests zu bestehen." ] }, "fr": { "title": "Redimensionner vos images", "description": [ "Le CSS a une propriété nommé width qui contrôle la largeur d'un élément. Comme pour les polices, nous utiliserons px (pixels) pour déterminer la largeur d'une image.", "Par exemple, si nous voulons créer une classe CSS nommée larger-image qui donnne aux éléments une largeur de 500 pixels, nous utilisons :", "
<style>
  .larger-image {
    width: 500px;
  }
</style>
", "
", "Créez une classe nommée smaller-image et utilisez la pour redimensionner l'image pour qu'elle ai 100 pixels de large.", "Prenez note
Dû aux différences entre les navigateurs Web, votre niveau de zoom devrait être à 100% pour passer les tests de ce défi." ] }, "pt-br": { "title": "Dê um Tamanho para suas Imagens", "description": [ "O CSS possui uma propriedade chamada width, que controla a largura de um elemento. Da mesma forma que com as fontes, vamos utilizar px (pixels) como medida para especificar a largura de nossa imagem.", "Por exemplo, se queremos criar uma classe CSS chamada larger-image que dê aos elementos HTML uma largura de 500px, vamos usar:", "<estilo>", "  .larger-image{", "    width: 500px;", "  }", "</style>", "
", "Crie uma classe chamada smaller-image e a utilize para mudar o tamanho da imagem para que ela tenha apenas 100 pixels de largura." ] }, "ru": { "title": "Установите размер ваших изображений", "description": [ "В CSS есть свойтсво, называемое width, которе управляет шириной элемента. По аналогии со шрифтами, мы используем px (пиксели) для указания ширины изображения.", "Например, если бы мы хотели создать CSS-класс larger-image, который присваивал бы HTML-эементам ширину равную 500 пикселей, мы бы использовали:", "
<style>
  .larger-image {
    width: 500px;
  }
</style>
", "
", "Создайте класс smaller-image и используйте его для изменения размера изображений до 100 пикселей в ширину.", "Внимание
По причине разницы в реализации браузеров, вам может понадобиться установить 100% масштаб окна браузера для прохождения этого испытания." ] } } }, { "id": "bad87fee1348bd9bedf08813", "title": "Add Borders Around your Elements", "description": [ "CSS borders have properties like style, color and width", "For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class:", "
<style>
  .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;
  }
</style>
", "
", "Create a class called thick-green-border that puts a 10-pixel-wide green border with a style of solid around an HTML element, and apply that class to your cat photo.", "Remember that you can apply multiple classes to an element by separating each class with a space within its class attribute. For example:", "<img class=\"class1 class2\">" ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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\").hasClass(\"smaller-image\"), 'message: Your img element should have the class smaller-image.');", "assert($(\"img\").hasClass(\"thick-green-border\"), 'message: Your img element should have the class thick-green-border.');", "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) >= 8 && parseInt($(\"img\").css(\"border-top-width\"), 10) <= 12, 'message: Give your image a border width of 10px.');", "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'message: Give your image a border style of solid.');", "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'message: The border around your img element should be green.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "description": [ "CSS Rahmen haben Attribute wie style, color und width", "Wenn wir nun einen roten, 5 Pixel dicken Rahmen um ein HTML Element setzen wollen, könnten wir diese Klasse verwenden:", "
<style>
  .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;
  }
</style>
", "
", "Erstelle die Klasse thick-green-border, welche einen 10 Pixel dicken, grünen Rahmen mit dem Style solid um ein HTML Element setzt. Füge diese Klasse deinem Katzenfoto hinzu.", "Vergiss nicht, dass du einem Element mehrere Klassen geben kannst indem du jede Klasse mit einem Leerzeichen im class Attribut trennst. Zum Beispiel:", "<img class=\"class1 class2\">" ] }, "fr": { "title": "Ajouter des bordures autour de vos éléments", "description": [ "Les bordures CSS ont des propriétés comme style, color et width", "Par exemple, si nous voulons créer une bordure de 5 pixel rouge autour d'un élément HTML, nous pouvons utiliser cette classe :", "
<style>
  .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;
  }
</style>
", "
", "Créer une classe nommée thick-green-border qui ajoute une bordure verte de 10 pixel avec un style solid autour d'un élément HTML. Appliquez ensuite cette classe sur votre photo de chat.", "Souvenez-vous que vous pouvez appliquer plus d'une classe sur un élément en les séparant par un espace, le tout dans l'attribut class de l'élément. Par exemple :", "<img class=\"class1 class2\">" ] }, "pt-br": { "title": "Adicione Bordas ao Redor de seus Elementos", "description": [ "As bordas em CSS possuem propriedades como style, color e width", "Por exemplo, se queremos criar uma borda com tamanho de 5 pixels de cor vermelha ao redor de um elemento HTML, podemos utilizar esta classe:", "<style>", "  .thin-red-border {", "    border-color: red;", "    border-width: 5px;", "    border-style: solid;", "  }", "</style>", "
", "Crie uma classe chamada thick-green-border que insira uma borda verde de 10 pixels de largura com um estilo solid ao redor de um elemento HTML, e então adicione essa classe em sua foto com o gato.", "Lembre que você pode aplicar diversas classes a um elemento separando cada uma das classes com um espaço, dentro do atributo class. Por exemplo:", "<img class=\"clase1 clase2\">" ] }, "ru": { "title": "Дбавьте границы вокруг ваших элементов", "description": [ "CSS-границы имеют свойства: style, color и width", "Например, если бы мы хотели создать красную границу шириной в 5 пикселей вокруг HTML-элемента, мы могли бы использовать этот класс:", "
<style>
  .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;
  }
</style>
", "
", "Создайте класс thick-green-border, который добавляет зелёную границу шириной в 10 пикселей со стилем solid вокруг HTML-элемента и примените этот класс к вашему фото кота.", "Помните, что вы можете может применить множество классов к одному элементу путём разделения их с помощью пробела внутри атрибута class. Например:", "<img class=\"class1 class2\">" ] } } }, { "id": "bad87fee1348bd9aedf08814", "title": "Add Rounded Corners with a Border Radius", "description": [ "Your cat photo currently has sharp corners. We can round out those corners with a CSS property called border-radius.", "
", "You can specify a border-radius with pixels. Give your cat photo a border-radius of 10px.", "Note: this waypoint allows for multiple possible solutions. For example, you may add border-radius to either the .thick-green-border class or .smaller-image class." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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\").hasClass(\"thick-green-border\"), 'message: Your image element should have the class \"thick-green-border\".');", "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 8, 'message: Your image should have a border radius of 10px');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Füge abgerundete Ecken mit Border Radius hinzu", "description": [ "Dein Katzenfoto hat momentan spitze Ecken. Wir können diese Ecken mit dem CSS Attribut border-radius abrunden.", "
", "Du kannst einen border-radius mit Pixeln deklarieren. Gib deinem Katzenfoto einen border-radius von 10px.", "Beachte dass es für diese Challenge verschiedene mögliche Lösungsansätze gibt. Zum Beispiel könntest du einen border-radius zu der .thick-green-border oder .smaller-image Klasse hinzufügen." ] }, "es": { "title": "Agrega esquinas redondeadas usando Border Radius", "description": [ "Tu foto del gato tiene actualmente esquinas angulares. Podemos redondear esas esquinas con una propiedad CSS llamada border-radius.", "
", "Puedes especificar border-radius usando pixeles. Dale a tu foto del gato un border-radius de 10px.", "Nota: este desafío acepta múltiples soluciones. Por ejemplo, puedes agregar border-radius ya sea a la clase .thick-green-border o a la clase .smaller-image." ] }, "pt-br": { "title": "Insira Bordas Arredondadas com o Border Radius", "description": [ "Sua foto com o gato possui cantos pontiagudos. Podemos arredondar os cantos com uma propriedade CSS chamado border-radius.", "
", "Você pode especificar um border-radius com pixels. Adicione um border-radius de 10px para a sua foto.", "Nota: Este desafio permite várias soluções possíveis. Por exemplo, você pode adicionar o border-radius tanto para a classe .thick-green-border como para a classe .smaller-image." ] }, "ru": { "title": "Добавьте скруглённые углы с помощью радиуса границы", "description": [ "У вашего фото кота сейчас острые углы. Мы можем скруглить углы используя CSS-свойство border-radius.", "
", "Вы можете указать значения border-radius в пикселях. Присвойте вашему фото кота свойство border-radius со значением 10px.", "Внимание: это задание подразумевает наличие нескольких возможных решений. Например, вы можете добавить border-radius как к классу .thick-green-border, так и к классу .smaller-image." ] } } }, { "id": "bad87fee1348bd9aedf08815", "title": "Make Circular Images with a Border Radius", "description": [ "In addition to pixels, you can also specify a border-radius using a percentage.", "
", "Give your cat photo a border-radius of 50%." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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(parseInt($(\"img\").css(\"border-top-left-radius\")) > 48, 'message: Your image should have a border radius of 50%, making it perfectly circular.');", "assert(code.match(/50%/g), 'message: Be sure to use a percentage value of 50%.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Erstelle runde Bilder mit einem Border Radius", "description": [ "Du kannst einem border-radius neben Pixeln auch Prozentwerte zuweisen.", "
", "Gib deinem Katzenfoto einen border-radius von 50%." ] }, "es": { "title": "Crea imágenes circulares usando Border Radius", "description": [ "Además de pixeles, puedes especificar un border-radius usando porcentajes.", "
", "Dale a tu foto del gato un border-radius de 50%." ] }, "pt-br": { "title": "Deixe as Imagens Circulares com o Border Radius", "description": [ "Assim como pixels, você também pode usar o border-radius com porcentagens.", "
", "Dê para a sua foto de gato um border-radius de 50%." ] }, "ru": { "title": "Сделайте круглые изображения с помощью радиуса границы", "description": [ "В дополнение к пикселям, вы также может использовать проценты для указания значения свойства border-radius.", "
", "Присвойте вашему фото кота свойство border-radius со значением 50%." ] } } }, { "id": "bad87fed1348bd9aede07836", "title": "Give a Background Color to a Div Element", "description": [ "You can set an element's background color with the background-color property.", "For example, if you wanted an element's background color to be green, you'd put this within your style element:", "
.green-background {
  background-color: green;
}
", "
", "Create a class called silver-background with the background-color of silver. Assign this class to your div element." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"div\").hasClass(\"silver-background\"), 'message: Give your div element the class silver-background.');", "assert($(\".silver-background\").css(\"background-color\") === \"rgb(192, 192, 192)\", 'message: Your div element should have a silver background.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Gib einem Div Element eine Hintergrundfarbe", "description": [ "Du kannst die Hintergrundfarbe von einem Element mit dem background-color Attribut setzen", "Wenn du zum Beispiel die Hintergrundfarbe von einem Element green machen willst, schreibe dies in dein style Element:", "
.green-background {
  background-color: green;
}
", "
", "Erstelle eine Klasse namens silver-background mit der background-color grau (silver). Füge diese Klasse deinem div Element hinzu" ] }, "es": { "title": "Da un color de fondo a un elemento Div", "description": [ "Puedes fijar el color de fondo de un elemento con la propiedad background-color.", "Por ejemplo, si quieres que el color de fondo de un elemento sea verde (green), dentro de tu elemento style pondrías:", "
.green-background {
  background-color: green;
}
", "
", "Crea una clase llamada silver-background con la propiedad background-color en gris (silver). Asigna esta clase a tu elemento div ." ] }, "pt-br": { "title": "Dê uma Cor de Fundo a um Elemento Div", "description": [ "Você pode acrescentar uma cor de fundo de um elemento com a propriedade background-color.", "Por exemplo, se você quiser que a cor de fundo de um elemento seja verde (green), dentro de seu elemento style seria assim:", ".green-background {", "  background-color: green;", "}", "
", "Crie uma classe chamada silver-background com a propriedade background-color em cinza (silver). Depois, adicione essa classe ao seu elemento div." ] }, "ru": { "title": "Присвойте цвет фона элементу div", "description": [ "Вы можете установить цвет фона элемента с помощью свойства background-color.", "Например, если бы вы хотели установить цвет фона элемента зелёным, вы бы использовали следующий стиль внутри вашего элемента style:", "
.green-background {
  background-color: green;
}
", "
", "Создайте класс silver-background со значением свойства background-color равным silver. Назначьте этот класс вашему элементу div." ] } } }, { "id": "bad87eee1348bd9aede07836", "title": "Set the ID of an Element", "description": [ "In addition to classes, each HTML element can also have an id attribute.", "There are several benefits to using id attributes: You can use an id to style a single element and later you'll learn that you can use them to select and modify specific elements with JavaScript.", "id attributes should be unique. Browsers won't enforce this, but it is a widely agreed upon best practice. So please don't give more than one element the same id attribute.", "Here's an example of how you give your h2 element the id of cat-photo-app:", "<h2 id=\"cat-photo-app\">", "
", "Give your form element the id cat-photo-form." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"form\").attr(\"id\") === \"cat-photo-form\", 'message: Give your form element the id of cat-photo-form.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Setze die ID von einem Element", "description": [ "Zusätzlich zu Klassen, kann jedes HTML Element auch ein id Attribut haben.", "Es hat mehrere Vorteile id Attribute zu verwenden und du wirst mehr über diese erfahren wenn du anfängst mit jQuery zu arbeiten.", "id Attribute sollten eindeutig sein. Browser werden das nicht durchsetzen, aber es ist eine weit verbreitete und erprobte Herangehensweise. Also gib bitte nie mehr als einem Element das gleiche id Attribut.", "Hier ist ein Beispiel wie du deinem h2 Element die Id cat-photo-app gibst:", "<h2 id=\"cat-photo-app\">", "
", "Gib deinem form Element die Id cat-photo-form." ] }, "es": { "title": "Establecer el ID de un elemento", "description": [ "Además de las clases, cada elemento HTML también puede tener un atributo de identificación id.", "Hay varias ventajas al usar atributos id, y aprenderás más sobre estas cuando comiences a usar jQuery.", "Los atributos id deben ser únicos. Los navegadores no obligarán esto, pero es ampliamente reconocido como una de las mejores prácticas. Así que por favor no le des a más de un elemento un mismo atributo id. ", "He aquí un ejemplo de cómo le das la identificación cat-photo-app a tu elemento h2:", "<h2 id=\"cat-photo-app\">", "
", "Dale a tu elemento form la id cat-photo-form." ] }, "pt-br": { "title": "Estabeleça a ID de um Elemento", "description": [ "Além das classes, cada elemento HTML também pode ter um atributo de identificação chamado id.", "Existem várias vantagens ao utilizar atributos id, e você aprenderá mais sobre elas quando começar a utilizar jQuery.", "Os atributos id devem ser únicos. Os navegadores não o obrigarão a isso, mas isso é amplamente reconhecido como uma boa prática. Assim, não dê um mesmo atributo id a mais de um elemento.", "Veja aqui um exemplo de como dar a id cat-photo-app ao seu elemento code>h2:", "<h2 id=\"cat-photo-app\">", "
", "Dê ao seu elemento form a id cat-photo-form." ] }, "ru": { "title": "Установите id элемента", "description": [ "В дополнение к классам, каждый HTML-элемент может также иметь атрибут id.", "Есть некоторые преимущества использования атрибутов id, вы узнаете о них больше, когда начнёте использовать jQuery.", "Атрибутам id следует быть уникальными. Браузеры не принуждают к этому, но широкой общественностью это признано лучшей практикой. Поэтому, пожалуйста, не присваивайте множеству элементов одинаковое значение атрибута id.", "Вот пример того, как вы можете присвоить вашему элементу h2 значение атрибута id равное cat-photo-app:", "<h2 id=\"cat-photo-app\">", "
", "Присвойте вашему элементу form атрибут id со значением cat-photo-form." ] } } }, { "id": "bad87dee1348bd9aede07836", "title": "Use an ID Attribute to Style an Element", "description": [ "One cool thing about id attributes is that, like classes, you can style them using CSS.", "However, an id is not reusable and should only be applied to one element. An id also has a higher specificity (importance) than a class so if both are applied to the same element and have conflicting styles, the styles of the id will be applied.", "Here's an example of how you can take your element with the id attribute of cat-photo-element and give it the background color of green. In your style element:", "
#cat-photo-element {
  background-color: green;
}
", "Note that inside your style element, you always reference classes by putting a . in front of their names. You always reference ids by putting a # in front of their names.", "
", "Try giving your form, which now has the id attribute of cat-photo-form, a green background." ], "challengeSeed": [ "", "", "", "

CatPhotoApp

", "
", "

Click here to view more 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($(\"form\").attr(\"id\") === \"cat-photo-form\", 'message: Give your form element the id of cat-photo-form.');", "assert($(\"#cat-photo-form\").css(\"background-color\") === \"rgb(0, 128, 0)\", 'message: Your form element should have the background-color of green.');", "assert(code.match(//gi) && code.match(//gi).length > 0, 'message: Make sure your form element has an id attribute.');", "assert(!code.match(//gi) && !code.match(//gi), 'message: Do not give your form any class or style attributes.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Benutze ein ID Attribute um ein Element zu stylen", "description": [ "Eine coole Eigenschaft von id Attributen ist, dass du sie, genauso wie Klassen, mit CSS stylen kannst.", "Hier ist ein Beispiel wie du einem Element mit dem id Attribut cat-photo-element eine grüne Hintergrundfarbe geben kannst. In deinem style Element:", "
#cat-photo-element {
  background-color: green;
}
", "Beachte, dass du in deinem style Element Klassen immer mit einem . vor deren Namen ansprichst. Ids sprichst du immer mit # vor deren Namen an.", "
", "Versuche deinem Formular, das jetzt das id Attribut cat-photo-form hat, einen grünen Hintergrund zu geben." ] }, "es": { "title": "Usa un atributo ID para dar estilo a un elemento", "description": [ "Una cosa buena sobre los atributos id es que, al igual que con clases, puedes darles estilo usando CSS.", "He aquí un ejemplo de cómo puedes tomar tu elemento con atributo id de cat-photo-element y ponerle el color de fondo verde. En tu elemento style: ", "
#cat-photo-element {
  background-color: green;
}
", "Ten en cuenta que dentro de tu elemento style, siempre referencias clases poniendo un . en frente de sus nombres. Y siempre referencias identificaciones poniendo un # frente a sus nombres. ", "
", "Trata de darle a tu formulario, que ahora tiene el atributo id en cat-photo-form, un fondo verde." ] }, "pt-br": { "title": "Use um Atributo ID para Estilizar um Elemento", "description": [ "Algo interessante sobre os atributos id é que, da mesma forma que com as classes, é possível dar estilos a eles usando CSS.", "Aqui está um exemplo de como você pode usar seu elemento com atributo id em cat-photo-element e dar a ele a cor de fundo verde.", "#cat-photo-element {", "  background-color: green;", "}", "Note que dentro de seu elemento style, você deve sempre referenciar uma classe colocando um . logo antes de seu nome. Já com uma id, você deve referenciar colocando um # antes de seu nome.", "
", "Dê ao seu formulário, que agora possui o atributo code>id em cat-photo-form, um fundo verde." ] }, "ru": { "title": "Используйте атрибут id для стилизации элемента", "description": [ "Одной из замечательных вещей в отношении атрибута id является то, что, как и с классами, вы можете стилизовать их с помощью CSS.", "Вот пример того как вы можете присвоить вашему элементу со значением атрибута id равным cat-photo-element зелёный цвет фона. В вашем элементе style:", "
#cat-photo-element {
  background-color: green;
}
", "Обратите внимание, что внутри вашего элемента style вы ссылаетесь на классы используя . перед их именами. При этом вы всегда ссылаетесь на идентификаторы вставляя # перед их именами.", "
", "Попробуйте установить для своей формы, которая теперь имеет атрибут id равный cat-photo-form, зелёный в качестве цвета фона." ] } } }, { "id": "bad88fee1348bd9aedf08825", "title": "Adjusting the Padding of an Element", "description": [ "Now let's put our Cat Photo App away for a little while and learn more about styling HTML.", "You may have already noticed this, but all HTML elements are essentially little rectangles.", "Three important properties control the space that surrounds each HTML element: padding, margin, and border.", "An element's padding controls the amount of space between the element's content and its border.", "Here, we can see that the green box and the red box are nested within the yellow box. Note that the red box has more padding than the green box.", "When you increase the green box's padding, it will increase the distance between the text padding and the border around it.", "
", "Change the padding of your green box to match that of your red box." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"padding-top\") === \"20px\", 'message: Your green-box class should give elements 20px of padding.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Justiere den Innenabstand eines Elements", "description": [ "Lass uns jetzt mal unsere Katzenfoto App kurz beiseite legen um mehr über HTML Styling zu lernen", "Du hast vielleicht schon bemerkt, dass alle HTML Elemente im Prinzip kleine Rechtecke sind.", "Drei wichtige CSS-Eigenschaften beeinflussen den Platz den jedes HTML Element umgibt: padding, margin und border.", "padding kontrolliert den Raum oder Abstand zwischen dem Inhalt eines Elements und dessen Rahmen – border", "Wir sehen in diesem Beispiel, dass sich die grüne Box und die rote Box innerhalb der gelben Box befinden. Beachte, dass die rote Box mehr padding hat als die grüne Box.", "
", "Ändere das padding der grünen Box um es an die rote Box anzugleichen." ] }, "es": { "title": "Ajusta el relleno de un elemento", "description": [ "Ahora vamos a dejar de lado nuestra aplicación de fotos de gatos por un tiempo, y aprenderemos más sobre dar estilo a HTML", "Ya habrás notado esto, pero todos los elementos HTML son esencialmente pequeños rectángulos.", "Tres propiedades importantes controlan el espacio que rodea a cada elemento HTML: relleno (padding), margen (margin) y borde (border)", "El relleno (padding) de un elemento controla la cantidad de espacio entre el elemento y su borde (border).", "Aquí, podemos ver que el cuadro verde y el cuadro rojo se anidan dentro del cuadro amarillo. Ten en cuenta que el cuadro rojo tiene más relleno (padding) que el cuadro verde. ", "Cuando aumentes el relleno de la caja verde, aumentará la distancia entre el texto padding y el borde alrededor de este.", "
", "Cambia el relleno (padding) de la caja verde para que coincida con el de tu cuadro rojo." ] }, "pt-br": { "title": "Ajuste o Preenchimento de um Elemento", "description": [ "Agora vamos deixar nosso aplicativo de fotos de gatos um pouco de lado, e aprender mais sobre dar estilos em HTML.", "Você provavelmente já deve ter notado, mas todos os elementos HTML são, essencialmente, pequenos retângulos.", "Três propriedades importantes controlam o espaço ao redor de cada elemento HTML: preenchimento (padding), margem (margin) e borda (border).", "O preenchimento (padding) de um elemento controla a quantidade de espaço entre o elemento e sua borda (border).", "Aqui, podemos ver que o quadro verde e o quadro vermelho se aninham dentro do quadro amarelo. Leve em conta que o quadro vermelho tem mais preenchimento (padding) que o quadro verde.", "Quando você aumenta o preenchimento da caixa verde, a distância entre o texto padding e a borda ao seu redor também será maior.", "
", "Mude o preenchimento (padding) da caixa verde para que coincida com a de seu quadrado vermelho." ] }, "ru": { "title": "Настройка отступа содержимого для элемента", "description": [ "Теперь давайте отложим наше фото кота на некоторое время и изучим стилизацию HTML.", "Вы могли уже заметить это, но все HTML-элеметы в приницпе являются небольшими прямоугольниками.", "Пространство вокруг каждого HTML-элемента контролируют три важных свойства: padding, margin, border.", "Свойство элемента padding управляет размером пространства между элементом и его границей border.", "Тут мы можем видеть, что зелёный и красный прямоугольник вложены в жёлтый прямоугольник. Обратите внимание на то, что красный прямоугольник имеет больший отступ содержимого padding, чем зелёный прямоугольник.", "Когда вы увеличиваете padding зелёного прямоугольника, увеличивается расстояние между границей содержимого и границей самого элемента border.", "
", "Измените значение свойства padding вашего зелёного прямоугольника, чтобы он был равен соответствующему значению красного прямоугольника." ] } } }, { "id": "bad87fee1348bd9aedf08822", "title": "Adjust the Margin of an Element", "description": [ "An element's margin controls the amount of space between an element's border and surrounding elements.", "Here, we can see that the green box and the red box are nested within the yellow box. Note that the red box has more margin than the green box, making it appear smaller.", "When you increase the green box's margin, it will increase the distance between its border and surrounding elements.", "
", "Change the margin of the green box to match that of the red box." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"margin-top\") === \"20px\", 'message: Your green-box class should give elements 20px of margin.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Passe den Außenabstand eines Elements an", "description": [ "margin kontrolliert den Abstand zwischen dem Rahmen - border - eines Elements und den benachbarten Elementen.", "In diesem Beispiel sehen wir die grüne und die rote Box die sich beide innerhalb der gelben Box befinden. Beachte, dass die rote Box mehr margin aufweist als die grüne Box, wodurch sie kleiner wirkt.", "Wenn du den Außenabstand – margin – der grünen Box erhöhst, wird sich der Abstand zwischen ihrem Rahmen und den benachbarten Elementen vergrößern.", "
", "Gleiche den Außenabstand – margin der grünen Box dem der roten Box an." ] }, "es": { "title": "Ajusta el margen de un elemento", "description": [ "El margen (margin) de un elemento controla la cantidad de espacio entre el borde (border) y los elementos alrededor.", "Aquí, podemos ver que la caja verde y la caja roja se anidan dentro de la caja amarilla. Ten en cuenta que la caja roja tiene más margen (margin) que la caja verde, haciendo que parezca más pequeña. ", "Cuando aumentes el margen (margin) de la caja verde, aumentará la distancia entre su borde y los elementos que la rodean.", "
", "Cambia el margen (margin) de la caja verde para que coincida con el de la caja roja." ] }, "pt-br": { "title": "Ajuste a Margem de um Elemento", "description": [ "A margem (margin) de um elemento controla a quantidade de espaço entre a borda (border) e os elementos ao seu redor.", "Aqui, podemos ver que a caixa verde e a caixa vermelha se aninham dentro da caixa amarela. Note que a caixa vermelha possui a margem maior que a caixa verde, fazendo com que ela pareça menor.", "Quando você aumenta a margem (margin) da caixa verde, a distância entre a borda e os elementos ao seu redor também aumentará.", "
", "Mude a margem (margin) da caixa verde para que coincida com a margem da caixa vermelha." ] }, "ru": { "title": "Настройка отступа элемента", "description": [ "Значение свойства margin контролирует размер отступа между границей border элемента и его окружением.", "Тут мы можем видеть, что зелёный прямоугольник и красный прямоугольник вложены в жёлтый прямоугольник. Обратите внимание на то, что красный прямоугольник имеет больший отступ margin, чем зелёный прямоугольник, что делает его визуально меньше.", "Когда вы увеличиваете отступ margin зелёного прямоугольника, увеличивается расстояние между его границей и окружающими элементами.", "
", "Измените значение отступа margin зелёного прямоугольника так, чтобы оно равнялось соответствующему значению красного прямоугольника." ] } } }, { "id": "bad87fee1348bd9aedf08823", "title": "Add a Negative Margin to an Element", "description": [ "An element's margin controls the amount of space between an element's border 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.", "Change the margin of the green box to -15px, so it fills the entire horizontal width of the yellow box around it." ], "challengeSeed": [ "", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"margin-top\") === \"-15px\", 'message: Your green-box class should give elements -15px of margin.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Füge einem Element negativen Außenabstand hinzu", "description": [ "margin kontrolliert den Abstand zwischen dem Rahmen - border - eines Elements und den benachbarten Elementen.", "Wenn du dem Außenabstand - margin - eines Elements einen negativen Wert zuweist, wird das Element größer.", "
", "Versuche den Außenabstand - margin - auf einen negativen Wert, wie bei der roten Box, zu setzen.", "Ändere den Außenabstand – margin – der grünen Box auf -15px, damit sie die gelbe Box horizontal ausfüllt." ] }, "es": { "title": "Agregar un margen negativo a un elemento", "description": [ "El margen de un elemento controla la cantidad de espacio entre el borde del elemento y los elementos que lo rodean.", "Si estableces el margen de un elemento en un valor negativo, el elemento se hará más grande.", "
", "Trata de establecer el margen (margin) a un valor negativo como el de la caja roja.", "Cambia el margen (margin) de la caja verde a -15px, de forma que ocupe todo el ancho horizontal de la caja amarilla que lo rodea." ] }, "pt-br": { "title": "Adicione uma Margem Negativa a um Elemento", "description": [ "A margem de um elemento controla a quantidade de espaço entre a borda do elemento e os elementos ao seu redor.", "Se você estabelece a margem de um elemento com um valor negativo, o elemento ficará maior.", "
", "Tente estabelecer a margem (margin) a um valor negativo como o da caixa vermelha.", "Mude a margem (margin) da caixa verde para -15px, de forma que ocupe toda a largura horizontal da caixa amarela que a rodeia." ] }, "ru": { "title": "Добавьте отрицательный отступ к элементу", "description": [ "Значение свойства margin контролирует размер отступа между границей border элемента и его окружением.", "Если вы установите значение свойства margin элемента отрицательным, то элемент будет становиться больше.", "
", "Попробуйте установить значение свойства margin зелёного прямоугольника отрицательным, по аналогии с красным прямоугольником.", "Измените значение свойства margin зелёного прямоугольника на -15px, таким образом он занимает всю ширину окружающего жёлтого прямоугольника." ] } } }, { "id": "bad87fee1348bd9aedf08824", "title": "Add Different Padding to Each Side of an Element", "description": [ "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 padding-top, padding-right, padding-bottom, and padding-left properties.", "
", "Give the green box a padding of 40px on its top and left side, but only 20px on its bottom and right side." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'message: Your green-box class should give the top of the elements 40px of padding.');", "assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'message: Your green-box class should give the right of the elements 20px of padding.');", "assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'message: Your green-box class should give the bottom of the elements 20px of padding.');", "assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'message: Your green-box class should give the left of the elements 40px of padding.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Gib jeder Seite eines Elements einen unterschiedlichen Innenabstand", "description": [ "Manchmal wirst du einem Element auf jeder Seite unterschiedliche Innenabstände – also padding – geben wollen.", "CSS erlaubt dir den Innenabstand - padding - eines Elements auf allen Seiten einzeln mit den Eigenschaften padding-top, padding-right, padding-bottom und padding-left zu steuern.", "
", "Verleihe der grünen Box einen Innenabstand – padding – von 40px auf der oberen und linken Seite, aber nur 20px auf der unteren und rechten Seite." ] }, "es": { "title": "Añade relleno diferente a cada lado de un elemento", "description": [ "A veces querrás personalizar un elemento para que tenga diferente relleno (padding) en cada uno de sus lados.", "CSS te permite controlar el relleno (padding) de un elemento en los cuatro lados superior, derecho, inferior e izquierdo con las propiedades padding-top, padding-right, padding-bottom y padding-left. ", "
", "Da a la caja verde un relleno (padding) de 40px en las partes superior e izquierda, pero sólo 20px en sus partes inferior y derecha." ] }, "pt-br": { "title": "Dê Valores Diferentes de Preenchimento a Cada Lado de um Elemento", "description": [ "As vezes pode ser que você queira personalizar um elemento para que tenha um preenchimento (padding) diferente em cada um de seus lados.", "O CSS permite controlar o preenchimento (padding) de um elemento em todos os quatro lados: superior, direito, inferior e esquerdo, com as propriedades padding-top, padding-right, padding-bottom e padding-left.", "
", "Dê para a caixa verde um preenchimento (padding) de 40px nas partes superior e esquerda, e de apenas 20px em suas partes inferior e direita." ] }, "ru": { "title": "Добавьте разный отступ содердимого с каждой стороны элемента", "description": [ "Иногда вам может потребоваться изменить элемент таким образом, чтобы отступ содержимого padding с каждой из сторон был разным.", "CSS позволяет вам контролировать значение свойства padding элемента со всех сторон с помощью свойств: padding-top, padding-right, padding-bottom, padding-left.", "
", "Присвойте зелёному прямоугольнику padding равный 40px сверху и слева, но только 20px снизу и справа." ] } } }, { "id": "bad87fee1248bd9aedf08824", "title": "Add Different Margins to Each Side of an Element", "description": [ "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 margin-top, margin-right, margin-bottom, and margin-left properties.", "
", "Give the green box a margin of 40px on its top and left side, but only 20px on its bottom and right side." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"margin-top\") === \"40px\", 'message: Your green-box class should give the top of elements 40px of margin.');", "assert($(\".green-box\").css(\"margin-right\") === \"20px\", 'message: Your green-box class should give the right of elements 20px of margin.');", "assert($(\".green-box\").css(\"margin-bottom\") === \"20px\", 'message: Your green-box class should give the bottom of elements 20px of margin.');", "assert($(\".green-box\").css(\"margin-left\") === \"40px\", 'message: Your green-box class should give the left of elements 40px of margin.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Füge jeder Seite eines Elements einen unterschiedlichen Außenabstand hinzu", "description": [ "Manchmal wirst du einem Element auf jeder Seite einen unterschiedlichen Außenabstand - margin - geben wollen.", "CSS erlaubt dir ebenfalls den Außenabstand - margin - eines Elements auf jeder Seite einzeln mit den Eigenschaften margin-top, margin-right, margin-bottom und margin-left zu steuern.", "
", "Gib der grünen Box einen Außenabstand – margin – von 40px auf der oberen und linken Seite, aber nur 20px auf der unteren und rechten Seite." ] }, "es": { "title": "Añade márgenes diferentes a cada lado de un elemento", "description": [ "A veces querrás personalizar un elemento para que tenga un margen (margin) diferente en cada uno de sus lados.", "CSS te permite controlar el margen de un elemento en los cuatro lados superior, derecho, inferior e izquierdo con las propiedades margin-top, margin-right, margin-bottom y margin-left. ", "
", "Da a la caja verde un margen (margin) de 40px en las partes superior e izquierda, pero sólo 20px en su parte inferior y al lado derecho." ] }, "pt-br": { "title": "Dê Valores Diferentes de Margem a Cada Lado de um Elemento", "description": [ "Talvez você queira personalizar um elemento para que possua uma margem (margin) diferente em cada um de seus lados.", "O CSS permite controlar a margem de um elemento em todos os seus quatro lados: superior, direito, inferior e esquerdo, com as propriedades margin-top, margin-right, margin-bottom e margin-left.", "
", "Dê para a caixa verde uma margem (margin) de 40px nas partes superior e esquerda, e de apenas 20px nas partes inferior e direita." ] }, "ru": { "title": "Добавьте разный отступ для элемента", "description": [ "Иногда вам может потребоваться изменить элемент, установив разный отступ margin с каждой из его сторон.", "CSS позволяет вам контролировать отступ margin элемента с каждой из его сторон с помощью свойств: margin-top, margin-right, margin-bottom, margin-left.", "
", "Присвойте красному прямоугольнику значение margin равное 40px сверху и слева, но только 20px снизу и справа." ] } } }, { "id": "bad87fee1348bd9aedf08826", "title": "Use Clockwise Notation to Specify the Padding of an Element", "description": [ "Instead of specifying an element's padding-top, padding-right, padding-bottom, and padding-left properties, you can specify them all in one line, like this:", "padding: 10px 20px 10px 20px;", "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.", "
", "Use Clockwise Notation to give the \".green-box\" class a padding of 40px on its top and left side, but only 20px on its bottom and right side." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'message: Your green-box class should give the top of elements 40px of padding.');", "assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'message: Your green-box class should give the right of elements 20px of padding.');", "assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'message: Your green-box class should give the bottom of elements 20px of padding.');", "assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'message: Your green-box class should give the left of elements 40px of padding.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Nutze die Notation im Uhrzeigersinn um den Innenabstand eines Elements zu bestimmen", "description": [ "Anstatt die Eigenschaften padding-top, padding-right, padding-bottom und padding-left zu verwenden, kannst du sie alle in einer Zeile schreiben:", "padding: 10px 20px 10px 20px;", "Diese vier Werte funktionieren wie eine Uhr: oben, rechts, unten und links. Sie bewirken exakt dasselbe wie die seitenspezifischen Anweisungen.", "
", "Gib der Klasse \".green-box\" mit einer Notation im Uhrzeigersinn einen Innenabstand – padding – von 40px auf der oberen und linken Seite, aber nur 20px auf der unteren und rechten Seite." ] }, "es": { "title": "Utiliza notación en sentido horario para especificar el relleno de un elemento", "description": [ "En lugar de especificar las propiedades padding-top, padding-right, padding-bottom y padding-left de un elemento, puedes especificar todas en una sóla línea, así: ", "padding: 10px 20px 10px 20px;", "Estos cuatro valores funcionan como un reloj: arriba, derecha, abajo, izquierda, y producirán exactamente el mismo resultado de las cuatro instrucciones de relleno.", "
", "Usa la notación en sentido horario para dar a la clase \".green-box\" un relleno de 40px en las partes superior e izquierda, pero sólo 20px en su parte inferior y al lado derecho ." ] }, "pt-br": { "title": "Use Notação em Sentido Horário para Especificar o Preenchimento de um Elemento", "description": [ "Ao invés de especificar as propriedades padding-top, padding-right, padding-bottom e padding-left de um elemento, você pode especificar todas elas em uma só linha, assim:", "padding: 10px 20px 10px 20px;", "Estes quatro valores funcionam como um relógio: cima, direita, baixo e esquerda, e produzirão o mesmo resultado das quatro instruções de preenchimento.", "
", "Use a notação em sentido horário para dar para a classe \".green-box\" um preenchimento de 40px nas partes superior e esquerda, mas de apenas 20px em sua parte inferior e ao lado direito." ] }, "ru": { "title": "Используйте систему ссылок по часовой стрелке для установки отступа содержмого элемента", "description": [ "Вместо указания свойств элемента: padding-top, padding-right, padding-bottom, padding-left, вы можете указать их в строку, например:", "padding: 10px 20px 10px 20px;", "Установка значений работает по часовой стрелке: сверху, справа, снизу, слева, и приводит к ровно такому же результату, как и использование других инструкций.", "
", "Используйте систему ссылок по часовой стрелке для установки для класса \".green-box\" значения отступа содержимого padding равное 40px сверху и слева, но только 20px снизу и справа." ] } } }, { "id": "bad87fee1348bd9afdf08726", "title": "Use Clockwise Notation to Specify the Margin of an Element", "description": [ "Let's try this again, but with margin this time.", "Instead of specifying an element's margin-top, margin-right, margin-bottom, and margin-left properties, you can specify them all in one line, like this:", "margin: 10px 20px 10px 20px;", "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.", "
", "Use Clockwise Notation to give the element with the green-box class a margin of 40px on its top and left side, but only 20px on its bottom and right side." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($(\".green-box\").css(\"margin-top\") === \"40px\", 'message: Your green-box class should give the top of elements 40px of margin.');", "assert($(\".green-box\").css(\"margin-right\") === \"20px\", 'message: Your green-box class should give the right of elements 20px of margin.');", "assert($(\".green-box\").css(\"margin-bottom\") === \"20px\", 'message: Your green-box class should give the bottom of elements 20px of margin.');", "assert($(\".green-box\").css(\"margin-left\") === \"40px\", 'message: Your green-box class should give the left of elements 40px of margin.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Nutze die Notation im Uhrzeigersinn um den Außenabstand eines Elements zu bestimmen", "description": [ "Versuchen wir das noch einmal, aber diesmal mit dem Außenabstand – also margin.", "Anstatt die Eigenschaften margin-top, margin-right, margin-bottom und margin-left zu verwenden, kannst du alle in eine Zeile schreiben:", "margin: 10px 20px 10px 20px;", "Diese vier Werte funktionieren wieder wie eine Uhr: oben, rechts, unten und links. Sie bewirken exakt das Gleiche wie die seitenspezifischen Anweisungen.", "
", "Nutze die Notation im Uhrzeigersinn – auch Clockwise Notation genannt – um dem Element mit der Klasse green-box 40px Außenabstand auf der oberen und linken Seite, aber nur 20px auf der unteren und rechten Seite zu verleihen." ] }, "es": { "title": "Utiliza notación en sentido horario para especificar el margen de un elemento", "description": [ "Vamos a intentar esto de nuevo, pero esta vez con el margen (margin).", "En lugar de especificar las propiedades margin-top, margin-right, margin-bottom, y margin-left de un elemento, puedes especificarlas en una sóla línea así: ", "margin: 10px 20px 10px 20px;", "Estos cuatro valores funcionan como un reloj: arriba, derecha, abajo, izquierda, y producirán exactamente el mismo resultado de las cuatro instrucciones que especifican el margen.", "
", "Usa notación en sentido horario para dar al elemento con la clase green-box un margen de 40px en las partes superior e izquierda, pero sólo 20px en su parte inferior y al lado derecho ." ] }, "pt-br": { "title": "Use Notação em Sentido Horário para Especificar a Margem de um Elemento", "description": [ "Vamos praticar isso outra vez, mas desta vez será com a margem (margin).", "Ao invés de especificar as propriedades margin-top, margin-right, margin-bottom, e margin-left de um elemento, você pode especificar todas elas em apenas uma linha assim:", "margin: 10px 20px 10px 20px;", "Estes quatro valores funcionam como um relógio: cima, direita, baixo e esquerda, e produzirão o mesmo resultado das quatro instruções de margem.", "
", "Use a notação em sentido horário para dar para a classe \".green-box\" uma margem de 40px nas partes superior e esquerda, mas de apenas 20px em sua parte inferior e ao lado direito." ] }, "ru": { "title": "Используйте систему ссылок по часовой стрелке для установки отступа элемента", "description": [ "Давайте попробуем то же самое, но со свойством margin на этот раз.", "Вмето указания свойств элемента: margin-top, margin-right, margin-bottom, margin-left, вы можете указать их в строку, например:", "margin: 10px 20px 10px 20px;", "Установка значений работает по часовой стрелке: сверху, справа, снизу, слева, и приводит к ровно такому же результату, как и использование других инструкций.", "
", "Используйте систему ссылок по часовой стрелке для установки для класса green-box значения отступа margin равное 40px сверху и слева, но только 20px снизу и справа." ] } } }, { "id": "bad82fee1322bd9aedf08721", "title": "Understand Absolute versus Relative Units", "description": [ "The last several challenges all set an element's margin or padding with pixels (px). Pixels are a type of length unit, which is what tells the browser how to size or space an item. In addition to px, CSS has a number of different length unit options that you can use.", "The two main types of length units are absolute and relative. Absolute units tie to physical units of length. For example, in and mm refer to inches and millimeters, respectively. Absolute length units approximate the actual measurement on a screen, but there are some differences depending on a screen's resolution.", "Relative units, such as em or rem, are relative to another length value. For example, em is based on the size of an element's font. If you use it to set the font-size property itself, it's relative to the parent's font-size.", "Note
There are several relative unit options that are tied to the size of the viewport. They are covered in the Responsive Web Design Principles section.", "
", "Add a padding property to the element with class red-box and set it to 1.5em." ], "challengeSeed": [ "", "
margin
", "", "
", "
padding
", "
padding
", "
" ], "tests": [ "assert($('.red-box').css('padding-top') != '0px' && $('.red-box').css('padding-right') != '0px' && $('.red-box').css('padding-bottom') != '0px' && $('.red-box').css('padding-left') != '0px', 'message: Your red-box class should have a padding property.');", "assert(code.match(/\\.red-box\\s*?{\\s*?.*?\\s*?.*?\\s*?padding:\\s*?1\\.5em/gi), 'message: Your red-box class should give elements 1.5em of padding.');" ], "type": "waypoint", "challengeType": 0, "translations": {} }, { "id": "bad87fee1348bd9aedf08736", "title": "Style the HTML Body Element", "description": [ "Now let's start fresh and talk about CSS inheritance.", "Every HTML page has a body element.", "
", "We can prove that the body element exists here by giving it a background-color of black.", "We can do this by adding the following to our style element:", "
body {
  background-color: black;
}
" ], "challengeSeed": [ "" ], "tests": [ "assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'message: Give your body element the background-color of black.');", "assert(code.match(/" ], "tests": [ "assert(($(\"h1\").length > 0), 'message: Create an h1 element.');", "assert(($(\"h1\").length > 0 && $(\"h1\").text().match(/hello world/i)), 'message: Your h1 element should have the text Hello World.');", "assert(code.match(/<\\/h1>/g) && code.match(/

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

h1 element has a closing tag.');", "assert(($(\"body\").css(\"color\") === \"rgb(0, 128, 0)\"), 'message: Give your body element the color property of green.');", "assert(($(\"body\").css(\"font-family\").match(/Monospace/i)), 'message: Give your body element the font-family property of Monospace.');", "assert(($(\"h1\").length > 0 && $(\"h1\").css(\"font-family\").match(/monospace/i)), 'message: Your h1 element should inherit the font Monospace from your body element.');", "assert(($(\"h1\").length > 0 && $(\"h1\").css(\"color\") === \"rgb(0, 128, 0)\"), 'message: Your h1 element should inherit the color green from your body element.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Erbe Styles vom Body Element", "description": [ "Jetzt haben wir bewiesen dass jede HTML Seite ein body Element besitzt und dass dieses body Element ebenfalls mit CSS gestylt werden kann.", "Vergiss nicht, dass du dein body Element wie jedes andere HTML Element stylen kannst und dass alle anderen Elemente von deinem body Element Styles erben werden.", "
", "Erstelle zuerst ein h1 Element mit dem Text Hello World", "Dann gib allen Elementen auf deiner Seite die Farbe green indem du color:green; deinen body Element Styles hinzufügst.", "Gib deinem body Element abschließend die Schriftart Monospace indem du font-family: Monospace; deinen body Element Styles hinzufügst." ] }, "es": { "title": "Hereda estilos del elemento cuerpo", "description": [ "Ya hemos demostrado que cada página HTML tiene un cuerpo (body), y que puede dársele estilo CSS.", "Recuerda que puedes dar estilo de tu elemento body como a cualquier otro elemento HTML, y que todos tus otros elementos heredarán sus estilos de tu elemento body.", "
", "En primer lugar, crea un elemento h1 con el texto Hello World", "Después, vamos a darle a todos los elementos de tu página el color verde (green) añadiendo color: green; a la declaración de estilo de tu elemento body.", "Por último, da a tu elemento body el tipo de letra Monospace añadiendo font-family: Monospace; a la declaración del estilo de tu elemento body." ] }, "pt-br": { "title": "Herde Estilos do Elemento Body", "description": [ "Já demonstramos que cada página HTML possui um corpo (body), e que podemos dar estilo a ele através do CSS.", "Observe que você pode dar estilo ao seu elemento body como a qualquer outro elemento HTML, e que todos os outros elementos herdarão os estilos de seu elemento body.", "
", "Em primeiro lugar, crie um elemento h1 com o texto Hello World", "Depois, dê a todos os elementos de sua página uma cor verde (green) adicionando color: green; na declaração de estilo de seu elemento body.", "Por último, dê ao seu elemento body o tipo de fonte Monospace adicionando font-family: Monospace; na declaração de estilo de seu elemento body." ] }, "ru": { "title": "Наследование стилей от элемента Body", "description": [ "Мы доказали наличие у каждой HTML-страницы элемента body и то, что этот элемент body можно стилизовать с помощью CSS.", "Не забывайте, что вы можете стилизовать ваш элемент body так же как и любой другой HTML-элемент, а все остальные элементы унаследуют стили элемента body.", "
", "Для начала, создайте элемент h1 с текстом Hello World", "Затем присвойте всем элементам на вашей странице зелёный цвет путём добавления color: green; к свойствам, указанным в объявлении стилей для элемента body.", "В завершении, присвойте вашему элементу body свойство семейства шрифтов равное Monospace путём добавления font-family: Monospace; к свойствам, указанным в объявлении стилей для элемента body." ] } } }, { "id": "bad87fee1348bd9aedf08756", "title": "Prioritize One Style Over Another", "description": [ "Sometimes your HTML elements will receive multiple styles that conflict with one another.", "For example, your h1 element can't be both green and pink at the same time.", "Let's see what happens when we create a class that makes text pink, then apply it to an element. Will our class override the body element's color: green; CSS property?", "
", "Create a CSS class called pink-text that gives an element the color pink.", "Give your h1 element the class of pink-text." ], "challengeSeed": [ "", "

Hello World!

" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'message: Your h1 element should have the class pink-text.');", "assert(code.match(/\\.pink-text\\s*\\{\\s*color\\s*:\\s*.+\\s*;\\s*\\}/g), 'message: Your <style> should have a pink-text CSS class that changes the color.');", "assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'message: Your h1 element should be pink.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Ziehe einen Style einem Anderen vor", "description": [ "Manchmal werden deine HTML Elemente mehrere Styles erhalten die sich gegenseitig widersprechen.", "Zum Beispiel könnte dein h1 Element nicht gleichzeitig grün und pink sein.", "
", "Schauen wir uns an was passiert wenn wir eine Klasse erstellen die Text pink macht und dann einem Element hinzufügen. Wird unsere Klasse die color:green; Eigenschaft unseres body Elements überschreiben - override - ?" ] }, "es": { "title": "Priorizar un estilo sobre otro", "description": [ "A veces los elementos HTML recibirán múltiples estilos que entran en conflicto entre sí.", "Por ejemplo, el elemento h1 no puede ser verde y rosa al mismo tiempo.", "Vamos a ver lo que sucede cuando creamos una clase que hace rosado el texto y luego lo aplicamos a un elemento. ¿Anulará (override) nuestra clase la propiedad CSS color: green del elemento body?", "
", "Crea una clase CSS llamada pink-text que le da a un elemento el color rosado.", "Ponle a tu elemento h1 la clase de pink-text." ] }, "pt-br": { "title": "Priorize um Estilo Sobre o Outro", "description": [ "As vezes os elementos HTML recebem múltiplos estilos que entram em conflito entre si.", "Por exemplo, o elemento h1 não pode ser verde e rosa ao mesmo tempo.", "Vamos ver o que acontece quando criamos uma classe que faz com que o texto seja rosa e então o aplicamos a um elemento. Isso irá sobrepor (override) a propriedade CSS color: green do elemento body de nossa classe?", "
", "Crie uma classe CSS chamada pink-text, que dê a cor rosa a um elemento.", "Depois, adicione a classe pink-text ao seu elemento h1." ] }, "ru": { "title": "Установите приоритет одного стиля над другим", "description": [ "Иногда вашим HTML-элементам будут присвоены множественные стили, конфликтующие друг с другом.", "Например, ваш элемент h1 не может быть одновременно зелёным и розовым.", "Давайте посмотрим, что произойдёт, когда мы создадим класс, который делает текст розовым, затем присвоим его элементу. Переопределит ли наш класс значение CSS-свойства элемента body равное color: green;?", "
", "Создайте CSS-класс pink-text, который назначает элементу розовый в качестве цвета.", "Назначьте вашему элементу h1 класс pink-text." ] } } }, { "id": "bad87fee1348bd9aedf04756", "title": "Override Styles in Subsequent CSS", "description": [ "Our \"pink-text\" class overrode our body element's CSS declaration!", "We just proved that our classes will override the body element's CSS. So the next logical question is, what can we do to override our pink-text class?", "
", "Create an additional CSS class called blue-text that gives an element the color blue. Make sure it's below your pink-text class declaration.", "Apply the blue-text class to your h1 element in addition to your pink-text class, and let's see which one wins.", "Applying multiple class attributes to a HTML element is done with a space between them like this:", "class=\"class1 class2\"", "Note: It doesn't matter which order the classes are listed in the HTML element.", "However, the order of the class declarations in the <style> section are what is important. The second declaration will always take precedence over the first. Because .blue-text is declared second, it overrides the attributes of .pink-text" ], "challengeSeed": [ "", "

Hello World!

" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'message: Your h1 element should have the class pink-text.');", "assert($(\"h1\").hasClass(\"blue-text\"), 'message: Your h1 element should have the class blue-text.');", "assert($(\".pink-text\").hasClass(\"blue-text\"), 'message: Both blue-text and pink-text should belong to the same h1 element.');", "assert($(\"h1\").css(\"color\") === \"rgb(0, 0, 255)\", 'message: Your h1 element should be blue.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Überschreibe Styles mit nachträglichen CSS", "description": [ "Unsere \"pink-text\" Klasse hat unsere CSS Angaben des body Elements überschrieben!", "Wir haben gerade bewiesen, dass unsere Klassen das CSS des body Elements überschreiben. Die logische nächste Frage ist also was wir tun können um unsere pink-text Klasse zu überschreiben?", "
", "Erstelle eine weitere CSS Klasse namens blue-text, die deinem Element eine blaue Farbe gibt. Stelle sicher dass sie unter deiner pink-text Klassen-Deklaration steht.", "Füge die blue-text Klasse deinem h1 Element zusätzlich zur pink-text Klasse hinzu und schau welche gewinnt.", "Einem HTML Element mehrere Klassen Attribute zu geben funktioniert mit einem Leerzeichen dazwischen:", "class=\"class1 class2\"", "Notiz: Es ist egal in welcher Reihenfolge die Klassen in einem HTML Element angeordnet sind.", "Allerdings ist die Reihenfolge der class Deklarationen im <style> Abschnitt durchaus wichtig. Die zweite Deklaration wird immer Vorzug gegenüber der Ersten erhalten. Weil .blue-text als zweites deklariert wird, überschreibt es die Attribute von .pink-text" ] }, "es": { "title": "Anula estilos con CSS posterior", "description": [ "¡Nuestra clase \"pink-text\" anuló la declaración CSS de nuestro elemento body!", "Acabamos de demostrar que nuestras clases anularán el CSS del elemento body. Así que la siguiente pregunta lógica es: ¿qué podemos hacer para anular nuestra clase pink-text?", "
", "Crea una clase CSS adicional llamada texto-azul que le de a un elemento el color azul. Asegúrate de que está debajo de tu declaración de la clase pink-text. ", "Aplica la clase blue-text a tu elemento h1 además de tu clase pink-text y veamos cuál gana.", "La aplicación de múltiples atributos de clase a un elemento HTML se hace usando espacios entre ellos así:", "class=\"clase1 clase2\"", "Nota: No importa el orden en que las clases aparecen en el HTML.", "Sin embargo, el orden de las declaraciones class en la sección <style> sí son importantes. La segunda declaración siempre precederá a la primera. Debido a que .blue-text es declarada después, esta anula los atributos de .pink-text" ] }, "pt-br": { "title": "Sobreponha Estilos com CSS Posterior", "description": [ "Nossa classe \"pink-text\" anulou a declaração CSS de nosso elemento body!", "Acabamos de demonstrar que nossas classes irão sobrepor o CSS do elemento body. Sendo assim, nossa seguinte pergunta lógica é: O que podemos fazer para sobrepor a nossa classe pink-text?", "
", "Crie uma classe tradicional com CSS chamada texto-azul, que possa dar a um elemento a cor azul. Tenha a certeza de deixá-la abaixo de sua declaração da classe pink-text.", "Aplique a classe blue-text ao seu elemento h1, além da classe pink-text, e vamos ver qual delas ganhará.", "Lembre que a adição de vários atributos de classe a um elemento HTML se faz utilizando espaços entre ambos, assim:", "class=\"class1 class2\"", "Nota: A ordem em que as classes são listadas em HTML não tem importância.", "Contudo, a ordem de declarações de classe no <style> é importante. A segunda declaração sempre terá precedência pela primeira. Já que .blue-text é declarado depois, ele irá sobrepor os atributos de .pink-text." ] }, "ru": { "title": "Преопределите стили последующим CSS", "description": [ "Наш класс \"pink-text\" переопределил объявленное CSS-свойство элемента body!", "Мы только что доказали, что наши классы переопределяют CSS-свойства, обявленные в элементе body. Следующим вопросом по логике дожно быть: можем ли мы переопределить наш класс pink-text class?", "
", "Создайте дополнительный CSS-класс blue-text, который присваивает элементу синий цвет. Убедитесь, что он расположен ниже объявления вашего класса pink-text.", "Примените класс blue-text к вашему элементу h1 в дополнение к вашему классу pink-text, и давайте посмотрим какой выиграет.", "Применение множественных классов к атрибуту class HTML-элемента осуществляется через пробел:", "class=\"class1 class2\"", "Внимание: порядок, в котором указаны классы HTML-элемента неважен.", "Однако, порядок, в котором классы указаны в элементе <style> важен. Последующее объявление будет всегда иметь приоритет над предшествующим. Поскольку .blue-text объявлен последним, он переопрпделяет значения заданные атрибутом .pink-text" ] } } }, { "id": "bad87fee1348bd8aedf06756", "title": "Override Class Declarations by Styling ID Attributes", "description": [ "We just proved that browsers read CSS from top to bottom. That means that, in the event of a conflict, the browser will use whichever CSS declaration came last.", "But we're not done yet. There are other ways that you can override CSS. Do you remember id attributes?", "Let's override your pink-text and blue-text classes, and make your h1 element orange, by giving the h1 element an id and then styling that id.", "
", "Give your h1 element the id attribute of orange-text. Remember, id styles look like this:", "<h1 id=\"orange-text\">", "Leave the blue-text and pink-text classes on your h1 element.", "Create a CSS declaration for your orange-text id in your style element. Here's an example of what this looks like:", "
#brown-text {
  color: brown;
}
", "Note: It doesn't matter whether you declare this CSS above or below pink-text class, since id attribute will always take precedence." ], "challengeSeed": [ "", "

Hello World!

" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'message: Your h1 element should have the class pink-text.');", "assert($(\"h1\").hasClass(\"blue-text\"), 'message: Your h1 element should have the class blue-text.');", "assert($(\"h1\").attr(\"id\") === \"orange-text\", 'message: Give your h1 element the id of orange-text.');", "assert(($(\"h1\").length === 1), 'message: There should be only one h1 element.');", "assert(code.match(/#orange-text\\s*{/gi), 'message: Create a CSS declaration for your orange-text id');", "assert(!code.match(//gi), 'message: Do not give your h1 any style attributes.');", "assert($(\"h1\").css(\"color\") === \"rgb(255, 165, 0)\", 'message: Your h1 element should be orange.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Überschreibe Klassen Deklarationen mit Styling von ID Attributen", "description": [ "Wir haben gerade bewiesen, dass der Browser CSS von oben nach unten liest. Das bedeuted, dass im Falle eines Konflikts der Browser immer die letzte CSS Deklaration verwenden wird.", "Aber damit sind wir noch nicht fertig. Es gibt andere Wege um CSS zu überschreiben. Erinnerst du dich an Id Attribute?", "Überschreiben wir jetzt unsere pink-text und blue-text Klasse und machen unser h1 Element orange, indem wir dem h1 Element eine Id geben und diese dann stylen.", "
", "Gib deinem h1 Element das id Attribute orange-text. Vergiss nicht, Id Styles sehen so aus:", "<h1 id=\"orange-text\">", "Erstelle eine CSS Deklaration für deine orange-text Id in deinem style Element. Hier siehst du ein Beispiel wie sowas aussieht:", "
#brown-text {
  color: brown;
}
", "Notiz: Es ist egal ob du dies vor oder nach deiner \"pink-text\" Klasse schreibst, da Id Attribute immer bevorzugt werden." ] }, "es": { "title": "Anula la declaración de clases dando estilo a los atributos ID", "description": [ "Acabamos de demostrar que los navegadores leen CSS de arriba hacia abajo. Eso significa que, en el caso de un conflicto, el navegador utilizará la última declaración CSS. ", "Pero no hemos terminado todavía. Hay otras maneras con las que puedes anular CSS. ¿Te acuerdas de los atributos id?", "Anulemos tus clases pink-text y blue-text, y pongamos anaranjado tu elemento h1, dándole una identificación al elemento h1 y poniéndole estilo a esa identificación (id).", "
", "Dale a tu elemento h1 el atributo id con valor orange-text. Recuerda, los atributos id se ven así: ", "<h1 id=\"orange-text\">", "Deja las clases blue-text y pink-text de tu elemento h1.", "Crea una declaración CSS para tu identificación orange-text en tu elemento style. He aquí un ejemplo de como se ve esto: ", "
#brown-text {
  color: brown;
}
", "Nota: No importa si usted declara este CSS encima o debajo de la clase de texto de color rosa, ya atributo id siempre tendrá prioridad." ] }, "pt-br": { "title": "Sobreponha a Declaração de Classes Estilizando Atributos ID", "description": [ "Acabamos de demonstrar que os navegadores fazem a leitura do CSS de cima para baixo. Isso significa que, em caso de um conflito, o navegador utilizará a última declaração CSS.", "Mas ainda não terminamos, pois existem outras formas para sobrepor CSS. Você se lembra dos atributos id?", "Vamos sobrepor suas classes pink-text e blue-text, e fazer com que seu elemento h1 seja laranja. Faremos isso aplicando uma id para o elemento h1 e então estilizando essa id.", "
", "Dê ao seu elemento h1 o atributo id de nome orange-text. Relembre que os atributos id são assim:", "#brown-text {", "  color: brown;", "}", "Nota: Não importa se você declara este CSS acima ou abaixo da classe de texto cor de rosa, já que atributos id sempre terão prioridade." ] }, "ru": { "title": "Переопределите значения свойств классов стилизацией атрибутов id", "description": [ "Мы только что доказали, что браузеры читают CSS сверху-вниз. Это значит, что в случае конфликта значений будет установлено то, которое было объявлено в последнюю очередь.", "Но мы ещё не закончилил. Есть и другие способы переопределения CSS. Помните атрибуты id?", "Давайте переопределим ваши классы pink-text и blue-text, и сделаем ваш элемент h1 оранжевым, назначив элементу h1 зна��ение атрибута id и его последующей стилизацией.", "
", "Назначьте вашему элементу h1 значение атрибута id равное orange-text. Помните, что стилизация атрибута id выглядит так:", "<h1 id=\"orange-text\">", "Оставьте классы blue-text и pink-text присвоенными вашему элементу h1.", "Объявите свойства вашего атрибута id с названием orange-text в вашем элементе style. Вот пример того, как это выглядит:", "
#brown-text {
  color: brown;
}
", "Внимание: Не имеет значения объявите ли вы стиль выше или ниже класса pink-text, так как атрибут id всегда имеет приоритет." ] } } }, { "id": "bad87fee1348bd9aedf06756", "title": "Override Class Declarations with Inline Styles", "description": [ "So we've proven that id declarations override class declarations, regardless of where they are declared in your style element CSS.", "There are other ways that you can override CSS. Do you remember inline styles?", "
", "Use an inline style to try to make our h1 element white. Remember, in line styles look like this:", "<h1 style=\"color: green\">", "Leave the blue-text and pink-text classes on your h1 element." ], "challengeSeed": [ "", "

Hello World!

" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'message: Your h1 element should have the class pink-text.');", "assert($(\"h1\").hasClass(\"blue-text\"), 'message: Your h1 element should have the class blue-text.');", "assert($(\"h1\").attr(\"id\") === \"orange-text\", 'message: Your h1 element should have the id of orange-text.');", "assert(code.match(/h1
element the inline style of color: white.');", "assert($(\"h1\").css(\"color\") === \"rgb(255, 255, 255)\", 'message: Your h1 element should be white.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Überschreibe deine Klassen Deklarationen mit Inline Styles", "description": [ "Wir haben also gesehen dass Id Deklarationen die von Klassen überschreiben, egal wo sie in deinem style Element CSS stehen.", "Es gibt noch andere Wege CSS zu überschreiben. Erinnerst du dich an Inline Styles?", "
", "Benutze inline style um dein h1 Element weiß zu machen. Vergiss nicht, Inline Styles sehen so aus:", "<h1 style=\"color: green\">", "Lasse die blue-text und pink-text Klassen auf deinem h1 Element." ] }, "es": { "title": "Anula declaraciones de clase con estilos en línea", "description": [ "Así que hemos demostrado que las declaraciones de identificadores anulan las declaraciones de clase, independientemente del lugar donde se declaran en tu elemento de estilo CSS style.", "Hay otras maneras en las que puedes anular CSS. ¿Te acuerdas de los estilos en línea?", "
", "Utiliza un estilo en línea para tratar de hacer blanco nuestro elemento h1. Recuerda, los estilos en línea se ven así: ", "<h1 style=\"color: green\">", "Deja las clases blue-text y pink-text en tu elemento h1." ] }, "pt-br": { "title": "Sobreponha a Declaração de Classes com Estilos Inline", "description": [ "Certo, nós demonstramos que declarações de id sobrepoem as declarações de classe, independente do lugar onde são declarados em seu elemento style no CSS.", "Existem outras formas em que você pode sobrepor CSS. Você se lembra de estilos inline?", "
", "Use um estilo inline para tentar fazer com que nosso elemento h1 tenha a cor branca. Relembre que estilos inline são assim:", "<h1 style=\"color: green\">", "Deixe as classes blue-text e pink-text em seu elemento h1." ] }, "ru": { "title": "Переопределите значения свойств классов встроенными стилями", "description": [ "Итак, мы доказали, что объявление атрибута id переопределяет значения свойств, определённые в значениях атрибута class, независимо от того, были ли они объявлены в вашем элементе style.", "Есть и другие способы переопределения CSS. Помните встроенные стили?", "
", "Используйте встроенный стиль, чтобы попробовать сделать наш элемент h1 белым. Помните, что встроенные стили выглядят следующим образом:", "<h1 style=\"color: green\">", "Оставьте классы blue-text и pink-text назначенными вашему элементу h1." ] } } }, { "id": "bad87fee1348bd9aedf07756", "title": "Override All Other Styles by using Important", "description": [ "Yay! We just proved that inline styles will override all the CSS declarations in your style element.", "But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.", "In many situations, you will use CSS libraries. These may accidentally override your own CSS. So when you absolutely need to be sure that an element has specific CSS, you can use !important", "Let's go all the way back to our pink-text class declaration. Remember that our pink-text class was overridden by subsequent class declarations, id declarations, and inline styles.", "
", "Let's add the keyword !important to your pink-text element's color declaration to make 100% sure that your h1 element will be pink.", "An example of how to do this is:", "color: red !important;" ], "challengeSeed": [ "", "

Hello World!

" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'message: Your h1 element should have the class pink-text.');", "assert($(\"h1\").hasClass(\"blue-text\"), 'message: Your h1 element should have the class blue-text.');", "assert($(\"h1\").attr(\"id\") === \"orange-text\", 'message: Your h1 element should have the id of orange-text.');", "assert(code.match(/h1
element should have the inline style of color: white.');", "assert(code.match(/\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important\\s*;?[^\\.]*\\}/g), 'message: Your pink-text class declaration should have the !important keyword to override all other declarations.');", "assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'message: Your h1 element should be pink.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Überschreibe alle anderen Styles mit Important", "description": [ "Juhu! Wir haben bewiesen dass Inline Styles alle CSS Deklarationen aus deinem style Element überschreiben.", "Aber warte. Es gibt eine letzte Art CSS zu überschreiben. Dabei handelt es sich um die mächtigste Methode von allen. Aber bevor wir dazu kommen, sehen wir uns an warum du überhaupt CSS überschreiben wollen würdest.", "In vielen Situationen wirst du sogenannte \"CSS libraries\" (CSS Bibliotheken) verwenden. Diese könnten versehentlich dein eigenes CSS überschreiben. Wenn du also absolut sicher sein musst dass ein Element einen bestimmten Style hat, kannst du !important verwenden.", "Gehen wir zurück zu unserer pink-text Klassendeklaration. Wie du dich vielleicht erinnerst wurde unsere pink-text Klasse von darauffolgenden Klassen, Ids und Inline Styles überschrieben.", "
", "Füge das Schlüsselwort !important zu der Farbe deines \"pink-text\" Elements hinzu um 100% sicher zu gehen dass das h1 Element pink ist.", "Hier ist ein Beispiel wie man das macht:", "color: red !important;" ] }, "es": { "title": "Anula todos los demás estilos utilizando Important", "description": [ "¡Hurra! Demostramos que los estilos en línea anularán todas las declaraciones CSS de tu elemento style. ", "¡Pero espera! Hay una última forma de anular CSS. Este es el método más poderoso de todos. Pero antes de hacerlo, vamos a hablar de por qué puedes querer anular CSS. ", "En muchas situaciones, usarás bibliotecas CSS. Estas pueden anular accidentalmente tu propio CSS. Por eso, cuando necesitas estar seguro de que un elemento tiene un CSS específico puedes usar !important", "Regresemos a nuestra declaración de clase pink-text. Recuerda que nuestra clase pink-text fue anulada por declaraciones de clases posteriores, declaraciones id, y estilos en línea. ", "
", "Vamos a añadir la palabra clave !important a tu declaración del color de pink-text para estar 100% seguros que tu elemento h1 será rosado.", "Un ejemplo de cómo hacer esto es:", "color: red !important;" ] }, "pt-br": { "title": "Sobreponha Todos os Outros Elementos Utilizando Important", "description": [ "Isso! Demonstramos que os estilos inline irão sobrepor todas as declarações CSS de seu elemento style.", "Mas, espere! Há uma última forma de sobrepor com CSS. Este é o método mais poderoso de todos. Contudo, antes de colocá-lo em prática, vamos falar sobre os motivos que podem fazer você querer sobrepor CSS.", "Em diversas situações, você usará bibliotecas CSS. Pode ser que essas bibliotecas sobreponham acidentalmente o seu próprio CSS. Por isso, quando você precisar estar seguro de que um elemento possui um CSS específico, você poderá utilizar !important.", "Certo, vamos voltar para a nossa declaração de classe pink-text. Relembre que nossa classe pink-text foi sobreposta pelas declarações de classe posteriores, por declarações id e por estilos inline.", "
", "Vamos adicionar nossa palavra-clave !important para sua declaração de cor de pink-text para que possamos estar 100% seguros que seu elemento h1 será sempre cor de rosa.", "Um exemplo para fazer isso é:", "color: red !important;" ] }, "ru": { "title": "Переопределите все другие стили применив important", "description": [ "Ура! Мы только что доказали, что встроенные стили переопределяют все другие объявления CSS-свойств в вашем элементе style.", "Но подождите. Есть ещё один последний способ переопределения CSS. Это наиболее существенный способ из всех. Но перед тем, как мы его попробует, давайте поговорим о том, зачем вам может понадобиться переопрелить CSS.", "Во множестве ситуаций вы будете использовать CSS-библиотеки. Это может переопределить ваш собственный CSS. Таким образом, когда вам требуется быть абсолютно уверенными в том, что элемент будет обладать определёнными CSS-свойствами, вы можете использовать !important", "Давайте вернёмся к объявлению нашего класса pink-text. Помните, что наш класс pink-text был переопределён последующим классом, стилизацией атрибута id, встроенным стилем.", "
", "Давайте добавим ключевое слово !important к вашему объявлению текста розовым, чтобы убедиться на 100%, что ваш элемент h1 будет розовый.", "Пример того, как это можено сделать:", "color: red !important;" ] } } }, { "id": "bad87fee1348bd9aedf08726", "title": "Use Hex Code for Specific Colors", "description": [ "Did you know there are other ways to represent colors in CSS? One of these ways is called hexadecimal code, or hex code for short.", "We usually use decimals, or base 10 numbers, which use the symbols 0 to 9 for each digit. Hexadecimals (or hex) are base 16 numbers. This means it uses sixteen distinct symbols. Like decimals, the symbols 0-9 represent values zero to nine. Then A,B,C,D,E,F represent values ten to fifteen. Altogether, 0 to F can represent a digit in hexadecimal, giving us 16 total possible values. You can find more information about hexadecimal numbers here.", "In CSS, we can use 6 hexadecimal digits to represent colors, two each for the red (R), green (G), and blue (B) components. For example, #000000 is black and is also the lowest possible value. You can find more information about the RGB color system here.", "
", "Replace the word black in our body element's background-color with its hex code representation, #000000." ], "challengeSeed": [ "" ], "tests": [ "assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'message: Give your body element the background-color of black.');", "assert(code.match(/body\\s*{(([\\s\\S]*;\\s*?)|\\s*?)background.*\\s*:\\s*?#000(000)?((\\s*})|(;[\\s\\S]*?}))/gi), 'message: Use the hex code for the color black instead of the word black. For example body { color: #000000; }');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Verwende hexadezimal Code für spezifische Farben", "description": [ "Wusstest du dass es andere Möglichkeiten gibt Farben in CSS darzustellen? Eine dieser Möglichkeiten ist \"Hexadezimal Code\" genannt, oder kurz hex code.", "Wir verwenden üblicherweise decimals (Dezimalen), oder Zehnersystem, das für jede Ziffer eine Symbol von 0 bis 9 verwendet. Hexadecimals (Hexadezimalzahlen oder hex) beruhen auf einer 16er Basis. Das bedeuted dass sie 16 verschiedene Symbole verwenden. Wie auch Dezimalzahlen, repräsentiern die Symbole \"0\"-\"9\" Null bis Neun. Dann allerdings geht es weiter mit A,B,C,D,E,F für die Zahlen 10-15. Alles in Allem kann eine einzige Ziffer, mit 0 bis F, in hexadecimal 16 mögliche Werte ausdrücken. Mehr Informationen über das Hexadezimalsystem kannst du hier finden.", "In CSS können wir 6 Hexadezimalziffern verwenden um eine Farbe auszudrücken, je zwei für den Rot- (R), Grün (G)- und Blauanteil (B). #000000 ist zum Beispiel schwarz und der niedrigst mögliche Wert. Mehr Information über den RGB Farbraum findest du hier.", "
", "Ersetzte das Wort black in der Hintergrundfarbe deines body Elements mit dem hex code #000000." ] }, "es": { "title": "Usa el código hexadecimal para especificar colores", "description": [ "¿Sabías que hay otras maneras de representar los colores en CSS? Una de estas formas es llamada código hexadecimal o código hex para abreviar. ", "El sistema Decimal se refiere al que nos permite representar cantidades empleando los dígitos del cero al nueve - los números que la gente usa en la vida cotidiana. El sistema Hexadecimal incluye estos 10 dígitos más las letras A, B, C, D, E y F. Esto significa que Hexadecimal tiene un total de 16 dígitos posibles, en lugar de las 10 posibles que nos da nuestro sistema numérico normal en base 10. ", "Con CSS, utilizamos 6 dígitos hexadecimales para representar los colores. Por ejemplo, #000000 es el valor más bajo posible, y representa el color negro. ", "
", "Reemplaza la palabra black en el color de fondo (background-color) de nuestro elemento body por su representación hexadecimal #000000" ] }, "pt-br": { "title": "Use Código Hexadecimal para Especificar Cores", "description": [ "Você sabia que existem outras formas para representar as cores em CSS? Uma dessas formas é com o que chamamos de código hexadecimal, ou código hex para abreviar.", "O sistema Decimal nos permite representar quantidades numéricas com os dígitos de zero a nove - assim como nós os utilizamos durante o nosso dia a dia. Já o sistema Hexadecimal inclui estes 10 dígitos e também as letras A, B, C, D, E e F. Isso significa que o Hexadecimal possui um total de 16 dígitos possíveis, ao invés dos 10 possíveis que podemos usar com nosso sistema numérico normal de base 10.", "No CSS, utilizamos 6 dígitos hexadecimais para representar as cores. Por exemplo, #000000 é o valor mais baixo possível, e representa a cor preta.", "
", "Substitua a palavra black na cor de fundo (background-color) de nosso elemento body pela sua representação hexadecimal #000000." ] }, "ru": { "title": "Используйте hex-цвета для выбора определённых цветов", "description": [ "Знали ли вы, что существуют другие способы представления цветов в CSS? Одним из этих способов является шестнадцатиричный код, hex-код, если короче.", "Обычно мы используем десятки, или десятичную систему счисления, в основе которой лежит число 10, которая использует символы от 0 до 9 для каждого числа. В основе Шестнадцатиричной системы лежит число 16. Это значит, что она использует шестнадцать различных символов. Как в десятичной, символы 0-9 соответствуют значениям от нуля до девяти. Далее A,B,C,D,E,F соответствуют значениям от десяти до пятнадцати. Вместе, от 0 до F, с их помощью можно представить число в шестнадцатиричной системе счисления, что даёт нам в целом 16 возможных значений. Вы можете найти больше информации о шестнадцатиричной системе счисления тут.", "В CSS, мы можем использовать 6 шестнадцатиричных чисел для представления цвета, по два на каждый компонент: красный (R), зелёный (G), синий (B). Например, #000000 - черный цвет и минимальное значение. Вы можете найти больше информации о цветовой модели RGB.", "
", "Замените слово black в свойстве background-color нашего элемента body на представление в виде hex-кода, #000000." ] } } }, { "id": "bad87fee1348bd9aedf08721", "title": "Use Hex Code to Mix Colors", "description": [ "To review, hex codes use 6 hexadecimal digits to represent colors, two each for red (R), green (G), and blue (B) components.", "From these three pure colors (red, green, and blue), we can vary the amounts of each to create over 16 million other colors!", "For example, orange is pure red, mixed with some green, and no blue. In hex code, this translates to being #FFA500.", "The digit 0 is the lowest number in hex code, and represents a complete absence of color.", "The digit F is the highest number in hex code, and represents the maximum possible brightness.", "
", "Replace the color words in our style element with their correct hex codes.", "
ColorHex Code
Dodger Blue#1E90FF
Green#00FF00
Orange#FFA500
Red#FF0000
" ], "challengeSeed": [ "", "", "

I am red!

", "", "

I am green!

", "", "

I am dodger blue!

", "", "

I am orange!

" ], "tests": [ "assert($('.red-text').css('color') === 'rgb(255, 0, 0)', 'message: Give your h1 element with the text I am red! the color red.');", "assert(code.match(/\\.red-text\\s*?{\\s*?color:\\s*?#FF0000\\s*?;\\s*?}/gi), 'message: Use the hex code for the color red instead of the word red.');", "assert($('.green-text').css('color') === 'rgb(0, 255, 0)', 'message: Give your h1 element with the text I am green! the color green.');", "assert(code.match(/\\.green-text\\s*?{\\s*?color:\\s*?#00FF00\\s*?;\\s*?}/gi), 'message: Use the hex code for the color green instead of the word green.');", "assert($('.dodger-blue-text').css('color') === 'rgb(30, 144, 255)', 'message: Give your h1 element with the text I am dodger blue! the color dodger blue.');", "assert(code.match(/\\.dodger-blue-text\\s*?{\\s*?color:\\s*?#1E90FF\\s*?;\\s*?}/gi), 'message: Use the hex code for the color dodger blue instead of the word dodgerblue.');", "assert($('.orange-text').css('color') === 'rgb(255, 165, 0)', 'message: Give your h1 element with the text I am orange! the color orange.');", "assert(code.match(/\\.orange-text\\s*?{\\s*?color:\\s*?#FFA500\\s*?;\\s*?}/gi), 'message: Use the hex code for the color orange instead of the word orange.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Verwende Hexadezimal Code um Farben zu mischen", "description": [ "Mit diesen drei puren Farben (Rot, Grün und Blau) können wir 16 Millionen andere Farben erzeugen.", "Orange, zum Beispiel, ist pures Rot, gemischt mit ein bisschen Grün und keinem Blau", "
", "Gib dem body Element eine orange Hintergrundfarbe indem du den Hexadezimal Code #FFA500 verwendest." ] }, "es": { "title": "Usa código hex para mezclar colores", "description": [ "A partir de estos tres colores puros (rojo, verde y azul), podemos crear 16 millones de colores.", "Por ejemplo, el naranja es rojo puro, mezclado con un poco de verde, y sin azul.", "
", "Haz que el color de fondo del elemento body sea anaranjado, dándole el código hexadecimal #FFA500" ] }, "pt-br": { "title": "Use Código Hexadecimal para Misturar Cores", "description": [ "A partir dessas três cores puras (vermelho, verde e azul), podemos criar 16 milhões de cores.", "Por exemplo, o laranja é vermelho puro misturado com um pouco de verde, e sem nada de azul.", "
", "Faça com que a cor de fundo do elemento body seja alaranjada, usando o código hexadecimal #FFA500." ] }, "ru": { "title": "Используйте hex-код, чтобы смешивать цвета", "description": [ "Из этих трёх чистых цветов (красного, зелёного и синего), мы можем создать 16 миллионов других цветов.", "Например, оранжевый - смесь чистого красного с примесью зелёного, но без синего.", "
", "Сделайте цвет фона элемента body оранжевым, присвоив его соответствующему свойству значение hex-кода равное #FFA500" ] } } }, { "id": "bad87fee1348bd9aedf08719", "title": "Use Abbreviated Hex Code", "description": [ "Many people feel overwhelmed by the possibilities of more than 16 million colors. And it's difficult to remember hex code. Fortunately, you can shorten it.", "For example, red's hex code #FF0000 can be shortened to #F00. This shortened form gives one digit for red, one digit for green, and one digit for blue.", "This reduces the total number of possible colors to around 4,000. But browsers will interpret #FF0000 and #F00 as exactly the same color.", "
", "Go ahead, try using the abbreviated hex codes to color the correct elements.", "
ColorShort Hex Code
Cyan#0FF
Green#0F0
Red#F00
Fuchsia#F0F
" ], "challengeSeed": [ "", "", "

I am red!

", "", "

I am fuchsia!

", "", "

I am cyan!

", "", "

I am green!

" ], "tests": [ "assert($('.red-text').css('color') === 'rgb(255, 0, 0)', 'message: Give your h1 element with the text I am red! the color red.');", "assert(code.match(/\\.red-text\\s*?{\\s*?color:\\s*?#F00\\s*?;\\s*?}/gi), 'message: Use the abbreviate hex code for the color red instead of the hex code #FF0000.');", "assert($('.green-text').css('color') === 'rgb(0, 255, 0)', 'message: Give your h1 element with the text I am green! the color green.');", "assert(code.match(/\\.green-text\\s*?{\\s*?color:\\s*?#0F0\\s*?;\\s*?}/gi), 'message: Use the abbreviated hex code for the color green instead of the hex code #00FF00.');", "assert($('.cyan-text').css('color') === 'rgb(0, 255, 255)', 'message: Give your h1 element with the text I am cyan! the color cyan.');", "assert(code.match(/\\.cyan-text\\s*?{\\s*?color:\\s*?#0FF\\s*?;\\s*?}/gi), 'message: Use the abbreviated hex code for the color cyan instead of the hex code #00FFFF.');", "assert($('.fuchsia-text').css('color') === 'rgb(255, 0, 255)', 'message: Give your h1 element with the text I am fuchsia! the color fuchsia.');", "assert(code.match(/\\.fuchsia-text\\s*?{\\s*?color:\\s*?#F0F\\s*?;\\s*?}/gi), 'message: Use the abbreviated hex code for the color fuchsia instead of the hex code #FF00FF.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Verwende abgekürzten Hexadezimal Code", "description": [ "Viele Leute fühlen sich mit der Auswahl aus über 16 Millionen Farben überfordert. Außerdem ist es schwierig sich Hexadezimal Codes zu merken. Zum Glück kannst du sie abkürzen.", "Rot, zum Beispiel, mit dem Hexadezimal Code von #FF0000 kannst du mit #F00 abkürzen. Das bedeuted eine Ziffer für Rot, eine für Grün und eine für Blau", "Das reduziert die Gesamtsumme an möglichen Farben auf ungefähr 4.000. Aber Browser interpretieren #FF0000 und #F00 als exakt die gleiche Farbe.", "
", "Probiere #F00 aus um die Hintergrundfarbe des body Elements rot zu färben." ] }, "es": { "title": "Uso código hex abreviado", "description": [ "Mucha gente se siente abrumada por las posibilidades de más de 16 millones de colores. Y es difícil recordar el código hexadecimal. Afortunadamente puedes acortarlo. ", "Por ejemplo, el rojo, que es #FF0000 en código hexadecimal, se puede abreviar a #F00. Es decir, un dígito para el rojo, un dígito para el verde, un dígito para el azul. ", "Esto reduce el número total de posibles colores a alrededor de 4.000. Pero los navegadores interpretarán #FF0000 y #F00 como exactamente el mismo color. ", "
", "Adelante, intenta usar #F00 para volver rojo el color de fondo del elemento body." ] }, "pt-br": { "title": "Use Código Hexadecimal Abreviado", "description": [ "Muitas pessoas se sentem confusas com as possibilidades de mais de 16 milhões de cores. Além disso, é difícil lembrar de códigos hexadecimais. Por sorte, podemos abreviá-lo.", "Por exemplo, o vermelho que é #FF0000 em código hexadecimal pode ser abreviado a #F00. Isso quer dizer que podemos usar um dígito para vermelho, um dígito para verde e um dígito para azul.", "Fazer isso reduz o número total de possíveis cores para ao redor de 4.000. Apesar disso, os navegadores interpretarão #FF0000 e #F00 exatamente como a mesma cor.", "
", "Continue, tente usar #F00 para fazer com que a cor de fundo do elemento body seja vermelha." ] }, "ru": { "title": "Используйте аббревиатуры hex-кода", "description": [ "Множество людей обременяет возможность применения более 16-ти миллионов цветов. И hex-коды достаточно сложно запоминать. К счастью, вы можете использовать укороченные выражения.", "Например, красный, который имеет значение #FF0000 в виде hex-кода, может быть укорочен до #F00. В укороченном виде: одна цифра представляет красный, одна - зелёный, одна - синий.", "Это уменьшает общее количество возможных цветов до порядка 4,000. Но браузеры будут интерпретировать #FF0000 и #F00 как один и тот же цвет.", "
", "Вперёд, попробуйте применить значение #F00, чтобы сделать цвет фона элемента body красным." ] } } }, { "id": "bad87fee1348bd9aede08718", "title": "Use RGB values to Color Elements", "description": [ "Another way you can represent colors in CSS is by using RGB values.", "The RGB value for black looks like this:", "rgb(0, 0, 0)", "The RGB value for white looks like this:", "rgb(255, 255, 255)", "Instead of using six hexadecimal digits like you do with hex code, with RGB you specify the brightness of each color with a number between 0 and 255.", "If you do the math, the two digits for one color equal 16 times 16, which gives us 256 total values. So RGB, which starts counting from zero, has the exact same number of possible values as hex code.", "
", "Let's replace the hex code in our body element's background color with the RGB value for black: rgb(0, 0, 0)" ], "challengeSeed": [ "" ], "tests": [ "assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'message: Your body element should have a black background.');", "assert(code.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'message: Use rgb to give your body element a color of black. For example body { background-color: rgb(255, 165, 0); }');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Verwende RGB Werte um Elemente zu färben", "description": [ "Ein anderer Weg um Farben in CSS darzustellen ist rgb Werte zu verwenden.", "Der RGB Wert für Schwarz sieht so aus:", "rgb(0, 0, 0)", "Der RGB Wert für Weiß sieht so aus:", "rgb(255, 255, 255)", "Anstatt sechs Hexadezimalziffern zu verwenden, legst du mit rgb die Helligkeit jeder einzelner Farbe mit einer Zahl zwischen 0 und 255 fest.", "Wenn du nachrechnest, 16 mal 16 ist 256 Werte. Also hat rgb, das mit Null hochzuzählen beginnt, die gleiche Anzahl an möglichen Farben wie Hexadezimal Code.", "
", "Ersetzte jetzt den Hexadezimal Code der Hintergrundfarbe deines body Elements mit dem RGB Wert für Schwarz: rgb(0, 0, 0)" ] }, "es": { "title": "Usa RGB para colorear elementos", "description": [ "Otra forma en la que puedes representar colores en CSS es usando valores rgb.", "El valor RGB para el negro, luce así:", "rgb(0, 0, 0)", "El valor RGB para el blanco, se ve así:", "rgb(255, 255, 255)", "En lugar de utilizar seis dígitos hexadecimales, con rgb especificas el brillo de cada color con un número entre 0 y 255.", "Si haces la matemática, 16 veces 16 es 256 valores totales. Así que rgb, que comienza a contar desde cero, tiene exactamente el mismo número de valores posibles que el código hexadecimal.", "
", "Remplacemos el código hexadecimal del color de fondo de nuestro elemento body por el valor RGB para el negro: rgb(0, 0, 0)" ] }, "pt-br": { "title": "Use Valores RBG para Colorir Elementos", "description": [ "Outra forma em que você pode representar cores em CSS é utilizando valores rgb.", "O valor RGB para preto é assim:", "rgb(0, 0, 0)", "O valor RGB para branco é assim:", "rgb(255, 255, 255)", "Ao invés de utilizar 6 dígitos hexadecimais, com rgb você especifica o brilho de cada cor com um número entre 0 e 255.", "Se você fizer a matemática, 16 vezes 16 é igual a 256 valores totais. Sendo assim, o rgb, que começa a contar desde zero, tem exatamente o mesmo número de valores possíveis que o código hexadecimal.", "
", "Vamos substituir o código hexadecimal da cor de fundo do nosso elemento body pelo valor RGB para preto: rgb(0, 0, 0)." ] }, "ru": { "title": "Используйте формат RGB для придания цвета элементам", "description": [ "Другим способом представления цветов в CSS является применение значений rgb.", "Значение RGB для чёрного цвета выглядит следующим образом:", "rgb(0, 0, 0)", "Значение RGB для белого выглядит так:", "rgb(255, 255, 255)", "Вместо использования шести шестнадцатиразрядных цифр, как вы делаете, когда применяете hex-код, применяя rgb вы указываете значение яркости каждого цвета в диапазоне от 0 до 255.", "Если вы посчитаете, 16 раз по 16 - это 256 различных значений. Таким образом rgb, где счёт начинается с нуля, имеет ровно то же число возможных значений, что и hex-код.", "
", "Давайте заменим hex-код в цвете фона нашего элемента body на значение в формате RGB для получения чёрного: rgb(0, 0, 0)" ] } } }, { "id": "bad82fee1348bd9aedf08721", "title": "Use RGB to Mix Colors", "description": [ "Just like with hex code, you can mix colors in RGB by using combinations of different values.", "
", "Replace the hex codes in our style element with their correct RGB values.", "
ColorRGB
Bluergb(0, 0, 255)
Redrgb(255, 0, 0)
Orchidrgb(218, 112, 214)
Siennargb(160, 82, 45)
" ], "challengeSeed": [ "", "", "

I am red!

", "", "

I am orchid!

", "", "

I am sienna!

", "", "

I am blue!

" ], "tests": [ "assert($('.red-text').css('color') === 'rgb(255, 0, 0)', 'message: Give your h1 element with the text I am red! the color red.');", "assert(code.match(/\\.red-text\\s*?{\\s*?color:\\s*?rgb\\(\\s*?255\\s*?,\\s*?0\\s*?,\\s*?0\\s*?\\)\\s*?;\\s*?}/gi), 'message: Use rgb for the color red.');", "assert($('.orchid-text').css('color') === 'rgb(218, 112, 214)', 'message: Give your h1 element with the text I am orchid! the color orchid.');", "assert(code.match(/\\.orchid-text\\s*?{\\s*?color:\\s*?rgb\\(\\s*?218\\s*?,\\s*?112\\s*?,\\s*?214\\s*?\\)\\s*?;\\s*?}/gi), 'message: Use rgb for the color orchid.');", "assert($('.blue-text').css('color') === 'rgb(0, 0, 255)', 'message: Give your h1 element with the text I am blue! the color blue.');", "assert(code.match(/\\.blue-text\\s*?{\\s*?color:\\s*?rgb\\(\\s*?0\\s*?,\\s*?0\\s*?,\\s*?255\\s*?\\)\\s*?;\\s*?}/gi), 'message: Use rgb for the color blue.');", "assert($('.sienna-text').css('color') === 'rgb(160, 82, 45)', 'message: Give your h1 element with the text I am sienna! the color sienna.');", "assert(code.match(/\\.sienna-text\\s*?{\\s*?color:\\s*?rgb\\(\\s*?160\\s*?,\\s*?82\\s*?,\\s*?45\\s*?\\)\\s*?;\\s*?}/gi), 'message: Use rgb for the color sienna.');" ], "type": "waypoint", "challengeType": 0, "translations": { "de": { "title": "Verwende RGB um Farben zu mischen", "description": [ "Wie auch mit Hexadezimal Code, kannst du Farben in RGB mischen indem du Kombination von verschiedenen Werten nimmst.", "
", "Ändere die Hintergrundfarbe des body Elements zum RGB Wert von Orange: rgb(255, 165, 0)" ] }, "es": { "title": "Usa RGB para mezclar colores", "description": [ "Al igual que con el código hexadecimal, puedes mezclar los colores en RGB mediante el uso de combinaciones de diferentes valores.", "
", "Cambia el color de fondo del elemento body a anaranjado usando su valor RGB: rgb(255, 165, 0)" ] }, "pt-br": { "title": "Use Valores RBG para Misturar Cores", "description": [ "Assim como com código hexadecimal, você pode misturar as cores com RGB através do uso de combinações de valores diferentes.", "
", "Mude a cor de fundo do elemento body para alaranjado usando seu valor RGB: rgb(255, 165, 0)." ] }, "ru": { "title": "Используйте формат RGB, чтобы смешивать цвета", "description": [ "Так же как и с hex-кодом, вы можете смешивать цвета в формате RGB, используя комбинации различных значений.", "
", "Измените цвет фона элемента body на значение в формате RGB соответствующее оранжевому: rgb(255, 165, 0)" ] } } } ] }