Click here to view more cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats
<style>You can see that we've created a CSS class called
.blue-text {
color: blue;
}
</style>
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, class names start with a period. In your HTML elements' class attribute, the class name does not include the period.
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'.
h2 element should be red.
testString: assert($("h2").css("color") === "rgb(255, 0, 0)", 'Your h2 element should be red.');
- text: Your h2 element should have the class red-text.
testString: assert($("h2").hasClass("red-text"), 'Your h2 element should have the class red-text.');
- text: Your stylesheet should declare a red-text class and have its color set to red.
testString: assert(code.match(/\.red-text\s*\{\s*color\s*:\s*red;\s*\}/g), 'Your stylesheet should declare a red-text class and have its color set to red.');
- text: Do not use inline style declarations like style="color: red" in your h2 element.
testString: assert($("h2").attr("style") === undefined, 'Do not use inline style declarations like style="color: red" in your h2 element.');
```
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate: