Files
freeCodeCamp/curriculum/challenges/russian/01-responsive-web-design/basic-css/override-class-declarations-with-inline-styles.russian.md

2.6 KiB
Raw Blame History

id, title, challengeType, videoUrl, forumTopicId, localeTitle
id title challengeType videoUrl forumTopicId localeTitle
bad87fee1348bd9aedf06756 Override Class Declarations with Inline Styles 0 https://scrimba.com/c/cGJDRha 18252 Переопределить объявления классов со встроенными стилями

Description

Таким образом, мы доказали, что объявления id переопределяют объявления классов, независимо от того, где они объявлены в вашем элементе style CSS. Существуют и другие способы переопределения CSS. Вы помните встроенные стили?

Instructions

Используйте inline style чтобы сделать наш элемент h1 белым. Помните, что в стилях строк выглядит так: <h1 style="color: green;"> Оставьте классы blue-text и pink-text на вашем элементе h1 .

Tests

tests:
  - text: Your <code>h1</code> element should have the class <code>pink-text</code>.
    testString: assert($("h1").hasClass("pink-text"));
  - text: Your <code>h1</code> element should have the class <code>blue-text</code>.
    testString: assert($("h1").hasClass("blue-text"));
  - text: Your <code>h1</code> element should have the id of <code>orange-text</code>.
    testString: assert($("h1").attr("id") === "orange-text");
  - text: Give your <code>h1</code> element an inline style.
    testString: assert(document.querySelector('h1[style]'));
  - text: Your <code>h1</code> element should be white.
    testString: assert($("h1").css("color") === "rgb(255, 255, 255)");

Challenge Seed

<style>
  body {
    background-color: black;
    font-family: monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text">Hello World!</h1>

Solution

<style>
  body {
    background-color: black;
    font-family: monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>