0

I have two images inside of a div

<div class="my_div">

<img src="1.jpg" />
<img src="2.jpg" />

</div>

I have tried following css

.my_div img:nth-child(2) { margin-top:130px; }

But this doesn't work? Any idea why?

i76
  • 117
  • 1
  • 2
  • 11

1 Answers1

0

use display: inherit; on .my_div img:nth-child(2)

.my_div img:nth-child(2) {
    margin-top:130px;
    display: inherit;
}
<div class="my_div">

<img src="1.jpg" />
<img src="2.jpg" />

</div>
jafarbtech
  • 6,842
  • 1
  • 36
  • 55