# Use CSS Selectors to Style Elements #1

**URL:** <https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [July 25, 2021, 11:25pm UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905 "2021-07-25T23:25:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene.y.jang](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@Eugene.y.jang](https://forum.freecodecamp.org/u/Eugene.y.jang)\
**Post date:** [July 25, 2021, 11:25pm UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/1 "2021-07-25T23:25:19Z")

</div>

**Tell us what’s happening:**  
Why doesn’t this work for the **Use CSS Selectors to Style Elements** section??

```
  **Your code so far**

```

```html

<style>
h2 {
  color: blue;
}
</style>
<h2> Cat Photo App </h2>

```

```
  **Your browser information:**

```

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36`

**Challenge:** Use CSS Selectors to Style Elements

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/responsive-web-design/basic-css/use-css-selectors-to-style-elements)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Crumbs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/crumbs/32/183822_2.png) [@Crumbs](https://forum.freecodecamp.org/u/Crumbs)\
**Post date:** [July 25, 2021, 11:48pm UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/2 "2021-07-25T23:48:23Z")

</div>

Hi, I checked the link to the challenge and they were using inline css in the code.

```auto
<h2 style = "color: red;"> Cat Photo App<h2/>

what you have above is css in a style tag in order for the css to apply to your document you'd have to nest the style tag in a head tag like this.

<head>
 <style>
h2 { 
             color: blue;
  }
</style>
</head>

```

hope that helps

---

<div class="post-metadata">

**Author:** ![Crumbs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/crumbs/32/183822_2.png) [@Crumbs](https://forum.freecodecamp.org/u/Crumbs)\
**Post date:** [July 25, 2021, 11:50pm UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/3 "2021-07-25T23:50:01Z")

</div>

I just noticed it intialized all of the html I wrote

```auto
< head >
< style >
place code in here or apply style in the inline css
</ style>
</ head >

```

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [July 26, 2021, 12:40am UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/4 "2021-07-26T00:40:09Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [July 26, 2021, 12:43am UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/5 "2021-07-26T00:43:50Z")

</div>

Hi @Eugene.y.jang !

Welcome to the forum!

When asking for help on the forum please provide your FULL code and not parts of it.

It makes it easier for people to test your code and find any errors in your code if you provide the FULL code.

With the little bit you gave us, it works on my end.  
Assuming you didn’t mess with any of the other html it might be an issue with an extension.

Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [January 24, 2022, 12:44pm UTC](https://forum.freecodecamp.org/t/use-css-selectors-to-style-elements-1/470905/6 "2022-01-24T12:44:31Z")

</div>

Closed on January 24, 2022, 12:44pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
