Margin Issues CSS

I’m supposed to adjust the margin of the blue box to be the same as that of the red box. Whenver I try to compile, it just says “//running tests.” I don’t know what I’m doing wrong. Here are the instructions:

Give the blue box a margin of 40px on its top and left side, but only 20px on its bottom and right side.

Your code so far


<style>
.injected-text {
  margin-bottom: -25px;
  text-align: center;
}

.box {
  border-style: solid;
  border-color: black;
  border-width: 5px;
  text-align: center;
}

.yellow-box {
  background-color: yellow;
  padding: 10px;
}

.red-box {
  background-color: crimson;
  color: #fff;
  margin-top: 40px;
  margin-right: 20px;
  margin-bottom: 20px;
  margin-left: 40px;
}

.blue-box {
  background-color: blue;
  color: #fff;
  margin-top: 40px;
  margin-right: 20px;
  margin-bottom: 20px;
  margin-left: 40px;
}
</style>
<h5 class="injected-text">margin</h5>

<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box blue-box">padding</h5>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:73.0) Gecko/20100101 Firefox/73.0.

Challenge: Add Different Margins to Each Side of an Element

Link to the challenge:

you are having different margins on right and left , also top and bottom i guess that maybe the issue rewrite your code like :
margin-top: 40px
margin-bottom: 40px
margin-right: 20px
marigin-left: 20px

1 Like

no, the values were right. Read again the challenge instructions before giving wrong hints, thank you.

1 Like

can you try changing order of the rules? I remember I had a weird issue with this challenge this month when I tried it again, where it passed with rules in an order but it didn’t if they were in a different order.
Maybe try top-left-bottom-right?

1 Like

When it just sits on “running tests” it is usually a sign of some larger issue. Maybe it’s a Firefox on Mac problem? Can you try in Chrome just to test?

If that doesn’t help I’d suggest resetting the challenge, logging out and clearing the cache/cookies.

I should note that this might not be a great time to log out or clear the cookies as there are some users reporting issues logging back in right now. So maybe wait with this challenge for a bit instead.

1 Like

Thank you! I refreshed the page again, and then, it worked! Sorry for not being too specific, and I really appreciate your help!