Basic CSS - Use Attribute Selectors to Style Elements

Basic CSS - Use Attribute Selectors to Style Elements
0.0 0


I did this but I’ve no idea why isn’t this selecting all the checkboxes.

<link href="" rel="stylesheet" type="text/css">
  .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;
  input[type = 'checkbox']{
    margin-top: 10px; 
    margin-bottom: 15px;

<h2 class="red-text">CatPhotoApp</h2>
  <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="" alt="A cute orange cat lying on its back."></a>
  <div class="silver-background">
    <p>Things cats love:</p>
      <li>cat nip</li>
      <li>laser pointers</li>
    <p>Top 3 things cats hate:</p>
      <li>flea treatment</li>
      <li>other cats</li>
  <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>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>

Link to the challenge : Basic CSS - Use Attribute Selectors to Style Elements


Try changing this line:

 input[type = 'checkbox']



I think this may be down to the way the tests are being run, as I tried the syntax with spaces on and it worked fine.

Hope this solves your probem :slight_smile:


Man, this isn’t fair :frowning_face:
what’s the difference in between the space and that was proper indentation :frowning_face:


It might just be a styling choice. All of the examples that I looked at were without spaces


Thank you guys for your references!!

This code passes as well. Hope this can help other people

    margin: 10px 0px 15px 0px;


I guess now they’ve changed their tests :joy::joy::joy: