With CSS, there are hundreds of CSS <code>properties</code> that you can use to change the way an element looks on your page.
When you entered <code><h2 style="color: red">CatPhotoApp</h2></code>, you were styling that individual <code>h2</code> element with <code>inline CSS</code>, which stands for <code>Cascading Style Sheets</code>.
That's one way to specify the style of an element, but there's a better way to apply <code>CSS</code>.
At the top of your code, create a <code>style</code> block like this:
Inside that style block, you can create a <code>CSS selector</code> for all <code>h2</code> elements. For example, if you wanted all <code>h2</code> elements to be red, you would add a style rule that looks like this:
Note that it's important to have both opening and closing curly braces (<code>{</code> and <code>}</code>) around each element's style rule(s). You also need to make sure that your element's style definition is between the opening and closing style tags. Finally, be sure to add a semicolon to the end of each of your element's style rules.
</section>
## Instructions
<sectionid='instructions'>
Delete your <code>h2</code> element's style attribute, and instead create a CSS <code>style</code> block. Add the necessary CSS to turn all <code>h2</code> elements blue.
- text: Remove the style attribute from your <code>h2</code> element.
testString: 'assert(!$("h2").attr("style"), ''Remove the style attribute from your <code>h2</code> element.'');'
- text: Create a <code>style</code> element.
testString: 'assert($("style") && $("style").length > 1, ''Create a <code>style</code> element.'');'
- text: Your <code>h2</code> element should be blue.
testString: 'assert($("h2").css("color") === "rgb(0, 0, 255)", ''Your <code>h2</code> element should be blue.'');'
- text: Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace.
testString: 'assert(code.match(/h2\s*\{\s*color\s*:.*;\s*\}/g), ''Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace.'');'
- text: Make sure all your <code>style</code> elements are valid and have a closing tag.
testString: 'assert(code.match(/<\/style>/g) && code.match(/<\/style>/g).length === (code.match(/<style((\s)*((type|media|scoped|title|disabled)="[^"]*")?(\s)*)*>/g) || []).length, ''Make sure all your <code>style</code> elements are valid and have a closing tag.'');'