Stuck at adding a negative margin

Stuck at adding a negative margin
0

#1

I can’t get past the challenge I have entered the negative 15 into my code but the challenge will not let me go forward. I have tried signing out, refreshing the page and any help would be greatly appreciated thank you.


#2

Have you solve this yet? If not, can you post your code and a link to the challenge?


#3

Add a Negative Margin to an Element
An element’s margin controls the amount of space between an element’s border and surrounding elements.

If you set an element’s margin to a negative value, the element will grow larger.

Try to set the margin to a negative value like the one for the red box.

Change the margin of the green box to -15px, so it fills the entire horizontal width of the yellow box around it.

Run tests (ctrl + enter)
Reset your code
Get a hint
Ask for help on the forum
Your green-box class should give elements -15px of margin.

<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: 20px;
  }
  
  .red-box {
    background-color: red;
    padding: 20px;
    margin: -15px;
  }

  .green-box {
    background-color: green;
    padding: 20px;
    margin: -15px;
  }
</style>

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

​I have done what was asked and tapped the run test. But nothing happens.


#4

The code is correct. Try hitting the reset button and try again.


#5

Figured it out it was the position. Thank you for the help