Kindly help me im stuck

Tell us what’s happening:

using Attribute selectors to style elemnts

please help im stuck here i cant seem to get the following
1-The top margins of the checkboxes should be 10px
2-The bottom margins of the checkboxes should be 15px.

Your code so far

<link href="" rel="stylesheet" type="text/css">
  input[type='checkbox'] {
     margin: 10px 15px 10px 15px;

  .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;

<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="checkbox" name="indoor-outdoor" checked> Indoor</label>
    <label><input type="checkbox" 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>

Your browser information:

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

Link to the challenge:

[type="checkbox"] { margin: 10px auto 15px auto; }
1 Like

the way the values work for margin is:

margin: margin-top margin-right margin-bottom margin-left;

1 Like

yes that’s right, you can control margin of each side
example margin: 10px 5px 5px 7px;
and it’s similar to this

margin-top: 10px;
margin-right: 5px;
margin-bottom: 5px ;
margin-left: 7px;

It’s shorthand code

1 Like

There are a few different versions of the “shorthand code”:

  • margin: .5vmin; This sets all four sides to the same margin.
  • margin: 10px 15px; This sets the top and bottom to 10px, and the left and right to 15.
  • margin: 10px 5px 10px auto; This sets each side separately, in clockwise order from the top.

I don’t know if you fixed this, but right now your margin-bottom is 10px, not 15px. I hope this helps.

1 Like