# My 'Use Attribute Selectors to Style Elements' task can't be done

**URL:** <https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [January 21, 2021, 2:53am UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797 "2021-01-21T02:53:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoeee](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zoeee](https://forum.freecodecamp.org/u/zoeee)\
**Post date:** [January 21, 2021, 2:53am UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797/1 "2021-01-21T02:53:56Z")

</div>

**Tell us what’s happening:**

I’m trying to do my ‘Use Attribute Selectors to Style Elements’ task. My code is right. But I can’t pass the test because instead of code, this code

[type=‘checkboxes’] {  
margin: 10px 0px 15px 0px;  
}

only become an ordinary text.

**Your code so far**

```html

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
  color: red;
}

h2 {
  font-family: Lobster, monospace;
}

p {
  font-size: 16px;
  font-family: monospace;
}

.thick-green-border {
  border-color: green;
  border-width: 10px;
  border-style: solid;
  border-radius: 50%;
}

.smaller-image {
  width: 100px;
}

.silver-background {
  background-color: silver;
}
</style>

[type='checkboxes'] {
margin: 10px 0px 15px 0px;
}

<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<div class="silver-background">
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
</div>

<form action="https://freecatphotoapp.com/submit-cat-photo" id="cat-photo-form">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label><br>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</main>

```

**Your browser information:**

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

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

**Link to the challenge:**

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

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [January 21, 2021, 2:41pm UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797/3 "2021-01-21T14:41:55Z")

</div>

> [@zoeee](#):
>
> ```auto
> [type='checkboxes'] {
> margin: 10px 0px 15px 0px;
> }
> 
> ```

You have a couple of things incorrect;

1. This is to style the page so it needs to be within the `style` element
2. revisit this; `checkboxes` (That is not the correct `input` attribute name)

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [January 21, 2021, 2:42pm UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797/4 "2021-01-21T14:42:51Z")

</div>

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.  
If you post a full passing solution to a challenge and have questions about it, please surround it with `[spoiler]` and `[/spoiler]` tags on the line above and below your solution code.

---

<div class="post-metadata">

**Author:** ![Sunithack1](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sunithack1/32/17449_2.png) [@Sunithack1](https://forum.freecodecamp.org/u/Sunithack1)\
**Post date:** [January 21, 2021, 5:29pm UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797/5 "2021-01-21T17:29:19Z")

</div>

Hi @Roma,

Thanks for your guidance. In future, I will keep that in mind when I reply.

---

<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:** [July 23, 2021, 5:29am UTC](https://forum.freecodecamp.org/t/my-use-attribute-selectors-to-style-elements-task-cant-be-done/441797/6 "2021-07-23T05:29:20Z")

</div>

Closed on July 23, 2021, 5:29am UTC

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