Help with this problem?

Not exactly sure what to do here. Any suggestions? Thanks!

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;
}
</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="/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>
  [attr="checkbox"] {margin: 10px 0px 15px 0px}

 <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/81.0.4044.122 Safari/537.36.

Challenge: Use Attribute Selectors to Style Elements

Link to the challenge:

Hello!

Look at the example the challenge provides, and compare it to what the test is asking you to do.

I’ve tried this as well, still not working

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

That code is correct. But where are you putting it?

What kind of code is it? What does it do? That should help you know where to put it.

I’ve put it both before and after the code I set up for checkboxes but I’m still not getting any results.

It’s not html code. It’s CSS code. Where does CSS code go?

1 Like

The assignment is asking you to style using attribute selector. Therefore your style must be inside style tag.

1 Like

to style by attributes try adding to your style : input[type=checkbox]{ <–css here–> } and same for input[type=radio]{ <-- css here -->}