2018-10-10 18:03:03 -04:00
---
id: bad87fee1348bd9aedf06756
title: Override Class Declarations with Inline Styles
challengeType: 0
2019-08-28 16:26:13 +03:00
videoUrl: https://scrimba.com/c/cGJDRha
forumTopicId: 18252
2018-10-10 18:03:03 -04:00
localeTitle: Переопределить объявления классов с о встроенными стилями
---
## Description
2019-08-28 16:26:13 +03:00
<section id='description'>
Таким образом, мы доказали, что объявления id переопределяют объявления классов, независимо от того, где они объявлены в вашем элементе <code>style</code> CSS. Существуют и другие способы переопределения CSS. Вы помните встроенные стили?
</section>
2018-10-10 18:03:03 -04:00
## Instructions
2019-08-28 16:26:13 +03:00
<section id='instructions'>
Используйте <code>inline style</code> чтобы сделать наш элемент <code>h1</code> белым. Помните, что в стилях строк выглядит так: <code><h1 style="color: green;"></code> Оставьте классы <code>blue-text</code> и <code>pink-text</code> на вашем элементе <code>h1</code> .
</section>
2018-10-10 18:03:03 -04:00
## Tests
<section id='tests'>
```yml
tests:
2019-08-28 16:26:13 +03:00
- 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)");
2018-10-10 18:03:03 -04:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<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>
```
</div>
</section>
## Solution
<section id='solution'>
2019-08-28 16:26:13 +03:00
```html
<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>
2018-10-10 18:03:03 -04:00
```
2019-08-28 16:26:13 +03:00
2018-10-10 18:03:03 -04:00
</section>