1

.footer_image {
  height: 60rem;
}
<footer>
  <div class="footer_image">
    <img src="https://via.placeholder.com/200x200" 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?

2
  • The code appears to be working as expected. Can you elaborate on the problem you're observing?
    – David
    Nov 23, 2022 at 15:18
  • 1
    If you want to target the image itself, why not use .footer_image img?
    – Maharkus
    Nov 23, 2022 at 15:19

2 Answers 2

0

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 {
}
1
  • 1
    Thank you! I must have overlooked some properties and thought I was doing it incorrectly.
    – Matt
    Nov 23, 2022 at 15:34
0

This works nicely - the problem might be that you're targeting the image parent, not the image itself.

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

1
  • Thank you! I tried this earlier but must have slipped up somewhere
    – Matt
    Nov 23, 2022 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.