Why can't I target my footer image with CSS

.footer_image {
    height: 60rem;
}
<footer>
  <div class="footer_image">
    <img src="logo_footer.png" style="margin-left:20px">
  </div>
</footer>

I cant seem to target the properties to change my image in my footer, what am I doing wrong?

>Solution :

You can use

.footer_image img {
}

This will work on all pictures which have the html img tag and are inside the .footer_image class

Or you can assign a class or id to your image to define its properties

<img class="mysuperfancyimage" src="logo_footer.png" style="margin-left:20px">
<img id="mysuperfancyimage" src="logo_footer.png" style="margin-left:20px">

You can call classes with a dot and and IDs with a Rhombus

.mysuperfancyimage {
}
#mysuperfancyimage {
}

Leave a Reply