Trouble with Using Attribute Selectors to Style Elements

I have been stuck on this problem with the attribute selectors for a while. I have looked up videos and followed the hints to see if I could get it right but Code Camp says I have it wrong…

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

I have this typed into my style element but its saying that its wrong and the margins are not changing either. Some help would be much appreciated!

Your code so far


<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;
}
[type='checkboxes']{
margin: 10px 0px 15px 0px;
}

</style>

<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 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36.

Challenge: Use Attribute Selectors to Style Elements

Link to the challenge:

Hello and welcome to the freeCodeCamp community~!

Currently you are trying to select all elements with an attribute type="checkboxes". There are no such elements on the page - but there is something similar. Do you see what this selector should be?

1 Like

Thanks for responding! and no, i dont understand what it should be… should it be type=‘radio’‘checkboxes’ ?
Im sorry if that sounds stupid, I just really dont know :frowning:

Take a look at your HTML. You are trying to select the checkboxes, right? What type value do they have?

They have the type as radio. Does that mean I need to use radio instead of checkboxes?

Those would be the radio buttons, not the checkbox buttons. :slight_smile:

1 Like

I’ve figured it out! You have to make them for both! Thank you so much for your help!

1 Like

you don’t need to use it for both, you just need to match the correct type value